From 52f195a804121247fc382ad2efc91decac253db4 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Fri, 7 Feb 2014 14:52:35 -0400 Subject: [PATCH 1/4] ProcessMaker-MA "Web Entry (Fixes)" - Se han completado validaciones al crear un Web Entry --- workflow/engine/src/BusinessModel/Process.php | 42 +++- .../engine/src/BusinessModel/WebEntry.php | 180 ++++++++++++------ .../src/Services/Api/ProcessMaker/Project.php | 2 + .../Api/ProcessMaker/Project/WebEntry.php | 26 +-- 4 files changed, 173 insertions(+), 77 deletions(-) diff --git a/workflow/engine/src/BusinessModel/Process.php b/workflow/engine/src/BusinessModel/Process.php index 0be89187c..44ed9b1e4 100644 --- a/workflow/engine/src/BusinessModel/Process.php +++ b/workflow/engine/src/BusinessModel/Process.php @@ -364,6 +364,40 @@ class Process } } + /** + * Verify if doesn't exist the Task in table TASK + * + * @param string $processUid Unique id of Process + * @param string $taskUid Unique id of Task + * @param string $fieldNameForException Field name for the exception + * + * return void Throw exception if doesn't exist the Task in table TASK + */ + public function throwExceptionIfNotExistsTask($processUid, $taskUid, $fieldNameForException) + { + try { + $criteria = new \Criteria("workflow"); + + $criteria->addSelectColumn(\TaskPeer::TAS_UID); + + if ($processUid != "") { + $criteria->add(\TaskPeer::PRO_UID, $processUid, \Criteria::EQUAL); + } + + $criteria->add(\TaskPeer::TAS_UID, $taskUid, \Criteria::EQUAL); + + $rsCriteria = \TaskPeer::doSelectRS($criteria); + + if (!$rsCriteria->next()) { + $msg = str_replace(array("{0}", "{1}"), array($fieldNameForException, $taskUid), "The activity with {0}: {1}, does not exist"); + + throw (new \Exception($msg)); + } + } catch (\Exception $e) { + throw $e; + } + } + /** * Verify if doesn't exist the DynaForm in table DYNAFORM * @@ -1433,14 +1467,10 @@ class Process $arrayWebEntry = array(); //Verify data - $process = new \Process(); - - if (!$process->exists($processUid)) { - throw (new \Exception(str_replace(array("{0}", "{1}"), array($processUid, "PROCESS"), "The UID \"{0}\" doesn't exist in table {1}"))); - } - //Get data $webEntry = new \BusinessModel\WebEntry(); + $webEntry->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); + $webEntry->setArrayFieldNameForException($this->arrayFieldNameForException); $arrayWebEntryData = $webEntry->getData($processUid); diff --git a/workflow/engine/src/BusinessModel/WebEntry.php b/workflow/engine/src/BusinessModel/WebEntry.php index 7153fc0d3..0b7a564ae 100644 --- a/workflow/engine/src/BusinessModel/WebEntry.php +++ b/workflow/engine/src/BusinessModel/WebEntry.php @@ -3,6 +3,89 @@ namespace BusinessModel; class WebEntry { + private $arrayFieldDefinition = array( + "TAS_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "taskUid"), + "DYN_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "dynaFormUid"), + "METHOD" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array("WS", "HTML"), "fieldNameAux" => "method"), + "INPUT_DOCUMENT_ACCESS" => array("type" => "int", "required" => true, "empty" => false, "defaultValues" => array(0, 1), "fieldNameAux" => "inputDocumentAccess"), + "USR_USERNAME" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "userUsername"), + "USR_PASSWORD" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "userPassword") + ); + + private $formatFieldNameInUppercase = true; + + private $arrayFieldNameForException = array( + "processUid" => "PRO_UID" + ); + + /** + * Constructor of the class + * + * return void + */ + public function __construct() + { + try { + foreach ($this->arrayFieldDefinition as $key => $value) { + $this->arrayFieldNameForException[$value["fieldNameAux"]] = $key; + } + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Set the format of the fields name (uppercase, lowercase) + * + * @param bool $flag Value that set the format + * + * return void + */ + public function setFormatFieldNameInUppercase($flag) + { + try { + $this->formatFieldNameInUppercase = $flag; + + $this->setArrayFieldNameForException($this->arrayFieldNameForException); + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Set exception messages for fields + * + * @param array $arrayData Data with the fields + * + * return void + */ + public function setArrayFieldNameForException($arrayData) + { + try { + foreach ($arrayData as $key => $value) { + $this->arrayFieldNameForException[$key] = $this->getFieldNameByFormatFieldName($value); + } + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Get the name of the field according to the format + * + * @param string $fieldName Field name + * + * return string Return the field name according the format + */ + public function getFieldNameByFormatFieldName($fieldName) + { + try { + return ($this->formatFieldNameInUppercase)? strtoupper($fieldName) : strtolower($fieldName); + } catch (\Exception $e) { + throw $e; + } + } + /** * Sanitizes a filename * @@ -58,6 +141,20 @@ class WebEntry try { $arrayData = array(); + //Verify data + $process = new \BusinessModel\Process(); + + $process->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); + + if ($taskUid != "") { + $process->throwExceptionIfNotExistsTask($processUid, $taskUid, $this->arrayFieldNameForException["taskUid"]); + } + + if ($dynaFormUid != "") { + $process->throwExceptionIfNotExistsDynaForm($processUid, $dynaFormUid, $this->arrayFieldNameForException["dynaFormUid"]); + } + + //Get data $webEntryPath = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $processUid; if (is_dir($webEntryPath)) { @@ -150,6 +247,7 @@ class WebEntry } } + //Return return $arrayData; } catch (\Exception $e) { throw $e; @@ -170,37 +268,21 @@ class WebEntry $arrayData = array_change_key_case($arrayData, CASE_UPPER); //Verify data - $process = new \Process(); + $process = new \BusinessModel\Process(); - if (!$process->exists($processUid)) { - throw (new \Exception(str_replace(array("{0}", "{1}"), array($processUid, "PROCESS"), "The UID \"{0}\" doesn't exist in table {1}"))); - } + $process->throwExceptionIfNoExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); - if (!isset($arrayData["TAS_UID"])) { - throw (new \Exception(str_replace(array("{0}"), array(strtolower("TAS_UID")), "The \"{0}\" attribute is not defined"))); - } - - if (!isset($arrayData["DYN_UID"])) { - throw (new \Exception(str_replace(array("{0}"), array(strtolower("DYN_UID")), "The \"{0}\" attribute is not defined"))); - } - - if (!isset($arrayData["METHOD"])) { - throw (new \Exception(str_replace(array("{0}"), array(strtolower("METHOD")), "The \"{0}\" attribute is not defined"))); - } - - if (!isset($arrayData["INPUT_DOCUMENT_ACCESS"])) { - throw (new \Exception(str_replace(array("{0}"), array(strtolower("INPUT_DOCUMENT_ACCESS")), "The \"{0}\" attribute is not defined"))); - } + $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, true); $projectUser = new \BusinessModel\ProjectUser(); if ($arrayData["METHOD"] == "WS") { if (!isset($arrayData["USR_USERNAME"])) { - throw (new \Exception(str_replace(array("{0}"), array(strtolower("USR_USERNAME")), "The \"{0}\" attribute is not defined"))); + throw (new \Exception(str_replace(array("{0}"), array($this->arrayFieldNameForException["userUsername"]), "The \"{0}\" attribute is not defined"))); } if (!isset($arrayData["USR_PASSWORD"])) { - throw (new \Exception(str_replace(array("{0}"), array(strtolower("USR_PASSWORD")), "The \"{0}\" attribute is not defined"))); + throw (new \Exception(str_replace(array("{0}"), array($this->arrayFieldNameForException["userPassword"]), "The \"{0}\" attribute is not defined"))); } $loginData = $projectUser->userLogin($arrayData["USR_USERNAME"], $arrayData["USR_PASSWORD"]); @@ -210,11 +292,10 @@ class WebEntry } } - $task = new \Task(); + $process->throwExceptionIfNotExistsTask($processUid, $arrayData["TAS_UID"], $this->arrayFieldNameForException["taskUid"]); + $process->throwExceptionIfNotExistsDynaForm($processUid, $arrayData["DYN_UID"], $this->arrayFieldNameForException["dynaFormUid"]); - if (!$task->taskExists($arrayData["TAS_UID"])) { - throw (new \Exception(str_replace(array("{0}", "{1}"), array($arrayData["TAS_UID"], "TASK"), "The UID \"{0}\" doesn't exist in table {1}"))); - } + $task = new \Task(); $arrayTaskData = $task->load($arrayData["TAS_UID"]); @@ -226,18 +307,16 @@ class WebEntry throw (new \Exception(str_replace(array("{0}"), array($arrayTaskData["TAS_TITLE"]), "Web Entry only works with tasks which have \"Cyclical Assignment\", the task \"{0}\" doesn't have a valid assignment type. Please change the Assignment Rules"))); } - $task = new \Tasks(); + if ($arrayData["METHOD"] == "WS") { + $task = new \Tasks(); - if ($task->assignUsertoTask($arrayData["TAS_UID"]) == 0) { - throw (new \Exception(str_replace(array("{0}"), array($arrayTaskData["TAS_TITLE"]), "The task \"{0}\" doesn't have users"))); + if ($task->assignUsertoTask($arrayData["TAS_UID"]) == 0) { + throw (new \Exception(str_replace(array("{0}"), array($arrayTaskData["TAS_TITLE"]), "The task \"{0}\" doesn't have users"))); + } } $dynaForm = new \Dynaform(); - if (!$dynaForm->dynaformExists($arrayData["DYN_UID"])) { - throw (new \Exception(str_replace(array("{0}", "{1}"), array($arrayData["DYN_UID"], "DYNAFORM"), "The UID \"{0}\" doesn't exist in table {1}"))); - } - $arrayDynaFormData = $dynaForm->Load($arrayData["DYN_UID"]); $step = new \BusinessModel\Step(); @@ -387,7 +466,7 @@ class WebEntry //Data $url = $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $processUid . "/" . $dynTitle . ".php"; - $arrayDataAux = array("url" => $url); + $arrayDataAux = array("URL" => $url); break; case "HTML": global $G_FORM; @@ -433,14 +512,18 @@ class WebEntry //Data $html = str_replace("", "", str_replace("", "", $template->getOutputContent())); - $arrayDataAux = array("html" => $html); + $arrayDataAux = array("HTML" => $html); break; } //Return - $arrayData = array_change_key_case($arrayData, CASE_LOWER); + $arrayData = array_merge($arrayData, $arrayDataAux); - return array_merge($arrayData, $arrayDataAux); + if (!$this->formatFieldNameInUppercase) { + $arrayData = array_change_key_case($arrayData, CASE_LOWER); + } + + return $arrayData; } catch (\Exception $e) { throw $e; } @@ -459,12 +542,7 @@ class WebEntry { try { //Verify data - $process = new \Process(); - - if (!$process->exists($processUid)) { - throw (new \Exception(str_replace(array("{0}", "{1}"), array($processUid, "PROCESS"), "The UID \"{0}\" doesn't exist in table {1}"))); - } - + //Get data $arrayWebEntryData = $this->getData($processUid, "UID", $taskUid, $dynaFormUid); if (count($arrayWebEntryData) == 0) { @@ -492,11 +570,11 @@ class WebEntry { try { return array( - "tas_uid" => $record["taskUid"], - "tas_title" => $record["taskTitle"], - "dyn_uid" => $record["dynaFormUid"], - "dyn_title" => $record["dynaFormTitle"], - "url" => $record["url"] + $this->getFieldNameByFormatFieldName("TAS_UID") => $record["taskUid"], + $this->getFieldNameByFormatFieldName("TAS_TITLE") => $record["taskTitle"], + $this->getFieldNameByFormatFieldName("DYN_UID") => $record["dynaFormUid"], + $this->getFieldNameByFormatFieldName("DYN_TITLE") => $record["dynaFormTitle"], + $this->getFieldNameByFormatFieldName("URL") => $record["url"] ); } catch (\Exception $e) { throw $e; @@ -516,19 +594,13 @@ class WebEntry { try { //Verify data - $process = new \Process(); - - if (!$process->exists($processUid)) { - throw (new \Exception(str_replace(array("{0}", "{1}"), array($processUid, "PROCESS"), "The UID \"{0}\" doesn't exist in table {1}"))); - } - + //Get data $arrayWebEntryData = $this->getData($processUid, "UID", $taskUid, $dynaFormUid); if (count($arrayWebEntryData) == 0) { throw (new \Exception("The Web Entry doesn't exist")); } - //Get data //Return return $this->getWebEntryDataFromRecord($arrayWebEntryData[$taskUid . "/" . $dynaFormUid]); } catch (\Exception $e) { diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project.php b/workflow/engine/src/Services/Api/ProcessMaker/Project.php index 08f37180c..132453e4d 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Project.php @@ -325,6 +325,8 @@ class Project extends Api { try { $process = new \BusinessModel\Process(); + $process->setFormatFieldNameInUppercase(false); + $process->setArrayFieldNameForException(array("processUid" => "prj_uid")); $response = $process->getWebEntries($prj_uid); diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php b/workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php index 2256522cb..fbe0c06ad 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Project/WebEntry.php @@ -22,6 +22,8 @@ class WebEntry extends Api { try { $webEntry = new \BusinessModel\WebEntry(); + $webEntry->setFormatFieldNameInUppercase(false); + $webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid")); $response = $webEntry->getWebEntry($prj_uid, $tas_uid, $dyn_uid); @@ -34,29 +36,17 @@ class WebEntry extends Api /** * @url POST /:prj_uid/web-entry * - * @param string $prj_uid {@min 32}{@max 32} + * @param string $prj_uid {@min 32}{@max 32} * @param array $request_data - * @param string $tas_uid {@from body}{@min 32}{@max 32}{@required true} - * @param string $dyn_uid {@from body}{@min 32}{@max 32}{@required true} - * @param string $method {@from body}{@choice WS,HTML}{@required true} - * @param int $input_document_access {@from body}{@choice 0,1}{@required true} - * @param string $usr_username {@from body} - * @param string $usr_password {@from body} * * @status 201 */ - public function doPostWebEntry( - $prj_uid, - $request_data, - $tas_uid = "00000000000000000000000000000000", - $dyn_uid = "00000000000000000000000000000000", - $method = "WS", - $input_document_access = 0, - $usr_username = "", - $usr_password = "" - ) { + public function doPostWebEntry($prj_uid, $request_data) + { try { $webEntry = new \BusinessModel\WebEntry(); + $webEntry->setFormatFieldNameInUppercase(false); + $webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid")); $arrayData = $webEntry->create($prj_uid, $request_data); @@ -79,6 +69,8 @@ class WebEntry extends Api { try { $webEntry = new \BusinessModel\WebEntry(); + $webEntry->setFormatFieldNameInUppercase(false); + $webEntry->setArrayFieldNameForException(array("processUid" => "prj_uid")); $webEntry->delete($prj_uid, $tas_uid, $dyn_uid); } catch (\Exception $e) { From 9529d47f431e30fd31762aeefb19cb74d0aaa3f7 Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Fri, 7 Feb 2014 15:29:23 -0400 Subject: [PATCH 2/4] Se arreglan validaciones en OUTPUTDOCUMENT y se agregan validaciones en PM USER. --- .../src/BusinessModel/OutputDocument.php | 4 +- workflow/engine/src/BusinessModel/User.php | 68 ++++++++++++++----- .../src/Services/Api/ProcessMaker/User.php | 27 ++++++-- 3 files changed, 75 insertions(+), 24 deletions(-) diff --git a/workflow/engine/src/BusinessModel/OutputDocument.php b/workflow/engine/src/BusinessModel/OutputDocument.php index d98222b33..bd604f885 100644 --- a/workflow/engine/src/BusinessModel/OutputDocument.php +++ b/workflow/engine/src/BusinessModel/OutputDocument.php @@ -265,9 +265,7 @@ class OutputDocument $aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'] = \G::encrypt( $aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'], $aData['OUT_DOC_UID'] ); } } - if ($aData['OUT_DOC_UID'] == '') { - $outDocUid = $oOutputDocument->create($aData); - } + $outDocUid = $oOutputDocument->create($aData); //Return unset($aData["PRO_UID"]); $aData = array_change_key_case($aData, CASE_LOWER); diff --git a/workflow/engine/src/BusinessModel/User.php b/workflow/engine/src/BusinessModel/User.php index 81c093b3c..15f7d014e 100644 --- a/workflow/engine/src/BusinessModel/User.php +++ b/workflow/engine/src/BusinessModel/User.php @@ -263,7 +263,16 @@ class User if ($form['USR_DUE_DATE'] == '') { throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE')); } else { - $aData['USR_DUE_DATE'] = $form['USR_DUE_DATE']; + $dueDate = explode("-", $form['USR_DUE_DATE']); + if (ctype_digit($dueDate[0])) { + if (checkdate($dueDate[1], $dueDate[2], $dueDate[0]) == false) { + throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE')); + } else { + $aData['USR_DUE_DATE'] = $form['USR_DUE_DATE']; + } + } else { + throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE')); + } } $aData['USR_CREATE_DATE'] = date('Y-m-d H:i:s'); $aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s'); @@ -478,25 +487,36 @@ class User $aData['USR_EMAIL'] = $form['USR_EMAIL']; } } - if ($form['USR_DUE_DATE'] != '') { - $aData['USR_DUE_DATE'] = $form['USR_DUE_DATE']; + if ($form['USR_DUE_DATE'] == '') { + throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE')); + } else { + $dueDate = explode("-", $form['USR_DUE_DATE']); + if (ctype_digit($dueDate[0])) { + if (checkdate($dueDate[1], $dueDate[2], $dueDate[0]) == false) { + throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE')); + } else { + $aData['USR_DUE_DATE'] = $form['USR_DUE_DATE']; + } + } else { + throw new \Exception('`usr_due_date`. '.\G::LoadTranslation('ID_MSG_ERROR_DUE_DATE')); + } } $aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s'); if ($form['USR_STATUS'] != '') { $aData['USR_STATUS'] = $form['USR_STATUS']; } - $oCriteria = new \Criteria('rbac'); - $oCriteria->add(\RolesPeer::ROL_CODE, $form['USR_ROLE']); - $oDataset = \RolesPeer::doSelectRS($oCriteria); - $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - $oDataset->next(); - $aRow = $oDataset->getRow(); - if ($oDataset->getRow()){ - $aData['USR_ROLE'] = $form['USR_ROLE']; - } else { - throw new \Exception('`usr_role`. Invalid value for field.'); - } if ($form['USR_ROLE'] != '') { + $oCriteria = new \Criteria('rbac'); + $oCriteria->add(\RolesPeer::ROL_CODE, $form['USR_ROLE']); + $oDataset = \RolesPeer::doSelectRS($oCriteria); + $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC); + $oDataset->next(); + $aRow = $oDataset->getRow(); + if ($oDataset->getRow()){ + $aData['USR_ROLE'] = $form['USR_ROLE']; + } else { + throw new \Exception('`usr_role`. Invalid value for field.'); + } $this->updateUser($aData, $form['USR_ROLE']); } else { $this->updateUser($aData); @@ -548,7 +568,23 @@ class User } /** - * Delete Group + * Authenticate User + * + * @param array $arrayData Data + * + * return array Return data of the User updated + */ + public function authenticate($arrayData) + { + try { + + } catch (\Exception $e) { + throw $e; + } + } + + /** + * Delete User * * @param string $usrUid Unique id of User * @@ -653,7 +689,7 @@ class User /** * Get data of a User * - * @param string $userUid Unique id of Group + * @param string $userUid Unique id of User * * return array Return an array with data of a User */ diff --git a/workflow/engine/src/Services/Api/ProcessMaker/User.php b/workflow/engine/src/Services/Api/ProcessMaker/User.php index d5f733d33..c72202a30 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/User.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/User.php @@ -14,7 +14,7 @@ class User extends Api /** * @url GET */ - public function index($filter = '', $start = null, $limit = null) + public function doGetUsers($filter = '', $start = null, $limit = null) { try { $user = new \BusinessModel\User(); @@ -30,7 +30,7 @@ class User extends Api * * @param string $usr_uid {@min 32}{@max 32} */ - public function doGet($usr_uid) + public function doGetUser($usr_uid) { try { $user = new \BusinessModel\User(); @@ -48,7 +48,7 @@ class User extends Api * * @status 201 */ - public function doPost($request_data) { + public function doPostUser($request_data) { try { $user = new \BusinessModel\User(); $arrayData = $user->create($request_data); @@ -59,13 +59,30 @@ class User extends Api } } + /** + * @url POST /:usr_uid + * + * @param array $request_data + * + */ + public function doPostAuthenticate($request_data) { + try { + $user = new \BusinessModel\User(); + $arrayData = $user->authenticate($request_data); + $response = $arrayData; + return $response; + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + /** * @url PUT /:usr_uid * * @param string $usr_uid {@min 32}{@max 32} * @param array $request_data */ - public function doPut($usr_uid, $request_data) { + public function doPutUser($usr_uid, $request_data) { try { $userLoggedUid = $this->getUserId(); $user = new \BusinessModel\User(); @@ -82,7 +99,7 @@ class User extends Api * * @param string $usr_uid {@min 32}{@max 32} */ - public function doDelete($usr_uid) + public function doDeleteUser($usr_uid) { try { $user = new \BusinessModel\User(); From f6839233b51ee49c90f88ad103aa18fa1850bec8 Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Fri, 7 Feb 2014 15:33:58 -0400 Subject: [PATCH 3/4] Se arreglan validaciones en OUTPUTDOCUMENT. --- .../src/Services/Api/ProcessMaker/Project/OutputDocuments.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Project/OutputDocuments.php b/workflow/engine/src/Services/Api/ProcessMaker/Project/OutputDocuments.php index 7a007ff0e..9132562d6 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Project/OutputDocuments.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Project/OutputDocuments.php @@ -90,8 +90,7 @@ class OutputDocuments extends Api } catch (\Exception $e) { //response throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()); - } - return $response; + } } /** From 0986b5daa98d94271ac647e3a653c7ea97b039f3 Mon Sep 17 00:00:00 2001 From: Freddy Daniel Rojas Valda Date: Mon, 10 Feb 2014 08:48:31 -0400 Subject: [PATCH 4/4] Fix notice ASSIGNEE y PMUSER. --- workflow/engine/src/BusinessModel/Task.php | 6 ++++++ workflow/engine/src/BusinessModel/User.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/workflow/engine/src/BusinessModel/Task.php b/workflow/engine/src/BusinessModel/Task.php index ba90062b4..d4dc313b9 100644 --- a/workflow/engine/src/BusinessModel/Task.php +++ b/workflow/engine/src/BusinessModel/Task.php @@ -984,6 +984,9 @@ class Task public function getTaskAssignee($sProcessUID, $sTaskUID, $sAssigneeUID) { try { + $filter = ''; + $start = null; + $limit = null; $oProcess = \ProcessPeer::retrieveByPK( $sProcessUID ); if (is_null($oProcess)) { throw (new \Exception( 'This id for `prj_uid`: '. $sProcessUID .' do not correspond to a registered process')); @@ -1530,6 +1533,9 @@ class Task public function getTaskAdhocAssignee($sProcessUID, $sTaskUID, $sAssigneeUID) { try { + $filter = ''; + $start = null; + $limit = null; $oProcess = \ProcessPeer::retrieveByPK( $sProcessUID ); if (is_null($oProcess)) { throw (new \Exception( 'This id for `prj_uid`: '. $sProcessUID .' do not correspond to a registered process')); diff --git a/workflow/engine/src/BusinessModel/User.php b/workflow/engine/src/BusinessModel/User.php index 15f7d014e..ff1fc67f7 100644 --- a/workflow/engine/src/BusinessModel/User.php +++ b/workflow/engine/src/BusinessModel/User.php @@ -649,6 +649,7 @@ class User public function getUsers($filter, $start, $limit) { try { + $aUserInfo = array(); require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php"); $oCriteria = new \Criteria(); if ($filter != '') { @@ -696,6 +697,7 @@ class User public function getUser($userUid) { try { + $aUserInfo = array(); $oUser = \UsersPeer::retrieveByPK($userUid); if (is_null($oUser)) { throw (new \Exception( 'This id for `usr_uid`: '. $userUid .' do not correspond to a registered user'));