Разрешено редактирование своих точек, если они ещё не отмодерированы
This commit is contained in:
parent
08b1eae904
commit
6519a25d1d
|
|
@ -124,9 +124,9 @@ class JsonController extends Controller
|
||||||
$id = (int) $_POST['id'];
|
$id = (int) $_POST['id'];
|
||||||
$point = $point->getByPK($id);
|
$point = $point->getByPK($id);
|
||||||
|
|
||||||
if ($point->author != App::$user->id || ($point->date + 1800 < time() ))
|
if ($point->author != App::$user->id || $point->moderate == 1)
|
||||||
{
|
{
|
||||||
$errors[9] = 'Редактирование точек достурно только администратору!';
|
$errors[9] = 'Редактирование точек достурно только администратору или автору!';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ function drawInfoPopup(id, showPopup) {
|
||||||
description += '<button type="button" class="btn btn-default" onclick="addRemoveLike(' + id + ')"><span id="myLikesButton" class="glyphicon glyphicon-' + (data.iLike ? 'ok' : 'thumbs-up') + '"></span> <span class="label">Нравится</span></button>';
|
description += '<button type="button" class="btn btn-default" onclick="addRemoveLike(' + id + ')"><span id="myLikesButton" class="glyphicon glyphicon-' + (data.iLike ? 'ok' : 'thumbs-up') + '"></span> <span class="label">Нравится</span></button>';
|
||||||
description += '<button type="button" class="btn btn-default" onclick="addRemoveFavorite(' + id + ')"><span id="myFavoritesButton" class="glyphicon glyphicon-star' + (data.inFavorites ? '' : '-empty') + ' "></span> <span class="label">Хочу посетить</span></button>';
|
description += '<button type="button" class="btn btn-default" onclick="addRemoveFavorite(' + id + ')"><span id="myFavoritesButton" class="glyphicon glyphicon-star' + (data.inFavorites ? '' : '-empty') + ' "></span> <span class="label">Хочу посетить</span></button>';
|
||||||
|
|
||||||
if (isAdmin == '1')
|
if (isAdmin == '1' || data.moderate == "hide")
|
||||||
{
|
{
|
||||||
description += '<button type="button" class="btn btn-default" onclick="editPoint(' + id + ')"><span class="glyphicon glyphicon-pencil"></span> <span class="label">Редактировать</span></button>';
|
description += '<button type="button" class="btn btn-default" onclick="editPoint(' + id + ')"><span class="glyphicon glyphicon-pencil"></span> <span class="label">Редактировать</span></button>';
|
||||||
if (getURLParameter('edit') == 'true')
|
if (getURLParameter('edit') == 'true')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue