HOR-23 "Change error message text when wrong..." SOLVED

HOR-23-3018 "Change error message text when wrong..." SOLVED
This commit is contained in:
Luis Fernando Saisa Lopez
2016-01-25 15:00:41 -04:00
parent 7b2d2ba2aa
commit af5579219b

View File

@@ -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;