本文整理汇总了PHP中G::array_merges方法的典型用法代码示例。如果您正苦于以下问题:PHP G::array_merges方法的具体用法?PHP G::array_merges怎么用?PHP G::array_merges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::array_merges方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareInformation
//.........这里部分代码省略.........
$criteria->addAscendingOrderByColumn(RoutePeer::ROU_CASE);
$rsCriteria = RoutePeer::doSelectRS($criteria);
} else {
$criteria->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
$criteria->addJoin(AppDelegationPeer::TAS_UID, RoutePeer::TAS_UID, Criteria::LEFT_JOIN);
$criteria->add(AppDelegationPeer::APP_UID, $arrayData["APP_UID"], Criteria::EQUAL);
$criteria->add(AppDelegationPeer::DEL_INDEX, $arrayData["DEL_INDEX"], Criteria::EQUAL);
$criteria->addAscendingOrderByColumn(RoutePeer::ROU_CASE);
$rsCriteria = AppDelegationPeer::doSelectRS($criteria);
}
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$flagDefault = false;
while ($rsCriteria->next()) {
$arrayRouteData = G::array_merges($rsCriteria->getRow(), $arrayData);
if ((int)($arrayRouteData["ROU_DEFAULT"]) == 1) {
$arrayNextTaskDefault = $arrayRouteData;
$flagDefault = true;
continue;
}
$flagContinue = true;
//Evaluate the condition if there are conditions defined
if (isset($arrayRouteData["ROU_CONDITION"]) && trim($arrayRouteData["ROU_CONDITION"]) != "" && ($arrayRouteData["ROU_TYPE"] != "SELECT" || $arrayRouteData["ROU_TYPE"] == "PARALLEL-BY-EVALUATION")) {
G::LoadClass("pmScript");
$arrayApplicationData = $this->case->loadCase($arrayData["APP_UID"]);
$pmScript = new PMScript();
示例2: Derivation
}
if ($folderitem->filename == $aFields['APP_DOC_UID'] && $folderitem->type == 'PDF') {
$aFields['VIEW2'] = G::LoadTranslation('ID_GET_EXTERNAL_FILE');
$aFields['FILE2'] = $folderitem->downloadScript;
continue;
}
}
}
if ($aGields['OUT_DOC_GENERATE'] == 'BOTH' || $aGields['OUT_DOC_GENERATE'] == '') {
$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');
示例3: Cases
}
if ((int) $_SESSION['INDEX'] < 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ' . $_SERVER['HTTP_REFERER']);
die;
}
/* Includes */
G::LoadClass('case');
G::LoadClass('derivation');
/* GET , POST & $_SESSION Vars */
//$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
require_once 'classes/model/AppDocument.php';
require_once 'classes/model/Users.php';
$G_PUBLISH = new Publisher();
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['DOC']);
$oo = $oAppDocument->load($_GET['DOC']);
$oUser = new Users();
$aUser = $oUser->load($oAppDocument->Fields['USR_UID']);
$Fields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$oAppDocument->Fields['VIEW'] = G::LoadTranslation('ID_OPEN');
$oAppDocument->Fields['FILE'] = 'cases_ShowDocument?a=' . $_GET['DOC'] . '&r=' . rand();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewInputDocumentToRevise', '', G::array_merges($Fields, $oAppDocument->Fields), '');
G::RenderPage('publish');
示例4: restore_html
/**
* Restore the html code
*
* @param object $A
* @return code html
*/
public function restore_html($A)
{
$script = null;
$fileTmp = G::decrypt($A, URL_KEY);
$form = new Form($fileTmp, PATH_DYNAFORM, SYS_LANG, true);
//Navigation Bar
$form->fields = G::array_merges(array("__DYNAFORM_OPTIONS" => new XmlForm_Field_XmlMenu(new Xml_Node("__DYNAFORM_OPTIONS", "complete", "", array("type" => "xmlmenu", "xmlfile" => "gulliver/dynaforms_Options")), SYS_LANG, PATH_XMLFORM, $form)), $form->fields);
$form->enableTemplate = false;
$html = $form->printTemplate($form->template, $script);
$html = str_replace('{$form_className}', 'formDefault', $html);
if (file_exists(PATH_DYNAFORM . $fileTmp . '.html')) {
unlink(PATH_DYNAFORM . $fileTmp . '.html');
}
$fp = fopen(PATH_DYNAFORM . $fileTmp . '.html', 'w');
fwrite($fp, $html);
fclose($fp);
return $html;
}
示例5: getPreviousStep
public function getPreviousStep($sProUid = '', $sAppUid = '', $iDelIndex = 0, $iPosition = 0)
{
//Note: Depreciated, delete in the future
G::LoadClass('pmScript');
$oPMScript = new PMScript();
$oApplication = new Application();
//$aFields = $oApplication->load($sAppUid);
$oApplication = ApplicationPeer::retrieveByPk($sAppUid);
$aFields = $oApplication->toArray(BasePeer::TYPE_FIELDNAME);
if (!is_array($aFields['APP_DATA'])) {
$aFields['APP_DATA'] = G::array_merges(G::getSystemConstants(), unserialize($aFields['APP_DATA']));
}
$oPMScript->setFields($aFields['APP_DATA']);
try {
//get the current Delegation, and TaskUID
$c = new Criteria();
$c->add(AppDelegationPeer::PRO_UID, $sProUid);
$c->add(AppDelegationPeer::APP_UID, $sAppUid);
$c->add(AppDelegationPeer::DEL_INDEX, $iDelIndex);
$aRow = AppDelegationPeer::doSelect($c);
$sTaskUid = $aRow[0]->getTasUid();
$iFirstStep = 1;
if ($iPosition == 10000) {
//get max step for this task
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn('MAX(' . StepPeer::STEP_POSITION . ')');
$c->add(StepPeer::PRO_UID, $sProUid);
$c->add(StepPeer::TAS_UID, $sTaskUid);
$rs = StepPeer::doSelectRS($c);
$rs->next();
$row = $rs->getRow();
$iPosition = intval($row[0]);
} else {
$iPosition -= 1;
}
$aPreviousStep = null;
if ($iPosition >= 1) {
while ($iPosition >= $iFirstStep) {
$bAccessStep = false;
//step
$oStep = new Step;
$oStep = $oStep->loadByProcessTaskPosition($sProUid, $sTaskUid, $iPosition);
if ($oStep) {
if (trim($oStep->getStepCondition()) !== '') {
$oPMScript->setScript($oStep->getStepCondition());
//.........这里部分代码省略.........
示例6: prepareInformation
/**
* prepareInformation
*
* @param array $aData
* @return $taskInfo
*/
function prepareInformation($aData)
{
$oTask = new Task();
//SELECT *
//FROM APP_DELEGATION AS A
//LEFT JOIN TASK AS T ON(T.TAS_UID = A.TAS_UID)
//LEFT JOIN ROUTE AS R ON(R.TAS_UID = A.TAS_UID)
//WHERE
//APP_UID = '$aData['APP_UID']'
//AND DEL_INDEX = '$aData['DEL_INDEX']'
$c = new Criteria('workflow');
$c->clearSelectColumns();
$c->addSelectColumn(AppDelegationPeer::TAS_UID);
$c->addSelectColumn(RoutePeer::ROU_CONDITION);
$c->addSelectColumn(RoutePeer::ROU_NEXT_TASK);
$c->addSelectColumn(RoutePeer::ROU_TYPE);
$c->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
$c->addJoin(AppDelegationPeer::TAS_UID, RoutePeer::TAS_UID, Criteria::LEFT_JOIN);
$c->add(AppDelegationPeer::APP_UID, $aData['APP_UID']);
$c->add(AppDelegationPeer::DEL_INDEX, $aData['DEL_INDEX']);
$c->addAscendingOrderByColumn(RoutePeer::ROU_CASE);
$rs = AppDelegationPeer::doSelectRs($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$aDerivation = $rs->getRow();
$i = 0;
$taskInfo = array();
$oUser = new Users();
$this->case = new Cases();
// 1. there is no rule
if (is_null($aDerivation['ROU_NEXT_TASK'])) {
throw new Exception(G::LoadTranslation('ID_NO_DERIVATION_RULE'));
}
while (is_array($aDerivation)) {
$oTask = new Task();
$aDerivation = G::array_merges($aDerivation, $aData);
$bContinue = true;
//evaluate the condition if there are conditions defined.
if (isset($aDerivation['ROU_CONDITION']) && trim($aDerivation['ROU_CONDITION']) != '' && ($aDerivation['ROU_TYPE'] != 'SELECT' || $aDerivation['ROU_TYPE'] == 'PARALLEL-BY-EVALUATION')) {
$AppFields = $this->case->loadCase($aData['APP_UID']);
G::LoadClass('pmScript');
$oPMScript = new PMScript();
$oPMScript->setFields($AppFields['APP_DATA']);
$oPMScript->setScript($aDerivation['ROU_CONDITION']);
$bContinue = $oPMScript->evaluate();
}
if ($aDerivation['ROU_TYPE'] == 'EVALUATE') {
if (count($taskInfo) >= 1) {
$bContinue = false;
}
}
if ($bContinue) {
$i++;
$TaskFields = $oTask->load($aDerivation['TAS_UID']);
$aDerivation = G::array_merges($aDerivation, $TaskFields);
//2. if next case is an special case
if ((int) $aDerivation['ROU_NEXT_TASK'] < 0) {
$aDerivation['NEXT_TASK']['TAS_UID'] = (int) $aDerivation['ROU_NEXT_TASK'];
$aDerivation['NEXT_TASK']['TAS_ASSIGN_TYPE'] = 'nobody';
$aDerivation['NEXT_TASK']['TAS_PRIORITY_VARIABLE'] = '';
$aDerivation['NEXT_TASK']['TAS_DEF_PROC_CODE'] = '';
$aDerivation['NEXT_TASK']['TAS_PARENT'] = '';
$aDerivation['NEXT_TASK']['TAS_TRANSFER_FLY'] = '';
switch ($aDerivation['ROU_NEXT_TASK']) {
case -1:
$aDerivation['NEXT_TASK']['TAS_TITLE'] = G::LoadTranslation('ID_END_OF_PROCESS');
break;
case -2:
$aDerivation['NEXT_TASK']['TAS_TITLE'] = G::LoadTranslation('ID_TAREA_COLGANTE');
break;
}
$aDerivation['NEXT_TASK']['USR_UID'] = '';
} else {
//3. load the task information of normal NEXT_TASK
$aDerivation['NEXT_TASK'] = $oTask->load($aDerivation['ROU_NEXT_TASK']);
//print $aDerivation['ROU_NEXT_TASK']." **** ".$aDerivation['NEXT_TASK']['TAS_TYPE']."<hr>";
if ($aDerivation['NEXT_TASK']['TAS_TYPE'] === 'SUBPROCESS') {
$oCriteria = new Criteria('workflow');
$oCriteria->add(SubProcessPeer::PRO_PARENT, $aDerivation['PRO_UID']);
$oCriteria->add(SubProcessPeer::TAS_PARENT, $aDerivation['NEXT_TASK']['TAS_UID']);
$oDataset = SubProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$sTaskParent = $aDerivation['NEXT_TASK']['TAS_UID'];
$aDerivation['ROU_NEXT_TASK'] = $aRow['TAS_UID'];
//print "<hr>Life is just a lonely highway";
$aDerivation['NEXT_TASK'] = $oTask->load($aDerivation['ROU_NEXT_TASK']);
//print "<hr>Life is just a lonely highway";print"<hr>";
$oProcess = new Process();
$aRow = $oProcess->load($aRow['PRO_UID']);
$aDerivation['NEXT_TASK']['TAS_TITLE'] .= ' (' . $aRow['PRO_TITLE'] . ')';
$aDerivation['NEXT_TASK']['TAS_PARENT'] = $sTaskParent;
unset($oTask, $oProcess, $aRow, $sTaskParent);
//.........这里部分代码省略.........
示例7: testArray_merges
/**
* @covers G::array_merges
* @todo Implement testArray_merges().
*/
public function testArray_merges()
{
$arrayTest1 = array('camp1' => 'val1', 'camp2' => 'val2', 'camp3' => 'val3', 'camp4' => 'val4');
$arrayTest2 = array('camp1' => '1', 'camp2' => '2');
$arrayResponse = G::array_merges($arrayTest1, $arrayTest2);
$this->assertEquals($arrayResponse['camp1'], '1');
$this->assertEquals($arrayResponse['camp2'], '2');
$arrayResponse = G::array_merges($arrayTest2, $arrayTest1);
$this->assertEquals($arrayResponse['camp3'], 'val3');
$this->assertEquals($arrayResponse['camp4'], 'val4');
}
示例8: RenderContent0
/**
* It Renders content according to Part['Type']
*
* @author Fernando Ontiveros Lira <fernando@colosa.com>
*
* @param intPos = 0
* @return void
*
*/
public function RenderContent0($intPos = 0, $showXMLFormName = false)
{
global $G_FORM;
global $G_TABLE;
global $G_TMP_TARGET;
global $G_OP_MENU;
global $G_IMAGE_FILENAME;
global $G_IMAGE_PARTS;
global $_SESSION;
//Changed from $HTTP_SESSION_VARS
global $G_OBJGRAPH;
//For graphLayout component
$this->intPos = $intPos;
$Part = $this->Parts[$intPos];
$this->publishType = $Part['Type'];
switch ($this->publishType) {
case 'externalContent':
$G_CONTENT = new Content();
if ($Part['Content'] != "") {
$G_CONTENT = G::LoadContent($Part['Content']);
}
G::LoadTemplateExternal($Part['Template']);
break;
case 'image':
$G_IMAGE_FILENAME = $Part['File'];
$G_IMAGE_PARTS = $Part['Data'];
break;
case 'appform':
global $APP_FORM;
$G_FORM = $APP_FORM;
break;
case 'xmlform':
case 'dynaform':
global $G_FORM;
if ($Part['AbsolutePath']) {
$sPath = $Part['AbsolutePath'];
} else {
if ($this->publishType == 'xmlform') {
$sPath = PATH_XMLFORM;
} else {
$sPath = PATH_DYNAFORM;
}
}
//if the xmlform file doesn't exists, then try with the plugins folders
if (!is_file($sPath . $Part['File'] . '.xml')) {
$aux = explode(PATH_SEP, $Part['File']);
//check if G_PLUGIN_CLASS is defined, because publisher can be called without an environment
if (count($aux) > 2) {
//Subfolders
$filename = array_pop($aux);
$aux0 = implode(PATH_SEP, $aux);
$aux = array();
$aux[0] = $aux0;
$aux[1] = $filename;
}
if (count($aux) == 2 && defined('G_PLUGIN_CLASS')) {
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if ($response = $oPluginRegistry->isRegisteredFolder($aux[0])) {
if ($response !== true) {
$sPath = PATH_PLUGINS . $response . PATH_SEP;
} else {
$sPath = PATH_PLUGINS;
}
}
}
}
if (!class_exists($Part['Template']) || $Part['Template'] === 'xmlform') {
$G_FORM = new Form($Part['File'], $sPath, SYS_LANG, false);
} else {
eval('$G_FORM = new ' . $Part['Template'] . ' ( $Part[\'File\'] , "' . $sPath . '");');
}
if ($this->publishType == 'dynaform' && ($Part['Template'] == 'xmlform' || $Part['Template'] == 'xmlform_preview')) {
$dynaformShow = isset($G_FORM->printdynaform) && $G_FORM->printdynaform ? 'gulliver/dynaforms_OptionsPrint' : 'gulliver/dynaforms_Options';
$G_FORM->fields = G::array_merges(array('__DYNAFORM_OPTIONS' => new XmlForm_Field_XmlMenu(new Xml_Node('__DYNAFORM_OPTIONS', 'complete', '', array('type' => 'xmlmenu', 'xmlfile' => $dynaformShow, 'parentFormId' => $G_FORM->id)), SYS_LANG, PATH_XMLFORM, $G_FORM)), $G_FORM->fields);
}
//Needed to make ajax calls
//The action in the form tag.
if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') {
$G_FORM->action = urlencode(G::encrypt($Part['Target'], URL_KEY));
} else {
$G_FORM->action = $Part['Target'];
}
if (!(isset($Part['ajaxServer']) && $Part['ajaxServer'] !== '')) {
if ($this->publishType == 'dynaform') {
$Part['ajaxServer'] = '../gulliver/defaultAjaxDynaform';
} else {
$Part['ajaxServer'] = '../gulliver/defaultAjax';
}
}
if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') {
$G_FORM->ajaxServer = urlencode(G::encrypt($Part['ajaxServer'], URL_KEY));
//.........这里部分代码省略.........
示例9: run
/**
* function run
* @access public
* @param object $testerObject
* @param array $fields
* @param int $count
* @param int $start
* @return array
*/
function run(&$testerObject, $fields = array(), $count = -1, $start = 0)
{
$results = array();
//$this->addToPlan( $count, $start );
$functions = get_class_methods(get_class($testerObject));
foreach ($functions as $id => $fn) {
$functions[$id] = strtolower($fn);
}
foreach ($this->testCases as $index => $testCase) {
if ($start == 0 && $count != 0) {
if (isset($testCase['TODO'])) {
$this->testLime->todo($testCase['TODO']);
} else {
if (isset($testCase['Function'])) {
if (array_search(strtolower($testCase['Function']), $functions) !== FALSE) {
$testCase['Input'] = G::array_merges($testCase['Input'], $fields);
$result = eval('return $testerObject->' . $testCase['Function'] . '($testCase, $testCase["Input"]);');
$results[] = $result;
/* Start Block: Test the $result */
if (isset($testCase['Output'])) {
if (isset($testCase['Output']['Value'])) {
//$this->testLime->is( $result, $testCase['Output']['Value'], $testCase['Title'] );
$this->testLime->todo($testCase['Output']['Type']);
$this->testLime->diag("/processmaker/trunk/gulliver/system/class.ymlTestCases.php at line 204");
} elseif (isset($testCase['Output']['Type'])) {
// $this->testLime->isa_ok( $result, $testCase['Output']['Type'], $testCase['Title'] );
$this->testLime->todo($testCase['Output']['Type']);
$this->testLime->diag("/processmaker/trunk/gulliver/system/class.ymlTestCases.php at line 204");
}
}
/* End Block */
} else {
$this->testLime->fail('Case #' . $index . ': Test function (Function) is not present in tester object.');
}
} else {
$this->testLime->fail('Case #' . $index . ' doesn\'t have a test function (Function) defined.');
}
}
} else {
$start--;
if ($count > 0) {
$count--;
}
}
}
return $results;
}
示例10: replaceVariables
function replaceVariables($Fields, $ExternalVariables = array())
{
//TODO: Verify dependencies between fields
foreach ($Fields as $key => $field) {
if (is_string($field)) {
$mergedValues = G::array_merges($Fields, $ExternalVariables);
$Fields[$key] = G::ReplaceDataField($field, $mergedValues);
}
}
return $Fields;
}
示例11: rand
$aFields['FILE1'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
$aFields['FILE2'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
//If plugin and trigger are defined for listing
if ($oPluginRegistry->existsTrigger(PM_CASE_DOCUMENT_LIST_ARR)) {
$oPluginRegistry =& PMPluginRegistry::getSingleton();
$filesPluginArray = $oPluginRegistry->executeTriggers(PM_CASE_DOCUMENT_LIST_ARR, $aFields['APP_UID']);
//Now search for the file, if exists the change the download URL
foreach ($filesPluginArray as $file) {
if ($file->filename == $_POST['APP_DOC_UID']) {
$aFields['FILE2'] = $file->downloadScript;
// The PDF is the only one uploaded to KT
}
}
}
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'tracker/tracker_ViewAnyOutputDocument', '', G::array_merges($aOD, $aFields), '');
G::RenderPage('publish', 'raw');
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']));
示例12: reload
function reload($fieldName, $fieldParent, $valueRecived, $appid, $filename)
{
global $HTTP_SESSION_VARS;
$G_FORM = new Form();
G::LoadSystem("xmlform");
G::LoadClass("dynaform");
$fieldNew[$fieldParent] = $valueRecived;
$Connection = new DBConnection(DB_HOST, DB_RBAC_USER, DB_RBAC_PASS, DB_RBAC_NAME);
$ses = new DBSession($Connection);
$xml = new Xmlform();
$vars = explode('][', $fieldName);
if (is_array($vars)) {
$cant = count($vars);
$fieldName = $vars[$cant - 1];
if ($cant > 1) {
$filename = $vars[0];
}
}
$vars2 = explode('][', $fieldParent);
if (is_array($vars2)) {
$cant2 = count($vars2);
$fieldParent = $vars2[$cant2 - 1];
}
$v = $filename;
$xml->home = PATH_XMLFORM;
$fieldXmlform = $xml->parseXmlformToArray($v);
$fieldNew[$fieldParent] = $fieldXmlform[$fieldName][defaultvalue];
if ($valueRecived != '') {
$fieldNew[$fieldParent] = $valueRecived;
}
$qry = stripslashes($fieldXmlform[$fieldName][Sql]);
$fieldNew[$fieldParent] = $fieldXmlform[$fieldName][defaultvalue];
if ($valueRecived != '') {
$fieldNew[$fieldParent] = $valueRecived;
}
if ($qry != '') {
$conexion = $fieldXmlform[$fieldName][sqlconnection];
G::LoadClass('dynaform');
$myDyna = new Dynaform($Connection);
$fieldsBase = array();
if ($HTTP_SESSION_VARS['CURRENT_APPLICATION'] != "0") {
$fieldsBase = $myDyna->getFieldsDefaultDynaform($appid, 0);
}
if ($appid != "") {
$Fields = G::array_merges($fieldsBase, $fieldNew);
$qry = $myDyna->replaceTextWithFields($qry, $Fields);
} else {
$qry = "Select '1', 'dynamically filled' ";
}
eval('$Result = "$qry "; ');
$options = LoadOptions($Result, $Connection);
}
return $options;
}
示例13: prepareInformation
/**
* prepareInformation
*
* @param array $arrayData Data
* @param string $taskUid Unique id of Task
*
* @return array Return array
*/
public function prepareInformation(array $arrayData, $taskUid = "")
{
try {
if (!class_exists("Cases")) {
G::LoadClass("case");
}
$this->case = new Cases();
$task = new Task();
$arrayApplicationData = $this->case->loadCase($arrayData["APP_UID"]);
$arrayNextTask = array();
$arrayNextTaskDefault = array();
$i = 0;
//SELECT *
//FROM APP_DELEGATION AS A
//LEFT JOIN TASK AS T ON(T.TAS_UID = A.TAS_UID)
//LEFT JOIN ROUTE AS R ON(R.TAS_UID = A.TAS_UID)
//WHERE
//APP_UID = '$arrayData["APP_UID"]'
//AND DEL_INDEX = '$arrayData["DEL_INDEX"]'
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(RoutePeer::TAS_UID);
$criteria->addSelectColumn(RoutePeer::ROU_NEXT_TASK);
$criteria->addSelectColumn(RoutePeer::ROU_TYPE);
$criteria->addSelectColumn(RoutePeer::ROU_DEFAULT);
$criteria->addSelectColumn(RoutePeer::ROU_CONDITION);
if ($taskUid != "") {
$criteria->add(RoutePeer::TAS_UID, $taskUid, Criteria::EQUAL);
$criteria->addAscendingOrderByColumn(RoutePeer::ROU_CASE);
$rsCriteria = RoutePeer::doSelectRS($criteria);
} else {
$criteria->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
$criteria->addJoin(AppDelegationPeer::TAS_UID, RoutePeer::TAS_UID, Criteria::LEFT_JOIN);
$criteria->add(AppDelegationPeer::APP_UID, $arrayData["APP_UID"], Criteria::EQUAL);
$criteria->add(AppDelegationPeer::DEL_INDEX, $arrayData["DEL_INDEX"], Criteria::EQUAL);
$criteria->addAscendingOrderByColumn(RoutePeer::ROU_CASE);
$rsCriteria = AppDelegationPeer::doSelectRS($criteria);
}
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$flagDefault = false;
$aSecJoin = array();
$count = 0;
while ($rsCriteria->next()) {
$arrayRouteData = G::array_merges($rsCriteria->getRow(), $arrayData);
if ((int) $arrayRouteData["ROU_DEFAULT"] == 1) {
$arrayNextTaskDefault = $arrayRouteData;
$flagDefault = true;
continue;
}
$flagAddDelegation = true;
//Evaluate the condition if there are conditions defined
if (trim($arrayRouteData["ROU_CONDITION"]) != "" && $arrayRouteData["ROU_TYPE"] != "SELECT") {
G::LoadClass("pmScript");
$pmScript = new PMScript();
$pmScript->setFields($arrayApplicationData["APP_DATA"]);
$pmScript->setScript($arrayRouteData["ROU_CONDITION"]);
$flagAddDelegation = $pmScript->evaluate();
}
if (trim($arrayRouteData["ROU_CONDITION"]) == "" && $arrayRouteData["ROU_NEXT_TASK"] != "-1") {
$arrayTaskData = $task->load($arrayRouteData["ROU_NEXT_TASK"]);
if ($arrayRouteData["ROU_TYPE"] != "SEC-JOIN" && $arrayTaskData["TAS_TYPE"] == "GATEWAYTOGATEWAY") {
$flagAddDelegation = true;
}
if ($arrayRouteData["ROU_TYPE"] == "SEC-JOIN") {
$aSecJoin[$count]["ROU_PREVIOUS_TASK"] = $arrayRouteData["ROU_NEXT_TASK"];
$aSecJoin[$count]["ROU_PREVIOUS_TYPE"] = "SEC-JOIN";
$count++;
}
}
if ($arrayRouteData["ROU_TYPE"] == "EVALUATE" && !empty($arrayNextTask)) {
$flagAddDelegation = false;
}
if ($flagAddDelegation && preg_match("/^(?:EVALUATE|PARALLEL-BY-EVALUATION)\$/", $arrayRouteData["ROU_TYPE"]) && trim($arrayRouteData["ROU_CONDITION"]) == "") {
$flagAddDelegation = false;
}
if ($flagAddDelegation) {
$arrayNextTask[++$i] = $this->prepareInformationTask($arrayRouteData);
}
}
if (count($arrayNextTask) == 0 && count($arrayNextTaskDefault) > 0) {
$arrayNextTask[++$i] = $this->prepareInformationTask($arrayNextTaskDefault);
}
//Check Task GATEWAYTOGATEWAY, END-MESSAGE-EVENT, END-EMAIL-EVENT
$arrayNextTaskBackup = $arrayNextTask;
$arrayNextTask = array();
$i = 0;
foreach ($arrayNextTaskBackup as $value) {
$arrayNextTaskData = $value;
$regexpTaskTypeToInclude = "GATEWAYTOGATEWAY|END-MESSAGE-EVENT|END-EMAIL-EVENT";
if ($arrayNextTaskData["NEXT_TASK"]["TAS_UID"] != "-1" && preg_match("/^(?:" . $regexpTaskTypeToInclude . ")\$/", $arrayNextTaskData["NEXT_TASK"]["TAS_TYPE"])) {
$arrayAux = $this->prepareInformation($arrayData, $arrayNextTaskData["NEXT_TASK"]["TAS_UID"]);
foreach ($arrayAux as $value2) {
$arrayNextTask[++$i] = $value2;
//.........这里部分代码省略.........