CODE STYLE, workflow/engine/methods/steps/

FILES:
conditions_Edit.php
conditions_Save.php
steps_Ajax.php
steps_Delete.php
steps_Down.php
steps_New.php
steps_Save.php
steps_SupervisorAjax.php
steps_Up.php
This commit is contained in:
jennylee
2012-10-17 17:36:05 -04:00
parent 0f6644bcb0
commit 35225d9e7b
9 changed files with 399 additions and 424 deletions

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* conditions_Edit.php * conditions_Edit.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,39 +12,37 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
try { try {
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) { switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case -2: case - 2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
case -1: case - 1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
require_once 'classes/model/Step.php'; require_once 'classes/model/Step.php';
$oStep = new Step(); $oStep = new Step();
$aFields = $oStep->load($_GET['UID']); $aFields = $oStep->load( $_GET['UID'] );
G::LoadClass('xmlfield_InputPM'); G::LoadClass( 'xmlfield_InputPM' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/conditions_Edit', '', $aFields, '../steps/conditions_Save'); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/conditions_Edit', '', $aFields, '../steps/conditions_Save' );
G::RenderPage('publish-raw' , 'raw'); G::RenderPage( 'publish-raw', 'raw' );
} catch (Exception $oException) {
die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* conditions_Save.php * conditions_Save.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,42 +12,41 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
try { try {
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) { switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case -2: case - 2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
case -1: case - 1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
require_once 'classes/model/Step.php'; require_once 'classes/model/Step.php';
$oStep = new Step(); $oStep = new Step();
if(isset ($_POST['form'])) if (isset( $_POST['form'] ))
$value=$_POST['form']; $value = $_POST['form'];
else else
$value=$_POST; $value = $_POST;
$oStep->update(array('STEP_UID' => $value['STEP_UID'], 'STEP_CONDITION' => $value['STEP_CONDITION'])); $oStep->update( array ('STEP_UID' => $value['STEP_UID'],'STEP_CONDITION' => $value['STEP_CONDITION']
G::LoadClass('processMap'); ) );
$oProcessMap = new ProcessMap(); G::LoadClass( 'processMap' );
$oProcessMap->getStepsCriteria($value['TAS_UID']); $oProcessMap = new ProcessMap();
$oProcessMap->getStepsCriteria( $value['TAS_UID'] );
} catch (Exception $oException) {
die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -12,171 +12,166 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
try { try {
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
{ case - 2:
case -2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case -1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
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);
} }
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']) {
switch ($aData['action']) { case 'showTriggers':
case 'showTriggers': G::LoadClass( 'processMap' );
G::LoadClass('processMap'); $oProcessMap = new ProcessMap();
$oProcessMap = new ProcessMap(); global $G_PUBLISH;
global $G_PUBLISH; $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher(); if ($aData['sType'] == 'BEFORE') {
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']
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'steps/triggersBefore_List', $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], $aData['sType']), array('STEP' => $aData['sStep'])); ) );
} } else {
else { $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/triggersAfter_List', $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] ), array ('STEP' => $aData['sStep']
$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'); G::RenderPage( 'publish-twocolumns', 'raw' );
break; break;
case 'availableTriggers': case 'availableTriggers':
$oCriteria = new Criteria('workflow'); $oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn('TRI_UID'); $oCriteria->addSelectColumn( 'TRI_UID' );
$oCriteria->add(StepTriggerPeer::TAS_UID , $_SESSION['TASK']); $oCriteria->add( StepTriggerPeer::TAS_UID, $_SESSION['TASK'] );
$oCriteria->add(StepTriggerPeer::STEP_UID, $aData['sStep']); $oCriteria->add( StepTriggerPeer::STEP_UID, $aData['sStep'] );
$oCriteria->add(StepTriggerPeer::ST_TYPE , $aData['sType']); $oCriteria->add( StepTriggerPeer::ST_TYPE, $aData['sType'] );
$oDataset = StepTriggerPeer::doSelectRS($oCriteria); $oDataset = StepTriggerPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next(); $oDataset->next();
$sUIDs = "'0'"; $sUIDs = "'0'";
$aUIDs = array(); $aUIDs = array ();
while ($aRow = $oDataset->getRow()) { while ($aRow = $oDataset->getRow()) {
$sUIDs .= ",'" . $aRow['TRI_UID'] . "'"; $sUIDs .= ",'" . $aRow['TRI_UID'] . "'";
$aUIDs[] = $aRow['TRI_UID']; $aUIDs[] = $aRow['TRI_UID'];
$oDataset->next(); $oDataset->next();
} }
$oCriteria = new Criteria('workflow'); $oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn('COUNT(TRI_UID) AS CANTITY'); $oCriteria->addSelectColumn( 'COUNT(TRI_UID) AS CANTITY' );
$oCriteria->add(TriggersPeer::TRI_UID, $aUIDs, Criteria::NOT_IN); $oCriteria->add( TriggersPeer::TRI_UID, $aUIDs, Criteria::NOT_IN );
$oCriteria->add(TriggersPeer::PRO_UID, $aData['sProcess']); $oCriteria->add( TriggersPeer::PRO_UID, $aData['sProcess'] );
$oDataset = TriggersPeer::doSelectRS($oCriteria); $oDataset = TriggersPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next(); $oDataset->next();
$aRow = $oDataset->getRow(); $aRow = $oDataset->getRow();
if ((int)$aRow['CANTITY'] > 0) { if ((int) $aRow['CANTITY'] > 0) {
$aFields['LANG'] = SYS_LANG; $aFields['LANG'] = SYS_LANG;
$aFields['UIDS'] = $sUIDs; $aFields['UIDS'] = $sUIDs;
$aFields['PROCESS'] = $aData['sProcess']; $aFields['PROCESS'] = $aData['sProcess'];
$aFields['action'] = 'assignTrigger'; $aFields['action'] = 'assignTrigger';
$aFields['STEP_UID'] = $aData['sStep']; $aFields['STEP_UID'] = $aData['sStep'];
$aFields['ST_TYPE'] = $aData['sType']; $aFields['ST_TYPE'] = $aData['sType'];
global $G_PUBLISH; global $G_PUBLISH;
G::LoadClass('xmlfield_InputPM'); G::LoadClass( 'xmlfield_InputPM' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/triggers_Assign', '', $aFields, '../steps/steps_Ajax'); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggers_Assign', '', $aFields, '../steps/steps_Ajax' );
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
} } else {
else { global $G_PUBLISH;
global $G_PUBLISH; $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggers_NoAssign', '' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/triggers_NoAssign', ''); G::RenderPage( 'publish', 'raw' );
G::RenderPage('publish', 'raw'); }
} break;
break; case 'assignTrigger':
case 'assignTrigger': $aFields = array ('STEP_UID' => $aData['STEP_UID'],'TAS_UID' => $_SESSION['TASK'],'TRI_UID' => $aData['TRI_UID'],'ST_TYPE' => $aData['ST_TYPE']
$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 = new StepTrigger();
$oStepTrigger->create($aFields); $oStepTrigger->create( $aFields );
$aFields['ST_CONDITION'] = $aData['ST_CONDITION']; $aFields['ST_CONDITION'] = $aData['ST_CONDITION'];
$aFields['ST_POSITION'] = ($oStepTrigger->getNextPosition($aData['STEP_UID'], $aData['ST_TYPE']) - 1); $aFields['ST_POSITION'] = ($oStepTrigger->getNextPosition( $aData['STEP_UID'], $aData['ST_TYPE'] ) - 1);
$oStepTrigger->update($aFields); $oStepTrigger->update( $aFields );
break; break;
case 'editTriggerCondition': case 'editTriggerCondition':
require_once 'classes/model/Step.php'; require_once 'classes/model/Step.php';
require_once 'classes/model/Triggers.php'; require_once 'classes/model/Triggers.php';
$oStep = new Step(); $oStep = new Step();
$aFields['STEP_UID'] = $aData['sStep']; $aFields['STEP_UID'] = $aData['sStep'];
$aFields['TRI_UID'] = $aData['sTrigger']; $aFields['TRI_UID'] = $aData['sTrigger'];
$aFields['ST_TYPE'] = $aData['sType']; $aFields['ST_TYPE'] = $aData['sType'];
$Trigger = new Triggers(); $Trigger = new Triggers();
$aRow = $Trigger->load($aData['sTrigger']); $aRow = $Trigger->load( $aData['sTrigger'] );
$oStepTrigger = new StepTrigger(); $oStepTrigger = new StepTrigger();
$aFields = $oStepTrigger->load($aFields['STEP_UID'], $_SESSION['TASK'], $aFields['TRI_UID'], $aFields['ST_TYPE']); $aFields = $oStepTrigger->load( $aFields['STEP_UID'], $_SESSION['TASK'], $aFields['TRI_UID'], $aFields['ST_TYPE'] );
$aFields['action'] = 'saveTriggerCondition'; $aFields['action'] = 'saveTriggerCondition';
$aFields['PROCESS'] = $aRow['PRO_UID']; $aFields['PROCESS'] = $aRow['PRO_UID'];
global $G_PUBLISH; global $G_PUBLISH;
G::LoadClass('xmlfield_InputPM'); G::LoadClass( 'xmlfield_InputPM' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'steps/triggersCondition_Edit', '', $aFields, '../steps/steps_Ajax'); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'steps/triggersCondition_Edit', '', $aFields, '../steps/steps_Ajax' );
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
break; break;
case 'saveTriggerCondition': case 'saveTriggerCondition':
$oStepTrigger = new StepTrigger(); $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'])); $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': break;
$aData['iPosition'] = (int)$aData['iPosition']; case 'upTrigger':
$oStepTrigger = new StepTrigger(); $aData['iPosition'] = (int) $aData['iPosition'];
$oStepTrigger->up($aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition']); $oStepTrigger = new StepTrigger();
break; $oStepTrigger->up( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition'] );
case 'downTrigger': break;
$aData['iPosition'] = (int)$aData['iPosition']; case 'downTrigger':
$oStepTrigger = new StepTrigger(); $aData['iPosition'] = (int) $aData['iPosition'];
$oStepTrigger->down($aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition']); $oStepTrigger = new StepTrigger();
break; $oStepTrigger->down( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'], $aData['iPosition'] );
case 'ofToAssignTrigger': break;
$oStepTrigger = new StepTrigger(); case 'ofToAssignTrigger':
$oStepTrigger->reOrder($aData['sStep'], $_SESSION['TASK'], $aData['sType'], $aData['iPosition']); $oStepTrigger = new StepTrigger();
$oStepTrigger->remove($aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType']); $oStepTrigger->reOrder( $aData['sStep'], $_SESSION['TASK'], $aData['sType'], $aData['iPosition'] );
break; $oStepTrigger->remove( $aData['sStep'], $_SESSION['TASK'], $aData['sTrigger'], $aData['sType'] );
break;
case 'counterTriggers': case 'counterTriggers':
G::LoadClass('processMap'); G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap(); $oProcessMap = new ProcessMap();
$oCriteria1 = $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], $aData['sType']); $oCriteria1 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], $aData['sType'] );
if ($aData['sType'] == 'BEFORE') { if ($aData['sType'] == 'BEFORE') {
$oCriteria2 = $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], 'AFTER'); $oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'AFTER' );
} } else {
else { $oCriteria2 = $oProcessMap->getStepTriggersCriteria( $aData['sStep'], $_SESSION['TASK'], 'BEFORE' );
$oCriteria2 = $oProcessMap->getStepTriggersCriteria($aData['sStep'], $_SESSION['TASK'], 'BEFORE'); }
} $iCantity = StepTriggerPeer::doCount( $oCriteria1 );
$iCantity = StepTriggerPeer::doCount($oCriteria1); $iTotal = $iCantity + StepTriggerPeer::doCount( $oCriteria2 );
$iTotal = $iCantity + StepTriggerPeer::doCount($oCriteria2); echo $iTotal . '|' . $iCantity;
echo $iTotal . '|' . $iCantity; break;
break; }
} } catch (Exception $oException) {
die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* steps_Delete.php * steps_Delete.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,40 +12,37 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
try { try {
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
{ case - 2:
case -2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case -1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
} require_once 'classes/model/Step.php';
require_once 'classes/model/Step.php'; $oStep = new Step();
$oStep = new Step(); $oStep->reOrder( $_POST['STEP_UID'], $_POST['STEP_POSITION'] );
$oStep->reOrder($_POST['STEP_UID'], $_POST['STEP_POSITION']); $oStep->remove( $_POST['STEP_UID'] );
$oStep->remove($_POST['STEP_UID']); G::LoadClass( 'processMap' );
G::LoadClass('processMap'); $oProcessMap = new ProcessMap();
$oProcessMap = new ProcessMap(); $oProcessMap->getStepsCriteria( $_POST['TASK'] );
$oProcessMap->getStepsCriteria($_POST['TASK']); } catch (Exception $oException) {
die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* steps_Down.php * steps_Down.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,39 +12,36 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
try { try {
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
{ case - 2:
case -2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case -1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
} require_once 'classes/model/Step.php';
require_once 'classes/model/Step.php'; $oStep = new Step();
$oStep = new Step(); $oStep->down( $_POST['STEP_UID'], $_POST['TASK'], $_POST['STEP_POSITION'] );
$oStep->down($_POST['STEP_UID'], $_POST['TASK'] ,$_POST['STEP_POSITION']); G::LoadClass( 'processMap' );
G::LoadClass('processMap'); $oProcessMap = new ProcessMap();
$oProcessMap = new ProcessMap(); $oProcessMap->getStepsCriteria( $_POST['TASK'] );
$oProcessMap->getStepsCriteria($_POST['TASK']); } catch (Exception $oException) {
die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* steps_New.php * steps_New.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,38 +12,36 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
try { try {
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) { switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case -2: case - 2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
case -1: case - 1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
G::LoadClass('processMap'); G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap(); $oProcessMap = new ProcessMap();
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'steps/steps_availableBB', $oProcessMap->getAvailableBBCriteria($_GET['PROCESS'], $_GET['TASK']), $_GET); $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'steps/steps_availableBB', $oProcessMap->getAvailableBBCriteria( $_GET['PROCESS'], $_GET['TASK'] ), $_GET );
G::RenderPage('publish-raw', 'raw'); G::RenderPage( 'publish-raw', 'raw' );
} catch (Exception $oException) {
die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -12,43 +12,39 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
try { try {
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) { switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
case -2: case - 2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
case -1: case - 1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
require_once 'classes/model/Step.php'; require_once 'classes/model/Step.php';
$oStep = new Step(); $oStep = new Step();
$sStepUID = $oStep->create(array('PRO_UID' => $_POST['sProcess'], 'TAS_UID' => $_POST['sTask'])); $sStepUID = $oStep->create( array ('PRO_UID' => $_POST['sProcess'],'TAS_UID' => $_POST['sTask']
$oStep->update(array('STEP_UID' => $sStepUID, ) );
'STEP_TYPE_OBJ' => $_POST['sType'], $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'
'STEP_UID_OBJ' => $_POST['sUID'], ) );
'STEP_POSITION' => ($oStep->getNextPosition($_POST['sTask']) - 1), G::LoadClass( 'processMap' );
'STEP_MODE' => (isset($_POST['sMode'])) ? $_POST['sMode'] : 'EDIT')); $oProcessMap = new ProcessMap();
G::LoadClass('processMap'); $oProcessMap->getStepsCriteria( $_POST['sTask'] );
$oProcessMap = new ProcessMap(); } catch (Exception $oException) {
$oProcessMap->getStepsCriteria($_POST['sTask']); die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -12,59 +12,57 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
try { try {
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
{ case - 2:
case -2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case -1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
}
//srequire_once 'classes/model/StepTrigger.php'; //srequire_once 'classes/model/StepTrigger.php';
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
switch ($_POST['action']) { G::LoadClass( 'processMap' );
case 'availableSupervisorDynaforms': $oProcessMap = new ProcessMap();
$oProcessMap->availableSupervisorDynaforms($_POST['PRO_UID']);
break; switch ($_POST['action']) {
case 'assignSupervisorDynaform': case 'availableSupervisorDynaforms':
$oProcessMap->assignSupervisorStep($_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID']); $oProcessMap->availableSupervisorDynaforms( $_POST['PRO_UID'] );
break; break;
case 'removeSupervisorDynaform': case 'assignSupervisorDynaform':
$oProcessMap->removeSupervisorStep($_POST['STEP_UID'], $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'], $_POST['STEP_POSITION']); $oProcessMap->assignSupervisorStep( $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'] );
break; break;
case 'availableSupervisorInputs': case 'removeSupervisorDynaform':
$oProcessMap->availableSupervisorInputs($_POST['PRO_UID']); $oProcessMap->removeSupervisorStep( $_POST['STEP_UID'], $_POST['PRO_UID'], 'DYNAFORM', $_POST['DYN_UID'], $_POST['STEP_POSITION'] );
break; break;
case 'assignSupervisorInput': case 'availableSupervisorInputs':
$oProcessMap->assignSupervisorStep($_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID']); $oProcessMap->availableSupervisorInputs( $_POST['PRO_UID'] );
break; break;
case 'removeSupervisorInput': case 'assignSupervisorInput':
$oProcessMap->removeSupervisorStep($_POST['STEP_UID'], $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'], $_POST['STEP_POSITION']); $oProcessMap->assignSupervisorStep( $_POST['PRO_UID'], 'INPUT_DOCUMENT', $_POST['INP_DOC_UID'] );
break; 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());
}
?>

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* steps_Up.php * steps_Up.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,39 +12,36 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * 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. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
try { try {
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
{ case - 2:
case -2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case -1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
} require_once 'classes/model/Step.php';
require_once 'classes/model/Step.php'; $oStep = new Step();
$oStep = new Step(); $oStep->up( $_POST['STEP_UID'], $_POST['TASK'], $_POST['STEP_POSITION'] );
$oStep->up($_POST['STEP_UID'], $_POST['TASK'] ,$_POST['STEP_POSITION']); G::LoadClass( 'processMap' );
G::LoadClass('processMap'); $oProcessMap = new ProcessMap();
$oProcessMap = new ProcessMap(); $oProcessMap->getStepsCriteria( $_POST['TASK'] );
$oProcessMap->getStepsCriteria($_POST['TASK']); } catch (Exception $oException) {
die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>