|
|
@ -15,12 +15,14 @@ try {
|
|
|
|
if (!$note->hasWriteAccess(getRequestUser())) {
|
|
|
|
if (!$note->hasWriteAccess(getRequestUser())) {
|
|
|
|
sendJsonResp($Strings->get("You don't have permission to edit this note.", false), "ERROR");
|
|
|
|
sendJsonResp($Strings->get("You don't have permission to edit this note.", false), "ERROR");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (empty($VARS['favorite'])) {
|
|
|
|
if (!isset($VARS['favorite'])) {
|
|
|
|
$note->setFavorite(!$note->getFavorite());
|
|
|
|
$note->setFavorite(!$note->getFavorite());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$note->setFavorite($VARS['favorite'] == true);
|
|
|
|
$note->setFavorite($VARS['favorite'] == true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$note->setModified(date("Y-m-d H:i:s"));
|
|
|
|
|
|
|
|
|
|
|
|
$note->saveNote();
|
|
|
|
$note->saveNote();
|
|
|
|
|
|
|
|
|
|
|
|
sendJsonResp($Strings->get("Note saved", false), "OK", ["note" => $note->toArray()]);
|
|
|
|
sendJsonResp($Strings->get("Note saved", false), "OK", ["note" => $note->toArray()]);
|