public function create($data) { try { parent::create($data); } catch (\Exception $e) { throw new \RuntimeException(sprintf("Can't create Bpmn Project." . PHP_EOL . $e->getMessage())); } try { $wpData = array(); $wpData["PRO_UID"] = $this->getUid(); if (array_key_exists("PRJ_NAME", $data)) { $wpData["PRO_TITLE"] = $data["PRJ_NAME"]; } if (array_key_exists("PRJ_DESCRIPTION", $data)) { $wpData["PRO_DESCRIPTION"] = $data["PRJ_DESCRIPTION"]; } if (array_key_exists("PRJ_AUTHOR", $data)) { $wpData["PRO_CREATE_USER"] = $data["PRJ_AUTHOR"]; } $this->wp = new Project\Workflow(); $this->wp->create($wpData); //Add Audit Log $ogetProcess = new \Process(); $getprocess=$ogetProcess->load($this->getUid()); $nameProcess=$getprocess['PRO_TITLE']; \G::auditLog("ImportProcess", 'PMX File Imported '.$nameProcess. ' ('.$this->getUid().')'); } catch (\Exception $e) { $prjUid = $this->getUid(); //$this->remove(); $bpmnProject = Project\Bpmn::load($prjUid); $bpmnProject->remove(); throw new \RuntimeException(sprintf( "Can't create Bpmn Project with prj_uid: %s, workflow creation fails." . PHP_EOL . $e->getMessage() , $prjUid )); } }
public function create($data) { try { parent::create($data); } catch (\Exception $e) { throw new \RuntimeException(sprintf("Can't create Workflow Project." . PHP_EOL . $e->getMessage())); } try { $bpData = array(); $bpData["PRJ_UID"] = $this->getUid(); if (array_key_exists("PRO_TITLE", $data)) { $bpData["PRJ_NAME"] = $data["PRO_TITLE"]; } if (array_key_exists("PRO_DESCRIPTION", $data)) { $bpData["PRJ_DESCRIPTION"] = $data["PRO_DESCRIPTION"]; } if (array_key_exists("PRO_CREATE_USER", $data)) { $bpData["PRJ_AUTHOR"] = $data["PRO_CREATE_USER"]; } elseif (array_key_exists("USR_UID", $data)) { $bpData["PRJ_AUTHOR"] = $data["USR_UID"]; } $this->bp = new Project\Bpmn(); $this->bp->create($bpData); // At this time we will add a default diagram and process $this->bp->addDiagram(); $this->bp->addProcess(); //Add Audit Log $ogetProcess = new \Process(); $getprocess = $ogetProcess->load($this->getUid()); $nameProcess = $getprocess['PRO_TITLE']; \G::auditLog("ImportProcess", 'BPMN Imported ' . $nameProcess . ' (' . $this->getUid() . ')'); } catch (\Exception $e) { $prjUid = $this->getUid(); $this->remove(); throw new \RuntimeException(sprintf("Can't create Project with prj_uid: %s, workflow creation fails." . PHP_EOL . $e->getMessage(), $prjUid)); } }
//#20 $t->like($e->getMessage(), "%The process cannot be created. The USR_UID is empty.%", 'create() return The process cannot be created. The USR_UID is empty.'); } //create try { $Fields['USR_UID'] = '1'; // we need a valid user $obj = new Process(); $proUid = $obj->create($Fields); //#21 $t->isa_ok($proUid, 'string', 'create(), creates a new Process'); //#22 //$t->is ( strlen($proUid), 14, 'create(), creates a new Process, Guid lenth=14 chars' ); $t->diag("strlen({$proUid}), 14, 'create(), creates a new Process, Guid lenth=14 chars' "); $t->is(strlen($proUid), 32, 'create(), creates a new Process, Guid lenth=32 chars'); $res = $obj->load($proUid); //#23 $t->isa_ok($res, 'array', 'load(), loads a new Process'); //#24 $t->is($res['PRO_UID'], $proUid, 'load(), loads a new Process, valid PRO_UID'); //#25 $t->is(strlen($res['PRO_CREATE_DATE']), 19, 'load(), loads a new Process, valid CREATE_DATE'); //#26 $t->like($res['PRO_TITLE'], '%Default Process%', 'load(), loads a new Process, valid PRO_TITLE'); //#27 $t->is($res['PRO_DESCRIPTION'], 'Default Process Description', 'load(), loads a new Process, valid PRO_DESCRIPTION'); } catch (Exception $e) { $t->like($e->getMessage(), "%Unable to execute INSERT statement%", 'create() return Error in getAppTitle, the APP_UID cant be blank'); } //update with empty try {
$tasksAffected .= 'From -> ' . $titleTask . ' : ' . $aData['TASK'] . ' To End Of Process Condition -> ' . $aFields['ROU_CONDITION'] . ' ; '; } } else { $oTaskSaveNextPattern = new Task(); $taskNextInfo = $oTaskSaveNextPattern->load($aRow['ROU_NEXT_TASK']); $titleNextTask = $taskNextInfo['TAS_TITLE']; if ($aRow['ROU_CONDITION'] == '') { $tasksAffected .= 'From -> ' . $titleTask . ' : ' . $aData['TASK'] . ' To -> ' . $titleNextTask . ' : ' . $aRow['ROU_NEXT_TASK'] . ' Condition -> Empty ; '; } else { $tasksAffected .= 'From -> ' . $titleTask . ' : ' . $aData['TASK'] . ' To -> ' . $titleNextTask . ' : ' . $aRow['ROU_NEXT_TASK'] . ' Condition -> ' . $aFields['ROU_CONDITION'] . ' ; '; } } unset($aFields); } $oProcessNewPattern = new Process(); $processInfo = $oProcessNewPattern->load($aData['PROCESS']); $titleProcess = $processInfo['PRO_TITLE']; G::auditLog("DerivationRule", 'PROCESS NAME : ' . $titleProcess . ' : ' . $aData['PROCESS'] . ' Change Routing Rule From : ' . $aData['ROU_TYPE'] . ' Details : ROU_TYPE_OLD -> ' . $aData['ROU_TYPE_OLD'] . ' ROU_TYPE ->' . $aData['ROU_TYPE'] . ' ' . $tasksAffected); break; case 'DISCRIMINATOR': //Girish ->Added to save changes, while editing the route foreach ($aData['GRID_DISCRIMINATOR_TYPE'] as $iKey => $aRow) { $aFields['PRO_UID'] = $aData['PROCESS']; $aFields['TAS_UID'] = $aData['TASK']; $aFields['ROU_NEXT_TASK'] = $aRow['ROU_NEXT_TASK']; $aFields['ROU_CASE'] = $iKey; $aFields['ROU_TYPE'] = $aData['ROU_TYPE']; $aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION']; $aFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL']; $routeData = $oTasks->getRouteByType($aData['PROCESS'], $aRow['ROU_NEXT_TASK'], $aData['ROU_TYPE']); foreach ($routeData as $route) {
} 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/CaseTrackerObject.php'; $oCaseTrackerObject = new CaseTrackerObject(); if (isset($_POST['form'])) { $value = $_POST['form']; } else { $value = $_POST; } $aFields = $oCaseTrackerObject->load($value['CTO_UID']); $aFields['CTO_CONDITION'] = $value['CTO_CONDITION']; $oCaseTrackerObject->update($aFields); $infoProcess = new Process(); $resultProcess = $infoProcess->load($value['PRO_UID']); G::auditLog('CaseTrackers', 'Save Condition Case Tracker Object (' . $value['CTO_UID'] . ', condition: ' . $value['CTO_CONDITION'] . ') in Process "' . $resultProcess['PRO_TITLE'] . '"'); } catch (Exception $oException) { die($oException->getMessage()); }
function getDatasetCasesByProcess() { $dataSet = new XYDataSet(); $processObj = new Process(); $c = new Criteria('workflow'); $c->clearSelectColumns(); $c->addSelectColumn(ApplicationPeer::PRO_UID); $c->addSelectColumn('COUNT(*) AS CANT'); //$c->addJoin( ProcessPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN); $c->addGroupByColumn(ApplicationPeer::PRO_UID); $rs = ApplicationPeer::doSelectRS($c); $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC); $rs->next(); $row = $rs->getRow(); while (is_array($row)) { $processObj->load($row['PRO_UID']); $label = $processObj->getProTitle(); $value = $row['CANT']; $dataSet->addPoint(new Point($label, (int) $value)); $rs->next(); $row = $rs->getRow(); } return $dataSet; }
public static function getByProTitle($proTitle) { $oCriteria = new Criteria("workflow"); $oCriteria->addSelectColumn(ContentPeer::CON_ID); $oCriteria->add(ContentPeer::CON_CATEGORY, 'PRO_TITLE'); $oCriteria->add(ContentPeer::CON_LANG, SYS_LANG); $oCriteria->add(ContentPeer::CON_VALUE, $proTitle); $oDataset = ContentPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro')); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $aRow = $oDataset->getRow(); $oProcess = new Process(); return isset($aRow["CON_ID"]) ? $oProcess->load($aRow["CON_ID"]) : null; }
$oTask = new Task(); $TaskFields = $oTask->load($sTASKS); $WE_EVN_UID = $oTask->getStartingEvent($sTASKS); if ($TaskFields['TAS_ASSIGN_TYPE'] != 'BALANCED') { throw new Exception("The task '" . $TaskFields['TAS_TITLE'] . "' doesn't have a valid assignment type. The task needs to have a 'Cyclical Assignment'."); } G::LoadClass('tasks'); $oTask = new Tasks(); $user = $oTask->assignUsertoTask($sTASKS); if ($user == 0) { throw new Exception(G::LoadTranslation('ID_TASK') . "'" . $TaskFields['TAS_TITLE'] . "'" . G::LoadTranslation('ID_NOT_HAVE_USERS')); } $http = G::is_https() ? "https://" : "http://"; $sContent = ''; $infoProcess = new Process(); $resultProcess = $infoProcess->load($sPRO_UID); if ($withWS) { //creating sys.info; $SITE_PUBLIC_PATH = ''; if (file_exists($SITE_PUBLIC_PATH . '')) { } //creating the first file require_once 'classes/model/Dynaform.php'; $oDynaform = new Dynaform(); $aDynaform = $oDynaform->load($sDYNAFORM); $dynTitle = str_replace(' ', '_', str_replace('/', '_', $aDynaform['DYN_TITLE'])); $sContent = "<?php\n"; $sContent .= "global \$_DBArray;\n"; $sContent .= "if (!isset(\$_DBArray)) {\n"; $sContent .= " \$_DBArray = array();\n"; $sContent .= "}\n";
/** * get the case summary data * * @param string $httpData->appUid * @param string $httpData->delIndex * @return array containg the case summary data */ function getSummary($httpData) { $labels = array(); $form = new Form('cases/cases_Resume', PATH_XMLFORM, SYS_LANG); G::LoadClass('case'); $case = new Cases(); foreach ($form->fields as $fieldName => $field) { $labels[$fieldName] = $field->label; } if (isset($_SESSION['_applicationFields']) && $_SESSION['_processData']) { $applicationFields = $_SESSION['_applicationFields']; unset($_SESSION['_applicationFields']); $processData = $_SESSION['_processData']; unset($_SESSION['_processData']); } else { if ($httpData->action == 'sent') { // Get the last valid delegation for participated list $criteria = new Criteria(); $criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX); $criteria->add(AppDelegationPeer::APP_UID, $httpData->appUid); $criteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL); $criteria->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX); if (AppDelegationPeer::doCount($criteria) > 0) { $dataset = AppDelegationPeer::doSelectRS($criteria); $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $dataset->next(); $row = $dataset->getRow(); $httpData->delIndex = $row['DEL_INDEX']; } } $applicationFields = $case->loadCase($httpData->appUid, $httpData->delIndex); $process = new Process(); $processData = $process->load($applicationFields['PRO_UID']); } $data = array(); $task = new Task(); $taskData = $task->load($applicationFields['TAS_UID']); $currentUser = $applicationFields['CURRENT_USER'] != '' ? $applicationFields['CURRENT_USER'] : '******' . G::LoadTranslation('ID_UNASSIGNED') . ']'; $data[] = array('label' => $labels['PRO_TITLE'], 'value' => $processData['PRO_TITLE'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['TITLE'], 'value' => $applicationFields['TITLE'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['APP_NUMBER'], 'value' => $applicationFields['APP_NUMBER'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['STATUS'], 'value' => $applicationFields['STATUS'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['APP_UID'], 'value' => $applicationFields['APP_UID'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['CREATOR'], 'value' => $applicationFields['CREATOR'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['CREATE_DATE'], 'value' => $applicationFields['CREATE_DATE'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['UPDATE_DATE'], 'value' => $applicationFields['UPDATE_DATE'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['DESCRIPTION'], 'value' => $applicationFields['DESCRIPTION'], 'section' => $labels['TITLE1']); // note added by krlos pacha carlos[at]colosa[dot]com //getting this field if it doesn't exist. Related 7994 bug $taskData['TAS_TITLE'] = array_key_exists('TAS_TITLE', $taskData) ? $taskData['TAS_TITLE'] : Content::Load("TAS_TITLE", "", $applicationFields['TAS_UID'], SYS_LANG); $data[] = array('label' => $labels['TAS_TITLE'], 'value' => $taskData['TAS_TITLE'], 'section' => $labels['TITLE2']); $data[] = array('label' => $labels['CURRENT_USER'], 'value' => $currentUser, 'section' => $labels['TITLE2']); $data[] = array('label' => $labels['DEL_DELEGATE_DATE'], 'value' => $applicationFields['DEL_DELEGATE_DATE'], 'section' => $labels['TITLE2']); $data[] = array('label' => $labels['DEL_INIT_DATE'], 'value' => $applicationFields['DEL_INIT_DATE'], 'section' => $labels['TITLE2']); $data[] = array('label' => $labels['DEL_TASK_DUE_DATE'], 'value' => $applicationFields['DEL_TASK_DUE_DATE'], 'section' => $labels['TITLE2']); $data[] = array('label' => $labels['DEL_FINISH_DATE'], 'value' => $applicationFields['DEL_FINISH_DATE'], 'section' => $labels['TITLE2']); //$data[] = array('label'=>$labels['DYN_UID'] , 'value' => $processData['PRO_DYNAFORMS']['PROCESS'];, 'section'=>$labels['DYN_UID']); return $data; }
* 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. * */ if (($RBAC_Response = $RBAC->userCanAccess("PM_FACTORY")) != 1) { return $RBAC_Response; } require_once 'classes/model/Triggers.php'; require_once 'classes/model/Process.php'; $sProcessUID = $_GET['PRO_UID']; $oProcess = new Process(); $aFields = $oProcess->load($sProcessUID); $_SESSION['PROCESS'] = $sProcessUID; $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('view', 'triggers/triggersTree'); G::RenderPage('publish', 'raw');
} //replacing the processOwner user for the current user $oData->process['PRO_CREATE_USER'] = $_SESSION['USER_LOGGED']; //!respect of the groups if ($result->ExistProcessInDatabase == 0 && $result->ExistGroupsInDatabase == 0) { if ($processFileType == "pm") { $oProcess->createProcessFromData($oData, $path . $filename); } } //!data ouput $result->sNewProUid = $sProUid; $result->proFileName = $Fields['PRO_FILENAME']; //Add Audit Log $process = new Process(); if ($process->processExists($sProUid)) { $arrayProcessData = $process->load($oData->process["PRO_UID"]); G::auditLog("ImportProcess", "PM File Imported " . $arrayProcessData["PRO_TITLE"] . " (" . $arrayProcessData["PRO_UID"] . ")"); } } catch (Exception $e) { $result->response = $e->getMessage(); $result->catchMessage = $e->getMessage(); $result->success = true; } } if ($action == "uploadFileNewProcessExist") { try { $option = $_REQUEST["IMPORT_OPTION"]; $filename = $_REQUEST["PRO_FILENAME"]; $processFileType = $_REQUEST["processFileType"]; $result->ExistGroupsInDatabase = ""; //"" -Default
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"}); leimnud.exec(leimnud.fix.memoryLeak); ' ); require_once 'classes/model/Process.php'; $objProc = new Process(); $aProc = $objProc->load( $Fields['PRO_UID'] ); $Fields['PRO_TITLE'] = $aProc['PRO_TITLE']; $objTask = new Task(); $aTask = $objTask->load( $Fields['TAS_UID'] ); $Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
//!data ouput $result->sNewProUid = $sProUid; $result->proFileName = $Fields['PRO_FILENAME']; //Add Audit Log $ogetProcess = new Process(); $getprocess=$ogetProcess->load($oData->process['PRO_UID']); $nameProcess=$getprocess['PRO_TITLE']; G::auditLog("ImportProcess", 'PM File Imported '.$nameProcess. ' ('.$oData->process['PRO_UID'].')'); } catch (Exception $e) { $result->response = $e->getMessage(); $result->catchMessage = $e->getMessage(); $result->success = true;
public function getProcessInformation() { $process = new Process(); $processData = $process->load($_SESSION['PROCESS']); require_once 'classes/model/Users.php'; $user = new Users(); try { $userData = $user->load($processData['PRO_CREATE_USER']); $processData['PRO_AUTHOR'] = $userData['USR_FIRSTNAME'] . ' ' . $userData['USR_LASTNAME']; } catch (Exception $oError) { $processData['PRO_AUTHOR'] = '(USER DELETED)'; } $processData['PRO_CREATE_DATE'] = date('F j, Y', strtotime($processData['PRO_CREATE_DATE'])); print G::json_encode($processData); }
/** * PROPFIND method handler * * @param array general parameter passing array * @param array return array for file properties * @return bool true on success */ function PROPFIND(&$options, &$files) { $paths = $this->paths; // prepare property array $files["files"] = array(); $pathClasses = PATH_DB . PATH_SEP . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP; if (count($paths) == 0 && is_dir($pathClasses)) { $props = array(); $props[] = $this->mkprop("displayname", 'Classes'); $props[] = $this->mkprop("creationdate", filectime($pathClasses)); $props[] = $this->mkprop("getlastmodified", filemtime($pathClasses)); $props[] = $this->mkprop("lastaccessed", filemtime($pathClasses)); $props[] = $this->mkprop("resourcetype", 'collection'); $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory'); $files["files"][] = array('path' => 'classes', 'props' => $props); } if (count($paths) > 0 && $paths[0] == 'classes' && is_dir($pathClasses)) { // try to open directory $handle = @opendir($pathClasses); if ($handle) { while ($filename = readdir($handle)) { $ext = array_pop(explode('.', $filename)); if ($filename != "." && $filename != ".." && !is_dir($pathClasses . $filename) && $ext == 'php') { $props = array(); $props[] = $this->mkprop("displayname", $filename); $props[] = $this->mkprop("creationdate", filectime($pathClasses . $filename)); $props[] = $this->mkprop("getlastmodified", filemtime($pathClasses . $filename)); $props[] = $this->mkprop("getetag", fileatime($pathClasses . $filename)); $props[] = $this->mkprop("lastaccessed", filemtime($pathClasses . $filename)); $props[] = $this->mkprop("resourcetype", ''); $props[] = $this->mkprop("getcontenttype", 'text/plain'); $props[] = $this->mkprop("getcontentlength", filesize($pathClasses . $filename)); if (count($paths) == 1 || count($paths) == 2 && $paths[1] == $filename) { $files["files"][] = array('path' => "classes/{$filename}", 'props' => $props); } } } } } //path classes $pathProcesses = PATH_DB . SYS_SYS . PATH_SEP; if (count($paths) == 0 && is_dir($pathProcesses)) { $props = array(); $props[] = $this->mkprop("displayname", 'Processes'); $props[] = $this->mkprop("creationdate", filectime($pathProcesses)); $props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses)); $props[] = $this->mkprop("resourcetype", 'collection'); $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory'); $files["files"][] = array('path' => 'processes', 'props' => $props); } //list all active processes if (count($paths) == 1 && $paths[0] == 'processes' && is_dir($pathProcesses)) { // try to get the process directory list G::LoadClass('processMap'); G::LoadClass('model/Process'); $oProcessMap = new processMap(); $oProcess = new Process(); $c = $oProcessMap->getConditionProcessList(); $oDataset = ProcessPeer::doSelectRS($c); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); while ($aRow = $oDataset->getRow()) { if ($aRow['PRO_STATUS'] == 'ACTIVE') { $aProcess = $oProcess->load($aRow['PRO_UID']); $props = array(); $props[] = $this->mkprop("displayname", $aProcess['PRO_TITLE']); $props[] = $this->mkprop("creationdate", filectime($pathProcesses)); $props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses)); $props[] = $this->mkprop("lastaccessed", filemtime($pathProcesses)); $props[] = $this->mkprop("resourcetype", 'collection'); $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory'); $files["files"][] = array('path' => "processes/" . $aRow['PRO_UID'], 'props' => $props); } $oDataset->next(); } } //dir of processes //content of any process ( the three major folders of Processes ) $pathXmlform = $pathProcesses . 'xmlForms' . PATH_SEP; if (count($paths) == 2 && $paths[0] == 'processes' && is_dir($pathProcesses)) { $props = array(); $props[] = $this->mkprop("displayname", 'xmlforms'); $props[] = $this->mkprop("creationdate", filectime($pathXmlform)); $props[] = $this->mkprop("getlastmodified", filemtime($pathXmlform)); $props[] = $this->mkprop("lastaccessed", filemtime($pathXmlform)); $props[] = $this->mkprop("resourcetype", 'collection'); $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory'); $files["files"][] = array('path' => 'processes/' . $paths[1] . '/xmlforms', 'props' => $props); $props[] = $this->mkprop("displayname", 'mailTemplates'); $props[] = $this->mkprop("creationdate", filectime($pathProcesses)); $props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses)); $props[] = $this->mkprop("lastaccessed", filemtime($pathProcesses)); $props[] = $this->mkprop("resourcetype", 'collection'); $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory'); $files["files"][] = array('path' => 'processes/' . $paths[1] . '/mailTemplates', 'props' => $props); $props[] = $this->mkprop("displayname", 'public_html'); $props[] = $this->mkprop("creationdate", filectime($pathProcesses)); $props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses)); $props[] = $this->mkprop("lastaccessed", filemtime($pathProcesses)); $props[] = $this->mkprop("resourcetype", 'collection'); $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory'); $files["files"][] = array('path' => 'processes/' . $paths[1] . '/public_html', 'props' => $props); } //content of any processes //list available xmlforms if (count($paths) == 3 && $paths[0] == 'processes' && $paths[2] == 'xmlforms' && is_dir($pathXmlform)) { $pathXmlform = $pathProcesses . 'xmlForms' . PATH_SEP . $paths[1] . PATH_SEP; $handle = @opendir($pathXmlform); if ($handle) { while ($filename = readdir($handle)) { $ext = array_pop(explode('.', $filename)); if ($filename != "." && $filename != ".." && !is_dir($pathXmlform . $filename) && ($ext == 'xml' || $ext == 'html')) { $props = array(); $props[] = $this->mkprop("displayname", $filename); $props[] = $this->mkprop("creationdate", filectime($pathXmlform . $filename)); $props[] = $this->mkprop("getlastmodified", filemtime($pathXmlform . $filename)); $props[] = $this->mkprop("getetag", fileatime($pathXmlform . $filename)); $props[] = $this->mkprop("lastaccessed", filemtime($pathXmlform . $filename)); $props[] = $this->mkprop("resourcetype", ''); $props[] = $this->mkprop("getcontenttype", 'text/plain'); $props[] = $this->mkprop("getcontentlength", filesize($pathXmlform . $filename)); //if ( count( $paths ) == 1 || ( count( $paths ) == 2 && $paths[1] == $filename ) ) $files["files"][] = array('path' => 'processes/' . $paths[1] . '/xmlforms/' . $filename, 'props' => $props); } } } } //content of xmlforms //list available mailTemplates $pathTemplates = $pathProcesses . 'mailTemplates' . PATH_SEP; if (count($paths) == 3 && $paths[0] == 'processes' && $paths[2] == 'mailTemplates' && is_dir($pathTemplates)) { $pathTemplates = $pathProcesses . 'mailTemplates' . PATH_SEP . $paths[1] . PATH_SEP; $handle = @opendir($pathTemplates); if ($handle) { while ($filename = readdir($handle)) { $ext = array_pop(explode('.', $filename)); if ($filename != "." && $filename != ".." && !is_dir($pathTemplates . $filename)) { $props = array(); $props[] = $this->mkprop("displayname", $filename); $props[] = $this->mkprop("creationdate", filectime($pathTemplates . $filename)); $props[] = $this->mkprop("getlastmodified", filemtime($pathTemplates . $filename)); $props[] = $this->mkprop("getetag", fileatime($pathTemplates . $filename)); $props[] = $this->mkprop("lastaccessed", filemtime($pathTemplates . $filename)); $props[] = $this->mkprop("resourcetype", ''); $props[] = $this->mkprop("getcontenttype", 'text/plain'); $props[] = $this->mkprop("getcontentlength", filesize($pathTemplates . $filename)); //if ( count( $paths ) == 1 || ( count( $paths ) == 2 && $paths[1] == $filename ) ) $files["files"][] = array('path' => 'processes/' . $paths[1] . '/mailTemplates/' . $filename, 'props' => $props); } } } } //content of mailTemplates //list available public_html files $pathPublic = $pathProcesses . 'public' . PATH_SEP; if (count($paths) == 3 && $paths[0] == 'processes' && $paths[2] == 'public_html' && is_dir($pathTemplates)) { $pathPublic = $pathProcesses . 'public' . PATH_SEP . $paths[1] . PATH_SEP; $handle = @opendir($pathPublic); if ($handle) { while ($filename = readdir($handle)) { $ext = array_pop(explode('.', $filename)); if ($filename != "." && $filename != ".." && !is_dir($pathPublic . $filename)) { $props = array(); $props[] = $this->mkprop("displayname", $filename); $props[] = $this->mkprop("creationdate", filectime($pathPublic . $filename)); $props[] = $this->mkprop("getlastmodified", filemtime($pathPublic . $filename)); $props[] = $this->mkprop("getetag", fileatime($pathPublic . $filename)); $props[] = $this->mkprop("lastaccessed", filemtime($pathPublic . $filename)); $props[] = $this->mkprop("resourcetype", ''); $props[] = $this->mkprop("getcontenttype", 'text/plain'); $props[] = $this->mkprop("getcontentlength", filesize($pathPublic . $filename)); //if ( count( $paths ) == 1 || ( count( $paths ) == 2 && $paths[1] == $filename ) ) $files["files"][] = array('path' => 'processes/' . $paths[1] . '/public_html/' . $filename, 'props' => $props); } } } } //content of public_html files /* if ( 1 ) { $props = array (); $props[] = $this->mkprop("displayname", print_r ($pathPublic, 1) ); $props[] = $this->mkprop("creationdate", filectime( PATH_DB ) ); $props[] = $this->mkprop("getlastmodified", filemtime( PATH_DB ) ); $props[] = $this->mkprop("resourcetype", 'collection' ); $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory' ); $files["files"][] = array ( 'path' => '/' , 'props' => $props); } */ // ok, all done return true; }
/** * Delete all routes from a task * @param string $sProcessUID * @param string $sTaskUID * @return boolean */ public function deleteAllGatewayOfTask($sProcessUID = '', $sTaskUID = '', $bAll = false) { try { $oProcess = new Process(); $aFields = $oProcess->load($sProcessUID); $oTask = new Task(); $aFields = $oTask->load($sTaskUID); $oCriteria = new Criteria('workflow'); $oCriteria->add(GatewayPeer::PRO_UID, $sProcessUID); $oCriteria->add(GatewayPeer::TAS_UID, $sTaskUID); GatewayPeer::doDelete($oCriteria); if ($bAll) { $oCriteria = new Criteria('workflow'); $oCriteria->add(GatewayPeer::PRO_UID, $sProcessUID); $oCriteria->add(GatewayPeer::GAT_NEXT_TASK, $sTaskUID); GatewayPeer::doDelete($oCriteria); } return true; } catch (Exception $oError) { throw $oError; } }
$oTaskNewPattern = new Task(); $taskInfo=$oTaskNewPattern->load($oData->tas_uid); $titleTask=$taskInfo['TAS_TITLE']; if ($oData->next_task != "-1") { $oTaskNextNewPattern = new Task(); $taskNextInfo=$oTaskNextNewPattern->load($oData->next_task); $titleNextTask=$taskNextInfo['TAS_TITLE']; } else { $titleNextTask=G::LoadTranslation("ID_END_OF_PROCESS"); } G::auditLog("DerivationRule",'PROCESS NAME : '.$titleProcess.' : '.$oData->pro_uid.' Routing rule : '.$sType.' from -> '.$titleTask.' : '.$oData->tas_uid.' To -> '.$titleNextTask.' : '.$oData->next_task); break; case 8: $sType = 'DISCRIMINATOR'; $oProcessNewPattern = new Process(); $taskProcess=$oProcessNewPattern->load($oData->pro_uid); $titleProcess=$taskProcess['PRO_TITLE']; $oTaskNewPattern = new Task(); $taskInfo=$oTaskNewPattern->load($oData->tas_uid); $titleTask=$taskInfo['TAS_TITLE']; if ($oData->next_task != "-1") { $oTaskNextNewPattern = new Task(); $taskNextInfo=$oTaskNextNewPattern->load($oData->next_task); $titleNextTask=$taskNextInfo['TAS_TITLE']; } else { $titleNextTask=G::LoadTranslation("ID_END_OF_PROCESS"); } G::auditLog("DerivationRule",'PROCESS NAME : '.$titleProcess.' : '.$oData->pro_uid.' Routing rule : '.$sType.' from -> '.$titleTask.' : '.$oData->tas_uid.' To -> '.$titleNextTask.' : '.$oData->next_task); break; } if (($oData->type != 0) && ($oData->type != 5) && ($oData->type != 8)) {
break; case 'load': $oConnection = Propel::getConnection('workflow'); $oStatement = $oConnection->prepareStatement("CREATE TABLE IF NOT EXISTS `STAGE` (\r\n `STG_UID` VARCHAR( 32 ) NOT NULL ,\r\n `PRO_UID` VARCHAR( 32 ) NOT NULL ,\r\n `STG_POSX` INT( 11 ) NOT NULL DEFAULT '0',\r\n `STG_POSY` INT( 11 ) NOT NULL DEFAULT '0',\r\n `STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0',\r\n PRIMARY KEY ( `STG_UID` )\r\n );"); $oStatement->executeQuery(); /** * ************************************************************************************************************ */ require_once 'classes/model/Stage.php'; require_once 'classes/model/Process.php'; require_once 'classes/model/Task.php'; require_once 'classes/model/AppDelegation.php'; //$oJSON = new Services_JSON(); $oData = Bootstrap::json_decode(stripslashes($_POST['data'])); $oProcess = new Process(); $aRow = $oProcess->load($oData->uid); $oSM = new stdclass(); $oSM->title = new stdclass(); $oSM->title->label = strip_tags($aRow['PRO_TITLE']); //$oSM->title->position->x = $aRow['PRO_TITLE_X']; //$oSM->title->position->y = $aRow['PRO_TITLE_Y']; $oSM->title->position = new stdclass(); $oSM->title->position->x = 10; $oSM->title->position->y = 10; $oSM->stages = array(); $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(StagePeer::STG_UID); $oCriteria->addSelectColumn(ContentPeer::CON_VALUE); $oCriteria->addSelectColumn(StagePeer::STG_POSX); $oCriteria->addSelectColumn(StagePeer::STG_POSY); $aConditions = array();
* Hystory case for Case Tracker * * @author Everth S. Berrios Morales <*****@*****.**> * */ if (!isset($_SESSION['PROCESS'])) { G::header('location: login'); } $G_MAIN_MENU = 'caseTracker'; $G_ID_MENU_SELECTED = 'HISTORY'; G::LoadClass('case'); $oCase = new Cases(); $aFields = $oCase->loadCase($_SESSION['APPLICATION']); $idProcess = $_SESSION['PROCESS']; $oProcess = new Process(); $aProcessFieds = $oProcess->load($idProcess); $noShowTitle = 0; if (isset($aProcessFieds['PRO_SHOW_MESSAGE'])) { $noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE']; } if (isset($aFields['TITLE'])) { $aFields['APP_TITLE'] = $aFields['TITLE']; } if ($aFields['APP_PROC_CODE'] != '') { $aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE']; } $aFields['CASE'] = G::LoadTranslation('ID_CASE'); $aFields['TITLE'] = G::LoadTranslation('ID_TITLE'); $G_PUBLISH = new Publisher(); if ($noShowTitle == 0) { $G_PUBLISH->AddContent('smarty', 'cases/cases_title', '', '', $aFields);
/** * get the case summary data * @param string $httpData->appUid * @param string $httpData->delIndex * @return array containg the case summary data */ function getSummary($httpData) { $labels = array(); $form = new Form('cases/cases_Resume', PATH_XMLFORM, SYS_LANG); G::LoadClass('case'); $case = new Cases(); foreach ($form->fields as $fieldName => $field) { $labels[$fieldName] = $field->label; } if (isset($_SESSION['_applicationFields']) && $_SESSION['_processData']) { $applicationFields = $_SESSION['_applicationFields']; unset($_SESSION['_applicationFields']); $processData = $_SESSION['_processData']; unset($_SESSION['_processData']); } else { $applicationFields = $case->loadCase($httpData->appUid, $httpData->delIndex); $process = new Process(); $processData = $process->load($applicationFields['PRO_UID']); } $data = array(); $task = new Task(); $taskData = $task->load($applicationFields['TAS_UID']); $currentUser = $applicationFields['CURRENT_USER'] != '' ? $applicationFields['CURRENT_USER'] : '******' . G::LoadTranslation('ID_UNASSIGNED') . ']'; $data[] = array('label' => $labels['PRO_TITLE'], 'value' => $processData['PRO_TITLE'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['TITLE'], 'value' => $applicationFields['TITLE'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['APP_NUMBER'], 'value' => $applicationFields['APP_NUMBER'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['STATUS'], 'value' => $applicationFields['STATUS'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['APP_UID'], 'value' => $applicationFields['APP_UID'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['CREATOR'], 'value' => $applicationFields['CREATOR'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['CREATE_DATE'], 'value' => $applicationFields['CREATE_DATE'], 'section' => $labels['TITLE1']); $data[] = array('label' => $labels['UPDATE_DATE'], 'value' => $applicationFields['UPDATE_DATE'], 'section' => $labels['TITLE1']); // note added by krlos pacha carlos[at]colosa[dot]com //getting this field if it doesn't exist. Related 7994 bug $taskData['TAS_TITLE'] = array_key_exists('TAS_TITLE', $taskData) ? $taskData['TAS_TITLE'] : Content::Load("TAS_TITLE", "", $applicationFields['TAS_UID'], SYS_LANG); $data[] = array('label' => $labels['TAS_TITLE'], 'value' => $taskData['TAS_TITLE'], 'section' => $labels['TITLE2']); $data[] = array('label' => $labels['CURRENT_USER'], 'value' => $currentUser, 'section' => $labels['TITLE2']); $data[] = array('label' => $labels['DEL_DELEGATE_DATE'], 'value' => $applicationFields['DEL_DELEGATE_DATE'], 'section' => $labels['TITLE2']); $data[] = array('label' => $labels['DEL_INIT_DATE'], 'value' => $applicationFields['DEL_INIT_DATE'], 'section' => $labels['TITLE2']); $data[] = array('label' => $labels['DEL_TASK_DUE_DATE'], 'value' => $applicationFields['DEL_TASK_DUE_DATE'], 'section' => $labels['TITLE2']); $data[] = array('label' => $labels['DEL_FINISH_DATE'], 'value' => $applicationFields['DEL_FINISH_DATE'], 'section' => $labels['TITLE2']); //$data[] = array('label'=>$labels['DYN_UID'] , 'value' => $processData['PRO_DYNAFORMS']['PROCESS'];, 'section'=>$labels['DYN_UID']); return $data; }
/** * get case information * * @param string $caseId * @param string $iDelIndex * @param bool $flagUseDelIndex * * @return $result will return an object */ public function getCaseInfo($caseId, $iDelIndex, $flagUseDelIndex = false) { try { $oCase = new Cases(); $aRows = $oCase->loadCase( $caseId, $iDelIndex ); if (count( $aRows ) == 0) { $data['CASE_NUMBER'] = $caseNumber; $result = new wsResponse( 16, G::loadTranslation( 'ID_CASE_DOES_NOT_EXIST', SYS_LANG, $data ) ); return $result; } $oProcess = new Process(); try { $uFields = $oProcess->load( $aRows['PRO_UID'] ); $processName = $uFields['PRO_TITLE']; } catch (Exception $e) { $processName = ''; } $result = new wsResponse( 0, G::loadTranslation( 'ID_COMMAND_EXECUTED_SUCCESSFULLY' ) ); $result->caseId = $aRows['APP_UID']; $result->caseNumber = $aRows['APP_NUMBER']; $result->caseName = $aRows['TITLE']; $result->caseStatus = $aRows['APP_STATUS']; $result->caseParalell = $aRows['APP_PARALLEL']; $result->caseCreatorUser = $aRows['APP_INIT_USER']; $result->caseCreatorUserName = $aRows['CREATOR']; $result->processId = $aRows['PRO_UID']; $result->processName = $processName; $result->createDate = $aRows['CREATE_DATE']; $result->updateDate = $aRows['UPDATE_DATE']; //now fill the array of AppDelay $oCriteria = new Criteria( 'workflow' ); $oCriteria->addSelectColumn( AppDelayPeer::APP_DEL_INDEX ); $oCriteria->add( AppDelayPeer::APP_UID, $caseId ); $oCriteria->add( AppDelayPeer::APP_TYPE, 'PAUSE' ); $oCriteria->add( AppDelayPeer::APP_DISABLE_ACTION_USER, '0' ); $oDataset = AppDelayPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $aIndexsPaused = array(); while ($oDataset->next()) { $data = $oDataset->getRow(); $aIndexsPaused[] = $data['APP_DEL_INDEX']; } //now fill the array of AppDelegationPeer $oCriteria = new Criteria( 'workflow' ); $oCriteria->addSelectColumn( AppDelegationPeer::DEL_INDEX ); $oCriteria->addSelectColumn( AppDelegationPeer::USR_UID ); $oCriteria->addSelectColumn( AppDelegationPeer::TAS_UID ); $oCriteria->addSelectColumn( AppDelegationPeer::DEL_THREAD ); $oCriteria->addSelectColumn( AppDelegationPeer::DEL_THREAD_STATUS ); $oCriteria->addSelectColumn( AppDelegationPeer::DEL_FINISH_DATE ); $oCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE); $oCriteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE); $oCriteria->add( AppDelegationPeer::APP_UID, $caseId ); if (count($aIndexsPaused)) { $cton1 = $oCriteria->getNewCriterion( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL); $cton2 = $oCriteria->getNewCriterion( AppDelegationPeer::DEL_INDEX, $aIndexsPaused, Criteria::IN ); $cton1->addOR( $cton2 ); $oCriteria->add( $cton1 ); } else { $oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL); } $oCriteria->addAscendingOrderByColumn( AppDelegationPeer::DEL_INDEX ); $oDataset = AppDelegationPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $aCurrentUsers = array (); while ($oDataset->next()) { $aAppDel = $oDataset->getRow(); $oUser = new Users(); try { $oUser->load( $aAppDel['USR_UID'] ); $uFields = $oUser->toArray( BasePeer::TYPE_FIELDNAME ); $currentUserName = $oUser->getUsrFirstname() . ' ' . $oUser->getUsrLastname(); } catch (Exception $e) { $currentUserName = ''; } $oTask = new Task(); try { $uFields = $oTask->load( $aAppDel['TAS_UID'] ); $taskName = $uFields['TAS_TITLE']; } catch (Exception $e) { $taskName = ''; } $currentUser = new stdClass(); $currentUser->userId = $aAppDel['USR_UID']; $currentUser->userName = $currentUserName; $currentUser->taskId = $aAppDel['TAS_UID']; $currentUser->taskName = $taskName; $currentUser->delIndex = $aAppDel['DEL_INDEX']; $currentUser->delThread = $aAppDel['DEL_THREAD']; $currentUser->delThreadStatus = $aAppDel['DEL_THREAD_STATUS']; $currentUser->delStatus = ($aAppDel["DEL_THREAD_STATUS"] == 'CLOSED') ? 'PAUSED' : $aRows['APP_STATUS']; $currentUser->delInitDate = $aAppDel["DEL_INIT_DATE"]; $currentUser->delTaskDueDate = $aAppDel["DEL_TASK_DUE_DATE"]; $aCurrentUsers[] = $currentUser; } $result->currentUsers = $aCurrentUsers; return $result; } catch (Exception $e) { $result = new wsResponse( 100, $e->getMessage() ); return $result; } }
* 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. */ if (($RBAC_Response = $RBAC->userCanAccess("PM_FACTORY")) != 1) { return $RBAC_Response; } require_once 'classes/model/Triggers.php'; $oTrigger = new Triggers(); if ($_POST['form']['TRI_UID'] != '') { $oTrigger->load($_POST['form']['TRI_UID']); } else { $oTrigger->create($_POST['form']); $_POST['form']['TRI_UID'] = $oTrigger->getTriUid(); } $oTrigger->update($_POST['form']); $triggerFields = $oTrigger->load($_POST['form']['TRI_UID']); $proUid = $triggerFields['PRO_UID']; $infoProcess = new Process(); $resultProcess = $infoProcess->load($proUid); G::auditLog('EditEvent', 'Save trigger from event (' . $_POST['form']['TRI_UID'] . ') in process "' . $resultProcess['PRO_TITLE'] . '"');
public function getProcessDescription () { $c = new Criteria( 'workflow' ); $c->clearSelectColumns(); $c->addSelectColumn( ProcessPeer::PRO_UID ); $oDataset = ProcessPeer::doSelectRS( $c ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); $aRows = Array (); while ($aRow = $oDataset->getRow()) { $aRows[] = $aRow; $oDataset->next(); } foreach ($aRows as $k => $aRow) { $oProcess = new Process(); $aProcessRow = $oProcess->load( $aRow['PRO_UID'] ); $aRows[$k] = array_merge( $aRow, array ('PRO_TITLE' => $aProcessRow['PRO_TITLE'] ) ); } return $aRows; }
public function getExtusersadhoc($start, $limit, $sProcessUID = '', $sTaskUID = '') { try { $oProcess = new Process(); $aFields = $oProcess->load($sProcessUID); $oTask = new Task(); $aFields = $oTask->load($sTaskUID); $_SESSION['iType'] = 2; $aFields['TASK'] = $sTaskUID; $aFields['TYPE'] = $_SESSION['iType']; $aFields['OF_TO_ASSIGN'] = G::LoadTranslation('ID_DE_ASSIGN'); $aFields['CONFIRM'] = G::LoadTranslation('ID_MSG_CONFIRM_DEASIGN_USER_GROUP_MESSAGE'); $aFields['UIDS'] = "'0'"; $oTasks = new Tasks(); $oGroups = new Groups(); $aAux1 = $oTasks->getGroupsOfTask($sTaskUID, $_SESSION['iType']); foreach ($aAux1 as $aGroup) { $aAux2 = $oGroups->getUsersOfGroup($aGroup['GRP_UID']); foreach ($aAux2 as $aUser) { $aFields['UIDS'] .= ",'" . $aUser['USR_UID'] . "'"; } } global $G_PUBLISH; $G_PUBLISH = new Publisher(); $oTask = new Task(); $aTask = $oTask->load($sTaskUID); //$assignedUsers = getExtTaskUsersCriteria($sTaskUID, $_SESSION ['iType']); $this->getExtTaskUsersAdHocCriteria($start, $limit, $sTaskUID, $_SESSION['iType']); return $_SESSION['_DBArray']['taskUsers']; } catch (Exception $oError) { throw $oError; } }
function getDerivatedCases ($sParentUid, $sDelIndexParent) { $oCriteria = new Criteria( 'workflow' ); $cases = array (); $derivation = array (); //get the child delegations , of parent delIndex $children = array (); $oCriteria->clearSelectColumns(); $oCriteria->addSelectColumn( AppDelegationPeer::DEL_INDEX ); $oCriteria->add( AppDelegationPeer::APP_UID, $sParentUid ); $oCriteria->add( AppDelegationPeer::DEL_PREVIOUS, $sDelIndexParent ); $oDataset = AppDelegationPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); $aRow = $oDataset->getRow(); while (is_array( $aRow )) { $children[] = $aRow['DEL_INDEX']; $oDataset->next(); $aRow = $oDataset->getRow(); } //foreach child , get the info of their derivations and subprocesses foreach ($children as $keyChild => $child) { $oCriteria = new Criteria( 'workflow' ); $oCriteria->clearSelectColumns(); $oCriteria->addSelectColumn( SubApplicationPeer::APP_UID ); $oCriteria->addSelectColumn( AppDelegationPeer::APP_UID ); $oCriteria->addSelectColumn( AppDelegationPeer::DEL_INDEX ); $oCriteria->addSelectColumn( AppDelegationPeer::PRO_UID ); $oCriteria->addSelectColumn( AppDelegationPeer::TAS_UID ); $oCriteria->addSelectColumn( AppDelegationPeer::USR_UID ); $oCriteria->addSelectColumn( UsersPeer::USR_USERNAME ); $oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME ); $oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME ); $oCriteria->add( SubApplicationPeer::APP_PARENT, $sParentUid ); $oCriteria->add( SubApplicationPeer::DEL_INDEX_PARENT, $child ); $oCriteria->addJoin( SubApplicationPeer::APP_UID, AppDelegationPeer::APP_UID ); $oCriteria->addJoin( AppDelegationPeer::USR_UID, UsersPeer::USR_UID ); $oDataset = SubApplicationPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); $aRow = $oDataset->getRow(); while (is_array( $aRow )) { $oProcess = new Process(); $proFields = $oProcess->load( $aRow['PRO_UID'] ); $oCase = new Application(); $appFields = $oCase->load( $aRow['APP_UID'] ); $oTask = new Task(); $tasFields = $oTask->load( $aRow['TAS_UID'] ); $derivation[] = array ('processId' => $aRow['PRO_UID'],'processTitle' => $proFields['PRO_TITLE'],'caseId' => $aRow['APP_UID'],'caseNumber' => $appFields['APP_NUMBER'],'taskId' => $aRow['TAS_UID'],'taskTitle' => $tasFields['TAS_TITLE'],'userId' => $aRow['USR_UID'],'userName' => $aRow['USR_USERNAME'],'userFullname' => $aRow['USR_FIRSTNAME'] . ' ' . $aRow['USR_LASTNAME'] ); $oDataset->next(); $aRow = $oDataset->getRow(); } } return $derivation; }
G::LoadClass('toolBar'); G::LoadClass('dynaFormField'); //G::LoadClass('configuration'); $G_MAIN_MENU = 'processmaker'; $G_SUB_MENU = 'processes'; $G_ID_MENU_SELECTED = 'PROCESSES'; $G_ID_SUB_MENU_SELECTED = 'FIELDS'; $PRO_UID = isset($_GET['PRO_UID']) ? $_GET['PRO_UID'] : '0'; $DYN_UID = isset($_GET['DYN_UID']) ? urldecode($_GET['DYN_UID']) : '0'; $_SESSION['PROCESS'] = $_GET['PRO_UID']; if ($PRO_UID === '0') { return; } $process = new Process(); if ($process->exists($PRO_UID)) { $process->load($PRO_UID); } else { //TODO print "{$PRO_UID} doesn't exist, continue? yes"; } $dynaform = new dynaform(); if ($dynaform->exists($DYN_UID)) { $dynaform->load($DYN_UID); $_SESSION['CURRENT_DYN_UID'] = $DYN_UID; } else { /* New Dynaform * */ $dynaform->create(array('PRO_UID' => $PRO_UID)); } //creating SESSION for redirecting to new bpmn editor after closing Dynaform
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocument1', '', G::array_merges($aOD, $aFields), ''); } if ($aGields['OUT_DOC_GENERATE'] == 'DOC') { $G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocument2', '', G::array_merges($aOD, $aFields), ''); } if ($aGields['OUT_DOC_GENERATE'] == 'PDF') { $G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocument3', '', G::array_merges($aOD, $aFields), ''); } break; } break; case 'ASSIGN_TASK': $oDerivation = new Derivation(); $oProcess = new Process(); $aData = $oCase->loadCase($_SESSION['APPLICATION']); $aFields['PROCESS'] = $oProcess->load($_SESSION['PROCESS']); $aFields['PREVIOUS_PAGE'] = $aPreviousStep['PAGE']; $aFields['PREVIOUS_PAGE_LABEL'] = G::LoadTranslation('ID_PREVIOUS_STEP'); $aFields['ASSIGN_TASK'] = G::LoadTranslation('ID_ASSIGN_TASK'); $aFields['END_OF_PROCESS'] = G::LoadTranslation('ID_END_OF_PROCESS'); $aFields['NEXT_TASK_LABEL'] = G::LoadTranslation('ID_NEXT_TASK'); $aFields['EMPLOYEE'] = G::LoadTranslation('ID_EMPLOYEE'); $aFields['LAST_EMPLOYEE'] = G::LoadTranslation('ID_LAST_EMPLOYEE'); $aFields['OPTION_LABEL'] = G::LoadTranslation('ID_OPTION'); $aFields['CONTINUE'] = G::LoadTranslation('ID_CONTINUE'); $aFields['FINISH'] = G::LoadTranslation('ID_FINISH'); $aFields['CONTINUE_WITH_OPTION'] = G::LoadTranslation('ID_CONTINUE_WITH_OPTION'); $aFields['FINISH_WITH_OPTION'] = G::LoadTranslation('ID_FINISH_WITH_OPTION'); $aFields['TAS_TIMING_TITLE'] = 'Timing Control'; $aFields['TAS_DURATION'] = 'Task Duration'; $aFields['TAS_TIMEUNIT'] = 'Task Unit';
public function getProcessInformation() { if (!isset($_SESSION['USER_LOGGED'])) { $response = new stdclass(); $response->message = G::LoadTranslation('ID_LOGIN_AGAIN'); $response->lostSession = true; print G::json_encode($response); die; } $process = new Process(); $processData = $process->load($_SESSION['PROCESS']); require_once 'classes/model/Users.php'; $user = new Users(); try { $userData = $user->load($processData['PRO_CREATE_USER']); $processData['PRO_AUTHOR'] = $userData['USR_FIRSTNAME'] . ' ' . $userData['USR_LASTNAME']; } catch (Exception $oError) { $processData['PRO_AUTHOR'] = '(USER DELETED)'; } $conf = new Configurations(); $conf->getFormats(); $processData['PRO_CREATE_DATE'] = $conf->getSystemDate($processData['PRO_CREATE_DATE']); print G::json_encode($processData); }
function getSimpleDashboardData() { G::LoadClass("BasePeer"); require_once "classes/model/AppCacheView.php"; require_once 'classes/model/Process.php'; $sUIDUserLogged = $_SESSION['USER_LOGGED']; $Criteria = new Criteria('workflow'); $Criteria->clearSelectColumns(); $Criteria->addSelectColumn(AppCacheViewPeer::PRO_UID); $Criteria->addSelectColumn(AppCacheViewPeer::APP_UID); $Criteria->addSelectColumn(AppCacheViewPeer::APP_NUMBER); $Criteria->addSelectColumn(AppCacheViewPeer::APP_STATUS); $Criteria->addSelectColumn(AppCacheViewPeer::DEL_INDEX); $Criteria->addSelectColumn(AppCacheViewPeer::APP_TITLE); $Criteria->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE); $Criteria->addSelectColumn(AppCacheViewPeer::APP_TAS_TITLE); $Criteria->addSelectColumn(AppCacheViewPeer::APP_DEL_PREVIOUS_USER); $Criteria->addSelectColumn(AppCacheViewPeer::DEL_TASK_DUE_DATE); $Criteria->addSelectColumn(AppCacheViewPeer::APP_UPDATE_DATE); $Criteria->addSelectColumn(AppCacheViewPeer::DEL_PRIORITY); $Criteria->addSelectColumn(AppCacheViewPeer::DEL_DELAYED); $Criteria->addSelectColumn(AppCacheViewPeer::USR_UID); $Criteria->addSelectColumn(AppCacheViewPeer::APP_THREAD_STATUS); $Criteria->add(AppCacheViewPeer::APP_STATUS, array("TO_DO", "DRAFT"), CRITERIA::IN); $Criteria->add(AppCacheViewPeer::USR_UID, array($sUIDUserLogged, ""), CRITERIA::IN); $Criteria->add(AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL); //$Criteria->add ( AppCacheViewPeer::APP_THREAD_STATUS, 'OPEN' ); $Criteria->add(AppCacheViewPeer::DEL_THREAD_STATUS, 'OPEN'); //execute the query $oDataset = AppCacheViewPeer::doSelectRS($Criteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $oProcess = new Process(); $rows = array(); $processNames = array(); while ($aRow = $oDataset->getRow()) { // G::pr($aRow); if (!isset($processNames[$aRow['PRO_UID']])) { $aProcess = $oProcess->load($aRow['PRO_UID']); $processNames[$aRow['PRO_UID']] = $aProcess['PRO_TITLE']; } if ($aRow['USR_UID'] == "") { $aRow['APP_STATUS'] = "UNASSIGNED"; } if (in_array($aRow['APP_STATUS'], array("TO_DO", "UNASSIGNED")) && $aRow['APP_THREAD_STATUS'] == "OPEN" || $aRow['APP_STATUS'] == "DRAFT") { $rows[$processNames[$aRow['PRO_UID']]][$aRow['APP_STATUS']][$aRow['DEL_DELAYED']][] = $aRow['APP_UID']; if (!isset($rows[$processNames[$aRow['PRO_UID']]][$aRow['APP_STATUS']]['count'])) { $rows[$processNames[$aRow['PRO_UID']]][$aRow['APP_STATUS']]['count'] = 0; } $rows[$processNames[$aRow['PRO_UID']]][$aRow['APP_STATUS']]['count']++; } $oDataset->next(); } //Generate different groups of data for graphs $rowsResponse = array(); $i = 0; foreach ($rows as $processID => $processInfo) { $i++; if ($i <= 10) { $rowsResponse['caseStatusByProcess'][] = array('process' => $processID, 'inbox' => isset($processInfo['TO_DO']['count']) ? $processInfo['TO_DO']['count'] : 0, 'draft' => isset($processInfo['DRAFT']['count']) ? $processInfo['DRAFT']['count'] : 0, 'unassigned' => isset($processInfo['UNASSIGNED']['count']) ? $processInfo['UNASSIGNED']['count'] : 0); } } $rowsResponse['caseDelayed'][] = array('delayed' => 'On Time', 'total' => 100); $rowsResponse['caseDelayed'][] = array('delayed' => 'Delayed', 'total' => 50); print_r(G::json_encode($rowsResponse)); }
{ 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; } */ $PRO_UID = $_GET['PRO_UID']; require_once 'classes/model/Process.php'; G::LoadClass('case'); $oProcessMap = new Cases(); $process = new Process(); $processData = $process->load($PRO_UID); $c = $oProcessMap->getCriteriaProcessCases('TO_DO', $PRO_UID); $processData["TO_DO"] = ApplicationPeer::doCount($c); $c = $oProcessMap->getCriteriaProcessCases('COMPLETED', $PRO_UID); $processData["COMPLETED"] = ApplicationPeer::doCount($c); $c = $oProcessMap->getCriteriaProcessCases('DRAFT', $PRO_UID); $processData["DRAFT"] = ApplicationPeer::doCount($c); $c = $oProcessMap->getCriteriaProcessCases('CANCELLED', $PRO_UID); $processData["CANCELLED"] = ApplicationPeer::doCount($c); $processData["PRO_UID"] = $PRO_UID; $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_DeleteCases', '', $processData, 'processes_Delete.php'); G::RenderPage('publish', 'raw');