CODE STYLE

FILES:
workflow/engine/methods/processes/processes_ImportExisting.php
workflow/engine/methods/processes/processes_ImportExistingXpdl.php
workflow/engine/methods/processes/processes_ImportFile.php
workflow/engine/methods/processes/processes_ImportFileXpdl.php
workflow/engine/methods/processes/processes_ImportXpdl.php
workflow/engine/methods/processes/processes_Library.php
workflow/engine/methods/processes/processes_List.php
workflow/engine/methods/processes/processes_Map.php
workflow/engine/methods/processes/processes_New.php
workflow/engine/methods/processes/processes_Save.php
This commit is contained in:
jennylee
2012-10-17 12:12:52 -04:00
parent 27ac82a803
commit 06683e9a3d
10 changed files with 936 additions and 956 deletions

View File

@@ -12,121 +12,120 @@
*
* 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 <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.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
//load the variables
G::LoadClass('processes');
$oProcess = new Processes();
try {
//load the variables
G::LoadClass( 'processes' );
$oProcess = new Processes();
if ( !isset ($_POST['form']['IMPORT_OPTION'] ) ) {
throw ( new Exception ('Please select an option before to continue')) ;
}
if ( !isset ($_POST['form']['GROUP_IMPORT_OPTION']) ) {
$action = "none" ;
} else {
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
}
$option = $_POST['form']['IMPORT_OPTION'];
$filename = $_POST['form']['PRO_FILENAME'];
$ObjUid = $_POST['form']['OBJ_UID'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP ;
$oData = $oProcess->getProcessData ( $path . $filename );
$Fields['PRO_FILENAME'] = $filename;
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD']=$sProUid;
// code added by gustavo cruz gustavo-at-colosa-dot-com
// evaluate actions or import options
switch($action){
case "none":
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
case "rename":
$oData->groupwfs = $oProcess->renameExistingGroups($oData->groupwfs);
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
case "merge":
$oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups($oData->groupwfs);
$oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers($oBaseGroup, $oNewGroup, $oData->taskusers);
break;
default:
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
}
// if there are duplicated groups render the group importing options
if((isset($groupsDuplicated))&&($groupsDuplicated>0)){
$Fields['PRO_FILENAME'] = $filename;
$Fields['PRO_PATH'] = $path;
$Fields['IMPORT_OPTION'] = $option;
$Fields['OBJ_UID'] = $ObjUid;
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportExisting' );
G::RenderPage('publish', 'blank');
die;
}
//end added code
//Update the current Process, overwriting all tasks and steps
if ( $option == 1 ) {
$oProcess->updateProcessFromData ($oData, $path . $filename );
if (file_exists(PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid)) {
$oDirectory = dir(PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid);
while($sObjectName = $oDirectory->read()) {
if (($sObjectName != '.') && ($sObjectName != '..')) {
unlink(PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid . PATH_SEP . $sObjectName);
}
}
$oDirectory->close();
if (! isset( $_POST['form']['IMPORT_OPTION'] )) {
throw (new Exception( 'Please select an option before to continue' ));
}
$sNewProUid = $sProUid;
}
//Disable current Process and create a new version of the Process
if ( $option == 2 ) {
$oProcess->disablePreviousProcesses( $sProUid );
$sNewProUid = $oProcess->getUnusedProcessGUID() ;
$oProcess->setProcessGuid ( $oData, $sNewProUid );
$oProcess->setProcessParent( $oData, $sProUid );
$oData->process['PRO_TITLE'] = "New - " . $oData->process['PRO_TITLE'] . ' - ' . date ( 'M d, H:i' );
$oProcess->renewAll ( $oData );
$oProcess->createProcessFromData ($oData, $path . $filename );
}
if (! isset( $_POST['form']['GROUP_IMPORT_OPTION'] )) {
$action = "none";
} else {
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
}
//Create a completely new Process without change the current Process
if ( $option == 3 ) {
//krumo ($oData); die;
$sNewProUid = $oProcess->getUnusedProcessGUID() ;
$oProcess->setProcessGuid ( $oData, $sNewProUid );
$oData->process['PRO_TITLE'] = "Copy of - " . $oData->process['PRO_TITLE'] . ' - ' . date ( 'M d, H:i' );
$oProcess->renewAll ( $oData );
$oProcess->createProcessFromData ($oData, $path . $filename );
}
G::header('Location: processes_Map?PRO_UID=' . $sNewProUid);
}
catch ( Exception $e ){
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publish', 'blank');
$option = $_POST['form']['IMPORT_OPTION'];
$filename = $_POST['form']['PRO_FILENAME'];
$ObjUid = $_POST['form']['OBJ_UID'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
$oData = $oProcess->getProcessData( $path . $filename );
$Fields['PRO_FILENAME'] = $filename;
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD'] = $sProUid;
// code added by gustavo cruz gustavo-at-colosa-dot-com
// evaluate actions or import options
switch ($action) {
case "none":
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "rename":
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "merge":
$oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
$oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
break;
default:
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
}
// if there are duplicated groups render the group importing options
if ((isset( $groupsDuplicated )) && ($groupsDuplicated > 0)) {
$Fields['PRO_FILENAME'] = $filename;
$Fields['PRO_PATH'] = $path;
$Fields['IMPORT_OPTION'] = $option;
$Fields['OBJ_UID'] = $ObjUid;
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportExisting' );
G::RenderPage( 'publish', 'blank' );
die();
}
//end added code
//Update the current Process, overwriting all tasks and steps
if ($option == 1) {
$oProcess->updateProcessFromData( $oData, $path . $filename );
if (file_exists( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid )) {
$oDirectory = dir( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid );
while ($sObjectName = $oDirectory->read()) {
if (($sObjectName != '.') && ($sObjectName != '..')) {
unlink( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid . PATH_SEP . $sObjectName );
}
}
$oDirectory->close();
}
$sNewProUid = $sProUid;
}
//Disable current Process and create a new version of the Process
if ($option == 2) {
$oProcess->disablePreviousProcesses( $sProUid );
$sNewProUid = $oProcess->getUnusedProcessGUID();
$oProcess->setProcessGuid( $oData, $sNewProUid );
$oProcess->setProcessParent( $oData, $sProUid );
$oData->process['PRO_TITLE'] = "New - " . $oData->process['PRO_TITLE'] . ' - ' . date( 'M d, H:i' );
$oProcess->renewAll( $oData );
$oProcess->createProcessFromData( $oData, $path . $filename );
}
//Create a completely new Process without change the current Process
if ($option == 3) {
//krumo ($oData); die;
$sNewProUid = $oProcess->getUnusedProcessGUID();
$oProcess->setProcessGuid( $oData, $sNewProUid );
$oData->process['PRO_TITLE'] = "Copy of - " . $oData->process['PRO_TITLE'] . ' - ' . date( 'M d, H:i' );
$oProcess->renewAll( $oData );
$oProcess->createProcessFromData( $oData, $path . $filename );
}
G::header( 'Location: processes_Map?PRO_UID=' . $sNewProUid );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}

View File

@@ -1,132 +1,132 @@
<?php
/**
* processes_ImportFileExisting.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 {
//load the variables
G::LoadClass('xpdl');
$oProcess = new Xpdl();
if ( !isset ($_POST['form']['IMPORT_OPTION'] ) ) {
throw ( new Exception ('Please select an option before to continue')) ;
}
if ( !isset ($_POST['form']['GROUP_IMPORT_OPTION']) ) {
$action = "none" ;
} else {
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
}
$option = $_POST['form']['IMPORT_OPTION'];
$filename = $_POST['form']['PRO_FILENAME'];
$ObjUid = $_POST['form']['OBJ_UID'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP ;
$oData = $oProcess->getProcessDataXpdl ( $path . $filename );
$Fields['PRO_FILENAME'] = $filename;
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD']=$sProUid;
if ( !isset( $oData->tasks) ) $oData->tasks = array();
$tasks = $oData->tasks;
// code added by gustavo cruz gustavo-at-colosa-dot-com
// evaluate actions or import options
switch($action){
case "none":
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
case "rename":
$oData->groupwfs = $oProcess->renameExistingGroups($oData->groupwfs);
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
case "merge":
$oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups($oData->groupwfs);
$oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers($oBaseGroup, $oNewGroup, $oData->taskusers);
break;
default:
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
}
// if there are duplicated groups render the group importing options
if($groupsDuplicated>0){
$Fields['PRO_FILENAME'] = $filename;
$Fields['PRO_PATH'] = $path;
$Fields['IMPORT_OPTION'] = $option;
$Fields['OBJ_UID'] = $ObjUid;
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportExisting' );
G::RenderPage('publish', "blank");
die;
}
//end added code
//Update the current Process, overwriting all tasks and steps
if ( $option == 1 ) {
$oProcess->updateProcessFromData ($oData, $path . $filename );
if (file_exists(PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid)) {
$oDirectory = dir(PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid);
while($sObjectName = $oDirectory->read()) {
if (($sObjectName != '.') && ($sObjectName != '..')) {
unlink(PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid . PATH_SEP . $sObjectName);
}
}
$oDirectory->close();
}
$sNewProUid = $sProUid;
}
//Disable current Process and create a new version of the Process
if ( $option == 2 ) {
$oProcess->disablePreviousProcesses( $sProUid );
$sNewProUid = $oProcess->getUnusedProcessGUID() ;
$oProcess->setProcessGuid ( $oData, $sNewProUid );
$oProcess->setProcessParent( $oData, $sProUid );
$oData->process['PRO_TITLE'] = "New - " . $oData->process['PRO_TITLE'] . ' - ' . date ( 'M d, H:i' );
$oProcess->renewAll ( $oData );
$oProcess->createProcessFromDataXpdl ($oData,$tasks);
}
//Create a completely new Process without change the current Process
if ( $option == 3 ) {
//krumo ($oData); die;
$sNewProUid = $oProcess->getUnusedProcessGUID() ;
$oProcess->setProcessGuid ( $oData, $sNewProUid );
$oData->process['PRO_TITLE'] = "Copy of - " . $oData->process['PRO_TITLE'] . ' - ' . date ( 'M d, H:i' );
$oProcess->renewAll ( $oData );
$oProcess->createProcessFromDataXpdl ($oData,$tasks);
}
G::header('Location: processes_Map?PRO_UID=' . $sNewProUid);
}
catch ( Exception $e ){
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publish', "blank");
}
<?php
/**
* processes_ImportFileExisting.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 {
//load the variables
G::LoadClass( 'xpdl' );
$oProcess = new Xpdl();
if (! isset( $_POST['form']['IMPORT_OPTION'] )) {
throw (new Exception( 'Please select an option before to continue' ));
}
if (! isset( $_POST['form']['GROUP_IMPORT_OPTION'] )) {
$action = "none";
} else {
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
}
$option = $_POST['form']['IMPORT_OPTION'];
$filename = $_POST['form']['PRO_FILENAME'];
$ObjUid = $_POST['form']['OBJ_UID'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
$Fields['PRO_FILENAME'] = $filename;
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD'] = $sProUid;
if (! isset( $oData->tasks ))
$oData->tasks = array ();
$tasks = $oData->tasks;
// code added by gustavo cruz gustavo-at-colosa-dot-com
// evaluate actions or import options
switch ($action) {
case "none":
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "rename":
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "merge":
$oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
$oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
break;
default:
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
}
// if there are duplicated groups render the group importing options
if ($groupsDuplicated > 0) {
$Fields['PRO_FILENAME'] = $filename;
$Fields['PRO_PATH'] = $path;
$Fields['IMPORT_OPTION'] = $option;
$Fields['OBJ_UID'] = $ObjUid;
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportExisting' );
G::RenderPage( 'publish', "blank" );
die();
}
//end added code
//Update the current Process, overwriting all tasks and steps
if ($option == 1) {
$oProcess->updateProcessFromData( $oData, $path . $filename );
if (file_exists( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid )) {
$oDirectory = dir( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid );
while ($sObjectName = $oDirectory->read()) {
if (($sObjectName != '.') && ($sObjectName != '..')) {
unlink( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid . PATH_SEP . $sObjectName );
}
}
$oDirectory->close();
}
$sNewProUid = $sProUid;
}
//Disable current Process and create a new version of the Process
if ($option == 2) {
$oProcess->disablePreviousProcesses( $sProUid );
$sNewProUid = $oProcess->getUnusedProcessGUID();
$oProcess->setProcessGuid( $oData, $sNewProUid );
$oProcess->setProcessParent( $oData, $sProUid );
$oData->process['PRO_TITLE'] = "New - " . $oData->process['PRO_TITLE'] . ' - ' . date( 'M d, H:i' );
$oProcess->renewAll( $oData );
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
}
//Create a completely new Process without change the current Process
if ($option == 3) {
//krumo ($oData); die;
$sNewProUid = $oProcess->getUnusedProcessGUID();
$oProcess->setProcessGuid( $oData, $sNewProUid );
$oData->process['PRO_TITLE'] = "Copy of - " . $oData->process['PRO_TITLE'] . ' - ' . date( 'M d, H:i' );
$oProcess->renewAll( $oData );
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
}
G::header( 'Location: processes_Map?PRO_UID=' . $sNewProUid );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', "blank" );
}

View File

@@ -12,106 +12,105 @@
*
* 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 <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.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
//load the variables
G::LoadClass('processes');
$oProcess = new Processes();
try {
//load the variables
G::LoadClass( 'processes' );
$oProcess = new Processes();
// if ( isset ($_POST) ) {
// krumo ( $_POST );
// }
// if ( isset ($_POST) ) {
// krumo ( $_POST );
// }
if (isset($_POST['form']['PRO_FILENAME'])){
$path = $_POST['form']['PRO_PATH'];
$filename = $_POST['form']['PRO_FILENAME'];
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
} else {
//save the file, if it's not saved
if (isset( $_POST['form']['PRO_FILENAME'] )) {
$path = $_POST['form']['PRO_PATH'];
$filename = $_POST['form']['PRO_FILENAME'];
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
} else {
//save the file, if it's not saved
if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) {
$filename = $_FILES['form']['name']['PROCESS_FILENAME'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP ;
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
$tempName = $_FILES['form']['tmp_name']['PROCESS_FILENAME'];
$action = "none";
G::uploadFile($tempName, $path, $filename );
G::uploadFile( $tempName, $path, $filename );
}
}
//we check if the file is a pm file
$aExtPmfile= explode('.', $filename);
if($aExtPmfile[sizeof($aExtPmfile)-1]!='pm') {
throw ( new Exception ( G::LoadTranslation( 'ID_NOT_PM_FILE' )) );
}
$oData = $oProcess->getProcessData ( $path . $filename );
}
//we check if the file is a pm file
$aExtPmfile = explode( '.', $filename );
if ($aExtPmfile[sizeof( $aExtPmfile ) - 1] != 'pm') {
throw (new Exception( G::LoadTranslation( 'ID_NOT_PM_FILE' ) ));
}
$Fields['PRO_FILENAME'] = $filename;
$Fields['IMPORT_OPTION'] = 2;
$oData = $oProcess->getProcessData( $path . $filename );
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD']=$sProUid;
if ( $oProcess->processExists ( $sProUid ) ) {
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ImportExisting', '', $Fields, 'processes_ImportExisting' );
G::RenderPage('publish', 'blank');
die;
}
// code added by gustavo cruz gustavo-at-colosa-dot-com
// evaluate actions or import options
switch($action){
case "none":
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
case "rename":
$oData->groupwfs = $oProcess->renameExistingGroups($oData->groupwfs);
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
case "merge":
$oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups($oData->groupwfs);
$oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers($oBaseGroup, $oNewGroup, $oData->taskusers);
break;
default:
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
}
// if there are duplicated groups render the group importing options
if($groupsDuplicated>0){
$Fields['PRO_FILENAME'] = $filename;
$Fields['PRO_PATH'] = $path;
$Fields['PRO_FILENAME'] = $filename;
$Fields['IMPORT_OPTION'] = 2;
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportFile' );
G::RenderPage('publish', 'blank');
die;
}
// end added code
$oProcess->createProcessFromData ($oData, $path . $filename );
G::header('Location: processes_Map?PRO_UID=' . $sProUid);
}
catch ( Exception $e ){
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publish', 'blank');
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD'] = $sProUid;
if ($oProcess->processExists( $sProUid )) {
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ImportExisting', '', $Fields, 'processes_ImportExisting' );
G::RenderPage( 'publish', 'blank' );
die();
}
// code added by gustavo cruz gustavo-at-colosa-dot-com
// evaluate actions or import options
switch ($action) {
case "none":
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "rename":
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "merge":
$oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
$oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
break;
default:
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
}
// if there are duplicated groups render the group importing options
if ($groupsDuplicated > 0) {
$Fields['PRO_FILENAME'] = $filename;
$Fields['PRO_PATH'] = $path;
$Fields['IMPORT_OPTION'] = 2;
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportFile' );
G::RenderPage( 'publish', 'blank' );
die();
}
// end added code
$oProcess->createProcessFromData( $oData, $path . $filename );
G::header( 'Location: processes_Map?PRO_UID=' . $sProUid );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}

View File

@@ -1,106 +1,105 @@
<?php
/**
* processes_ImportFile.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 {
//load the variables
G::LoadClass('xpdl');
$oProcess = new Xpdl();
if (isset($_POST['form']['PRO_FILENAME'])){
$path = $_POST['form']['PRO_PATH'];
$filename = $_POST['form']['PRO_FILENAME'];
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
} else {
//save the file, if it's not saved
if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) {
$filename = $_FILES['form']['name']['PROCESS_FILENAME'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP ;
$tempName = $_FILES['form']['tmp_name']['PROCESS_FILENAME'];
$action = "none";
G::uploadFile($tempName, $path, $filename );
}
}
$oData = $oProcess->getProcessDataXpdl ( $path . $filename );
$Fields['PRO_FILENAME'] = $filename;
$Fields['IMPORT_OPTION'] = 2;
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD']=$sProUid;
if ( $oProcess->processExists ( $sProUid ) ) {
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ImportExistingXpdl', '', $Fields, 'processes_ImportExistingXpdl' );
G::RenderPage('publish', "blank");
die;
}
// code added by gustavo cruz gustavo-at-colosa-dot-com
// evaluate actions or import options
switch($action){
case "none":
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
case "rename":
$oData->groupwfs = $oProcess->renameExistingGroups($oData->groupwfs);
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
case "merge":
$oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups($oData->groupwfs);
$oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers($oBaseGroup, $oNewGroup, $oData->taskusers);
break;
default:
$groupsDuplicated = $oProcess->checkExistingGroups($oData->groupwfs);
break;
}
// if there are duplicated groups render the group importing options
if($groupsDuplicated>0){
$Fields['PRO_FILENAME'] = $filename;
$Fields['PRO_PATH'] = $path;
$Fields['IMPORT_OPTION'] = 2;
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportFile' );
G::RenderPage('publish', "blank");
die;
}
// end added code
if ( !isset( $oData->tasks) ) $oData->tasks = array();
$tasks = $oData->tasks;
$oProcess->createProcessFromDataXpdl ($oData,$tasks);
G::header('Location: processes_Map?PRO_UID=' . $sProUid);
}
catch ( Exception $e ){
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publish', "blank");
}
<?php
/**
* processes_ImportFile.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 {
//load the variables
G::LoadClass( 'xpdl' );
$oProcess = new Xpdl();
if (isset( $_POST['form']['PRO_FILENAME'] )) {
$path = $_POST['form']['PRO_PATH'];
$filename = $_POST['form']['PRO_FILENAME'];
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
} else {
//save the file, if it's not saved
if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) {
$filename = $_FILES['form']['name']['PROCESS_FILENAME'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
$tempName = $_FILES['form']['tmp_name']['PROCESS_FILENAME'];
$action = "none";
G::uploadFile( $tempName, $path, $filename );
}
}
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
$Fields['PRO_FILENAME'] = $filename;
$Fields['IMPORT_OPTION'] = 2;
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD'] = $sProUid;
if ($oProcess->processExists( $sProUid )) {
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ImportExistingXpdl', '', $Fields, 'processes_ImportExistingXpdl' );
G::RenderPage( 'publish', "blank" );
die();
}
// code added by gustavo cruz gustavo-at-colosa-dot-com
// evaluate actions or import options
switch ($action) {
case "none":
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "rename":
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "merge":
$oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
$oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
break;
default:
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
}
// if there are duplicated groups render the group importing options
if ($groupsDuplicated > 0) {
$Fields['PRO_FILENAME'] = $filename;
$Fields['PRO_PATH'] = $path;
$Fields['IMPORT_OPTION'] = 2;
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportFile' );
G::RenderPage( 'publish', "blank" );
die();
}
// end added code
if (! isset( $oData->tasks ))
$oData->tasks = array ();
$tasks = $oData->tasks;
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
G::header( 'Location: processes_Map?PRO_UID=' . $sProUid );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', "blank" );
}

View File

@@ -1,65 +1,62 @@
<?php
/**
* processes_Import.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.
*
*/
$access = $RBAC->userCanAccess('PM_FACTORY');
if( $access != 1 ){
switch ($access)
{
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
default:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
}
try {
/* Includes */
G::LoadClass('processes');
/* Render page */
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_ImportXpdl', '', NULL, 'processes_ImportFileXpdl' );
G::RenderPage('publish', "blank");
}
catch ( Exception $e ){
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publish', "blank");
}
<?php
/**
* processes_Import.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.
*/
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) {
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
}
try {
/* Includes */
G::LoadClass( 'processes' );
/* Render page */
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ImportXpdl', '', NULL, 'processes_ImportFileXpdl' );
G::RenderPage( 'publish', "blank" );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', "blank" );
}

View File

@@ -1,138 +1,136 @@
<?php
/**
* processes_List.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.
*
*/
global $RBAC;
$access = $RBAC->userCanAccess('PM_FACTORY');
if( $access != 1 ){
switch ($access)
{
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
default:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
}
/**************************/
function parseItemArray( $array ) {
if (!isset ($array->item) && !is_array($array) ) {
return null;
}
$result = array();
if ( isset ( $array->item ) ) {
foreach ($array->item as $key => $value) {
$result[$value->key] = $value->value;
}
}
else {
foreach ($array as $key => $value) {
$result[$value->key] = $value->value;
}
}
return $result;
}
try {
G::LoadClass('processes');
$oProcess = new Processes();
$oProcess->ws_open_public ();
$result = $oProcess->ws_ProcessList ( );
$processes[] = array ( 'uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float' );
if ( $result->status_code == 0 && isset($result->processes) ) {
foreach ( $result->processes as $key => $val ) {
$process = parseItemArray($val);
$processes[] = $process;
}
}
$_DBArray['processes'] = $processes;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass( 'ArrayPeer');
$c = new Criteria ('dbarray');
$c->setDBArrayTable('processes');
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'processes/processes_ListPublic', $c);
$oHeadPublisher =& headPublisher::getSingleton();
//$oHeadPublisher->addScriptCode('leimnud.Package.Load("newAccount",{Type:"file",Absolute:true,Path:"/jscore/newAccount.js"});');
$oHeadPublisher->addScriptCode("
var oPanel;
var oPanel2;
var showDetails = function(sUID) {
oPanel = new leimnud.module.panel();
oPanel.options = {
size:{w:650,h:550},
position:{x:0,y:0,center:true},
title:'',
theme:'firefox',
statusBar:true,
control :{resize:false,roll:false,drag:true},
fx :{modal:true,opacity:true,blinkToFront:false,fadeIn:false}
};
oPanel.events = {
remove: function() { delete(oPanel); }.extend(this)
};
oPanel.make();
oPanel.loader.show();
var oRPC = new leimnud.module.rpc.xmlhttp({
url : 'processes_Ajax',
args: 'action=showDetailsPMDWL&data=' + {pro_uid:sUID}.toJSONString()
});
oRPC.callback = function(rpc){
oPanel.loader.hide();
var scs = rpc.xmlhttp.responseText.extractScript();
oPanel.addContent(rpc.xmlhttp.responseText);
scs.evalScript();
}.extend(this);
oRPC.make();
};
");
G::RenderPage('publish', 'blank');
}
catch ( Exception $e ) {
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}
<?php
/**
* processes_List.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.
*/
global $RBAC;
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) {
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
}
/**
* ***********************
*/
function parseItemArray ($array)
{
if (! isset( $array->item ) && ! is_array( $array )) {
return null;
}
$result = array ();
if (isset( $array->item )) {
foreach ($array->item as $key => $value) {
$result[$value->key] = $value->value;
}
} else {
foreach ($array as $key => $value) {
$result[$value->key] = $value->value;
}
}
return $result;
}
try {
G::LoadClass( 'processes' );
$oProcess = new Processes();
$oProcess->ws_open_public();
$result = $oProcess->ws_ProcessList();
$processes[] = array ('uid' => 'char','name' => 'char','age' => 'integer','balance' => 'float'
);
if ($result->status_code == 0 && isset( $result->processes )) {
foreach ($result->processes as $key => $val) {
$process = parseItemArray( $val );
$processes[] = $process;
}
}
$_DBArray['processes'] = $processes;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass( 'ArrayPeer' );
$c = new Criteria( 'dbarray' );
$c->setDBArrayTable( 'processes' );
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'processes/processes_ListPublic', $c );
$oHeadPublisher = & headPublisher::getSingleton();
//$oHeadPublisher->addScriptCode('leimnud.Package.Load("newAccount",{Type:"file",Absolute:true,Path:"/jscore/newAccount.js"});');
$oHeadPublisher->addScriptCode( "
var oPanel;
var oPanel2;
var showDetails = function(sUID) {
oPanel = new leimnud.module.panel();
oPanel.options = {
size:{w:650,h:550},
position:{x:0,y:0,center:true},
title:'',
theme:'firefox',
statusBar:true,
control :{resize:false,roll:false,drag:true},
fx :{modal:true,opacity:true,blinkToFront:false,fadeIn:false}
};
oPanel.events = {
remove: function() { delete(oPanel); }.extend(this)
};
oPanel.make();
oPanel.loader.show();
var oRPC = new leimnud.module.rpc.xmlhttp({
url : 'processes_Ajax',
args: 'action=showDetailsPMDWL&data=' + {pro_uid:sUID}.toJSONString()
});
oRPC.callback = function(rpc){
oPanel.loader.hide();
var scs = rpc.xmlhttp.responseText.extractScript();
oPanel.addContent(rpc.xmlhttp.responseText);
scs.evalScript();
}.extend(this);
oRPC.make();
};
" );
G::RenderPage( 'publish', 'blank' );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}

View File

@@ -1,73 +1,69 @@
<?php
/**
* processes_List.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.
*
*/
global $RBAC;
$access = $RBAC->userCanAccess('PM_FACTORY');
if( $access != 1 ){
switch ($access)
{
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
default:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'process';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_ID_SUB_MENU_SELECTED = '-';
$aLabels['LANG'] = SYS_LANG;
$aLabels['PRO_EDIT'] = G::LoadTranslation('ID_EDIT');
$aLabels['PRO_DELETE']= G::LoadTranslation('ID_DELETE');
$aLabels['ACTIVE'] = G::LoadTranslation('ID_ACTIVE');
$aLabels['INACTIVE'] = G::LoadTranslation('ID_INACTIVE');
$aLabels['CONFIRM'] = G::LoadTranslation('ID_MSG_CONFIRM_DELETE_PROCESS');
G::LoadClass ( 'processMap');
$oProcess = new processMap();
$c = $oProcess->getConditionProcessList();
function activeFalse($value)
{
return $value=="ACTIVE"?"ID_ACTIVE":"ID_INACTIVE";
}
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'processes/processes_List', $c, $aLabels, '' );
G::RenderPage('publish');
<?php
/**
* processes_List.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.
*/
global $RBAC;
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) {
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'process';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_ID_SUB_MENU_SELECTED = '-';
$aLabels['LANG'] = SYS_LANG;
$aLabels['PRO_EDIT'] = G::LoadTranslation( 'ID_EDIT' );
$aLabels['PRO_DELETE'] = G::LoadTranslation( 'ID_DELETE' );
$aLabels['ACTIVE'] = G::LoadTranslation( 'ID_ACTIVE' );
$aLabels['INACTIVE'] = G::LoadTranslation( 'ID_INACTIVE' );
$aLabels['CONFIRM'] = G::LoadTranslation( 'ID_MSG_CONFIRM_DELETE_PROCESS' );
G::LoadClass( 'processMap' );
$oProcess = new processMap();
$c = $oProcess->getConditionProcessList();
function activeFalse ($value)
{
return $value == "ACTIVE" ? "ID_ACTIVE" : "ID_INACTIVE";
}
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'processes/processes_List', $c, $aLabels, '' );
G::RenderPage( 'publish' );

View File

@@ -1,96 +1,94 @@
<?php
/**
* processes_Map.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.
*
*/
global $RBAC;
$access = $RBAC->userCanAccess('PM_FACTORY');
if( $access != 1 ){
switch ($access)
{
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
default:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
}
$processUID = $_GET['PRO_UID'];
$_SESSION['PROCESS'] = $processUID;
$_SESSION['PROCESSMAP'] = 'LEIMNUD';
G::LoadClass('processMap');
$oTemplatePower = new TemplatePower(PATH_TPL . 'processes/processes_Map.html');
$oTemplatePower->prepare();
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_SUB_MENU = 'processes';
$G_ID_SUB_MENU_SELECTED = '_';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptFile('/jscore/dbConnections/main.js');
$oHeadPublisher->addScriptCode('
var maximunX = ' . processMap::getMaximunTaskX($processUID) . ';
var leimnud = new maborak();
leimnud.make();
leimnud.Package.Load("rpc,drag,drop,panel,app,validator,fx,dom,abbr",{Instance:leimnud,Type:"module"});
leimnud.Package.Load("json",{Type:"file"});
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.Package.Load("processes_Map",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processes_Map.js"});
leimnud.Package.Load("stagesmap",{Type:"file",Absolute:true,Path:"/jscore/stagesmap/core/stagesmap.js"});
leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){
var pb=leimnud.dom.capture("tag.body 0");
Pm=new processmap();
Pm.options={
target :"pm_target",
dataServer :"processes_Ajax.php",
uid :"' . $processUID . '",
lang :"' . SYS_LANG . '",
theme :"processmaker",
size :{w:pb.offsetWidth-10,h:pb.offsetHeight},
images_dir :"/jscore/processmap/core/images/"
}
Pm.make();
});
var changesSavedLabel = "' . addslashes(G::LoadTranslation('ID_SAVED_SUCCESSFULLY')) . '";');
if( ! isset($_GET['raw']) )
G::RenderPage('publish', 'green-submenu');
else
G::RenderPage('publish', 'raw');
<?php
/**
* processes_Map.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.
*/
global $RBAC;
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) {
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
}
$processUID = $_GET['PRO_UID'];
$_SESSION['PROCESS'] = $processUID;
$_SESSION['PROCESSMAP'] = 'LEIMNUD';
G::LoadClass( 'processMap' );
$oTemplatePower = new TemplatePower( PATH_TPL . 'processes/processes_Map.html' );
$oTemplatePower->prepare();
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_SUB_MENU = 'processes';
$G_ID_SUB_MENU_SELECTED = '_';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptFile( '/jscore/dbConnections/main.js' );
$oHeadPublisher->addScriptCode( '
var maximunX = ' . processMap::getMaximunTaskX( $processUID ) . ';
var leimnud = new maborak();
leimnud.make();
leimnud.Package.Load("rpc,drag,drop,panel,app,validator,fx,dom,abbr",{Instance:leimnud,Type:"module"});
leimnud.Package.Load("json",{Type:"file"});
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.Package.Load("processes_Map",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processes_Map.js"});
leimnud.Package.Load("stagesmap",{Type:"file",Absolute:true,Path:"/jscore/stagesmap/core/stagesmap.js"});
leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){
var pb=leimnud.dom.capture("tag.body 0");
Pm=new processmap();
Pm.options={
target :"pm_target",
dataServer :"processes_Ajax.php",
uid :"' . $processUID . '",
lang :"' . SYS_LANG . '",
theme :"processmaker",
size :{w:pb.offsetWidth-10,h:pb.offsetHeight},
images_dir :"/jscore/processmap/core/images/"
}
Pm.make();
});
var changesSavedLabel = "' . addslashes( G::LoadTranslation( 'ID_SAVED_SUCCESSFULLY' ) ) . '";' );
if (! isset( $_GET['raw'] ))
G::RenderPage( 'publish', 'green-submenu' );
else
G::RenderPage( 'publish', 'raw' );

View File

@@ -1,63 +1,59 @@
<?php
/**
* processes_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.
*
*/
$access = $RBAC->userCanAccess('PM_FACTORY');
if( $access != 1 ){
switch ($access)
{
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
default:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
}
//call plugins
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->executeTriggers ( PM_NEW_PROCESS_LIST , NULL );
$aFields['MESSAGE1'] = G::LoadTranslation('ID_MSG_ERROR_PRO_TITLE');
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher;
if ( isset ( $_DBArray['ProcessesNew']) ) {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_New', '', $aFields, 'processes_Save');
}
else {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_NewSimple', '', $aFields, 'processes_Save');
}
G::RenderPage( 'publish', 'blank');
<?php
/**
* processes_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.
*/
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
if ($access != 1) {
switch ($access) {
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
default:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
}
//call plugins
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$oPluginRegistry->executeTriggers( PM_NEW_PROCESS_LIST, NULL );
$aFields['MESSAGE1'] = G::LoadTranslation( 'ID_MSG_ERROR_PRO_TITLE' );
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
if (isset( $_DBArray['ProcessesNew'] )) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_New', '', $aFields, 'processes_Save' );
} else {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_NewSimple', '', $aFields, 'processes_Save' );
}
G::RenderPage( 'publish', 'blank' );

View File

@@ -1,96 +1,94 @@
<?php
/**
* processes_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.
*
*/
/*
* This is a ajax response file
*
*/
G::LoadThirdParty('pear/json','class.json');
$function = isset($_POST['function']) ? $_POST['function']: '';
switch($function){
case 'lookForNameProcess':
require_once 'classes/model/Content.php';
$snameProcess=urldecode($_POST['NAMEPROCESS']);
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn('COUNT(*) AS PROCESS');
$oCriteria->add(ContentPeer::CON_CATEGORY, 'PRO_TITLE');
$oCriteria->add(ContentPeer::CON_LANG, SYS_LANG);
$oCriteria->add(ContentPeer::CON_VALUE, $snameProcess);
$oDataset = ContentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
print($aRow['PROCESS'] ? true : false);
break;
default:
if ( isset($_GET['PRO_UID'])) {
$_POST['form']['PRO_UID'] = $_GET['PRO_UID'];
}
$_POST['form']['PRO_TITLE'] = trim($_POST['form']['PRO_TITLE']);
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
if (!isset($_POST['form']['PRO_UID'])) {
$_POST['form']['USR_UID'] = $_SESSION['USER_LOGGED'];
$oJSON = new Services_JSON();
require_once 'classes/model/Task.php';
$sProUid = $oProcessMap->createProcess($_POST['form']);
//call plugins
$oData['PRO_UID'] = $sProUid;
$oData['PRO_TEMPLATE'] = (isset($_POST['form']['PRO_TEMPLATE']) && $_POST['form']['PRO_TEMPLATE'] != '') ? $_POST['form']['PRO_TEMPLATE'] : '';
$oData['PROCESSMAP'] = $oProcessMap;
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$oPluginRegistry->executeTriggers(PM_NEW_PROCESS_SAVE, $oData);
G::header('location: processes_Map?PRO_UID=' . $sProUid);
die;
}
else {
$_POST['form']['PRO_DYNAFORMS'] = array();
$_POST['form']['PRO_DYNAFORMS']['PROCESS'] = isset($_POST['form']['PRO_SUMMARY_DYNAFORM']) ? $_POST['form']['PRO_SUMMARY_DYNAFORM'] : '';
unset($_POST['form']['PRO_SUMMARY_DYNAFORM']);
$oProcessMap->updateProcess($_POST['form']);
$sProUid = $_POST['form']['PRO_UID'];
}
//Save Calendar ID for this process
G::LoadClass("calendar");
$calendarObj=new Calendar();
$calendarObj->assignCalendarTo($sProUid, $_POST['form']['PRO_CALENDAR'], 'PROCESS');
if ($_POST['form']['THETYPE'] == '') {
G::header('location: main');
}
break;
<?php
/**
* processes_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.
*/
/*
* This is a ajax response file
*
*/
G::LoadThirdParty( 'pear/json', 'class.json' );
$function = isset( $_POST['function'] ) ? $_POST['function'] : '';
switch ($function) {
case 'lookForNameProcess':
require_once 'classes/model/Content.php';
$snameProcess = urldecode( $_POST['NAMEPROCESS'] );
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( 'COUNT(*) AS PROCESS' );
$oCriteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE' );
$oCriteria->add( ContentPeer::CON_LANG, SYS_LANG );
$oCriteria->add( ContentPeer::CON_VALUE, $snameProcess );
$oDataset = ContentPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
print ($aRow['PROCESS'] ? true : false) ;
break;
default:
if (isset( $_GET['PRO_UID'] )) {
$_POST['form']['PRO_UID'] = $_GET['PRO_UID'];
}
$_POST['form']['PRO_TITLE'] = trim( $_POST['form']['PRO_TITLE'] );
G::LoadClass( 'processMap' );
$oProcessMap = new ProcessMap();
if (! isset( $_POST['form']['PRO_UID'] )) {
$_POST['form']['USR_UID'] = $_SESSION['USER_LOGGED'];
$oJSON = new Services_JSON();
require_once 'classes/model/Task.php';
$sProUid = $oProcessMap->createProcess( $_POST['form'] );
//call plugins
$oData['PRO_UID'] = $sProUid;
$oData['PRO_TEMPLATE'] = (isset( $_POST['form']['PRO_TEMPLATE'] ) && $_POST['form']['PRO_TEMPLATE'] != '') ? $_POST['form']['PRO_TEMPLATE'] : '';
$oData['PROCESSMAP'] = $oProcessMap;
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$oPluginRegistry->executeTriggers( PM_NEW_PROCESS_SAVE, $oData );
G::header( 'location: processes_Map?PRO_UID=' . $sProUid );
die();
} else {
$_POST['form']['PRO_DYNAFORMS'] = array ();
$_POST['form']['PRO_DYNAFORMS']['PROCESS'] = isset( $_POST['form']['PRO_SUMMARY_DYNAFORM'] ) ? $_POST['form']['PRO_SUMMARY_DYNAFORM'] : '';
unset( $_POST['form']['PRO_SUMMARY_DYNAFORM'] );
$oProcessMap->updateProcess( $_POST['form'] );
$sProUid = $_POST['form']['PRO_UID'];
}
//Save Calendar ID for this process
G::LoadClass( "calendar" );
$calendarObj = new Calendar();
$calendarObj->assignCalendarTo( $sProUid, $_POST['form']['PRO_CALENDAR'], 'PROCESS' );
if ($_POST['form']['THETYPE'] == '') {
G::header( 'location: main' );
}
break;
}