From 2d1fa53b88c2ca936daffd797d637c74ba232fff Mon Sep 17 00:00:00 2001 From: Dante Date: Mon, 15 Feb 2016 11:44:25 -0400 Subject: [PATCH] BY-186 Cambiar los endpoints de bookmarks que se encuentran en users, para pasar a cases --- .../src/ProcessMaker/Services/Api/Cases.php | 38 +++++++++++++++++++ .../src/ProcessMaker/Services/Api/User.php | 38 ------------------- 2 files changed, 38 insertions(+), 38 deletions(-) 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()); - } - } }