public function saveInputDoc($params) { require_once 'classes/model/InputDocument.php'; G::LoadClass('processMap'); $aData = array(); $aData['PRO_UID'] = $params->PRO_UID; $aData['INP_DOC_UID'] = $params->INP_DOC_UID; $aData['INP_DOC_TITLE'] = $params->INP_DOC_TITLE; $aData['INP_DOC_FORM_NEEDED'] = $params->INP_DOC_FORM_NEEDED; if ($aData['INP_DOC_FORM_NEEDED'] != 'VIRTUAL') { $aData['INP_DOC_ORIGINAL'] = $params->INP_DOC_ORIGINAL; } else { $aData['INP_DOC_ORIGINAL'] = 'ORIGINAL'; } $aData['INP_DOC_VERSIONING'] = $params->INP_DOC_VERSIONING; $aData['INP_DOC_DESCRIPTION'] = $params->INP_DOC_DESCRIPTION; $aData['INP_DOC_DESTINATION_PATH'] = $params->INP_DOC_DESTINATION_PATH; $aData['INP_DOC_TAGS'] = $params->INP_DOC_TAGS; $oInputDocument = new InputDocument(); if ($aData['INP_DOC_UID'] == '') { unset($aData['INP_DOC_UID']); $oInputDocument->create($aData); $this->msg = G::LoadTranslation('ID_INPUT_DOC_SUCCESS_NEW'); } else { $oInputDocument->update($aData); $this->msg = G::LoadTranslation('ID_INPUT_DOC_SUCCESS_UPDATE'); } //refresh dbarray with the last change in inputDocument $oMap = new processMap(); $oCriteria = $oMap->getInputDocumentsCriteria($aData['PRO_UID']); $this->success = true; }
/** * get pmtables list * * @param string $httpData->start * @param string $httpData->limit * @param string $httpData->textFilter */ public function getList($httpData) { G::LoadClass('configuration'); G::LoadClass('processMap'); G::LoadClass('pmTable'); $configurations = new Configurations(); $processMap = new processMap(); // setting parameters $config = $configurations->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']); $env = $configurations->getConfiguration('ENVIRONMENT_SETTINGS', ''); $limit_size = isset($config->pageSize) ? $config['pageSize'] : 20; $start = isset($httpData->start) ? $httpData->start : 0; $limit = isset($httpData->limit) ? $httpData->limit : $limit_size; $filter = isset($httpData->textFilter) ? $httpData->textFilter : ''; $pro_uid = isset($httpData->pro_uid) ? $httpData->pro_uid : null; if ($pro_uid !== null) { $process = $pro_uid == '' ? array('not_equal' => $pro_uid) : array('equal' => $pro_uid); $addTables = AdditionalTables::getAll($start, $limit, $filter, $process); $c = $processMap->getReportTablesCriteria($pro_uid); $oDataset = RoutePeer::doSelectRS($c); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $reportTablesOldList = array(); while ($oDataset->next()) { $reportTablesOldList[] = $oDataset->getRow(); } $addTables['count'] += count($reportTablesOldList); foreach ($reportTablesOldList as $i => $oldRepTab) { $addTables['rows'][] = array('ADD_TAB_UID' => $oldRepTab['REP_TAB_UID'], 'PRO_UID' => $oldRepTab['PRO_UID'], 'DBS_UID' => $oldRepTab['REP_TAB_CONNECTION'] == 'wf' ? 'workflow' : 'rp', 'ADD_TAB_DESCRIPTION' => $oldRepTab['REP_TAB_TITLE'], 'ADD_TAB_NAME' => $oldRepTab['REP_TAB_NAME'], 'ADD_TAB_TYPE' => $oldRepTab['REP_TAB_TYPE'], 'TYPE' => 'CLASSIC'); } } else { $addTables = AdditionalTables::getAll($start, $limit, $filter); } foreach ($addTables['rows'] as $i => $table) { try { $con = Propel::getConnection(pmTable::resolveDbSource($table['DBS_UID'])); $stmt = $con->createStatement(); $rs = $stmt->executeQuery('SELECT COUNT(*) AS NUM_ROWS from ' . $table['ADD_TAB_NAME']); if ($rs->next()) { $r = $rs->getRow(); $addTables['rows'][$i]['NUM_ROWS'] = $r['NUM_ROWS']; } else { $addTables['rows'][$i]['NUM_ROWS'] = 0; } //removing the prefix "PMT" to allow alphabetical order (just in view) if (substr($addTables['rows'][$i]['ADD_TAB_NAME'], 0, 4) == 'PMT_') { $addTables['rows'][$i]['ADD_TAB_NAME'] = substr($addTables['rows'][$i]['ADD_TAB_NAME'], 4); } } catch (Exception $e) { $addTables['rows'][$i]['NUM_ROWS'] = G::LoadTranslation('ID_TABLE_NOT_FOUND'); } } return $addTables; }
function load($params) { require_once "classes/model/Event.php"; $PRO_UID = $params->PRO_UID; $EVN_UID = $params->EVN_UID; $oEvent = new Event(); $oData = $oEvent->load($EVN_UID); $sch_uid = $oData['EVN_ACTION']; if ($sch_uid != '') { G::LoadClass('processMap'); $oProcessMap = new processMap(new DBConnection()); $rows = $oProcessMap->caseNewSchedulerList($sch_uid); if ($rows['SCH_OPTION'] == '3') { $sch_start_day = explode('|', $rows['SCH_START_DAY']); $count = count($sch_start_day); switch ($count) { case 1: $rows['SCH_START_DAY'] = $sch_start_day[0]; break; case 2: $rows['SCH_START_DAY'] = $sch_start_day[0]; $rows['SCH_START_DAY_OPT_2_WEEKS'] = $sch_start_day[1]; break; case 3: $rows['SCH_START_DAY'] = $sch_start_day[0]; $rows['SCH_START_DAY_OPT_2_WEEKS'] = $sch_start_day[1]; $rows['SCH_START_DAY_OPT_2_DAYS_WEEK'] = $sch_start_day[2]; break; } } if ($rows['SCH_START_DATE'] != '') { $sch_str_dt = explode(' ', $rows['SCH_START_DATE']); $rows['SCH_START_DATE'] = $sch_str_dt[0]; } if ($rows['SCH_END_DATE'] != '') { $sch_str_dt = explode(' ', $rows['SCH_END_DATE']); $rows['SCH_END_DATE'] = $sch_str_dt[0]; } $this->success = true; $this->data = $rows; } else { $this->success = false; } }
$GROUP_TITLE = strip_tags($group->getGrpTitle()); $aRows[] = array('GRP_UID' => $UID, 'GROUP_TITLE' => $GROUP_TITLE); } global $_DBArray; $_DBArray['virtualtable'] = $aRows; $_SESSION['_DBArray'] = $_DBArray; G::LoadClass('ArrayPeer'); $oCriteria = new Criteria('dbarray'); $oCriteria->setDBArrayTable('virtualtable'); $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('propeltable', 'paged-table', 'events/groupmailList', $oCriteria); G::RenderPage('publish', 'raw'); break; case 'showDynavars': G::LoadClass('processMap'); $oProcessMap = new processMap(); $aDynaforms = $oProcessMap->getDynaformsList($_SESSION['PROCESS']); //g::pr($aDynaforms); G::LoadSystem('dynaformhandler'); $aDynaformFields = array(); foreach ($aDynaforms as $dyn) { if ($dyn['DYN_TYPE'] == 'xmlform') { if (is_file(PATH_DYNAFORM . "{$_SESSION['PROCESS']}/{$dyn['DYN_UID']}" . '.xml')) { $oDynaformHandler = new dynaFormHandler(PATH_DYNAFORM . "{$_SESSION['PROCESS']}/{$dyn['DYN_UID']}" . '.xml'); $aDynaformFields[$dyn['DYN_TITLE']] = $oDynaformHandler->getFieldNames(); } else { continue; } } } //G::pr($aDynaformFields); die;
/** * Prints the components of the toolBar * * @param string $value * @return string */ public function render($value) { $url = $this->file; if ($this->home === "methods") { $url = G::encryptlink(SYS_URI . $url); } if ($this->home === "public_html") { $url = '/' . $url; } $urlAlt = $this->fileAlt; if ($this->fileAlt !== '') { if ($this->home === "methods") { $urlAlt = G::encryptlink(SYS_URI . $urlAlt); } if ($this->home === "public_html") { $urlAlt = '/' . $urlAlt; } } $this->url = $url; $this->urlAlt = $urlAlt; switch ($this->buttonType) { case 'image': $html = ''; if ($this->hoverMethod === 'back') { $html = '<img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . ($this->style ? ' style="' . $this->style . '"' : '') . ' onmouseover=\'backImage(this,"url(' . htmlentities($urlAlt, ENT_QUOTES, 'utf-8') . ') no-repeat")\' onmouseout=\'backImage(this,"")\' title=\'' . addslashes($this->label) . '\' />'; } elseif ($this->hoverMethod === 'switch') { $html = '<img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . ($this->style ? ' style="' . $this->style . '"' : '') . ' onmouseover=\'switchImage(this,"' . htmlentities($url, ENT_QUOTES, 'utf-8') . '","' . htmlentities($urlAlt, ENT_QUOTES, 'utf-8') . '")\' onmouseout=\'switchImage(this,"' . htmlentities($url, ENT_QUOTES, 'utf-8') . '","' . htmlentities($urlAlt, ENT_QUOTES, 'utf-8') . '")\'/>'; } else { $html = '<img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . ($this->style ? ' style="' . $this->style . '"' : '') . '/>'; } break; case 'text': $html = $this->htmlentities($this->label, ENT_QUOTES, 'utf-8'); break; case 'html': $html = '<div ' . ' onmouseover=\'backImage(this,"url(' . htmlentities($urlAlt, ENT_QUOTES, 'utf-8') . ') no-repeat")\' onmouseout=\'backImage(this,"")\' style="width:25px;height:25px;margin-bottom:3px">' . $this->label . '</div>'; //$html=$this->label; break; case 'image/text': $html = '<img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . ($this->style ? ' style="' . $this->style . '"' : '') . '/><br/>' . $this->htmlentities($this->label, ENT_QUOTES, 'utf-8'); break; case 'text/image': $html = $this->htmlentities($this->label, ENT_QUOTES, 'utf-8') . '<br/><img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . ($this->style ? ' style="' . $this->style . '"' : '') . '/>'; break; case 'dropdown': $html = ''; if (isset($this->owner->values['PRO_UID'])) { G::LoadClass('processMap'); $criteria = processMap::getDynaformsCriteria($this->owner->values['PRO_UID']); $dataset = DynaformPeer::doSelectRS($criteria); if ($dataset->getRecordCount() > 0) { $html .= '<span style="display:inline-block; font-size: 8pt;margin-left: 5px;margin-bottom: 3px;">' . G::LoadTranslation('ID_DYNAFORM'); $html .= ': <select id="_dynaformsList_" onchange="window.location = \'dynaforms_Editor?PRO_UID=' . $this->owner->values['PRO_UID']; $html .= '&DYN_UID=\' + this.value;" class="module_app_input___gray">'; $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $dataset->next(); while ($row = $dataset->getRow()) { $html .= '<option value="' . $row['DYN_UID'] . '"'; $html .= ($this->owner->values['DYN_UID'] == $row['DYN_UID'] ? ' selected="selected"' : '') . '>'; $html .= htmlentities($row['DYN_TITLE'], ENT_QUOTES, 'utf-8') . '</option>'; $dataset->next(); } $html .= '</select></span>'; } } return $html; break; case 'class': $html = '<a href="#" onclick="' . $this->onclick . '" onmouseover="backImage(this, \'url(/images/dynamicForm/hover.gif) no-repeat\')" onmouseout="backImage(this, \'\')" style="height:25px;margin-bottom:3px"> <div class="' . $this->class . '" title="' . strip_tags($this->label) . '" style="height:25px;margin-bottom:3px"></div> </a>'; return $html; } return '<a class="toolButton" ' . ($this->buttonStyle ? ' style="' . $this->buttonStyle . '"' : '') . ($this->onclick ? ' onclick="' . htmlentities($this->onclick, ENT_QUOTES, 'utf-8') . '"' : '') . '>' . $html . '</a>'; }
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); $consolidated = 0; /*----------------------------------********---------------------------------*/ $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"});
<?php try { G::LoadClass('processMap'); $oProcessMap = new processMap(new DBConnection()); //$_GET['sid'] gets STEP_UID and sTYPE(i.e BEFORE and AFTER) in format STEP_UID-sTYPE if (isset($_GET['stepid'])) { $aStepTypeId = explode('|', $_GET['stepid']); $_SESSION['stepUID'] = $_GET['stepid']; //$aStepTypeId = explode('-','2517180104cd42c25cc39e4071099227-BEFORE'); $sStep = $aStepTypeId[0]; $sType = $aStepTypeId[1]; } if (isset($_GET['pid']) && isset($_SESSION['stepUID'])) { $aStepTypeId = explode('|', $_SESSION['stepUID']); $sStep = $aStepTypeId[0]; $sType = $aStepTypeId[1]; //Getting available Steps Criteria that have been not selected for a particular task $rows = $oProcessMap->getExtAvailableStepTriggersCriteria($_GET['pid'], $sStep, $_GET['tid'], $sType); } else { //Getting all Steps Criteria that have been selected for a particular task $rows = $oProcessMap->getExtStepTriggersCriteria($sStep, $_GET['tid'], $sType); } $result['totalCount'] = count($rows); $result['data'] = $rows; print G::json_encode($result); } catch (Exception $e) { print G::json_encode($e->getMessage()); }
/** * input document process list * * @param string $sProcessUID * @return $result will return an object */ public function inputDocumentProcessList ($sProcessUID) { try { global $_DBArray; $_DBArray = (isset( $_SESSION['_DBArray'] ) ? $_SESSION['_DBArray'] : ''); $oMap = new processMap(); $oCriteria = $oMap->getInputDocumentsCriteria( $sProcessUID ); $oDataset = InputDocumentPeer::doSelectRS( $oCriteria ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->next(); $result = array (); /* //not necesary for SOAP message $result[] = array( 'guid' => 'char', 'name' => 'name', 'description' => 'description' ); */ while ($aRow = $oDataset->getRow()) { if ($aRow['INP_DOC_TITLE'] == null) { //There is no transaltion for this Document name, try to get/regenerate the label $inputDocument = new InputDocument(); $inputDocumentObj = $inputDocument->load( $aRow['INP_DOC_UID'] ); $aRow['INP_DOC_TITLE'] = $inputDocumentObj['INP_DOC_TITLE']; $aRow['INP_DOC_DESCRIPTION'] = $inputDocumentObj['INP_DOC_DESCRIPTION']; } $docrow = array (); $docrow['guid'] = $aRow['INP_DOC_UID']; $docrow['name'] = $aRow['INP_DOC_TITLE']; $docrow['description'] = $aRow['INP_DOC_DESCRIPTION']; $result[] = $docrow; $oDataset->next(); } //$_DBArray['inputDocArray'] = $inputDocArray; return $result; } catch (Exception $e) { $result[] = array ('guid' => $e->getMessage() ); return $result; } }
G::header('location: ../login/login'); die; } global $_DBArray; G::LoadClass('tasks'); G::LoadClass('processMap'); $oTasks = new Tasks(); $aAux1 = $oTasks->getAllTasks($_GET['PRO_UID']); $aTasks = array(); $aTasks[] = array('TAS_UID' => 'char', 'TAS_TITLE' => 'char'); //g::pr($aAux1);die; foreach ($aAux1 as $aAux2) { if ($aAux2['TAS_TYPE'] != 'SUBPROCESS') { $aTasks[] = array('TAS_UID' => $aAux2['TAS_UID'], 'TAS_TITLE' => $aAux2['TAS_TITLE']); } } $oProcessMap = new processMap(new DBConnection()); $aTriggersList = $oProcessMap->getTriggers($_GET['PRO_UID']); $aTriggersFileds = array('TRI_UID' => 'char', 'TRI_TITLE' => 'char'); foreach ($aTriggersList as $i => $v) { unset($aTriggersList[$i]['PRO_UID']); unset($aTriggersList[$i]['TRI_DESCRIPTION']); $aTriggersList[$i]['TRI_TITLE'] = strlen($aTriggersList[$i]['TRI_TITLE']) > 32 ? substr($aTriggersList[$i]['TRI_TITLE'], 0, 32) . '...' : $aTriggersList[$i]['TRI_TITLE']; } $aTriggersList = array_merge($aTriggersFileds, $aTriggersList); $_DBArray['tasks'] = $aTasks; $_DBArray['TMP_TRIGGERS'] = $aTriggersList; $_SESSION['_DBArray'] = $_DBArray; $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsNew', '', array('PRO_UID' => $_GET['PRO_UID'], 'EVN_ACTION' => $_GET['EVN_TYPE']), ''); G::RenderPage('publish', 'raw');
/** * 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; }
function load($params) { G::LoadClass('processMap'); $oProcessMap = new processMap(new DBConnection()); $PRO_UID = $params->PRO_UID; $EVN_UID = $params->EVN_UID; $sOutput = $oProcessMap->listNewWebEntry($PRO_UID, $EVN_UID); return $sOutput; }
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; }*/ $oJSON = new Services_JSON(); if (isset($_REQUEST['data'])) { $oData = $oJSON->decode(stripslashes($_REQUEST['data'])); $sOutput = ''; } G::LoadClass('processMap'); $oProcessMap = new processMap(new DBConnection()); switch ($_REQUEST['action']) { case 'load': if ($oData->ct) { $sOutput = $oProcessMap->load($oData->uid, true, $_SESSION['APPLICATION'], -1, $_SESSION['TASK'], $oData->ct); } else { if ($oData->mode) { $sOutput = $oProcessMap->load($oData->uid); } else { $sOutput = $oProcessMap->load($oData->uid, true, $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']); } } break; case 'process_Edit': $oProcessMap->editProcess($oData->pro_uid); break;
$oCriteria1->add(ContentPeer::CON_LANG, SYS_LANG); $oDataset1 = ContentPeer::doSelectRS($oCriteria1); $oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset1->next(); $aRow1 = $oDataset1->getRow(); if ($aRow1['TRIGGERS']) { $flag = false; } } print $flag; //print'krlos';return ; } else { try { $oTrigger = new Triggers(); G::LoadClass('processMap'); $oProcessMap = new processMap(new DBConnection()); if (isset($_POST['form'])) { $value = $_POST['form']; } else { $value = $_POST; } if ($value['TRI_UID'] != '') { $oTrigger->load($value['TRI_UID']); } else { $oTrigger->create($value); $value['TRI_UID'] = $oTrigger->getTriUid(); } //print_r($_POST['form']);die; $oTrigger->update($value); if (!isset($_POST['mode'])) { $oProcessMap->triggersList($value['PRO_UID']);
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');
/** * creates row tasks from an Route Array * @param string $aTasks * @return array */ public function createRouteRows($aRoutes) { $routeID = array(); $aField = array(); $taskParallel = ''; $taskSecJoin = ''; $taskEvaluate = ''; $taskParallelEv = ''; $taskSelect = ''; $taskDiscriminator = ''; foreach ($aRoutes as $key => $row) { $sRouteType = $row['ROU_TYPE']; $oRoute = new Route(); $oProcessMap = new processMap(); $oTask = new Task(); $oEvent = new Event(); //unset ($row['ROU_UID']); //Saving Gateway into the GATEWAY table $idTask = $row['TAS_UID']; $nextTask = $row['ROU_NEXT_TASK']; if ($nextTask == "-1") { $end = 1; } if ($sRouteType != 'SEQUENTIAL') { switch ($sRouteType) { case 'PARALLEL': if ($idTask != $taskParallel) { $taskParallel = $idTask; $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']); } break; case 'SEC-JOIN': if ($nextTask != $taskSecJoin) { $taskSecJoin = $nextTask; $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']); } break; case 'EVALUATE': if ($idTask != $taskEvaluate) { $taskEvaluate = $idTask; $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']); } break; case 'PARALLEL-BY-EVALUATION': if ($idTask != $taskParallelEv) { $taskParallelEv = $idTask; $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']); } break; case 'SELECT': if ($idTask != $taskSelect) { $taskSelect = $idTask; $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']); } break; case 'DISCRIMINATOR': if ($nextTask != $taskDiscriminator) { $taskDiscriminator = $nextTask; $sGatewayUID = $oProcessMap->saveNewGateway($row['PRO_UID'], $row['TAS_UID'], $row['ROU_NEXT_TASK']); } break; } $row['GAT_UID'] = $sGatewayUID; } if ($oRoute->routeExists($row['ROU_UID'])) { $oRoute->remove($row['ROU_UID']); } $routeID = $oRoute->create($row); //saving end event while import old processes if (isset($end) && $end == 1) { if (!$oEvent->existsByTaskUidFrom($idTask)) { if ($sRouteType == "SEQUENTIAL") { $aTaskDetails = $oTask->load($idTask); $positionX = $aTaskDetails['TAS_POSX'] + $aTaskDetails['TAS_WIDTH'] / 2; $positionY = $aTaskDetails['TAS_POSY'] + $aTaskDetails['TAS_HEIGHT'] + 10; $aData['PRO_UID'] = $row['PRO_UID']; $aData['EVN_TYPE'] = 'bpmnEventEmptyEnd'; $aData['EVN_POSX'] = $positionX; $aData['EVN_POSY'] = $positionY; $aData['EVN_TAS_UID_FROM'] = $idTask; $aData['EVN_STATUS'] = 'ACTIVE'; $aData['EVN_RELATED_TO'] = 'MULTIPLE'; $aData['EVN_WHEN'] = '1'; $aData['EVN_ACTION'] = ''; $sEvn_uid = $oEvent->create($aData); $aField['ROU_UID'] = $routeID; $aField['ROU_EVN_UID'] = $sEvn_uid; $oRoute->update($aField); $end = 0; } } } } return; }
/** * * @param string $sProcessUID {@min 32} {@max 32} * @param string $prfUid {@min 32} {@max 32} * * * @access public */ public function downloadProcessFilesManager($sProcessUID, $prfUid) { try { $path = ''; $criteria = new \Criteria("workflow"); $criteria->addSelectColumn(\ProcessFilesPeer::PRF_PATH); $criteria->add(\ProcessFilesPeer::PRF_UID, $prfUid, \Criteria::EQUAL); $rsCriteria = \ProcessFilesPeer::doSelectRS($criteria); $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC); $rsCriteria->next(); while ($aRow = $rsCriteria->getRow()) { $path = $aRow['PRF_PATH']; $rsCriteria->next(); } if ($path == '') { throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('prf_uid'))); } $sFile = end(explode("/",$path)); $sPath = str_replace($sFile,'',$path); $sSubDirectory = substr(str_replace($sProcessUID,'',substr($sPath,(strpos($sPath, $sProcessUID)))),0,-1); $sMainDirectory = str_replace(substr($sPath, strpos($sPath, $sProcessUID)),'', $sPath); if ($sMainDirectory == PATH_DATA_MAILTEMPLATES) { $sMainDirectory = 'mailTemplates'; } else { $sMainDirectory = 'public'; } if (file_exists($path)) { $oProcessMap = new \processMap(new \DBConnection()); $oProcessMap->downloadFile($sProcessUID,$sMainDirectory,$sSubDirectory,$sFile); die(); } else { throw (new \Exception( 'Invalid value specified for path.')); } } catch (Exception $e) { throw $e; } }
public function processMap() { global $G_PUBLISH; global $G_CONTENT; global $G_FORM; global $G_TABLE; global $RBAC; G::LoadClass('processMap'); $oTemplatePower = new TemplatePower(PATH_TPL . 'processes/processes_Map.html'); $oTemplatePower->prepare(); $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $oHeadPublisher =& headPublisher::getSingleton(); //$oHeadPublisher->addScriptfile('/jscore/processmap/core/processmap.js'); $oHeadPublisher->addScriptCode(' var maximunX = ' . processMap::getMaximunTaskX($_SESSION['PROCESS']) . '; window.onload = function(){ var pb=leimnud.dom.capture("tag.body 0"); Pm=new processmap(); var params = "{\\"uid\\":\\"' . $_SESSION['PROCESS'] . '\\",\\"mode\\":false,\\"ct\\":false}"; // maximun x and y position var xPos = 0; var yPos = 0; //obtaining the processmap object for the current process var oRPC = new leimnud.module.rpc.xmlhttp({ url : "../processes/processes_Ajax", async : false, method: "POST", args : "action=load&data="+params }); oRPC.make(); var response = eval(\'(\' + oRPC.xmlhttp.responseText + \')\'); for (var i in response){ if (i==\'task\'){ elements = response[i]; for (var j in elements){ if (elements[j].uid!=undefined){ if (elements[j].position.x > xPos){ xPos = elements[j].position.x; } if (elements[j].position.y > yPos){ yPos = elements[j].position.y; } } } } } Pm.options = { target : "pm_target", dataServer: "../processes/processes_Ajax", uid : "' . $_SESSION['PROCESS'] . '", lang : "' . SYS_LANG . '", theme : "processmaker", size : {w:xPos+800,h:yPos+150}, images_dir: "/jscore/processmap/core/images/", rw : false, hideMenu : false } Pm.make(); oLeyendsPanel = new leimnud.module.panel(); oLeyendsPanel.options = { size :{w:260,h:155}, position:{x:((document.body.clientWidth * 95) / 100) - ((document.body.clientWidth * 95) / 100 - (((document.body.clientWidth * 95) / 100) - 260)),y:45,center:false}, title :G_STRINGS.ID_COLOR_LEYENDS, theme :"processmaker", statusBar:false, control :{resize:false,roll:false,drag:true,close:false}, fx :{modal:false,opacity:false,blinkToFront:true,fadeIn:false,drag:false} }; oLeyendsPanel.setStyle = { content:{overflow:"hidden"} }; oLeyendsPanel.events = { remove: function() {delete(oLeyendsPanel);}.extend(this) }; oLeyendsPanel.make(); oLeyendsPanel.loader.show(); var oRPC = new leimnud.module.rpc.xmlhttp({ url : "cases_Ajax", args: "action=showLeyends" }); oRPC.callback = function(rpc){ oLeyendsPanel.loader.hide(); var scs=rpc.xmlhttp.responseText.extractScript(); oLeyendsPanel.addContent(rpc.xmlhttp.responseText); }.extend(this); oRPC.make(); }'); G::RenderPage('publish', 'blank'); }
G::LoadClass("processes"); $infoProcess = new Processes(); if (!in_array($_REQUEST["action"], array("load"))) { $infoProcess->updateProcessRow(array( "PRO_UID" => $proUid, "PRO_UPDATE_DATE" => date("Y-m-d H:i:s") )); } $resultProcess = $infoProcess->getProcessRow($proUid); } //G::LoadClass( 'processMap' ); $oProcessMap = new processMap(new DBConnection()); switch ($_REQUEST['action']) { case 'load': $_SESSION['PROCESS'] = $oData->uid; if ($oData->ct) { $sOutput = $oProcessMap->load($oData->uid, true, $_SESSION['APPLICATION'], - 1, $_SESSION['TASK'], $oData->ct); } else { if ($oData->mode) { $sOutput = $oProcessMap->load($oData->uid); } else { if ($_SESSION['TASK'] != - 1) { $taskUid = $_SESSION['TASK']; } else { $c = new Criteria('workflow'); $c->clearSelectColumns();
$at->deleteAll($row->id); } } $result->success = true; } catch (Exception $e) { $result->success = false; $result->msg = $e->getMessage(); } echo G::json_encode($result); break; case 'list': require_once 'classes/model/AdditionalTables.php'; G::LoadClass('configuration'); G::LoadClass('processMap'); $configigurations = new Configurations(); $oProcessMap = new processMap(); $config = $configigurations->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']); $env = $configigurations->getConfiguration('ENVIRONMENT_SETTINGS', ''); $limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20; $start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0; $limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size; $filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : ''; $pro_uid = isset($_REQUEST['pro_uid']) ? $_REQUEST['pro_uid'] : ''; $process = $pro_uid == '' ? array('not_equal' => $pro_uid) : array('equal' => $pro_uid); $addTab = AdditionalTables::getAll($start, $limit, $filter, $process); if ($pro_uid != '') { $c = $oProcessMap->getReportTablesCriteria($pro_uid); $oDataset = RoutePeer::doSelectRS($c); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $reportTablesOldList = array(); while ($oDataset->next()) {
<?php try { G::LoadClass('processMap'); $oProcessMap = new processMap(new DBConnection()); if (isset($_GET['pid'])) { $rows = $oProcessMap->getExtOutputDocumentsCriteria($_GET['pid']); array_shift($rows); } // else // { // $rows = $oProcessMap->getExtInputDocumentsCriteria($_GET['pid']); // } if (isset($_GET['tid'])) { require_once 'classes/model/OutputDocument.php'; $oOutputDocument = new OutputDocument(); $rows = $oOutputDocument->load($_GET['tid']); } $tmpData = G::json_encode($rows); $tmpData = str_replace("\\/", "/", '{success:true,data:' . $tmpData . '}'); // unescape the slashes $result = $tmpData; echo $result; /* $result['totalCount'] = count($rows); $result['data'] = $rows; print G::json_encode( $result) ;*/ } catch (Exception $e) { print G::json_encode($e->getMessage()); }
if (isset($aData['OUT_DOC_PDF_SECURITY_ENABLED']) && $aData['OUT_DOC_PDF_SECURITY_ENABLED'] == "0") { $aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] = ""; $aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'] = ""; $aData['OUT_DOC_PDF_SECURITY_PERMISSIONS'] = ""; } if (isset($aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD']) && $aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] != "") { $aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'] = G::encrypt($aData['OUT_DOC_PDF_SECURITY_OPEN_PASSWORD'], $aData['OUT_DOC_UID']); $aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'] = G::encrypt($aData['OUT_DOC_PDF_SECURITY_OWNER_PASSWORD'], $aData['OUT_DOC_UID']); } } if ($aData['OUT_DOC_UID'] == '') { if (isset($aData['OUT_DOC_TYPE']) && $aData['OUT_DOC_TYPE'] == 'JRXML') { $dynaformUid = $aData['DYN_UID']; $outDocUid = $oOutputDocument->create($aData); G::LoadClass('javaBridgePM'); $jbpm = new JavaBridgePM(); print $jbpm->generateJrxmlFromDynaform($outDocUid, $dynaformUid, 'classic'); } else { $outDocUid = $oOutputDocument->create($aData); } } else { $oOutputDocument->update($aData); } if (isset($aData['PRO_UID'])) { //refresh dbarray with the last change in outputDocument $oMap = new processMap(); $oCriteria = $oMap->getOutputDocumentsCriteria($aData['PRO_UID']); } } catch (Exception $oException) { die($oException->getMessage()); }
/** * saveNewPattern * * @param string $sProcessUID Default value empty * @param string $sTaskUID Default value empty * @param string $sNextTask Default value empty * @param string $sType Default value empty * @param boolean $sDelete * @return array void */ public function saveNewPattern($sProcessUID = '', $sTaskUID = '', $sNextTask = '', $sType = '', $sDelete = '') { try { $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn('COUNT(*) AS ROUTE_NUMBER'); $oCriteria->addSelectColumn('GAT_UID AS GATEWAY_UID'); $oCriteria->add(RoutePeer::PRO_UID, $sProcessUID); $oCriteria->add(RoutePeer::TAS_UID, $sTaskUID); $oCriteria->add(RoutePeer::ROU_TYPE, $sType); $oDataset = RoutePeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $aRow = $oDataset->getRow(); $aFields['PRO_UID'] = $sProcessUID; $aFields['TAS_UID'] = $sTaskUID; $aFields['ROU_NEXT_TASK'] = $sNextTask; $aFields['ROU_TYPE'] = $sType; $aFields['ROU_CASE'] = (int) $aRow['ROUTE_NUMBER'] + 1; $sGatewayUID = $aRow['GATEWAY_UID']; if ($sDelete && $sGatewayUID != '') { $oGateway = new Gateway(); $oGateway->remove($sGatewayUID); } //Getting Gateway UID after saving gateway //if($sType != 'SEQUENTIAL' && $sGatewayUID == '' && $sDelete == '1') if ($sType != 'SEQUENTIAL') { $oProcessMap = new processMap(); $sGatewayUID = $oProcessMap->saveNewGateway($sProcessUID, $sTaskUID, $sNextTask); } $aFields['GAT_UID'] = isset($sGatewayUID) ? $sGatewayUID : ''; $oRoute = new Route(); $oRoute->create($aFields); } catch (Exception $oError) { throw $oError; } }
/** * Get process and task properties * * @param object $httpData{type, UID} */ public function getProperties($httpData) { switch ($httpData->type) { case 'process': require_once 'classes/model/ProcessCategory.php'; require_once 'classes/model/CalendarDefinition.php'; G::LoadClass('processMap'); $oProcessMap = new processMap(new DBConnection()); $process = $oProcessMap->editProcessNew($httpData->UID); $category = ProcessCategoryPeer::retrieveByPk($process['PRO_CATEGORY']); $categoryName = is_object($category) ? $category->getCategoryName() : ''; $calendar = CalendarDefinitionPeer::retrieveByPk($process['PRO_CALENDAR']); $calendarName = is_object($calendar) ? $calendar->getCalendarName() : ''; $properties['Title'] = $process['PRO_TITLE']; $properties['Description'] = $process['PRO_DESCRIPTION']; $properties['Calendar'] = $calendarName; $properties['Category'] = $categoryName; $properties['Debug'] = $process['PRO_DEBUG'] == '1' ? true : false; $this->sucess = true; $this->prop = $properties; break; case 'task': require_once 'classes/model/Task.php'; $task = new Task(); $taskData = $task->load($httpData->UID); $properties['Title'] = $taskData['TAS_TITLE']; $properties['Description'] = $taskData['TAS_DESCRIPTION']; $properties['Variable for case priority'] = $taskData['TAS_PRIORITY_VARIABLE']; $properties['Starting Task'] = $taskData['TAS_START'] == 'TRUE' ? true : false; $this->sucess = true; $this->prop = $properties; break; } }
<?php try { G::LoadClass('processMap'); $oProcessMap = new processMap(new DBConnection()); if (isset($_GET['pid'])) { //Getting Dynaform List $rows = $oProcessMap->getExtDynaformsList($_GET['pid']); array_shift($rows); } else { if (isset($_GET['tabId'])) { $oAdditionalTables = new AdditionalTables(); $aData = $oAdditionalTables->load($_GET['tabId'], true); $addTabName = $aData['ADD_TAB_NAME']; foreach ($aData['FIELDS'] as $iRow => $aRow) { if ($aRow['FLD_KEY'] == 1) { $rows[] = $aRow; } } } else { //Getting Dynaform List $rows = $oProcessMap->getExtAdditionalTablesList(); } } $result['totalCount'] = count($rows); $result['data'] = $rows; print G::json_encode($result); } catch (Exception $e) { print G::json_encode($e->getMessage()); }
} #Global Definitions require_once 'classes/model/DbSource.php'; require_once 'classes/model/Content.php'; $G_PUBLISH = new Publisher(); G::LoadClass('processMap'); G::LoadClass('ArrayPeer'); G::LoadClass('dbConnections'); global $_DBArray; switch ($action) { case 'loadInfoAssigConnecctionDB': $oStep = new Step(); return print $oStep->loadInfoAssigConnecctionDB($_POST['PRO_UID'], $_POST['DBS_UID']); break; case 'showDbConnectionsList': $oProcess = new processMap(); $oCriteria = $oProcess->getConditionProcessList(); if (ProcessPeer::doCount($oCriteria) > 0) { $aProcesses = array(); $aProcesses[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char'); $oDataset = ArrayBasePeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $sProcessUID = ''; while ($aRow = $oDataset->getRow()) { if ($sProcessUID == '') { $sProcessUID = $aRow['PRO_UID']; } $aProcesses[] = array('PRO_UID' => isset($aRow['PRO_UID']) ? $aRow['PRO_UID'] : '', 'PRO_TITLE' => isset($aRow['PRO_TITLE']) ? $aRow['PRO_TITLE'] : ''); $oDataset->next(); }
while (!feof($hd)) { $line = fgets($hd, 4096); fwrite($hd1, str_replace($DYN_UID, $dynUid, $line)); } } fclose($hd); fclose($hd1); // check if the template file also exists if (isset($templateHd)) { while (!feof($templateHd)) { $line = fgets($templateHd, 4096); fwrite($templateHd1, str_replace($DYN_UID, $dynUid, $line)); } fclose($templateHd); fclose($templateHd1); } $criteria = processMap::getDynaformsCriteria($PRO_UID); //FROM //WHERE //QUERY $rsCriteria = DynaformPeer::doSelectRS($criteria); $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); $arrayData = array(); while ($rsCriteria->next()) { $row = $rsCriteria->getRow(); $arrayData[] = array("value" => $row["DYN_UID"], "text" => htmlentities($row["DYN_TITLE"], ENT_QUOTES, "utf-8")); } echo G::json_encode(array("data" => $arrayData, "length" => count($arrayData))); } catch (Exception $e) { return (array) $e; }
try { $oStepSupervisor = new StepSupervisor(); $fields2 = $oStepSupervisor->loadInfo($_POST['INP_DOC_UID']); $oStepSupervisor->remove($fields2['STEP_UID']); $oPermission = new ObjectPermission(); $fields3 = $oPermission->loadInfo($_POST['INP_DOC_UID']); if (is_array($fields3)) { $oPermission->remove($fields3['OP_UID']); } $oInputDocument = new InputDocument(); $fields = $oInputDocument->load($_POST['INP_DOC_UID']); $oInputDocument->remove($_POST['INP_DOC_UID']); $oStep = new Step(); $oStep->removeStep('INPUT_DOCUMENT', $_POST['INP_DOC_UID']); $oOP = new ObjectPermission(); $oOP->removeByObject('INPUT', $_POST['INP_DOC_UID']); //refresh dbarray with the last change in inputDocument $oMap = new processMap(); $oCriteria = $oMap->getInputDocumentsCriteria($fields['PRO_UID']); $result->success = true; $result->msg = G::LoadTranslation('ID_INPUTDOCUMENT_REMOVED'); } catch (Exception $e) { $result->success = false; $result->msg = $e->getMessage(); } print G::json_encode($result); break; } } catch (Exception $oException) { die($oException->getMessage()); }
} if (!isset($_SESSION['PROCESS'])) { if (isset($aFields['PRO_UID'])) { $_SESSION['PROCESS'] = $aFields['PRO_UID']; } } $oTasks = new Tasks(); $aAux1 = $oTasks->getAllTasks($aFields['PRO_UID']); $aTasks = array(); $aTasks[] = array('TAS_UID' => 'char', 'TAS_TITLE' => 'char'); foreach ($aAux1 as $aAux2) { if ($aAux2['TAS_TYPE'] != 'SUBPROCESS') { $aTasks[] = array('TAS_UID' => $aAux2['TAS_UID'], 'TAS_TITLE' => $aAux2['TAS_TITLE']); } } $oProcessMap = new processMap(new DBConnection()); $aTriggersList = $oProcessMap->getTriggers($_SESSION['PROCESS']); $aTriggersFileds = array(); $aTriggersFileds[] = array('TRI_UID' => 'char', 'TRI_TITLE' => 'char'); foreach ($aTriggersList as $i => $v) { unset($aTriggersList[$i]['PRO_UID']); unset($aTriggersList[$i]['TRI_DESCRIPTION']); unset($aTriggersList[$i]['TRI_LOCATE_WEBBOT_PARAM']); $aTriggersList[$i]['TRI_TITLE'] = strlen($aTriggersList[$i]['TRI_TITLE']) > 32 ? substr($aTriggersList[$i]['TRI_TITLE'], 0, 32) . '...' : $aTriggersList[$i]['TRI_TITLE']; } $aTriggersList = array_merge($aTriggersFileds, $aTriggersList); $_DBArray['tasks'] = $aTasks; $_DBArray['TMP_TRIGGERS'] = $aTriggersList; $_SESSION['_DBArray'] = $_DBArray; $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsEdit', '', $aFields, '../events/eventsSave');
break; case 'actions': global $G_PUBLISH; $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('view', 'cases/cases_ActionsTree'); G::RenderPage('publish', 'raw'); break; case 'showProcessMap': G::LoadClass('processMap'); $oTemplatePower = new TemplatePower(PATH_TPL . 'processes/processes_Map.html'); $oTemplatePower->prepare(); $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher->addScriptCode(' var maximunX = ' . processMap::getMaximunTaskX($_SESSION['PROCESS']) . '; var pb=leimnud.dom.capture("tag.body 0"); Pm=new processmap(); var params = "{\\"uid\\":\\"' . $_SESSION['PROCESS'] . '\\",\\"mode\\":false,\\"ct\\":false}"; // maximun x and y position var xPos = 0; var yPos = 0; //obtaining the processmap object for the current process var oRPC = new leimnud.module.rpc.xmlhttp({ url : "../processes/processes_Ajax", async : false, method: "POST", args : "action=load&data="+params });
<?php G::LoadClass('processMap'); $oProcessMap = new processMap(new DBConnection()); //$_GET['sid'] gets STEP_UID and sTYPE(i.e BEFORE and AFTER) in format STEP_UID-sTYPE if (isset($_GET['stepid'])) { $aStepTypeId = explode('|', $_GET['stepid']); $_SESSION['stepUID'] = $_GET['stepid']; //$aStepTypeId = explode('-','2517180104cd42c25cc39e4071099227-BEFORE'); $sStep = $aStepTypeId[0]; $sType = $aStepTypeId[1]; } //$_GET['sid'] gets STEP_UID and sTYPE(i.e BEFORE and AFTER) in format STEP_UID-sTYPE if (isset($_GET['stepid'])) { $aStepTypeId = explode('|', $_GET['stepid']); $_SESSION['stepUID'] = $_GET['stepid']; //$aStepTypeId = explode('-','2517180104cd42c25cc39e4071099227-BEFORE'); $sStep = $aStepTypeId[0]; $sType = $aStepTypeId[1]; } $start = isset($_POST['start']) ? $_POST['start'] : 0; $limit = isset($_POST['limit']) ? $_POST['limit'] : ''; switch ($_GET['action']) { case 'getDynaformList': $result = $oProcessMap->getExtDynaformsList($start, $limit, $_GET['pid']); print G::json_encode($result); break; case 'getPMTableDynaform': $oAdditionalTables = new AdditionalTables(); $aData = $oAdditionalTables->load($_GET['tabId'], true); $addTabName = $aData['ADD_TAB_NAME'];