diff --git a/workflow/engine/methods/steps/conditions_Edit.php b/workflow/engine/methods/steps/conditions_Edit.php index cf499c796..fdc60c1e7 100755 --- a/workflow/engine/methods/steps/conditions_Edit.php +++ b/workflow/engine/methods/steps/conditions_Edit.php @@ -1,10 +1,10 @@ . - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * along with this program. If not, see . + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * */ try { - global $RBAC; - switch ($RBAC->userCanAccess('PM_FACTORY')) { - case -2: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - case -1: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - } - require_once 'classes/model/Step.php'; - $oStep = new Step(); - $aFields = $oStep->load($_GET['UID']); - G::LoadClass('xmlfield_InputPM'); - $G_PUBLISH = new Publisher(); - $G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/conditions_Edit', '', $aFields, '../steps/conditions_Save'); - G::RenderPage('publish-raw' , 'raw'); + global $RBAC; + switch ($RBAC->userCanAccess( 'PM_FACTORY' )) { + case - 2: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + case - 1: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + } + require_once 'classes/model/Step.php'; + $oStep = new Step(); + $aFields = $oStep->load( $_GET['UID'] ); + G::LoadClass( 'xmlfield_InputPM' ); + $G_PUBLISH = new Publisher(); + $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/conditions_Edit', '', $aFields, '../steps/conditions_Save' ); + G::RenderPage( 'publish-raw', 'raw' ); +} catch (Exception $oException) { + die( $oException->getMessage() ); } -catch (Exception $oException) { - die($oException->getMessage()); -} -?> \ No newline at end of file + diff --git a/workflow/engine/methods/steps/conditions_Save.php b/workflow/engine/methods/steps/conditions_Save.php index 488983d40..343e3a1ef 100755 --- a/workflow/engine/methods/steps/conditions_Save.php +++ b/workflow/engine/methods/steps/conditions_Save.php @@ -1,10 +1,10 @@ . - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * along with this program. If not, see . + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * */ try { - global $RBAC; - switch ($RBAC->userCanAccess('PM_FACTORY')) { - case -2: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - case -1: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - } - require_once 'classes/model/Step.php'; - $oStep = new Step(); - if(isset ($_POST['form'])) - $value=$_POST['form']; - else - $value=$_POST; - $oStep->update(array('STEP_UID' => $value['STEP_UID'], 'STEP_CONDITION' => $value['STEP_CONDITION'])); - G::LoadClass('processMap'); - $oProcessMap = new ProcessMap(); - $oProcessMap->getStepsCriteria($value['TAS_UID']); + global $RBAC; + switch ($RBAC->userCanAccess( 'PM_FACTORY' )) { + case - 2: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + case - 1: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + } + require_once 'classes/model/Step.php'; + $oStep = new Step(); + if (isset( $_POST['form'] )) + $value = $_POST['form']; + else + $value = $_POST; + $oStep->update( array ('STEP_UID' => $value['STEP_UID'],'STEP_CONDITION' => $value['STEP_CONDITION'] + ) ); + G::LoadClass( 'processMap' ); + $oProcessMap = new ProcessMap(); + $oProcessMap->getStepsCriteria( $value['TAS_UID'] ); +} catch (Exception $oException) { + die( $oException->getMessage() ); } -catch (Exception $oException) { - die($oException->getMessage()); -} -?> \ No newline at end of file + diff --git a/workflow/engine/methods/steps/steps_Ajax.php b/workflow/engine/methods/steps/steps_Ajax.php index 281c399ef..3270bf504 100755 --- a/workflow/engine/methods/steps/steps_Ajax.php +++ b/workflow/engine/methods/steps/steps_Ajax.php @@ -12,171 +12,166 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . * * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * */ try { - global $RBAC; - switch ($RBAC->userCanAccess('PM_FACTORY')) - { - case -2: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - case -1: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - } - - require_once 'classes/model/StepTrigger.php'; - require_once 'classes/model/Triggers.php'; - G::LoadInclude('ajax'); - if (!empty($_GET)) { - $aData = urldecode_values($_GET); - } - else { - if (!isset($_POST['form'])) { - $aData = urldecode_values($_POST); + global $RBAC; + switch ($RBAC->userCanAccess( 'PM_FACTORY' )) { + case - 2: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + case - 1: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; } - else { - $aData = urldecode_values($_POST['form']); + + require_once 'classes/model/StepTrigger.php'; + require_once 'classes/model/Triggers.php'; + G::LoadInclude( 'ajax' ); + if (! empty( $_GET )) { + $aData = urldecode_values( $_GET ); + } else { + if (! isset( $_POST['form'] )) { + $aData = urldecode_values( $_POST ); + } else { + $aData = urldecode_values( $_POST['form'] ); + } } - } - switch ($aData['action']) { - case 'showTriggers': - G::LoadClass('processMap'); - $oProcessMap = new ProcessMap(); - global $G_PUBLISH; - $G_PUBLISH = new Publisher(); - if ($aData['sType'] == 'BEFORE') { - $G_PUBLISH->AddContent('propeltable', 'paged-table', 'steps/triggersBefore_List', $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], $aData['sType']), array('STEP' => $aData['sStep'])); - } - else { - $G_PUBLISH->AddContent('propeltable', 'paged-table', 'steps/triggersAfter_List', $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], $aData['sType']), array('STEP' => $aData['sStep'])); - } - G::RenderPage('publish-twocolumns', 'raw'); - break; - case 'availableTriggers': - $oCriteria = new Criteria('workflow'); - $oCriteria->addSelectColumn('TRI_UID'); - $oCriteria->add(StepTriggerPeer::TAS_UID , $_SESSION['TASK']); - $oCriteria->add(StepTriggerPeer::STEP_UID, $aData['sStep']); - $oCriteria->add(StepTriggerPeer::ST_TYPE , $aData['sType']); - $oDataset = StepTriggerPeer::doSelectRS($oCriteria); - $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); - $oDataset->next(); - $sUIDs = "'0'"; - $aUIDs = array(); - while ($aRow = $oDataset->getRow()) { - $sUIDs .= ",'" . $aRow['TRI_UID'] . "'"; - $aUIDs[] = $aRow['TRI_UID']; - $oDataset->next(); - } - $oCriteria = new Criteria('workflow'); - $oCriteria->addSelectColumn('COUNT(TRI_UID) AS CANTITY'); - $oCriteria->add(TriggersPeer::TRI_UID, $aUIDs, Criteria::NOT_IN); - $oCriteria->add(TriggersPeer::PRO_UID, $aData['sProcess']); - $oDataset = TriggersPeer::doSelectRS($oCriteria); - $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); - $oDataset->next(); - $aRow = $oDataset->getRow(); - if ((int)$aRow['CANTITY'] > 0) { - $aFields['LANG'] = SYS_LANG; - $aFields['UIDS'] = $sUIDs; - $aFields['PROCESS'] = $aData['sProcess']; - $aFields['action'] = 'assignTrigger'; - $aFields['STEP_UID'] = $aData['sStep']; - $aFields['ST_TYPE'] = $aData['sType']; - global $G_PUBLISH; - G::LoadClass('xmlfield_InputPM'); - $G_PUBLISH = new Publisher(); - $G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/triggers_Assign', '', $aFields, '../steps/steps_Ajax'); - G::RenderPage('publish', 'raw'); - } - else { - global $G_PUBLISH; - $G_PUBLISH = new Publisher(); - $G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/triggers_NoAssign', ''); - G::RenderPage('publish', 'raw'); - } - break; - case 'assignTrigger': - $aFields = array('STEP_UID' => $aData['STEP_UID'], 'TAS_UID' => $_SESSION['TASK'], 'TRI_UID' => $aData['TRI_UID'], 'ST_TYPE' => $aData['ST_TYPE']); - $oStepTrigger = new StepTrigger(); - $oStepTrigger->create($aFields); - $aFields['ST_CONDITION'] = $aData['ST_CONDITION']; - $aFields['ST_POSITION'] = ($oStepTrigger->getNextPosition($aData['STEP_UID'], $aData['ST_TYPE']) - 1); - $oStepTrigger->update($aFields); - break; - case 'editTriggerCondition': - require_once 'classes/model/Step.php'; - require_once 'classes/model/Triggers.php'; - $oStep = new Step(); + switch ($aData['action']) { + case 'showTriggers': + G::LoadClass( 'processMap' ); + $oProcessMap = new ProcessMap(); + global $G_PUBLISH; + $G_PUBLISH = new Publisher(); + if ($aData['sType'] == 'BEFORE') { + $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/triggersBefore_List', $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] ), array ('STEP' => $aData['sStep'] + ) ); + } else { + $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/triggersAfter_List', $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] ), array ('STEP' => $aData['sStep'] + ) ); + } + G::RenderPage( 'publish-twocolumns', 'raw' ); + break; + case 'availableTriggers': + $oCriteria = new Criteria( 'workflow' ); + $oCriteria->addSelectColumn( 'TRI_UID' ); + $oCriteria->add( StepTriggerPeer::TAS_UID, $_SESSION['TASK'] ); + $oCriteria->add( StepTriggerPeer::STEP_UID, $aData['sStep'] ); + $oCriteria->add( StepTriggerPeer::ST_TYPE, $aData['sType'] ); + $oDataset = StepTriggerPeer::doSelectRS( $oCriteria ); + $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); + $oDataset->next(); + $sUIDs = "'0'"; + $aUIDs = array (); + while ($aRow = $oDataset->getRow()) { + $sUIDs .= ",'" . $aRow['TRI_UID'] . "'"; + $aUIDs[] = $aRow['TRI_UID']; + $oDataset->next(); + } + $oCriteria = new Criteria( 'workflow' ); + $oCriteria->addSelectColumn( 'COUNT(TRI_UID) AS CANTITY' ); + $oCriteria->add( TriggersPeer::TRI_UID, $aUIDs, Criteria::NOT_IN ); + $oCriteria->add( TriggersPeer::PRO_UID, $aData['sProcess'] ); + $oDataset = TriggersPeer::doSelectRS( $oCriteria ); + $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); + $oDataset->next(); + $aRow = $oDataset->getRow(); + if ((int) $aRow['CANTITY'] > 0) { + $aFields['LANG'] = SYS_LANG; + $aFields['UIDS'] = $sUIDs; + $aFields['PROCESS'] = $aData['sProcess']; + $aFields['action'] = 'assignTrigger'; + $aFields['STEP_UID'] = $aData['sStep']; + $aFields['ST_TYPE'] = $aData['sType']; + global $G_PUBLISH; + G::LoadClass( 'xmlfield_InputPM' ); + $G_PUBLISH = new Publisher(); + $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggers_Assign', '', $aFields, '../steps/steps_Ajax' ); + G::RenderPage( 'publish', 'raw' ); + } else { + global $G_PUBLISH; + $G_PUBLISH = new Publisher(); + $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggers_NoAssign', '' ); + G::RenderPage( 'publish', 'raw' ); + } + break; + case 'assignTrigger': + $aFields = array ('STEP_UID' => $aData['STEP_UID'],'TAS_UID' => $_SESSION['TASK'],'TRI_UID' => $aData['TRI_UID'],'ST_TYPE' => $aData['ST_TYPE'] + ); + $oStepTrigger = new StepTrigger(); + $oStepTrigger->create( $aFields ); + $aFields['ST_CONDITION'] = $aData['ST_CONDITION']; + $aFields['ST_POSITION'] = ($oStepTrigger->getNextPosition( $aData['STEP_UID'], $aData['ST_TYPE'] ) - 1); + $oStepTrigger->update( $aFields ); + break; + case 'editTriggerCondition': + require_once 'classes/model/Step.php'; + require_once 'classes/model/Triggers.php'; + $oStep = new Step(); - $aFields['STEP_UID'] = $aData['sStep']; - $aFields['TRI_UID'] = $aData['sTrigger']; - $aFields['ST_TYPE'] = $aData['sType']; + $aFields['STEP_UID'] = $aData['sStep']; + $aFields['TRI_UID'] = $aData['sTrigger']; + $aFields['ST_TYPE'] = $aData['sType']; - $Trigger = new Triggers(); - $aRow = $Trigger->load($aData['sTrigger']); + $Trigger = new Triggers(); + $aRow = $Trigger->load( $aData['sTrigger'] ); - $oStepTrigger = new StepTrigger(); - $aFields = $oStepTrigger->load($aFields['STEP_UID'], $_SESSION['TASK'], $aFields['TRI_UID'], $aFields['ST_TYPE']); - $aFields['action'] = 'saveTriggerCondition'; - $aFields['PROCESS'] = $aRow['PRO_UID']; - global $G_PUBLISH; - G::LoadClass('xmlfield_InputPM'); - $G_PUBLISH = new Publisher(); - $G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/triggersCondition_Edit', '', $aFields, '../steps/steps_Ajax'); - G::RenderPage('publish', 'raw'); - break; - case 'saveTriggerCondition': - $oStepTrigger = new StepTrigger(); - $oStepTrigger->update(array('STEP_UID' => $aData['STEP_UID'], 'TAS_UID' => $_SESSION['TASK'], 'TRI_UID' => $aData['TRI_UID'], 'ST_TYPE' => $aData['ST_TYPE'], 'ST_CONDITION' => $aData['ST_CONDITION'])); - break; - case 'upTrigger': - $aData['iPosition'] = (int)$aData['iPosition']; - $oStepTrigger = new StepTrigger(); - $oStepTrigger->up($aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition']); - break; - case 'downTrigger': - $aData['iPosition'] = (int)$aData['iPosition']; - $oStepTrigger = new StepTrigger(); - $oStepTrigger->down($aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition']); - break; - case 'ofToAssignTrigger': - $oStepTrigger = new StepTrigger(); - $oStepTrigger->reOrder($aData['sStep'], $_SESSION['TASK'], $aData['sType'], $aData['iPosition']); - $oStepTrigger->remove($aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType']); - break; - - case 'counterTriggers': - G::LoadClass('processMap'); - $oProcessMap = new ProcessMap(); - $oCriteria1 = $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], $aData['sType']); - if ($aData['sType'] == 'BEFORE') { - $oCriteria2 = $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], 'AFTER'); - } - else { - $oCriteria2 = $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], 'BEFORE'); - } - $iCantity = StepTriggerPeer::doCount($oCriteria1); - $iTotal = $iCantity + StepTriggerPeer::doCount($oCriteria2); - echo $iTotal . '|' . $iCantity; - break; - } + $oStepTrigger = new StepTrigger(); + $aFields = $oStepTrigger->load( $aFields['STEP_UID'], $_SESSION['TASK'], $aFields['TRI_UID'], $aFields['ST_TYPE'] ); + $aFields['action'] = 'saveTriggerCondition'; + $aFields['PROCESS'] = $aRow['PRO_UID']; + global $G_PUBLISH; + G::LoadClass( 'xmlfield_InputPM' ); + $G_PUBLISH = new Publisher(); + $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggersCondition_Edit', '', $aFields, '../steps/steps_Ajax' ); + G::RenderPage( 'publish', 'raw' ); + break; + case 'saveTriggerCondition': + $oStepTrigger = new StepTrigger(); + $oStepTrigger->update( array ('STEP_UID' => $aData['STEP_UID'],'TAS_UID' => $_SESSION['TASK'],'TRI_UID' => $aData['TRI_UID'],'ST_TYPE' => $aData['ST_TYPE'],'ST_CONDITION' => $aData['ST_CONDITION'] + ) ); + break; + case 'upTrigger': + $aData['iPosition'] = (int) $aData['iPosition']; + $oStepTrigger = new StepTrigger(); + $oStepTrigger->up( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition'] ); + break; + case 'downTrigger': + $aData['iPosition'] = (int) $aData['iPosition']; + $oStepTrigger = new StepTrigger(); + $oStepTrigger->down( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition'] ); + break; + case 'ofToAssignTrigger': + $oStepTrigger = new StepTrigger(); + $oStepTrigger->reOrder( $aData['sStep'], $_SESSION['TASK'], $aData['sType'], $aData['iPosition'] ); + $oStepTrigger->remove( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'] ); + break; + case 'counterTriggers': + G::LoadClass( 'processMap' ); + $oProcessMap = new ProcessMap(); + $oCriteria1 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] ); + if ($aData['sType'] == 'BEFORE') { + $oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'AFTER' ); + } else { + $oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'BEFORE' ); + } + $iCantity = StepTriggerPeer::doCount( $oCriteria1 ); + $iTotal = $iCantity + StepTriggerPeer::doCount( $oCriteria2 ); + echo $iTotal . '|' . $iCantity; + break; + } +} catch (Exception $oException) { + die( $oException->getMessage() ); } -catch (Exception $oException) { - die($oException->getMessage()); -} -?> \ No newline at end of file + diff --git a/workflow/engine/methods/steps/steps_Delete.php b/workflow/engine/methods/steps/steps_Delete.php index 5ee58aba9..70bc82c5b 100755 --- a/workflow/engine/methods/steps/steps_Delete.php +++ b/workflow/engine/methods/steps/steps_Delete.php @@ -1,10 +1,10 @@ . - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * along with this program. If not, see . + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * */ try { - global $RBAC; - switch ($RBAC->userCanAccess('PM_FACTORY')) - { - case -2: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - case -1: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - } - require_once 'classes/model/Step.php'; - $oStep = new Step(); - $oStep->reOrder($_POST['STEP_UID'], $_POST['STEP_POSITION']); - $oStep->remove($_POST['STEP_UID']); - G::LoadClass('processMap'); - $oProcessMap = new ProcessMap(); - $oProcessMap->getStepsCriteria($_POST['TASK']); + global $RBAC; + switch ($RBAC->userCanAccess( 'PM_FACTORY' )) { + case - 2: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + case - 1: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + } + require_once 'classes/model/Step.php'; + $oStep = new Step(); + $oStep->reOrder( $_POST['STEP_UID'], $_POST['STEP_POSITION'] ); + $oStep->remove( $_POST['STEP_UID'] ); + G::LoadClass( 'processMap' ); + $oProcessMap = new ProcessMap(); + $oProcessMap->getStepsCriteria( $_POST['TASK'] ); +} catch (Exception $oException) { + die( $oException->getMessage() ); } -catch (Exception $oException) { - die($oException->getMessage()); -} -?> \ No newline at end of file + diff --git a/workflow/engine/methods/steps/steps_Down.php b/workflow/engine/methods/steps/steps_Down.php index 3d56bca7e..5e0a70f57 100755 --- a/workflow/engine/methods/steps/steps_Down.php +++ b/workflow/engine/methods/steps/steps_Down.php @@ -1,10 +1,10 @@ . - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * along with this program. If not, see . + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * */ try { - global $RBAC; - switch ($RBAC->userCanAccess('PM_FACTORY')) - { - case -2: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - case -1: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - } - require_once 'classes/model/Step.php'; - $oStep = new Step(); - $oStep->down($_POST['STEP_UID'], $_POST['TASK'] ,$_POST['STEP_POSITION']); - G::LoadClass('processMap'); - $oProcessMap = new ProcessMap(); - $oProcessMap->getStepsCriteria($_POST['TASK']); + global $RBAC; + switch ($RBAC->userCanAccess( 'PM_FACTORY' )) { + case - 2: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + case - 1: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + } + require_once 'classes/model/Step.php'; + $oStep = new Step(); + $oStep->down( $_POST['STEP_UID'], $_POST['TASK'], $_POST['STEP_POSITION'] ); + G::LoadClass( 'processMap' ); + $oProcessMap = new ProcessMap(); + $oProcessMap->getStepsCriteria( $_POST['TASK'] ); +} catch (Exception $oException) { + die( $oException->getMessage() ); } -catch (Exception $oException) { - die($oException->getMessage()); -} -?> \ No newline at end of file + diff --git a/workflow/engine/methods/steps/steps_New.php b/workflow/engine/methods/steps/steps_New.php index b88f410a5..5ff23800d 100755 --- a/workflow/engine/methods/steps/steps_New.php +++ b/workflow/engine/methods/steps/steps_New.php @@ -1,10 +1,10 @@ . - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * along with this program. If not, see . + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * */ try { - global $RBAC; - switch ($RBAC->userCanAccess('PM_FACTORY')) { - case -2: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - case -1: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - } - G::LoadClass('processMap'); - $oProcessMap = new ProcessMap(); - $G_PUBLISH = new Publisher(); - - $G_PUBLISH->AddContent('propeltable', 'paged-table', 'steps/steps_availableBB', $oProcessMap->getAvailableBBCriteria($_GET['PROCESS'], $_GET['TASK']), $_GET); - G::RenderPage('publish-raw', 'raw'); + global $RBAC; + switch ($RBAC->userCanAccess( 'PM_FACTORY' )) { + case - 2: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + case - 1: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + } + G::LoadClass( 'processMap' ); + $oProcessMap = new ProcessMap(); + $G_PUBLISH = new Publisher(); + + $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/steps_availableBB', $oProcessMap->getAvailableBBCriteria( $_GET['PROCESS'], $_GET['TASK'] ), $_GET ); + G::RenderPage( 'publish-raw', 'raw' ); +} catch (Exception $oException) { + die( $oException->getMessage() ); } -catch (Exception $oException) { - die($oException->getMessage()); -} -?> \ No newline at end of file + diff --git a/workflow/engine/methods/steps/steps_Save.php b/workflow/engine/methods/steps/steps_Save.php index 2ad3f912a..fecd184ee 100755 --- a/workflow/engine/methods/steps/steps_Save.php +++ b/workflow/engine/methods/steps/steps_Save.php @@ -12,43 +12,39 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . * * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * */ try { - global $RBAC; - switch ($RBAC->userCanAccess('PM_FACTORY')) { - case -2: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - case -1: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - } - require_once 'classes/model/Step.php'; - $oStep = new Step(); - $sStepUID = $oStep->create(array('PRO_UID' => $_POST['sProcess'], 'TAS_UID' => $_POST['sTask'])); - $oStep->update(array('STEP_UID' => $sStepUID, - 'STEP_TYPE_OBJ' => $_POST['sType'], - 'STEP_UID_OBJ' => $_POST['sUID'], - 'STEP_POSITION' => ($oStep->getNextPosition($_POST['sTask']) - 1), - 'STEP_MODE' => (isset($_POST['sMode'])) ? $_POST['sMode'] : 'EDIT')); - G::LoadClass('processMap'); - $oProcessMap = new ProcessMap(); - $oProcessMap->getStepsCriteria($_POST['sTask']); + global $RBAC; + switch ($RBAC->userCanAccess( 'PM_FACTORY' )) { + case - 2: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + case - 1: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + } + require_once 'classes/model/Step.php'; + $oStep = new Step(); + $sStepUID = $oStep->create( array ('PRO_UID' => $_POST['sProcess'],'TAS_UID' => $_POST['sTask'] + ) ); + $oStep->update( array ('STEP_UID' => $sStepUID,'STEP_TYPE_OBJ' => $_POST['sType'],'STEP_UID_OBJ' => $_POST['sUID'],'STEP_POSITION' => ($oStep->getNextPosition( $_POST['sTask'] ) - 1),'STEP_MODE' => (isset( $_POST['sMode'] )) ? $_POST['sMode'] : 'EDIT' + ) ); + G::LoadClass( 'processMap' ); + $oProcessMap = new ProcessMap(); + $oProcessMap->getStepsCriteria( $_POST['sTask'] ); +} catch (Exception $oException) { + die( $oException->getMessage() ); } -catch (Exception $oException) { - die($oException->getMessage()); -} -?> \ No newline at end of file + diff --git a/workflow/engine/methods/steps/steps_SupervisorAjax.php b/workflow/engine/methods/steps/steps_SupervisorAjax.php index 09be6c198..e9039ee50 100755 --- a/workflow/engine/methods/steps/steps_SupervisorAjax.php +++ b/workflow/engine/methods/steps/steps_SupervisorAjax.php @@ -12,59 +12,57 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * along with this program. If not, see . * * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * */ try { - global $RBAC; - switch ($RBAC->userCanAccess('PM_FACTORY')) - { - case -2: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - case -1: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - } + global $RBAC; + switch ($RBAC->userCanAccess( 'PM_FACTORY' )) { + case - 2: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + case - 1: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + } - //srequire_once 'classes/model/StepTrigger.php'; + //srequire_once 'classes/model/StepTrigger.php'; - G::LoadClass('processMap'); - $oProcessMap = new ProcessMap(); - switch ($_POST['action']) { - case 'availableSupervisorDynaforms': - $oProcessMap->availableSupervisorDynaforms($_POST['PRO_UID']); - break; - case 'assignSupervisorDynaform': - $oProcessMap->assignSupervisorStep($_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID']); - break; - case 'removeSupervisorDynaform': - $oProcessMap->removeSupervisorStep($_POST['STEP_UID'], $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'], $_POST['STEP_POSITION']); - break; - case 'availableSupervisorInputs': - $oProcessMap->availableSupervisorInputs($_POST['PRO_UID']); - break; - case 'assignSupervisorInput': - $oProcessMap->assignSupervisorStep($_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID']); - break; - case 'removeSupervisorInput': - $oProcessMap->removeSupervisorStep($_POST['STEP_UID'], $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'], $_POST['STEP_POSITION']); - break; - } + G::LoadClass( 'processMap' ); + $oProcessMap = new ProcessMap(); + + switch ($_POST['action']) { + case 'availableSupervisorDynaforms': + $oProcessMap->availableSupervisorDynaforms( $_POST['PRO_UID'] ); + break; + case 'assignSupervisorDynaform': + $oProcessMap->assignSupervisorStep( $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'] ); + break; + case 'removeSupervisorDynaform': + $oProcessMap->removeSupervisorStep( $_POST['STEP_UID'], $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'], $_POST['STEP_POSITION'] ); + break; + case 'availableSupervisorInputs': + $oProcessMap->availableSupervisorInputs( $_POST['PRO_UID'] ); + break; + case 'assignSupervisorInput': + $oProcessMap->assignSupervisorStep( $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'] ); + break; + case 'removeSupervisorInput': + $oProcessMap->removeSupervisorStep( $_POST['STEP_UID'], $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'], $_POST['STEP_POSITION'] ); + break; + } +} catch (Exception $oException) { + die( $oException->getMessage() ); } -catch (Exception $oException) { - die($oException->getMessage()); -} -?> \ No newline at end of file + diff --git a/workflow/engine/methods/steps/steps_Up.php b/workflow/engine/methods/steps/steps_Up.php index 5ef6e0d88..bc780cff5 100755 --- a/workflow/engine/methods/steps/steps_Up.php +++ b/workflow/engine/methods/steps/steps_Up.php @@ -1,10 +1,10 @@ . - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * along with this program. If not, see . + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. - * */ try { - global $RBAC; - switch ($RBAC->userCanAccess('PM_FACTORY')) - { - case -2: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - case -1: - G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); - G::header('location: ../login/login'); - die; - break; - } - require_once 'classes/model/Step.php'; - $oStep = new Step(); - $oStep->up($_POST['STEP_UID'], $_POST['TASK'] ,$_POST['STEP_POSITION']); - G::LoadClass('processMap'); - $oProcessMap = new ProcessMap(); - $oProcessMap->getStepsCriteria($_POST['TASK']); + global $RBAC; + switch ($RBAC->userCanAccess( 'PM_FACTORY' )) { + case - 2: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + case - 1: + G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' ); + G::header( 'location: ../login/login' ); + die(); + break; + } + require_once 'classes/model/Step.php'; + $oStep = new Step(); + $oStep->up( $_POST['STEP_UID'], $_POST['TASK'], $_POST['STEP_POSITION'] ); + G::LoadClass( 'processMap' ); + $oProcessMap = new ProcessMap(); + $oProcessMap->getStepsCriteria( $_POST['TASK'] ); +} catch (Exception $oException) { + die( $oException->getMessage() ); } -catch (Exception $oException) { - die($oException->getMessage()); -} -?> \ No newline at end of file +