Merged in luisfernandosl/processmaker/HOR-23-3018 (pull request #3567)

HOR-23 "Change error message text when wrong..." SOLVED
This commit is contained in:
Julio Cesar Laura Avendaño
2016-01-27 15:11:04 -04:00

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;