本文整理汇总了PHP中G::getSystemConstants方法的典型用法代码示例。如果您正苦于以下问题:PHP G::getSystemConstants方法的具体用法?PHP G::getSystemConstants怎么用?PHP G::getSystemConstants使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::getSystemConstants方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getVars
public function getVars($bWhitSystemVars = true)
{
$aFields = array();
if ($bWhitSystemVars) {
$aAux = G::getSystemConstants();
foreach ($aAux as $sName => $sValue) {
$aFields[] = array("sName" => $sName, "sType" => "system");
}
}
foreach ($this->fields as $k => $v) {
if ($v->type != "title" && $v->type != "subtitle" && $v->type != "file" && $v->type != "button" && $v->type != "reset" && $v->type != "submit" && $v->type != "listbox" && $v->type != "checkgroup" && $v->type != "grid" && $v->type != "javascript") {
$aFields[] = array('sName' => trim($k), 'sType' => trim($v->type));
}
}
return $aFields;
}
示例2: addCasesInputDocument
/**
* Get data of Cases InputDocument
*
* @param string $applicationUid
* @param string $taskUid
* @param string $appDocComment
* @param string $inputDocumentUid
* @param string $userUid
*
* return array Return an array with data of an InputDocument
*/
public function addCasesInputDocument($applicationUid, $taskUid, $appDocComment, $inputDocumentUid, $userUid)
{
try {
if ((isset( $_FILES['form'] )) && ($_FILES['form']['error'] != 0)) {
$code = $_FILES['form']['error'];
switch ($code) {
case UPLOAD_ERR_INI_SIZE:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_INI_SIZE' );
break;
case UPLOAD_ERR_FORM_SIZE:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_FORM_SIZE' );
break;
case UPLOAD_ERR_PARTIAL:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_PARTIAL' );
break;
case UPLOAD_ERR_NO_FILE:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_NO_FILE' );
break;
case UPLOAD_ERR_NO_TMP_DIR:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_NO_TMP_DIR' );
break;
case UPLOAD_ERR_CANT_WRITE:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_CANT_WRITE' );
break;
case UPLOAD_ERR_EXTENSION:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_EXTENSION' );
break;
default:
$message = \G::LoadTranslation( 'ID_UPLOAD_ERR_UNKNOWN' );
break;
}
\G::SendMessageText( $message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
\G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
die();
}
\G::LoadClass("case");
$appDocUid = \G::generateUniqueID();
$docVersion = '';
$appDocType = 'INPUT';
$case = new \Cases();
$delIndex = \AppDelegation::getCurrentIndex($applicationUid);
$case->thisIsTheCurrentUser($applicationUid, $delIndex, $userUid, "REDIRECT", "casesListExtJs");
//Load the fields
$arrayField = $case->loadCase($applicationUid);
$arrayField["APP_DATA"] = array_merge($arrayField["APP_DATA"], \G::getSystemConstants());
//Triggers
$arrayTrigger = $case->loadTriggers($taskUid, "INPUT_DOCUMENT", $inputDocumentUid, "AFTER");
//Add Input Document
if (empty($_FILES)) {
throw new \Exception(\G::LoadTranslation("ID_CASES_INPUT_FILENAME_DOES_NOT_EXIST"));
}
if (!$_FILES["form"]["error"]) {
$_FILES["form"]["error"] = 0;
}
if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) {
$appDocUid = $case->addInputDocument($inputDocumentUid,
$appDocUid,
$docVersion,
$appDocType,
$appDocComment,
'',
$applicationUid,
$delIndex,
$taskUid,
$userUid,
"xmlform",
$_FILES["form"]["name"],
$_FILES["form"]["error"],
$_FILES["form"]["tmp_name"]);
}
//Trigger - Execute after - Start
$arrayField["APP_DATA"] = $case->executeTriggers ($taskUid,
"INPUT_DOCUMENT",
$inputDocumentUid,
"AFTER",
$arrayField["APP_DATA"]);
//Trigger - Execute after - End
//Save data
$arrayData = array();
$arrayData["APP_NUMBER"] = $arrayField["APP_NUMBER"];
//$arrayData["APP_PROC_STATUS"] = $arrayField["APP_PROC_STATUS"];
$arrayData["APP_DATA"] = $arrayField["APP_DATA"];
$arrayData["DEL_INDEX"] = $delIndex;
$arrayData["TAS_UID"] = $taskUid;
$case->updateCase($applicationUid, $arrayData);
return($this->getCasesInputDocument($applicationUid, $userUid, $appDocUid));
} catch (\Exception $e) {
throw $e;
//.........这里部分代码省略.........
示例3: derivateCase
//.........这里部分代码省略.........
$oPMScript = new PMScript();
foreach ($aTriggers as $aTrigger) {
//$appFields = $oCase->loadCase( $caseId );
//$appFields['APP_DATA']['APPLICATION'] = $caseId;
//Set variables
$params = new stdClass();
$params->appData = $appFields["APP_DATA"];
if ($this->stored_system_variables) {
$params->option = "STORED SESSION";
$params->SID = $this->wsSessionId;
}
$appFields["APP_DATA"] = array_merge( $appFields["APP_DATA"], G::getSystemConstants( $params ) );
//PMScript
$oPMScript->setFields( $appFields['APP_DATA'] );
$bExecute = true;
if ($aTrigger['ST_CONDITION'] !== '') {
$oPMScript->setScript( $aTrigger['ST_CONDITION'] );
$bExecute = $oPMScript->evaluate();
}
if ($bExecute) {
$oPMScript->setScript( $aTrigger['TRI_WEBBOT'] );
$oPMScript->execute();
$trigger = TriggersPeer::retrieveByPk($aTrigger["TRI_UID"]);
$varTriggers = $varTriggers . " - " . nl2br(htmlentities($trigger->getTriTitle(), ENT_QUOTES)) . "<br />";
示例4: getVars
/**
* Function that return the valid fields to replace
*
* @author Julio Cesar Laura Avendao?=o <juliocesar@colosa.com>
* @access public
* @param boolean $bWhitSystemVars
* @return array
*/
public function getVars($bWhitSystemVars = true)
{
$aFields = array();
if ($bWhitSystemVars) {
$aAux = G::getSystemConstants();
foreach ($aAux as $sName => $sValue) {
$aFields[] = array('sName' => $sName, 'sType' => 'system');
}
}
foreach ($this->fields as $k => $v) {
if ($v->type != 'title' && $v->type != 'subtitle' && $v->type != 'link' && $v->type != 'file' && $v->type != 'button' && $v->type != 'reset' && $v->type != 'submit' && $v->type != 'listbox' && $v->type != 'checkgroup' && $v->type != 'grid' && $v->type != 'javascript') {
$aFields[] = array('sName' => trim($k), 'sType' => trim($v->type));
}
}
return $aFields;
}
示例5: intval
G::header("location: " . "/sys" . SYS_SYS . $backUrlObj[1]);
die;
}
G::LoadClass("case");
$inputDocumentUid = $_GET["UID"];
//$_POST["form"]["DOC_UID"]
$appDocUid = $_POST["form"]["APP_DOC_UID"];
$docVersion = intval($_POST["form"]["docVersion"]);
$appDocType = $_POST["form"]["APP_DOC_TYPE"];
$appDocComment = isset($_POST["form"]["APP_DOC_COMMENT"]) ? $_POST["form"]["APP_DOC_COMMENT"] : "";
$actionType = $_POST["form"]["actionType"];
$case = new Cases();
$case->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs");
//Load the fields
$arrayField = $case->loadCase($_SESSION["APPLICATION"]);
$arrayField["APP_DATA"] = array_merge($arrayField["APP_DATA"], G::getSystemConstants());
//Triggers
$arrayTrigger = $case->loadTriggers($_SESSION["TASK"], "INPUT_DOCUMENT", $inputDocumentUid, "AFTER");
//Trigger debug routines
//Cleaning debug variables
$_SESSION["TRIGGER_DEBUG"]["ERRORS"] = array();
$_SESSION["TRIGGER_DEBUG"]["DATA"] = array();
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_NAMES"] = array();
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_VALUES"] = array();
$_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] = count($arrayTrigger);
$_SESSION["TRIGGER_DEBUG"]["TIME"] = "AFTER";
if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) {
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_NAMES"] = $case->getTriggerNames($arrayTrigger);
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_VALUES"] = $arrayTrigger;
}
//Add Input Document
示例6: executeTriggersAfterExternal
public function executeTriggersAfterExternal($sProcess, $sTask, $sApplication, $iIndex, $iStepPosition, $aNewData = array())
{
//load the variables
$Fields = $this->loadCase($sApplication);
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], G::getSystemConstants());
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], $aNewData);
//execute triggers
$oCase = new Cases();
$aNextStep = $this->getNextStep($sProcess, $sApplication, $iIndex, $iStepPosition - 1);
$Fields['APP_DATA'] = $this->ExecuteTriggers(
$sTask, 'EXTERNAL', $aNextStep['UID'], 'AFTER', $Fields['APP_DATA']
);
//save data
$aData = array();
$aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
//$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
$aData['APP_DATA'] = $Fields['APP_DATA'];
$aData['DEL_INDEX'] = $iIndex;
$aData['TAS_UID'] = $sTask;
$this->updateCase($sApplication, $aData);
}
示例7: consolidatedUpdate
/**
* consolidatedUpdate
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*/
function consolidatedUpdate($dynaformUid, $dataUpdate, $usr_uid)
{
G::LoadClass("case");
G::LoadClass("pmFunctions");
$delIndex = 1;
$oCase = new \Cases();
$array = array();
$array["form"] = $dataUpdate;
$appUid = $array["form"]["APP_UID"];
$fields = $oCase->loadCase($appUid);
if (!isset($fields["DEL_INIT_DATE"])) {
$oCase->setDelInitDate($appUid, $delIndex);
//$aFields = $oCase->loadCase($appUid, $delIndex);
$fields = $oCase->loadCase($appUid, $delIndex);
}
$auxAppDataApplication = $fields["APP_DATA"]["APPLICATION"];
$auxAppDataProcess = $fields["APP_DATA"]["PROCESS"];
$auxAppDataTask = $fields["APP_DATA"]["TASK"];
$auxAppDataIndex = $fields["APP_DATA"]["INDEX"];
foreach ($array["form"] as $key => $value) {
$array["form"][$key] = (string)$array["form"][$key];
if (isset($fields["APP_DATA"][$key.'_label'])) {
$array["form"][$key.'_label'] = (string)$array["form"][$key];
}
}
/*
$_POST['form'] = $array["form"];
if (!class_exists('Smarty')) {
require_once(PATH_THIRDPARTY . 'smarty' . PATH_SEP . 'libs' . PATH_SEP . 'Smarty.class.php');
}
$oForm = new \Form( $auxAppDataProcess . "/" . $dynaformUid , PATH_DYNAFORM );
$oForm->validatePost();
$array["form"] = $_POST['form'];
*/
$fields["APP_DATA"] = array_merge($fields["APP_DATA"], G::getSystemConstants());
$fields["APP_DATA"] = array_merge($fields["APP_DATA"], $array["form"]);
$fields["APP_DATA"]["APPLICATION"] = $auxAppDataApplication;
$fields["APP_DATA"]["PROCESS"] = $auxAppDataProcess;
$fields["APP_DATA"]["TASK"] = $auxAppDataTask;
$fields["APP_DATA"]["INDEX"] = $auxAppDataIndex;
$aData = array();
$aData["APP_NUMBER"] = $fields["APP_NUMBER"];
$aData["APP_PROC_STATUS"] = $fields["APP_PROC_STATUS"];
$aData["APP_DATA"] = $fields["APP_DATA"];
$aData["DEL_INDEX"] = $delIndex;
$aData["TAS_UID"] = $fields["APP_DATA"]["TASK"];
$aData["CURRENT_DYNAFORM"] = $dynaformUid;
$aData["USER_UID"] = $usr_uid;
$aData["APP_STATUS"] = $fields["APP_STATUS"];
$aData["PRO_UID"] = $fields["APP_DATA"]["PROCESS"];
$oCase->updateCase($appUid, $aData);
}
示例8: getDynaformsVars
/**
* Function getDynaformsVars
*
* @access public
* @param eter string $sProcessUID
* @param eter boolean $bSystemVars
* @return array
*/
function getDynaformsVars ($sProcessUID, $typeVars = 'all', $bIncMulSelFields = 0)
{
$aFields = array ();
$aFieldsNames = array ();
if ($typeVars == 'system' || $typeVars == 'all') {
$aAux = G::getSystemConstants();
foreach ($aAux as $sName => $sValue) {
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
}
//we're adding the ping variable to the system list
$aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
}
$aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript", "pmconnection");
$aMultipleSelectionFields = array("listbox", "checkgroup");
if ($bIncMulSelFields != 0) {
$aInvalidTypes = array_merge( $aInvalidTypes, $aMultipleSelectionFields );
}
// getting bpmn projects
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(BpmnProjectPeer::PRJ_UID);
$oCriteria->add(BpmnProjectPeer::PRJ_UID, $sProcessUID);
$oDataset = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$row = $oDataset->getRow();
if (isset($row["PRJ_UID"])) {
if($typeVars == 'process' || $typeVars == 'all') {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_UID);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_NAME);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_TYPE);
$oCriteria->add(ProcessVariablesPeer::PRJ_UID, $sProcessUID);
$oDataset = DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
$row = $oDataset->getRow();
array_push($aFields, array(
"sName" => $row["VAR_NAME"],
"sType" => $row["VAR_FIELD_TYPE"],
"sLabel" => $row["VAR_FIELD_TYPE"]
));
}
}
if($typeVars == 'grid' || $typeVars == 'all') {
$oC = new Criteria( 'workflow' );
$oC->addSelectColumn( DynaformPeer::DYN_CONTENT );
$oC->add( DynaformPeer::PRO_UID, $sProcessUID );
$oC->add( DynaformPeer::DYN_TYPE, 'xmlform' );
$oData = DynaformPeer::doSelectRS( $oC );
$oData->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oData->next();
while ($aRowd = $oData->getRow()) {
$dynaform = G::json_decode($aRowd['DYN_CONTENT'],true);
if(is_array($dynaform) && sizeof($dynaform)) {
$items = $dynaform['items'][0]['items'];
foreach($items as $key => $val){
if($val[0]['type'] == 'grid'){
if(sizeof($val[0]['columns'])) {
$columns = $val[0]['columns'];
foreach($columns as $column) {
array_push($aFields, array(
"sName" => $column['name'],
"sType" => $column['type'],
"sLabel" => $column['type']
));
}
}
}
}
}
$oData->next();
}
}
} else {
require_once 'classes/model/Dynaform.php';
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME );
$oCriteria->add( DynaformPeer::PRO_UID, $sProcessUID );
$oCriteria->add( DynaformPeer::DYN_TYPE, 'xmlform' );
$oDataset = DynaformPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
if (file_exists( PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml' )) {
$G_FORM = new Form( $aRow['DYN_FILENAME'], PATH_DYNAFORM, SYS_LANG );
if (($G_FORM->type == 'xmlform') || ($G_FORM->type == '')) {
foreach ($G_FORM->fields as $k => $v) {
if (! in_array( $v->type, $aInvalidTypes )) {
if (! in_array( $k, $aFieldsNames )) {
//.........这里部分代码省略.........
示例9: testGetSystemConstants
/**
* @covers G::getSystemConstants
* @todo Implement testGetSystemConstants().
*/
public function testGetSystemConstants()
{
$response = G::getSystemConstants();
$this->assertTrue(is_array($response));
}
示例10: PMFGetUserEmailAddress
//.........这里部分代码省略.........
* 2.this $id param can be a array by example Array('000000000001','000000000002') in this case $prefix is necessary
* 3.this same param can be a array by example Array('usr|000000000001', 'usr|-1', 'grp|2245141479413131441')
*/
/*
* The second thing is that the return type will be configurated depend of the input type (using $retType)
*/
if (is_array($id)) {
$aItems = $id;
$retType = 'array';
} else {
$retType = 'string';
if (strpos($id, ",") !== false) {
$aItems = explode(',', $id);
} else {
array_push($aItems, $id);
}
}
foreach ($aItems as $sItem) {
//cleaning for blank spaces into each array item
$sItem = trim($sItem);
if (strpos($sItem, "|") !== false) {
// explode the parameter because always will be compose with pipe separator to indicate
// the type (user or group) and the target mai
list($sType, $sID) = explode('|', $sItem);
$sType = trim($sType);
$sID = trim($sID);
} else {
$sType = $prefix;
$sID = $sItem;
}
switch ($sType) {
case 'ext':
if (G::emailAddress($sID)) {
array_push($aRecipient, $sID);
}
break;
case 'usr':
if ($sID == '-1') {
// -1: Curent user, load from user record
if (isset($APP_UID)) {
$oAppDelegation = new AppDelegation();
$aAppDel = $oAppDelegation->getLastDeleration($APP_UID);
if (isset($aAppDel)) {
$oUserRow = UsersPeer::retrieveByPK($aAppDel['USR_UID']);
if (isset($oUserRow)) {
$sID = $oUserRow->getUsrEmail();
} else {
throw new Exception('User with ID ' . $oAppDelegation->getUsrUid() . 'doesn\'t exist');
}
if (G::emailAddress($sID)) {
array_push($aRecipient, $sID);
}
}
}
} else {
$oUserRow = UsersPeer::retrieveByPK($sID);
if ($oUserRow != null) {
$sID = $oUserRow->getUsrEmail();
if (G::emailAddress($sID)) {
array_push($aRecipient, $sID);
}
}
}
break;
case 'grp':
G::LoadClass('groups');
$oGroups = new Groups();
$oCriteria = $oGroups->getUsersGroupCriteria($sID);
$oDataset = GroupwfPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
$aGroup = $oDataset->getRow();
//to validate email address
if (G::emailAddress($aGroup['USR_EMAIL'])) {
array_push($aRecipient, $aGroup['USR_EMAIL']);
}
}
break;
case 'dyn':
$oCase = new Cases();
$aFields = $oCase->loadCase($APP_UID);
$aFields['APP_DATA'] = array_merge($aFields['APP_DATA'], G::getSystemConstants());
//to validate email address
if (isset($aFields['APP_DATA'][$sID]) && G::emailAddress($aFields['APP_DATA'][$sID])) {
array_push($aRecipient, $aFields['APP_DATA'][$sID]);
}
break;
}
}
switch ($retType) {
case 'array':
return $aRecipient;
break;
case 'string':
return implode(',', $aRecipient);
break;
default:
return $aRecipient;
}
}
示例11: Cases
$oApp = new Cases();
$aFields = $oApp->loadCase($_SESSION['APPLICATION']);
$aVars = array();
for ($i = 0; $i < count($_SESSION['TRIGGER_DEBUG']['DATA']); $i++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge($aFields['APP_DATA'], $aVars);
if (isset($_POST['filter']) && $_POST['filter'] == 'dyn') {
$sysVars = array_keys(G::getSystemConstants());
$varNames = array_keys($aVars);
foreach ($varNames as $var) {
if (in_array($var, $sysVars)) {
unset($aVars[$var]);
}
}
}
if (isset($_POST['filter']) && $_POST['filter'] == 'sys') {
$aVars = G::getSystemConstants();
}
ksort($aVars);
$return_object = new StdClass();
$return_object->totalCount = 1;
foreach ($aVars as $i => $var) {
if (is_array($var) || is_object($var)) {
$aVars[$i] = print_r($var, true);
}
}
$return_object->data[0] = $aVars;
echo G::json_encode($return_object);
break;
}
示例12: GetPrepareInformation
/**
* Return Informaction User for derivate
* assignment Users
*
* return array Return an array with Task Case
*/
public function GetPrepareInformation($usr_uid, $tas_uid, $app_uid, $del_index = null)
{
try {
$oCase = new \Cases();
$Fields = $oCase->loadCase($app_uid);
$_SESSION["APPLICATION"] = $app_uid;
$_SESSION["PROCESS"] = $Fields['PRO_UID'];
$_SESSION["TASK"] = $tas_uid;
$_SESSION["INDEX"] = $del_index;
$_SESSION["USER_LOGGED"] = $usr_uid;
$_SESSION["USR_USERNAME"] = isset($Fields['APP_DATA']['USR_USERNAME']) ? $Fields['APP_DATA']['USR_USERNAME'] : '';
$triggers = $oCase->loadTriggers($tas_uid, 'ASSIGN_TASK', '-1', 'BEFORE');
if (isset($triggers)) {
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], G::getSystemConstants());
$Fields['APP_DATA'] = $oCase->ExecuteTriggers($tas_uid, 'DYNAFORM', '-1', 'BEFORE', $Fields['APP_DATA']);
$oCase->updateCase($app_uid, $Fields);
}
$oDerivation = new \Derivation();
$aData = array();
$aData['APP_UID'] = $app_uid;
$aData['DEL_INDEX'] = $del_index;
$aData['USER_UID'] = $usr_uid;
$derive = $oDerivation->prepareInformation($aData);
$response = array();
foreach ($derive as $sKey => &$aValues) {
$sPriority = '';
//set priority value
if ($derive[$sKey]['NEXT_TASK']['TAS_PRIORITY_VARIABLE'] != '') {
//TO DO: review this type of assignment
if (isset($aData['APP_DATA'][str_replace('@@', '', $derive[$sKey]['NEXT_TASK']['TAS_PRIORITY_VARIABLE'])])) {
$sPriority = $aData['APP_DATA'][str_replace('@@', '', $derive[$sKey]['NEXT_TASK']['TAS_PRIORITY_VARIABLE'])];
}
}
//set priority value
$taskType = isset($aValues["NEXT_TASK"]["TAS_TYPE"]) ? $aValues["NEXT_TASK"]["TAS_TYPE"] : false;
$taskMessage = "";
switch ($taskType) {
case "SCRIPT-TASK":
$taskMessage = G::LoadTranslation("ID_ROUTE_TO_TASK_SCRIPT_TASK");
break;
case "INTERMEDIATE-CATCH-TIMER-EVENT":
$taskMessage = G::LoadTranslation("ID_ROUTE_TO_TASK_INTERMEDIATE_CATCH_TIMER_EVENT");
break;
}
switch ($aValues['NEXT_TASK']['TAS_ASSIGN_TYPE']) {
case 'EVALUATE':
case 'REPORT_TO':
case 'BALANCED':
case 'SELF_SERVICE':
$taskAss = array();
$taskAss['taskId'] = $aValues['NEXT_TASK']['TAS_UID'];
$taskAss['taskName'] = $aValues['NEXT_TASK']['TAS_TITLE'];
$taskAss['taskAssignType'] = $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'];
$taskAss['taskDefProcCode'] = $aValues['NEXT_TASK']['TAS_DEF_PROC_CODE'];
$taskAss['delPriority'] = isset($aValues['NEXT_TASK']['DEL_PRIORITY']) ? $aValues['NEXT_TASK']['DEL_PRIORITY'] : "";
$taskAss['taskParent'] = $aValues['NEXT_TASK']['TAS_PARENT'];
$taskAss['taskMessage'] = $taskType ? $taskMessage : "";
$users = array();
$users['userId'] = $derive[$sKey]['NEXT_TASK']['USER_ASSIGNED']['USR_UID'];
$users['userFullName'] = strip_tags($derive[$sKey]['NEXT_TASK']['USER_ASSIGNED']['USR_FULLNAME']);
$taskAss['users'][] = $users;
$response[] = $taskAss;
break;
case 'MANUAL':
case "MULTIPLE_INSTANCE":
case "MULTIPLE_INSTANCE_VALUE_BASED":
$manual = array();
$manual['taskId'] = $aValues['NEXT_TASK']['TAS_UID'];
$manual['taskName'] = $aValues['NEXT_TASK']['TAS_TITLE'];
$manual['taskAssignType'] = $aValues['NEXT_TASK']['TAS_ASSIGN_TYPE'];
$manual['taskDefProcCode'] = $aValues['NEXT_TASK']['TAS_DEF_PROC_CODE'];
$manual['delPriority'] = isset($aValues['NEXT_TASK']['DEL_PRIORITY']) ? $aValues['NEXT_TASK']['DEL_PRIORITY'] : "";
$manual['taskParent'] = $aValues['NEXT_TASK']['TAS_PARENT'];
$manual['taskMessage'] = $taskType ? $taskMessage : "";
$Aux = array();
foreach ($aValues['NEXT_TASK']['USER_ASSIGNED'] as $aUser) {
$Aux[$aUser['USR_UID']] = $aUser['USR_FULLNAME'];
}
asort($Aux);
$users = array();
foreach ($Aux as $id => $fullname) {
$user['userId'] = $id;
$user['userFullName'] = $fullname;
$users[] = $user;
}
$manual['users'] = $users;
$response[] = $manual;
break;
case '':
//when this task is the Finish process
//when this task is the Finish process
case 'nobody':
$userFields = $oDerivation->getUsersFullNameFromArray($derive[$sKey]['USER_UID']);
$taskAss = array();
//.........这里部分代码省略.........
示例13: getDynaformsVars
/**
* Function getDynaformsVars
*
* @access public
* @param eter string $sProcessUID
* @param eter boolean $bSystemVars
* @return array
*/
public static function getDynaformsVars ($sProcessUID, $bSystemVars = true, $bIncMulSelFields = 0)
{
$aFields = array ();
$aFieldsNames = array ();
if ($bSystemVars) {
$aAux = G::getSystemConstants();
foreach ($aAux as $sName => $sValue) {
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLE'), 'sUid' => '');
}
//we're adding the ping variable to the system list
$aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLE'), 'sUid' => '');
}
$aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript");
$aMultipleSelectionFields = array("listbox", "checkgroup", "grid");
if ($bIncMulSelFields != 0) {
$aInvalidTypes = array_merge( $aInvalidTypes, $aMultipleSelectionFields );
}
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( \DynaformPeer::DYN_FILENAME );
$oCriteria->addSelectColumn( \DynaformPeer::DYN_UID );
$oCriteria->add( \DynaformPeer::PRO_UID, $sProcessUID );
$oCriteria->add( \DynaformPeer::DYN_TYPE, 'xmlform' );
$oDataset = \DynaformPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
if (is_file(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml")) {
$dyn = new \dynaFormHandler(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . ".xml");
if ($dyn->getHeaderAttribute("type") !== "xmlform" && $dyn->getHeaderAttribute("type") !== "") {
// skip it, if that is not a xmlform
$oDataset->next();
continue;
}
$fields = $dyn->getFields();
foreach ($fields as $field) {
$label = "";
if ($field->hasChildNodes()) {
$child = $field->getElementsByTagName(SYS_LANG)->length ? $field->getElementsByTagName(SYS_LANG): $field->getElementsByTagName("en");
$label = $child->item(0) ? $child->item(0)->textContent : "";
}
if (! in_array($field->getAttribute("type"), $aInvalidTypes) && ! in_array($field->tagName, $aFieldsNames)) {
$aFieldsNames[] = $field->tagName;
$aFields[] = array (
'sName' => $field->tagName,
'sType' => $field->getAttribute("type"),
'sLabel' => ($field->getAttribute("type") != 'grid' ? $label : '[ ' . G::LoadTranslation('ID_GRID') . ' ]'),
'sUid' => $aRow['DYN_UID']);
}
}
}
$oDataset->next();
}
return $aFields;
}
示例14: replaceDataField
public function replaceDataField($sqlString, $result, $DBEngine = 'mysql')
{
if (!is_array($result)) {
$result = array();
}
$result = $result + G::getSystemConstants();
$__textoEval = "";
$u = 0;
//$count=preg_match_all('/\@(?:([\@\%\#\!Qq])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*(?:[\\\\][\w\W])?)*)\))/',$sqlString,$match,PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
$count = preg_match_all('/\\@(?:([\\@\\%\\#\\=\\!Qq])([a-zA-Z\\_]\\w*)|([a-zA-Z\\_][\\w\\-\\>\\:]*)\\(((?:[^\\\\\\)]*?)*)\\))/', $sqlString, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
if ($count) {
for ($r = 0; $r < $count; $r++) {
if (!isset($result[$match[2][$r][0]])) {
$result[$match[2][$r][0]] = '';
}
if (!is_array($result[$match[2][$r][0]])) {
$__textoEval .= substr($sqlString, $u, $match[0][$r][1] - $u);
$u = $match[0][$r][1] + strlen($match[0][$r][0]);
//Mysql quotes scape
if ($match[1][$r][0] == '@' && isset($result[$match[2][$r][0]])) {
$__textoEval .= "\"" . G::sqlEscape($result[$match[2][$r][0]], $DBEngine) . "\"";
continue;
}
//URL encode
if ($match[1][$r][0] == '%' && isset($result[$match[2][$r][0]])) {
$__textoEval .= urlencode($result[$match[2][$r][0]]);
continue;
}
//Double quoted parameter
if ($match[1][$r][0] == 'Q' && isset($result[$match[2][$r][0]])) {
$__textoEval .= '"' . addcslashes($result[$match[2][$r][0]], '\\"') . '"';
continue;
}
//Single quoted parameter
if ($match[1][$r][0] == 'q' && isset($result[$match[2][$r][0]])) {
$__textoEval .= "'" . addcslashes($result[$match[2][$r][0]], '\\\'') . "'";
continue;
}
//Substring (Sub replaceDataField)
if ($match[1][$r][0] == '!' && isset($result[$match[2][$r][0]])) {
$__textoEval .= G::replaceDataField($result[$match[2][$r][0]], $result);
continue;
}
//Call function
if ($match[1][$r][0] === '' && $match[2][$r][0] === '' && $match[3][$r][0] !== '') {
eval('$strAux = ' . $match[3][$r][0] . '(\'' . addcslashes(G::replaceDataField(stripslashes($match[4][$r][0]), $result), '\\\'') . '\');');
if ($match[3][$r][0] == "G::LoadTranslation") {
$arraySearch = array("'");
$arrayReplace = array("\\'");
$strAux = str_replace($arraySearch, $arrayReplace, $strAux);
}
$__textoEval .= $strAux;
continue;
}
//Non-quoted
if ($match[1][$r][0] == '#' && isset($result[$match[2][$r][0]])) {
$__textoEval .= G::replaceDataField($result[$match[2][$r][0]], $result);
continue;
}
//Non-quoted =
if ($match[1][$r][0] == '=' && isset($result[$match[2][$r][0]])) {
$__textoEval .= G::replaceDataField($result[$match[2][$r][0]], $result);
continue;
}
}
}
}
$__textoEval .= substr($sqlString, $u);
return $__textoEval;
}
示例15: getDynaformsVars
/**
* Function getDynaformsVars
*
* @access public
* @param eter string $sProcessUID
* @param eter boolean $bSystemVars
* @return array
*/
function getDynaformsVars($sProcessUID, $bSystemVars = true, $bIncMulSelFields = 0)
{
$aFields = array();
$aFieldsNames = array();
if ($bSystemVars) {
$aAux = G::getSystemConstants();
foreach ($aAux as $sName => $sValue) {
$aFields[] = array('sName' => $sName, 'sType' => 'system', 'sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
}
//we're adding the ping variable to the system list
$aFields[] = array('sName' => 'PIN', 'sType' => 'system', 'sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
}
$aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript", "pmconnection");
$aMultipleSelectionFields = array("listbox", "checkgroup");
if ($bIncMulSelFields != 0) {
$aInvalidTypes = array_merge($aInvalidTypes, $aMultipleSelectionFields);
}
require_once 'classes/model/Dynaform.php';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(DynaformPeer::DYN_FILENAME);
$oCriteria->add(DynaformPeer::PRO_UID, $sProcessUID);
$oCriteria->add(DynaformPeer::DYN_TYPE, 'xmlform');
$oDataset = DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
if (file_exists(PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml')) {
$G_FORM = new Form($aRow['DYN_FILENAME'], PATH_DYNAFORM, SYS_LANG);
if ($G_FORM->type == 'xmlform' || $G_FORM->type == '') {
foreach ($G_FORM->fields as $k => $v) {
if (!in_array($v->type, $aInvalidTypes)) {
if (!in_array($k, $aFieldsNames)) {
$aFields[] = array('sName' => $k, 'sType' => $v->type, 'sLabel' => $v->type != 'grid' ? $v->label : '[ ' . G::LoadTranslation('ID_GRID') . ' ]');
$aFieldsNames[] = $k;
}
}
}
}
}
$oDataset->next();
}
return $aFields;
}