本文整理汇总了PHP中AppDelegationPeer::doSelectRS方法的典型用法代码示例。如果您正苦于以下问题:PHP AppDelegationPeer::doSelectRS方法的具体用法?PHP AppDelegationPeer::doSelectRS怎么用?PHP AppDelegationPeer::doSelectRS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppDelegationPeer
的用法示例。
在下文中一共展示了AppDelegationPeer::doSelectRS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$dataPro = array();
$index = 0;
$content = new Content();
$tasTitleDefault = G::LoadTranslation('ID_TASK_NOT_RELATED');
while ($result->next()) {
$row = $result->getRow();
$row['APP_MSG_FROM'] = htmlentities($row['APP_MSG_FROM'], ENT_QUOTES, "UTF-8");
$row['APP_MSG_STATUS'] = ucfirst($row['APP_MSG_STATUS']);
$row['TAS_TITLE'] = $tasTitleDefault;
if ($row['DEL_INDEX'] != 0) {
$criteria = new Criteria();
$criteria->addSelectColumn(AppDelegationPeer::PRO_UID);
$criteria->addSelectColumn(AppDelegationPeer::TAS_UID);
$criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
$criteria->add(AppDelegationPeer::APP_UID, $row['APP_UID']);
$resultDelegation = AppDelegationPeer::doSelectRS($criteria);
$resultDelegation->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$row['TAS_TITLE'] = '-';
while ($resultDelegation->next()) {
$rowDelegation = $resultDelegation->getRow();
if ($row['DEL_INDEX'] == $rowDelegation['DEL_INDEX']) {
$row['TAS_TITLE'] = $content->load('TAS_TITLE', '', $rowDelegation['TAS_UID'], SYS_LANG);
break;
}
}
}
$data[] = $row;
}
$response = array();
$response['totalCount'] = $totalCount;
$response['data'] = $data;
示例2: loadActionByEmail
/**
*
* @url GET /loadActionByEmail
*/
public function loadActionByEmail($params)
{
$criteria = new Criteria();
$criteria->addSelectColumn('COUNT(*)');
$criteria->addJoin(AbeConfigurationPeer::ABE_UID, AbeRequestsPeer::ABE_UID);
$criteria->addJoin(AppDelegationPeer::APP_UID, AbeRequestsPeer::APP_UID);
$criteria->addJoin(AppDelegationPeer::DEL_INDEX, AbeRequestsPeer::DEL_INDEX);
$result = AbeConfigurationPeer::doSelectRS($criteria);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$result->next();
$totalCount = $result->getRow();
$totalCount = $totalCount['COUNT(*)'];
$criteria = new Criteria();
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
$criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
$criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_UPDATE_DATE);
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_TEMPLATE);
$criteria->addSelectColumn(AbeConfigurationPeer::ABE_ACTION_FIELD);
$criteria->addSelectColumn(AbeConfigurationPeer::DYN_UID);
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_UID);
$criteria->addSelectColumn(AbeRequestsPeer::APP_UID);
$criteria->addSelectColumn(AbeRequestsPeer::DEL_INDEX);
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_SENT_TO);
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_STATUS);
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_SUBJECT);
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_ANSWERED);
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_BODY);
$criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_DATE);
$criteria->addSelectColumn(ApplicationPeer::APP_NUMBER);
$criteria->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
$criteria->addJoin(AbeConfigurationPeer::ABE_UID, AbeRequestsPeer::ABE_UID);
$criteria->addJoin(ApplicationPeer::APP_UID, AbeRequestsPeer::APP_UID);
$criteria->addJoin(AppDelegationPeer::APP_UID, AbeRequestsPeer::APP_UID);
$criteria->addJoin(AppDelegationPeer::DEL_INDEX, AbeRequestsPeer::DEL_INDEX);
$criteria->addDescendingOrderByColumn(AbeRequestsPeer::ABE_REQ_DATE);
$criteria->setLimit($_REQUEST['limit']);
$criteria->setOffset($_REQUEST['start']);
$result = AbeConfigurationPeer::doSelectRS($criteria);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$data = Array();
$arrayPro = Array();
$arrayTAS = Array();
$index = 0;
while ($result->next()) {
$data[] = $result->getRow();
$criteriaRes = new Criteria();
$criteriaRes->addSelectColumn(AbeResponsesPeer::ABE_RES_UID);
$criteriaRes->addSelectColumn(AbeResponsesPeer::ABE_RES_CLIENT_IP);
$criteriaRes->addSelectColumn(AbeResponsesPeer::ABE_RES_DATA);
$criteriaRes->addSelectColumn(AbeResponsesPeer::ABE_RES_STATUS);
$criteriaRes->addSelectColumn(AbeResponsesPeer::ABE_RES_MESSAGE);
$criteriaRes->add(AbeResponsesPeer::ABE_REQ_UID, $data[$index]['ABE_REQ_UID']);
$resultRes = AbeResponsesPeer::doSelectRS($criteriaRes);
$resultRes->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$resultRes->next();
$dataRes = Array();
if ($dataRes = $resultRes->getRow()) {
$data[$index]['ABE_RES_UID'] = $dataRes['ABE_RES_UID'];
$data[$index]['ABE_RES_CLIENT_IP'] = $dataRes['ABE_RES_CLIENT_IP'];
$data[$index]['ABE_RES_DATA'] = $dataRes['ABE_RES_DATA'];
$data[$index]['ABE_RES_STATUS'] = $dataRes['ABE_RES_STATUS'];
$data[$index]['ABE_RES_MESSAGE'] = $dataRes['ABE_RES_MESSAGE'];
} else {
$data[$index]['ABE_RES_UID'] = '';
$data[$index]['ABE_RES_CLIENT_IP'] = '';
$data[$index]['ABE_RES_DATA'] = '';
$data[$index]['ABE_RES_STATUS'] = '';
$data[$index]['ABE_RES_MESSAGE'] = '';
}
$criteriaRes = new Criteria();
$criteriaRes->addSelectColumn(AppDelegationPeer::USR_UID);
$criteriaRes->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$criteriaRes->addSelectColumn(UsersPeer::USR_LASTNAME);
$criteria->addJoin(AppDelegationPeer::APP_UID, $data[$index]['APP_UID']);
$criteria->addJoin(AppDelegationPeer::DEL_INDEX, $data[$index]['DEL_PREVIOUS']);
$criteria->addJoin(AppDelegationPeer::USR_UID, UsersPeer::USR_UID);
$resultRes = AppDelegationPeer::doSelectRS($criteriaRes);
$resultRes->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$resultRes->next();
//.........这里部分代码省略.........
示例3: reassignCase
/**
* reassign Case
*
* @param string sessionId : The session ID (which was obtained during login)
* @param string caseId : The case ID (which can be obtained with the caseList() function)
* @param string delIndex : The delegation index number of the case (which can be obtained with the caseList()
* function).
* @param string userIdSource : The user who is currently assigned the case.
* @param string userIdTarget : The target user who will be newly assigned to the case.
* @return $result will return an object
*/
public function reassignCase ($sessionId, $caseId, $delIndex, $userIdSource, $userIdTarget)
{
$g = new G();
try {
$g->sessionVarSave();
$_SESSION["APPLICATION"] = $caseId;
$_SESSION["INDEX"] = $delIndex;
$_SESSION["USER_LOGGED"] = $userIdSource;
if ($userIdTarget == $userIdSource) {
$result = new wsResponse( 30, G::loadTranslation( 'ID_TARGET_ORIGIN_USER_SAME' ) );
$g->sessionVarRestore();
return $result;
}
/**
* ****************( 1 )*****************
*/
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( UsersPeer::USR_STATUS, 'ACTIVE' );
$oCriteria->add( UsersPeer::USR_UID, $userIdSource );
$oDataset = UsersPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRow = $oDataset->getRow();
if (! is_array( $aRow )) {
$result = new wsResponse( 31, G::loadTranslation( 'ID_INVALID_ORIGIN_USER' ) );
$g->sessionVarRestore();
return $result;
}
/**
//.........这里部分代码省略.........
示例4: AppDocument
$r->totalCount = $totalCount;
$r->dataFormat = $dateFormat;
echo Bootstrap::json_encode($r);
break;
case 'showGeneratedDocument':
//require_once 'classes/model/AppDocument.php';
//require_once 'classes/model/AppDelegation.php';
$oAppDocument = new AppDocument();
$aFields = $oAppDocument->load($_POST['APP_DOC_UID']);
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$aOD = $oOutputDocument->load($aFields['DOC_UID']);
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelegationPeer::APP_UID, $aFields['APP_UID']);
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $aFields['DEL_INDEX']);
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$oTask = new Task();
$aTask = $oTask->load($aRow['TAS_UID']);
$aFields['ORIGIN'] = $aTask['TAS_TITLE'];
require_once 'classes/model/Users.php';
$oUser = new Users();
$aUser = $oUser->load($aFields['USR_UID']);
$aFields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$aFields['VIEW'] = G::LoadTranslation('ID_OPEN');
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewAnyOutputDocument', '', G::array_merges($aOD, $aFields), '');
示例5: getSelfServiceCasesByEvaluate
public function getSelfServiceCasesByEvaluate($userUid)
{
$cases = array();
//check groups assigned to SelfService task
G::LoadClass('groups');
$group = new Groups();
$aGroups = $group->getActiveGroupsForAnUser($userUid);
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(TaskPeer::TAS_UID);
$c->addSelectColumn(TaskPeer::PRO_UID);
$c->addSelectColumn(TaskPeer::TAS_GROUP_VARIABLE);
$c->addJoin(TaskPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
$c->addJoin(TaskPeer::TAS_UID, TaskUserPeer::TAS_UID, Criteria::LEFT_JOIN);
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
$c->add(TaskPeer::TAS_ASSIGN_TYPE, 'SELF_SERVICE');
$c->add(TaskPeer::TAS_GROUP_VARIABLE, '', Criteria::NOT_EQUAL);
$rs = TaskPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
if ($rs->getRecordCount() > 0) {
if (!class_exists('Cases')) {
G::loadClass('case');
}
$caseInstance = new Cases();
while ($row = $rs->getRow()) {
$tasGroupVariable = str_replace(array('@', '#'), '', $row['TAS_GROUP_VARIABLE']);
$c2 = new Criteria();
$c2->clearSelectColumns();
$c2->addSelectColumn(AppDelegationPeer::APP_UID);
$c2->add(AppDelegationPeer::TAS_UID, $row['TAS_UID']);
$c2->add(AppDelegationPeer::USR_UID, '');
$c2->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
$rs2 = AppDelegationPeer::doSelectRS($c2);
$rs2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs2->next();
while ($row2 = $rs2->getRow()) {
$caseData = $caseInstance->LoadCase($row2['APP_UID']);
if (isset($caseData['APP_DATA'][$tasGroupVariable])) {
if (trim($caseData['APP_DATA'][$tasGroupVariable]) != '') {
if (in_array(trim($caseData['APP_DATA'][$tasGroupVariable]), $aGroups)) {
$cases[] = $row2['APP_UID'];
}
}
}
$rs2->next();
}
$rs->next();
}
}
return $cases;
}
示例6: Criteria
$_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();
$c->addSelectColumn(AppDelegationPeer::TAS_UID);
$c->add(AppDelegationPeer::APP_UID, $_SESSION['APPLICATION']);
$c->add(AppDelegationPeer::DEL_INDEX, $_SESSION['INDEX']);
$oDataset = AppDelegationPeer::doSelectRS($c);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aData = $oDataset->getRow();
$taskUid = isset($aData['TAS_UID']) ? $aData['TAS_UID'] : - 1;
}
$sOutput = $oProcessMap->load($oData->uid, true, $_SESSION['APPLICATION'], $_SESSION['INDEX'], $taskUid);
}
}
break;
case 'process_Edit':
$oProcessMap->editProcess($oData->pro_uid);
break;
case 'process_Export':
include (PATH_METHODS . 'processes/processes_Export.php');
G::auditLog('ExportProcess','Export process "'.$resultProcess['PRO_TITLE'].'"');
示例7: alreadyRouted
/**
* Verify if the current case is already routed.
*
* @param string $AppUid the uid of the application
* @return array $Fields the fields
*/
public function alreadyRouted ($appUid, $sDelIndex)
{
$c = new Criteria("workflow");
$c->clearSelectColumns();
$c->addSelectColumn(AppDelegationPeer::APP_UID);
$c->add(AppDelegationPeer::APP_UID, $appUid);
$c->add(AppDelegationPeer::DEL_INDEX, $sDelIndex);
$c->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNOTNULL);
$result = AppDelegationPeer::doSelectRS($c);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if($result->next()) {
return true;
} else {
return false;
}
}
示例8: getUsersParticipatedInCase
public function getUsersParticipatedInCase($sAppUid)
{
$c = new Criteria('workflow');
$c->addSelectColumn(AppDelegationPeer::APP_UID);
$c->addSelectColumn(AppDelegationPeer::USR_UID);
$c->addSelectColumn(UsersPeer::USR_USERNAME);
$c->addSelectColumn(UsersPeer::USR_EMAIL);
$c->add(AppDelegationPeer::APP_UID, $sAppUid, CRITERIA::EQUAL);
$c->addJoin(AppDelegationPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$rs = AppDelegationPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rows = array();
$rs->next();
while ($row = $rs->getRow()) {
$rows[$row['USR_UID']] = $row;
$rs->next();
}
$response['criteria'] = $c;
$response['array'] = $rows;
return $response;
}
示例9: getAppDelegationInfo
public function getAppDelegationInfo($filters, $fieldName)
{
$criteria = new Criteria();
eval('$criteria->addSelectColumn( AppDelegationPeer::' . $fieldName . ');');
foreach ($filters as $k => $v) {
eval('$criteria->add( AppDelegationPeer::' . $k . ',$v, Criteria::EQUAL);');
}
$dataset = AppDelegationPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
return isset($aRow[$fieldName]) ? $aRow[$fieldName] : NULL;
}
示例10: getDelegatedTaskData
public function getDelegatedTaskData($TAS_UID, $APP_UID, $DEL_INDEX)
{
require_once 'classes/model/AppDelegation.php';
require_once 'classes/model/Task.php';
$oTask = new Task();
$aFields = $oTask->load($TAS_UID);
$oCriteria = new Criteria('workflow');
$oCriteria->add(AppDelegationPeer::APP_UID, $APP_UID);
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $DEL_INDEX);
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$taskData = $oDataset->getRow();
$iDiff = strtotime($taskData['DEL_FINISH_DATE']) - strtotime($taskData['DEL_INIT_DATE']);
$aFields['INIT_DATE'] = $taskData['DEL_INIT_DATE'] != null ? $taskData['DEL_INIT_DATE'] : G::LoadTranslation('ID_CASE_NOT_YET_STARTED');
$aFields['DUE_DATE'] = $taskData['DEL_TASK_DUE_DATE'] != null ? $taskData['DEL_TASK_DUE_DATE'] : G::LoadTranslation('ID_NOT_FINISHED');
$aFields['FINISH'] = $taskData['DEL_FINISH_DATE'] != null ? $taskData['DEL_FINISH_DATE'] : G::LoadTranslation('ID_NOT_FINISHED');
$aFields['DURATION'] = $taskData['DEL_FINISH_DATE'] != null ? (int) ($iDiff / 3600) . ' ' . ((int) ($iDiff / 3600) == 1 ? G::LoadTranslation('ID_HOUR') : G::LoadTranslation('ID_HOURS')) . ' ' . (int) ($iDiff % 3600 / 60) . ' ' . ((int) ($iDiff % 3600 / 60) == 1 ? G::LoadTranslation('ID_MINUTE') : G::LoadTranslation('ID_MINUTES')) . ' ' . (int) ($iDiff % 3600 % 60) . ' ' . ((int) ($iDiff % 3600 % 60) == 1 ? G::LoadTranslation('ID_SECOND') : G::LoadTranslation('ID_SECONDS')) : G::LoadTranslation('ID_NOT_FINISHED');
return $aFields;
}
示例11: history
public function history($idProcess, $appUid)
{
$oCase = new \Cases();
$aFields = $oCase->loadCase($appUid);
$oProcess = new \Process();
$aProcessFieds = $oProcess->load($idProcess);
$noShowTitle = 0;
if (isset($aProcessFieds['PRO_SHOW_MESSAGE'])) {
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
}
if (isset($aFields['TITLE'])) {
$aFields['APP_TITLE'] = $aFields['TITLE'];
}
if ($aFields['APP_PROC_CODE'] != '') {
$aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE'];
}
$aFields['CASE'] = \G::LoadTranslation('ID_CASE');
$aFields['TITLE'] = \G::LoadTranslation('ID_TITLE');
$c = \Cases::getTransferHistoryCriteria($appUid);
$dataset = \AppDelegationPeer::doSelectRS($c);
$dataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$history = array();
while ($row = $dataset->getRow()) {
$history[] = $row;
$dataset->next();
}
$response = $this->parserHistory($history);
return $response;
}
示例12: getTasks
/**
* Get all Tasks of Case
* Based in: processmaker/workflow/engine/classes/class.processMap.php
* Method: processMap::load()
*
* @param string $applicationUid Unique id of Case
*
* return array Return an array with all Tasks of Case
*/
public function getTasks($applicationUid)
{
try {
$arrayTask = array();
//Verify data
$this->throwExceptionIfNotExistsCase($applicationUid, 0, $this->getFieldNameByFormatFieldName("APP_UID"));
//Set variables
$process = new \Process();
$application = new \Application();
$conf = new \Configurations();
$arrayApplicationData = $application->Load($applicationUid);
$processUid = $arrayApplicationData["PRO_UID"];
$confEnvSetting = $conf->getFormats();
$taskUid = "";
//Get data
//SQL
$delimiter = \DBAdapter::getStringDelimiter();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\TaskPeer::TAS_UID);
$criteria->addAsColumn("TAS_TITLE", "CT.CON_VALUE");
$criteria->addAsColumn("TAS_DESCRIPTION", "CD.CON_VALUE");
$criteria->addSelectColumn(\TaskPeer::TAS_START);
$criteria->addSelectColumn(\TaskPeer::TAS_TYPE);
$criteria->addSelectColumn(\TaskPeer::TAS_DERIVATION);
$criteria->addSelectColumn(\TaskPeer::TAS_ASSIGN_TYPE);
$criteria->addSelectColumn(\UsersPeer::USR_UID);
$criteria->addSelectColumn(\UsersPeer::USR_USERNAME);
$criteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
$criteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
$criteria->addAlias("CD", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\TaskPeer::TAS_UID, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "TAS_TITLE" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$arrayCondition = array();
$arrayCondition[] = array(\TaskPeer::TAS_UID, "CD.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_CATEGORY", $delimiter . "TAS_DESCRIPTION" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$criteria->addJoin(\TaskPeer::TAS_LAST_ASSIGNED, \UsersPeer::USR_UID, \Criteria::LEFT_JOIN);
$criteria->add(\TaskPeer::PRO_UID, $processUid, \Criteria::EQUAL);
$rsCriteria = \TaskPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
//Task
if ($row["TAS_TYPE"] == "NORMAL") {
if ($row["TAS_TITLE"] . "" == "") {
//There is no Label in Current SYS_LANG language so try to find in English - by default
$task = new \Task();
$task->setTasUid($row["TAS_UID"]);
$row["TAS_TITLE"] = $task->getTasTitle();
}
} else {
$criteria2 = new \Criteria("workflow");
$criteria2->addSelectColumn(\SubProcessPeer::PRO_UID);
$criteria2->addAsColumn("TAS_TITLE", "CT.CON_VALUE");
$criteria2->addAsColumn("TAS_DESCRIPTION", "CD.CON_VALUE");
$criteria2->addAlias("CT", \ContentPeer::TABLE_NAME);
$criteria2->addAlias("CD", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\SubProcessPeer::TAS_PARENT, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "TAS_TITLE" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria2->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$arrayCondition = array();
$arrayCondition[] = array(\SubProcessPeer::TAS_PARENT, "CD.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_CATEGORY", $delimiter . "TAS_DESCRIPTION" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria2->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$criteria2->add(\SubProcessPeer::PRO_PARENT, $processUid);
$criteria2->add(\SubProcessPeer::TAS_PARENT, $row["TAS_UID"]);
$rsCriteria2 = \SubProcessPeer::doSelectRS($criteria2);
$rsCriteria2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria2->next();
$row2 = $rsCriteria2->getRow();
if ($process->exists($row2["PRO_UID"])) {
$row["TAS_TITLE"] = $row2["TAS_TITLE"];
$row["TAS_DESCRIPTION"] = $row2["TAS_DESCRIPTION"];
}
}
//Routes
$routeType = "";
$arrayRoute = array();
$criteria2 = new \Criteria("workflow");
$criteria2->addAsColumn("ROU_NUMBER", \RoutePeer::ROU_CASE);
$criteria2->addSelectColumn(\RoutePeer::ROU_TYPE);
$criteria2->addSelectColumn(\RoutePeer::ROU_CONDITION);
$criteria2->addAsColumn("TAS_UID", \RoutePeer::ROU_NEXT_TASK);
//.........这里部分代码省略.........
示例13: generateData
/**
* Generate Data
*
* @return object criteria
*/
public function generateData($appUid, $delPreviusUsrUid)
{
try {
G::LoadClass("case");
//Generate data
$case = new Cases();
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(AppDelegationPeer::APP_UID);
$criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
$criteria->addSelectColumn(ApplicationPeer::APP_DATA);
$criteria->addSelectColumn(AppDelegationPeer::PRO_UID);
$criteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$criteria->addSelectColumn(TaskPeer::TAS_UID);
$criteria->addSelectColumn(TaskPeer::TAS_GROUP_VARIABLE);
$criteria->addJoin(AppDelegationPeer::APP_UID, ApplicationPeer::APP_UID, Criteria::LEFT_JOIN);
$criteria->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
$criteria->add(TaskPeer::TAS_ASSIGN_TYPE, "SELF_SERVICE", Criteria::EQUAL);
//$criteria->add(TaskPeer::TAS_GROUP_VARIABLE, "", Criteria::NOT_EQUAL);
$criteria->add(AppDelegationPeer::USR_UID, "", Criteria::EQUAL);
$criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN", Criteria::EQUAL);
$criteria->add(AppDelegationPeer::APP_UID, $appUid, Criteria::EQUAL);
$rsCriteria = AppDelegationPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$applicationData = $case->unserializeData($row["APP_DATA"]);
$taskGroupVariable = trim($row["TAS_GROUP_VARIABLE"], " @#");
$delPreviusUsrUid = '';
$unaUid = $this->newRow($row, $delPreviusUsrUid);
//Selfservice by group
if ($taskGroupVariable != "" && isset($applicationData[$taskGroupVariable]) && trim($applicationData[$taskGroupVariable]) != "") {
$gprUid = trim($applicationData[$taskGroupVariable]);
//Define Users by Group
$gpr = new GroupUser();
$arrayUsers = $gpr->getAllGroupUser($gprUid);
foreach ($arrayUsers as $urow) {
$newRow["USR_UID"] = $urow["USR_UID"];
$listUnassignedGpr = new ListUnassignedGroup();
$listUnassignedGpr->newRow($unaUid, $urow["USR_UID"], "GROUP", $gprUid);
}
} else {
//Define all users assigned to Task
$task = new TaskUser();
$arrayUsers = $task->getAllUsersTask($row["TAS_UID"]);
foreach ($arrayUsers as $urow) {
$newRow["USR_UID"] = $urow["USR_UID"];
$listUnassignedGpr = new ListUnassignedGroup();
$listUnassignedGpr->newRow($unaUid, $urow["USR_UID"], "USER", "");
}
}
}
} catch (Exception $e) {
throw $e;
}
}
示例14: getApplicationDelegationsIndex
/**
* Get all the application delegation records from database
*
* @param string $appUID
* Application identifier
* @return array delegation records
*/
public function getApplicationDelegationsIndex($appUID)
{
$delIndexes = array();
$c = new Criteria();
$c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
$c->add(AppDelegationPeer::APP_UID, $appUID);
$rs = AppDelegationPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
while (is_array($row)) {
$delIndexes[] = $row['DEL_INDEX'];
$rs->next();
$row = $rs->getRow();
}
return $delIndexes;
}
示例15: startContinueCaseByTimerEvent
/**
* Start/Continue case by Timer-Event
*
* @param string $datetime Datetime (yyyy-mm-dd hh:ii:ss)
* @param bool $frontEnd Flag to represent the terminal front-end
*
* return void
*/
public function startContinueCaseByTimerEvent($datetime, $frontEnd = false)
{
try {
\G::LoadClass("wsBase");
//Set variables
$ws = new \wsBase();
$case = new \Cases();
$common = new \ProcessMaker\Util\Common();
$common->setFrontEnd($frontEnd);
list($year, $month, $day, $hour, $minute) = $this->getYearMonthDayHourMinuteSecondByDatetime($datetime);
$date = "{$year}-{$month}-{$day}";
$dateIni = "{$year}-{$month}-{$day} 00:00:00";
$dateEnd = "{$year}-{$month}-{$day} 23:59:59";
//Start Timer-Event (start new case) ///////////////////////////////////////////////////////////////////////
$common->frontEndShow("START");
$this->log("START-NEW-CASES", "Date \"{$datetime}\": Start new cases");
//Query
$criteria = $this->getTimerEventCriteria();
$criteria->addSelectColumn(\BpmnEventPeer::EVN_NAME);
$criteria->addSelectColumn(\ElementTaskRelationPeer::TAS_UID);
$arrayCondition = array();
$arrayCondition[] = array(\TimerEventPeer::PRJ_UID, \ProcessPeer::PRO_UID, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
$criteria->add(\ProcessPeer::PRO_STATUS, "ACTIVE", \Criteria::EQUAL);
$arrayCondition = array();
$arrayCondition[] = array(\TimerEventPeer::PRJ_UID, \ElementTaskRelationPeer::PRJ_UID, \Criteria::EQUAL);
$arrayCondition[] = array(\TimerEventPeer::EVN_UID, \ElementTaskRelationPeer::ELEMENT_UID, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
$criteria->add(\ElementTaskRelationPeer::ELEMENT_TYPE, "bpmnEvent", \Criteria::EQUAL);
$arrayCondition = array();
$arrayCondition[] = array(\ElementTaskRelationPeer::PRJ_UID, \TaskPeer::PRO_UID, \Criteria::EQUAL);
$arrayCondition[] = array(\ElementTaskRelationPeer::TAS_UID, \TaskPeer::TAS_UID, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
$criteria->add(\TaskPeer::TAS_TYPE, "START-TIMER-EVENT", \Criteria::EQUAL);
$arrayCondition = array();
$arrayCondition[] = array(\TimerEventPeer::PRJ_UID, \BpmnEventPeer::PRJ_UID, \Criteria::EQUAL);
$arrayCondition[] = array(\TimerEventPeer::EVN_UID, \BpmnEventPeer::EVN_UID, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::INNER_JOIN);
$criteria->add(\BpmnEventPeer::EVN_TYPE, "START", \Criteria::EQUAL);
$criteria->add(\BpmnEventPeer::EVN_MARKER, "TIMER", \Criteria::EQUAL);
$criteria->add(\TimerEventPeer::TMREVN_OPTION, array("HOURLY", "DAILY", "MONTHLY", "EVERY", "ONE-DATE-TIME"), \Criteria::IN);
$criteria->add(\TimerEventPeer::TMREVN_STATUS, "ACTIVE", \Criteria::EQUAL);
$criteria->add($criteria->getNewCriterion(\TimerEventPeer::TMREVN_NEXT_RUN_DATE, $dateIni, \Criteria::GREATER_EQUAL)->addAnd($criteria->getNewCriterion(\TimerEventPeer::TMREVN_NEXT_RUN_DATE, $dateEnd, \Criteria::LESS_EQUAL))->addOr($criteria->getNewCriterion(\TimerEventPeer::TMREVN_NEXT_RUN_DATE, $dateIni, \Criteria::LESS_THAN)));
$criteria->add($criteria->getNewCriterion(\TimerEventPeer::TMREVN_END_DATE, $date, \Criteria::GREATER_EQUAL)->addOr($criteria->getNewCriterion(\TimerEventPeer::TMREVN_END_DATE, null, \Criteria::EQUAL)));
$rsCriteria = \TimerEventPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$flagRecord = false;
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$row["TMREVN_CONFIGURATION_DATA"] = unserialize($row["TMREVN_CONFIGURATION_DATA"]);
//Set variables
$arrayTimerEventData = $row;
$bpmnEventName = $row["EVN_NAME"];
$taskUid = $row["TAS_UID"];
//Create the new case
$timerEventNextRunDate = $arrayTimerEventData["TMREVN_NEXT_RUN_DATE"];
$timerEventNextRunDateNew = "";
$flagCase = false;
if (strtotime($timerEventNextRunDate) < strtotime($dateIni)) {
$timerEventNextRunDateNew = $this->getNextRunDateByDataAndDatetime($arrayTimerEventData, $datetime);
//Generate new date for old TMREVN_NEXT_RUN_DATE
$flagCase = true;
//Create the old case
} else {
list(, , , $hourCase, $minuteCase) = $this->getYearMonthDayHourMinuteSecondByDatetime($timerEventNextRunDate);
if ((int) ($hour . $minute) <= (int) ($hourCase . $minuteCase)) {
$flagCase = $hourCase == $hour && $minuteCase == $minute;
} else {
$timerEventNextRunDateNew = $this->getNextRunDateByDataAndDatetime($arrayTimerEventData, $datetime);
//Generate new date for old TMREVN_NEXT_RUN_DATE
$flagCase = true;
//Create the old case
}
}
if ($flagCase) {
if ($flagRecord) {
$common->frontEndShow("TEXT", "");
}
if ($bpmnEventName != "") {
$common->frontEndShow("TEXT", "> Name Timer-Event: {$bpmnEventName}");
}
$common->frontEndShow("TEXT", "> Creating the new case...");
//Start new case
$result = $ws->newCase($arrayTimerEventData["PRJ_UID"], "", $taskUid, array());
$arrayResult = json_decode(json_encode($result), true);
if ($arrayResult["status_code"] == 0) {
$applicationUid = $arrayResult["caseId"];
$applicationNumber = $arrayResult["caseNumber"];
$common->frontEndShow("TEXT", " - OK case #{$applicationNumber} was created");
$common->frontEndShow("TEXT", "> Routing the case #{$applicationNumber}...");
$this->log("CREATED-NEW-CASE", "Case #{$applicationNumber} created, APP_UID: {$applicationUid}, PRO_UID: " . $arrayTimerEventData["PRJ_UID"]);
//Derivate new case
//.........这里部分代码省略.........