initial commit from rev. 632

This commit is contained in:
Erik Amaru Ortiz
2010-12-02 23:34:41 +00:00
commit 0525681d79
5410 changed files with 864427 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?php
/**
* conditions_Edit.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* 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 <http://www.gnu.org/licenses/>.
*
* 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');
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -0,0 +1,49 @@
<?php
/**
* conditions_Save.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* 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 <http://www.gnu.org/licenses/>.
*
* 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->update(array('STEP_UID' => $_POST['form']['STEP_UID'], 'STEP_CONDITION' => $_POST['form']['STEP_CONDITION']));
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$oProcessMap->getStepsCriteria($_POST['form']['TAS_UID']);
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -0,0 +1,182 @@
<?php
/**
* steps_Ajax.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* 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 <http://www.gnu.org/licenses/>.
*
* 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);
}
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();
$aFields['STEP_UID'] = $aData['sStep'];
$aFields['TRI_UID'] = $aData['sTrigger'];
$aFields['ST_TYPE'] = $aData['sType'];
$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;
}
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -0,0 +1,51 @@
<?php
/**
* steps_Delete.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* 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 <http://www.gnu.org/licenses/>.
*
* 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']);
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -0,0 +1,50 @@
<?php
/**
* steps_Down.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* 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 <http://www.gnu.org/licenses/>.
*
* 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']);
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -0,0 +1,49 @@
<?php
/**
* steps_New.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* 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 <http://www.gnu.org/licenses/>.
*
* 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');
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -0,0 +1,54 @@
<?php
/**
* steps_Save.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* 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 <http://www.gnu.org/licenses/>.
*
* 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']);
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -0,0 +1,70 @@
<?php
/**
* steps_SupervisorAjax.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* 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 <http://www.gnu.org/licenses/>.
*
* 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;
}
//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;
}
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -0,0 +1,50 @@
<?php
/**
* steps_Up.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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
* 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 <http://www.gnu.org/licenses/>.
*
* 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']);
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>