From af5579219b5d888e957f29dcf614f5224af780de Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Mon, 25 Jan 2016 15:00:41 -0400 Subject: [PATCH] HOR-23 "Change error message text when wrong..." SOLVED HOR-23-3018 "Change error message text when wrong..." SOLVED --- .../BusinessModel/Cases/InputDocument.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php index 454695576..fa1144c7f 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php @@ -3,6 +3,26 @@ namespace ProcessMaker\BusinessModel\Cases; class InputDocument { + /** + * Verify exists app_doc_uid in table APP_DOCUMENT + * + * @param string $applicationUid + * + * return void Throw exception + */ + private function throwExceptionIfNotExistsAppDocument($appDocumentUid) + { + try { + $appDocument = \AppDocumentPeer::retrieveByPK($appDocumentUid, 1); + + if (is_null($appDocument)) { + throw new \Exception(\G::LoadTranslation("ID_CASES_INPUT_DOES_NOT_EXIST", array($appDocumentUid))); + } + } catch (\Exception $e) { + throw $e; + } + } + /** * Check if the user has permissions * @@ -47,6 +67,9 @@ class InputDocument throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION_DELETE_INPUT_DOCUMENT", array($userUid))); } + //verfiry exists $appDocumentUid + $this->throwExceptionIfNotExistsAppDocument($appDocumentUid); + //Verify data permission $flagPermission = 0;