Merge remote-tracking branch 'upstream/3.0.1.8' into 3.0.1.7-Gmail

This commit is contained in:
Dante
2016-02-25 16:01:05 -04:00
5 changed files with 166 additions and 46 deletions

View File

@@ -1110,4 +1110,42 @@ class Cases extends Api
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Mark a task process as a bookmark
* @url POST /bookmark/:tas_uid
*
* @param string $tas_uid {@min 32}{@max 32}
*
*/
public function doPostBookmarkStartCase($tas_uid)
{
try {
$userLoggedUid = $this->getUserId();
$user = new \ProcessMaker\BusinessModel\User();
$user->updateBookmark($userLoggedUid, $tas_uid, 'INSERT');
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Remove a task process from bookmarks
* @url DELETE /bookmark/:tas_uid
*
* @param string $tas_uid {@min 32}{@max 32}
*
*/
public function doDeleteBookmarkStartCase($tas_uid)
{
try {
$userLoggedUid = $this->getUserId();
$user = new \ProcessMaker\BusinessModel\User();
$user->updateBookmark($userLoggedUid, $tas_uid, 'DELETE');
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}

View File

@@ -143,43 +143,5 @@ class User extends Api
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Save Bookmark start case
* @url POST /bookmark/:tas_uid
*
* @param string $tas_uid {@min 32}{@max 32}
*
*/
public function doPostBookmarkStartCase($tas_uid)
{
try {
$userLoggedUid = $this->getUserId();
$user = new \ProcessMaker\BusinessModel\User();
$user->updateBookmark($userLoggedUid, $tas_uid, 'INSERT');
return array('bookmarkedTaskId'=>$tas_uid);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Delete Bookmark start case
* @url DELETE /bookmark/:tas_uid
*
* @param string $tas_uid {@min 32}{@max 32}
*
*/
public function doDeleteBookmarkStartCase($tas_uid)
{
try {
$userLoggedUid = $this->getUserId();
$user = new \ProcessMaker\BusinessModel\User();
$user->updateBookmark($userLoggedUid, $tas_uid, 'DELETE');
return array('unbookmarkedTaskId'=>$tas_uid);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}