diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php index 090b2f5a0..2f795bcbe 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Cases.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Cases.php @@ -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()); + } + } + } diff --git a/workflow/engine/src/ProcessMaker/Services/Api/User.php b/workflow/engine/src/ProcessMaker/Services/Api/User.php index 199184939..2bb1ee0e3 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/User.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/User.php @@ -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()); - } - } }