GI-130 Add files bookmark

Add field scritp mysql

Change output format Endpoint
This commit is contained in:
Marco A. Nina Mena
2015-11-05 14:56:45 -04:00
parent 29582243fb
commit 3f9e40986c
10 changed files with 372 additions and 13 deletions

View File

@@ -1193,6 +1193,31 @@ class User
}
}
/**
* change Bookmarks of an user
*
* @access public
* @param $userUID
* @param $tasUid
* @param $type
* @return void
*/
public function updateBookmark($userUID, $tasUid, $type)
{
$this->userObj = new \Users();
$fields = $this->userObj->load($userUID);
$bookmark = empty($fields['USR_BOOKMARK_START_CASES']) ? array() : unserialize($fields['USR_BOOKMARK_START_CASES']);
$position = array_search($tasUid, $bookmark);
if ($type === 'INSERT' and $position === false) {
$bookmark[] = $tasUid;
} elseif ($type === 'DELETE' and $position !== false) {
unset($bookmark[$position]);
}
$fields['USR_BOOKMARK_START_CASES'] = serialize($bookmark);
$this->userObj->update($fields);
}
/**
* Check permission
*