From 71bf8390281485574942279f7646bbedf95a1e69 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Tue, 11 Mar 2014 12:22:52 -0400 Subject: [PATCH 1/4] Correcion para validacion de input, outputs y dynaform en PERMISSIONS --- workflow/engine/src/BusinessModel/ProcessPermissions.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/workflow/engine/src/BusinessModel/ProcessPermissions.php b/workflow/engine/src/BusinessModel/ProcessPermissions.php index 51b0db8f3..2f24ac291 100644 --- a/workflow/engine/src/BusinessModel/ProcessPermissions.php +++ b/workflow/engine/src/BusinessModel/ProcessPermissions.php @@ -417,9 +417,6 @@ class ProcessPermissions public function validateDynUid($dyn_uid) { $dyn_uid = trim($dyn_uid); - if ($dyn_uid == '') { - throw (new \Exception("The dynaform with dynaforms: '' does not exist.")); - } $oDynaform = new \Dynaform(); if (!($oDynaform->dynaformExists($dyn_uid))) { throw (new \Exception("The dynaform with dynaforms: '$dyn_uid' does not exist.")); @@ -439,9 +436,6 @@ class ProcessPermissions public function validateInpUid($inp_uid) { $inp_uid = trim($inp_uid); - if ($inp_uid == '') { - throw (new \Exception("The input with inputs: '' does not exist.")); - } $oInputDocument = new \InputDocument(); if (!($oInputDocument->InputExists($inp_uid))) { throw (new \Exception("The input with inputs: '$inp_uid' does not exist.")); @@ -461,9 +455,6 @@ class ProcessPermissions public function validateOutUid($out_uid) { $out_uid = trim($out_uid); - if ($out_uid == '') { - throw (new \Exception("The output with outputs: '' does not exist.")); - } $oOutputDocument = new \OutputDocument(); if (!($oOutputDocument->OutputExists($out_uid))) { throw (new \Exception("The output with outputs: '$out_uid' does not exist.")); From 9e0f8deb6a8c992dd21bc54bbe369423c0138cbf Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Tue, 11 Mar 2014 14:57:46 -0400 Subject: [PATCH 2/4] Correcion para validacion de input, outputs y dynaform en PERMISSIONS --- .../src/BusinessModel/ProcessPermissions.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/workflow/engine/src/BusinessModel/ProcessPermissions.php b/workflow/engine/src/BusinessModel/ProcessPermissions.php index 2f24ac291..585a2f264 100644 --- a/workflow/engine/src/BusinessModel/ProcessPermissions.php +++ b/workflow/engine/src/BusinessModel/ProcessPermissions.php @@ -232,15 +232,21 @@ class ProcessPermissions $sObjectUID = ''; break; case 'DYNAFORM': - $this->validateDynUid($data['DYNAFORMS']); + if ($data['DYNAFORMS'] != '') { + $this->validateDynUid($data['DYNAFORMS']); + } $sObjectUID = $data['DYNAFORMS']; break; case 'INPUT': - $this->validateInpUid($data['INPUTS']); + if ($data['INPUTS'] != '') { + $this->validateInpUid($data['INPUTS']); + } $sObjectUID = $data['INPUTS']; break; case 'OUTPUT': - $this->validateOutUid($data['OUTPUTS']); + if ($data['OUTPUTS'] != '') { + $this->validateOutUid($data['OUTPUTS']); + } $sObjectUID = $data['OUTPUTS']; break; } @@ -417,6 +423,9 @@ class ProcessPermissions public function validateDynUid($dyn_uid) { $dyn_uid = trim($dyn_uid); + if ($dyn_uid == '') { + throw (new \Exception("The dynaform with dynaforms: '' does not exist.")); + } $oDynaform = new \Dynaform(); if (!($oDynaform->dynaformExists($dyn_uid))) { throw (new \Exception("The dynaform with dynaforms: '$dyn_uid' does not exist.")); @@ -436,6 +445,9 @@ class ProcessPermissions public function validateInpUid($inp_uid) { $inp_uid = trim($inp_uid); + if ($inp_uid == '') { + throw (new \Exception("The input with inputs: '' does not exist.")); + } $oInputDocument = new \InputDocument(); if (!($oInputDocument->InputExists($inp_uid))) { throw (new \Exception("The input with inputs: '$inp_uid' does not exist.")); @@ -455,6 +467,9 @@ class ProcessPermissions public function validateOutUid($out_uid) { $out_uid = trim($out_uid); + if ($out_uid == '') { + throw (new \Exception("The output with outputs: '' does not exist.")); + } $oOutputDocument = new \OutputDocument(); if (!($oOutputDocument->OutputExists($out_uid))) { throw (new \Exception("The output with outputs: '$out_uid' does not exist.")); From 75bd0ae47e8f41e126b42f7458347bed8dc5ef2e Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Tue, 11 Mar 2014 16:31:08 -0400 Subject: [PATCH 3/4] Arreglo para validar triggers eliminados --- workflow/engine/src/BusinessModel/Trigger.php | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/workflow/engine/src/BusinessModel/Trigger.php b/workflow/engine/src/BusinessModel/Trigger.php index efad0441e..5ae6bcdac 100644 --- a/workflow/engine/src/BusinessModel/Trigger.php +++ b/workflow/engine/src/BusinessModel/Trigger.php @@ -120,7 +120,27 @@ class Trigger public function deleteTrigger($sTriggerUID = '') { $oTrigger = new \Triggers(); - $triggerObj = $oTrigger->load( $sTriggerUID ); + $oTrigger->load( $sTriggerUID ); + $res = $oTrigger->verifyDependecies($sTriggerUID); + $messageEnd = ''; + if ($res->code != 0) { + foreach ($res->dependencies as $Object => $aDeps) { + $nDeps = count( $aDeps ); + $message = str_replace( '{N}', $nDeps, \G::LoadTranslation( 'ID_TRIGGERS_VALIDATION_ERR2' ) ); + $message = str_replace( '{Object}', $Object, $message ); + $messageEnd .= $message . "\n"; + foreach ($aDeps as $dep) { + if (substr( $Object, - 1 ) == 's') { + $Object = substr( $Object, 0, strlen( $Object ) - 1 ); + } + $message = str_replace( '{Object}', $Object, \G::LoadTranslation( 'ID_TRIGGERS_VALIDATION_ERR3' ) ); + $message = str_replace( '{Description}', '"' . $dep['DESCRIPTION'] . '"', $message ); + $messageEnd .= $message . "\n"; + } + $messageEnd .= "\n"; + } + throw new \Exception($messageEnd); + } $oTrigger->remove( $sTriggerUID ); $oStepTrigger = new \StepTrigger(); From 4620355256f566d577c94e62baf51aac5790d689 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Wed, 12 Mar 2014 10:59:59 -0400 Subject: [PATCH 4/4] Improvement redirect dynaforms --- workflow/engine/xmlform/dynaforms/dynaforms_Editor.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/engine/xmlform/dynaforms/dynaforms_Editor.xml b/workflow/engine/xmlform/dynaforms/dynaforms_Editor.xml index 2df4f7249..0b0e11c34 100755 --- a/workflow/engine/xmlform/dynaforms/dynaforms_Editor.xml +++ b/workflow/engine/xmlform/dynaforms/dynaforms_Editor.xml @@ -46,7 +46,7 @@ function loadEditor() } else if(dynEditorType == 'processMap3') { - window.location.href="@G::encryptLink(@#processMap3)?pro_uid=@%PRO_UID"; + window.location.href="@G::encryptLink(@#processMap3)?prj_uid=@%PRO_UID"; return true; } else if(dynEditorType == 'bpmn')