本文整理汇总了PHP中Criteria::addJoinMC方法的典型用法代码示例。如果您正苦于以下问题:PHP Criteria::addJoinMC方法的具体用法?PHP Criteria::addJoinMC怎么用?PHP Criteria::addJoinMC使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Criteria
的用法示例。
在下文中一共展示了Criteria::addJoinMC方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTriggerCriteria
/**
* Get criteria for Trigger
*
* return object
*/
public function getTriggerCriteria()
{
try {
$delimiter = \DBAdapter::getStringDelimiter();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\TriggersPeer::TRI_UID);
$criteria->addAsColumn("TRI_TITLE", "CT.CON_VALUE");
$criteria->addAsColumn("TRI_DESCRIPTION", "CD.CON_VALUE");
$criteria->addSelectColumn(\TriggersPeer::TRI_TYPE);
$criteria->addSelectColumn(\TriggersPeer::TRI_WEBBOT);
$criteria->addSelectColumn(\TriggersPeer::TRI_PARAM);
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
$criteria->addAlias("CD", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\TriggersPeer::TRI_UID, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "TRI_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(\TriggersPeer::TRI_UID, "CD.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_CATEGORY", $delimiter . "TRI_DESCRIPTION" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
return $criteria;
} catch (\Exception $e) {
throw $e;
}
}
示例2: getEvents
/**
* Get list for Events
* @var string $pro_uid. Uid for Process
* @var string $filter.
* @var string $evn_uid. Uid for Process
*
* @access public
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @return array
*/
public function getEvents($pro_uid, $filter = '', $evn_uid = '')
{
$pro_uid = $this->validateProUid($pro_uid);
if ($evn_uid != '') {
$evn_uid = $this->validateEvnUid($evn_uid);
}
$oProcess = new \Process();
if (!$oProcess->processExists($pro_uid)) {
throw new \Exception(\G::LoadTranslation("ID_PROCESS_NOT_EXIST", array('pro_uid', $pro_uid)));
}
$sDelimiter = \DBAdapter::getStringDelimiter();
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\EventPeer::EVN_UID);
$oCriteria->addSelectColumn(\EventPeer::EVN_ACTION);
$oCriteria->addSelectColumn(\EventPeer::EVN_STATUS);
$oCriteria->addSelectColumn(\EventPeer::EVN_WHEN_OCCURS);
$oCriteria->addSelectColumn(\EventPeer::EVN_RELATED_TO);
$oCriteria->addAsColumn('EVN_DESCRIPTION', \ContentPeer::CON_VALUE);
$aConditions = array();
$aConditions[] = array(\EventPeer::EVN_UID, \ContentPeer::CON_ID);
$aConditions[] = array(\ContentPeer::CON_CATEGORY, $sDelimiter . 'EVN_DESCRIPTION' . $sDelimiter);
$aConditions[] = array(\ContentPeer::CON_LANG, $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$oCriteria->add(\EventPeer::PRO_UID, $pro_uid);
if ($evn_uid != '') {
$oCriteria->add(\EventPeer::EVN_UID, $evn_uid);
}
switch ($filter) {
case 'message':
$oCriteria->add(\EventPeer::EVN_ACTION, "SEND_MESSAGE");
break;
case 'conditional':
$oCriteria->add(\EventPeer::EVN_ACTION, "EXECUTE_CONDITIONAL_TRIGGER");
break;
case 'multiple':
$oCriteria->add(\EventPeer::EVN_ACTION, "EXECUTE_TRIGGER");
break;
}
$eventsArray = array();
$oDataset = \EventPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oEvent = new \Event();
$aFields = $oEvent->load($aRow['EVN_UID']);
$aRow = array_merge($aRow, $aFields);
$eventsArray[] = array_change_key_case($aRow, CASE_LOWER);
$oDataset->next();
}
if ($evn_uid != '' && empty($eventsArray)) {
throw new \Exception(\G::LoadTranslation("ID_ROW_DOES_NOT_EXIST"));
} elseif ($evn_uid != '' && !empty($eventsArray)) {
return current($eventsArray);
}
return $eventsArray;
}
示例3: getCriteriaDBSList
public function getCriteriaDBSList($sProcessUID)
{
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(DbSourcePeer::DBS_UID);
$oCriteria->addSelectColumn(DbSourcePeer::PRO_UID);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_TYPE);
$oCriteria->addAsColumn("DBS_SERVER", "CASE WHEN " . DbSourcePeer::DBS_TYPE . " = 'oracle' AND " . DbSourcePeer::DBS_CONNECTION_TYPE . " = 'TNS' THEN CONCAT('[', " . DbSourcePeer::DBS_TNS . ", ']') ELSE " . DbSourcePeer::DBS_SERVER . " END");
$oCriteria->addAsColumn("DBS_DATABASE_NAME", "CASE WHEN " . DbSourcePeer::DBS_TYPE . " = 'oracle' AND " . DbSourcePeer::DBS_CONNECTION_TYPE . " = 'TNS' THEN CONCAT('[', " . DbSourcePeer::DBS_TNS . ", ']') ELSE " . DbSourcePeer::DBS_DATABASE_NAME . " END");
$oCriteria->addSelectColumn(DbSourcePeer::DBS_USERNAME);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_PASSWORD);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_PORT);
$oCriteria->addAsColumn('DBS_DESCRIPTION', 'C.CON_VALUE');
$oCriteria->addAlias('C', 'CONTENT');
$aConditions = array();
$aConditions[] = array(DbSourcePeer::DBS_UID, 'C.CON_ID');
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'DBS_DESCRIPTION' . $sDelimiter);
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(DbSourcePeer::PRO_UID, $sProcessUID);
return $oCriteria;
}
示例4: existsTitle
/**
* Verify if exists the title of a Department
*
* @param string $departmentTitle Title
* @param string $departmentUidExclude Unique id of Department to exclude
*
* return bool Return true if exists the title of a Department, false otherwise
*/
public function existsTitle($departmentTitle, $departmentUidExclude = "")
{
try {
$delimiter = \DBAdapter::getStringDelimiter();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\DepartmentPeer::DEP_UID);
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\DepartmentPeer::DEP_UID, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "DEPO_TITLE" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
if ($departmentUidExclude != "") {
$criteria->add(\DepartmentPeer::DEP_UID, $departmentUidExclude, \Criteria::NOT_EQUAL);
}
$criteria->add("CT.CON_VALUE", $departmentTitle, \Criteria::EQUAL);
$rsCriteria = \DepartmentPeer::doSelectRS($criteria);
return $rsCriteria->next() ? true : false;
} catch (\Exception $e) {
throw $e;
}
}
示例5: getCriteriaDBSList
public function getCriteriaDBSList($sProcessUID)
{
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(DbSourcePeer::DBS_UID);
$oCriteria->addSelectColumn(DbSourcePeer::PRO_UID);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_TYPE);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_SERVER);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_DATABASE_NAME);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_USERNAME);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_PASSWORD);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_PORT);
$oCriteria->addAsColumn('DBS_DESCRIPTION', 'C.CON_VALUE');
$oCriteria->addAlias('C', 'CONTENT');
$aConditions = array();
$aConditions[] = array(DbSourcePeer::DBS_UID, 'C.CON_ID');
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'DBS_DESCRIPTION' . $sDelimiter);
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(DbSourcePeer::PRO_UID, $sProcessUID);
return $oCriteria;
}
示例6: getSubprocesss
/**
* Get SubProcess in Process
*
* return object
*/
public function getSubprocesss($pro_uid, $tas_uid)
{
try {
$pro_uid = $this->validateProUid($pro_uid);
$tas_uid = $this->validateTasUid($tas_uid);
$oCriteria = new \Criteria('workflow');
$del = \DBAdapter::getStringDelimiter();
$oCriteria->add(SubProcessPeer::PRO_PARENT, $pro_uid);
$oCriteria->add(SubProcessPeer::TAS_PARENT, $tas_uid);
$oCriteria->addAsColumn('CON_VALUE', 'C1.CON_VALUE', 'CON_TITLE');
$oCriteria->addAlias("C1", 'CONTENT');
$tasTitleConds = array();
$tasTitleConds[] = array(SubProcessPeer::TAS_PARENT, 'C1.CON_ID');
$tasTitleConds[] = array('C1.CON_CATEGORY', $del . 'TAS_TITLE' . $del);
$tasTitleConds[] = array('C1.CON_LANG', $del . SYS_LANG . $del);
$oCriteria->addJoinMC($tasTitleConds, \Criteria::LEFT_JOIN);
$oDataset = SubProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$aRow = array_change_key_case($aRow, CASE_LOWER);
$response['spr_uid'] = $aRow['sp_uid'];
$response['spr_pro_parent'] = $aRow['pro_parent'];
$response['spr_tas_parent'] = $aRow['tas_parent'];
$response['spr_pro'] = $aRow['pro_uid'];
$response['spr_tas'] = $aRow['tas_uid'];
$response['spr_name'] = $aRow['con_value'];
$response['spr_synchronous'] = $aRow['sp_synchronous'];
$response['spr_variables_out'] = unserialize($aRow['sp_variables_out']);
if ((int) $response['spr_synchronous'] === 1) {
$response['spr_variables_in'] = unserialize($aRow['sp_variables_in']);
}
return $response;
} catch (\Exception $e) {
throw $e;
}
}
示例7: getDepartmentsForUser
public function getDepartmentsForUser($userUid)
{
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(UsersPeer::DEP_UID);
$criteria->addAsColumn('DEP_TITLE', 'C.CON_VALUE');
$criteria->addAlias('C', 'CONTENT');
$criteria->addJoin(UsersPeer::DEP_UID, DepartmentPeer::DEP_UID, Criteria::LEFT_JOIN);
$delimiter = DBAdapter::getStringDelimiter();
$conditions = array();
$conditions[] = array(DepartmentPeer::DEP_UID, 'C.CON_ID');
$conditions[] = array('C.CON_CATEGORY', $delimiter . 'DEPO_TITLE' . $delimiter);
$conditions[] = array('C.CON_LANG', $delimiter . SYS_LANG . $delimiter);
$criteria->addJoinMC($conditions, Criteria::LEFT_JOIN);
$criteria->add(UsersPeer::USR_UID, $userUid);
$criteria->add(UsersPeer::DEP_UID, '', Criteria::NOT_EQUAL);
$dataset = DepartmentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$departments = array();
while ($row = $dataset->getRow()) {
if (!isset($departments[$row['DEP_UID']])) {
$departments[$row['DEP_UID']] = $row;
}
$dataset->next();
}
return $departments;
}
示例8: getExtTriggersList
public function getExtTriggersList($start, $limit, $sProcessUID = '')
{
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(TriggersPeer::TRI_UID);
$oCriteria->addSelectColumn(TriggersPeer::PRO_UID);
$oCriteria->add(TriggersPeer::PRO_UID, $sProcessUID);
$this->tmpCriteria = clone $oCriteria;
$oCriteria->addAsColumn('TRI_TITLE', 'C1.CON_VALUE');
$oCriteria->addAsColumn('TRI_DESCRIPTION', 'C2.CON_VALUE');
$oCriteria->addAlias('C1', 'CONTENT');
$oCriteria->addAlias('C2', 'CONTENT');
$aConditions = array();
$aConditions[] = array(TriggersPeer::TRI_UID, 'C1.CON_ID');
$aConditions[] = array('C1.CON_CATEGORY', $sDelimiter . 'TRI_TITLE' . $sDelimiter);
$aConditions[] = array('C1.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$aConditions = array();
$aConditions[] = array(TriggersPeer::TRI_UID, 'C2.CON_ID');
$aConditions[] = array('C2.CON_CATEGORY', $sDelimiter . 'TRI_TITLE' . $sDelimiter);
$aConditions[] = array('C2.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(TriggersPeer::PRO_UID, $sProcessUID);
$oCriteria->addAscendingOrderByColumn('TRI_TITLE');
if ($start != '') {
$oCriteria->setOffset($start);
}
if ($limit != '') {
$oCriteria->setLimit($limit);
}
$oDataset = TriggersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$triggersArray = "";
$triggersArray[] = array('TRI_UID' => 'char', 'PRO_UID' => 'char', 'TRI_TITLE' => 'char', 'TRI_DESCRIPTION' => 'char');
while ($aRow = $oDataset->getRow()) {
if ($aRow['TRI_TITLE'] == null || $aRow['TRI_TITLE'] == "") {
// There is no translation for this Trigger name, try to get/regenerate the label
$triggerO = new Triggers();
$triggerObj = $triggerO->load($aRow['TRI_UID']);
$aRow['TRI_TITLE'] = $triggerObj['TRI_TITLE'];
$aRow['TRI_DESCRIPTION'] = $triggerObj['TRI_DESCRIPTION'];
}
$triggersArray[] = $aRow;
$oDataset->next();
}
return $triggersArray;
}
示例9: addProcessSupervisorInputDocument
/**
* Assign a inputdocument supervisor of a process
*
* @param string $sProcessUID
* @param string $sInputDocumentUID
* @param int $sPuiPosition
* @access public
*/
public function addProcessSupervisorInputDocument($sProcessUID, $sInputDocumentUID, $sPuiPosition)
{
$oTypeInputDocument= \InputDocumentPeer::retrieveByPK($sInputDocumentUID);
if (is_null( $oTypeInputDocument )) {
throw new \Exception(\G::LoadTranslation("ID_DOES NOT_INPUT_DOCUMENT", array($sInputDocumentUID)));
}
$aResp = array();
$sPuUIDT = array();
$sDelimiter = \DBAdapter::getStringDelimiter();
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID);
$oCriteria->addAsColumn('INP_DOC_TITLE', 'C.CON_VALUE');
$oCriteria->addAlias('C', 'CONTENT');
$aConditions = array();
$aConditions[] = array(\StepSupervisorPeer::STEP_UID_OBJ, \InputDocumentPeer::INP_DOC_UID);
$aConditions[] = array(\StepSupervisorPeer::STEP_TYPE_OBJ, $sDelimiter . 'INPUT_DOCUMENT' . $sDelimiter);
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$aConditions = array();
$aConditions[] = array(\InputDocumentPeer::INP_DOC_UID, 'C.CON_ID');
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'INP_DOC_TITLE' . $sDelimiter);
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
$oCriteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $sInputDocumentUID);
$oCriteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, 'INPUT_DOCUMENT');
$oCriteria->addAscendingOrderByColumn(\StepSupervisorPeer::STEP_POSITION);
$oDataset = \StepSupervisorPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$sPuUIDT = $aRow['STEP_UID'];
$oDataset->next();
}
if (sizeof($sPuUIDT) == 0) {
$oStepSupervisor = new \StepSupervisor();
$oStepSupervisor->create(array('PRO_UID' => $sProcessUID,
'STEP_TYPE_OBJ' => "INPUT_DOCUMENT",
'STEP_UID_OBJ' => $sInputDocumentUID,
'STEP_POSITION' => $oStepSupervisor->getNextPosition($sProcessUID, "INPUT_DOCUMENT")));
$sDelimiter = \DBAdapter::getStringDelimiter();
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID);
$oCriteria->addSelectColumn(\StepSupervisorPeer::PRO_UID);
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_TYPE_OBJ);
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID_OBJ);
$oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_POSITION);
$oCriteria->addAsColumn('INP_DOC_TITLE', 'C.CON_VALUE');
$oCriteria->addAlias('C', 'CONTENT');
$aConditions = array();
$aConditions[] = array(\StepSupervisorPeer::STEP_UID_OBJ, \InputDocumentPeer::INP_DOC_UID);
$aConditions[] = array(\StepSupervisorPeer::STEP_TYPE_OBJ, $sDelimiter . 'INPUT_DOCUMENT' . $sDelimiter);
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$aConditions = array();
$aConditions[] = array(\InputDocumentPeer::INP_DOC_UID, 'C.CON_ID');
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'INP_DOC_TITLE' . $sDelimiter);
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
$oCriteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $sInputDocumentUID);
$oCriteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, 'INPUT_DOCUMENT');
$oCriteria->addAscendingOrderByColumn(\StepSupervisorPeer::STEP_POSITION);
$oDataset = \StepSupervisorPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aResp = array('pui_uid' => $aRow['STEP_UID'],
'pui_position' => $aRow['STEP_POSITION'],
'input_doc_uid' => $aRow['STEP_UID_OBJ']);
$oDataset->next();
$aRespPosition = $this->updateProcessSupervisorInputDocument($sProcessUID ,$aRow['STEP_UID'], $sPuiPosition);
$aResp = array_merge(array('input_doc_title' => $aRow['INP_DOC_TITLE']), $aRespPosition);
}
return $aResp;
} else {
throw new \Exception(\G::LoadTranslation("ID_RELATION_EXIST"));
}
}
示例10: getValidateSelfService
public function getValidateSelfService($data)
{
$paused = false;
$data = array_change_key_case($data, CASE_LOWER);
$sTaskUID = $data['act_uid'];
$caseType = isset($data['case_type']) ? $data['case_type'] == 'assigned' ? $data['case_type'] : 'unassigned' : 'unassigned';
$response = new \stdclass();
$oCriteria = new \Criteria();
$arrayCondition = array();
$arrayCondition[] = array(\AppDelegationPeer::APP_UID, \AppDelayPeer::APP_UID);
$arrayCondition[] = array(\AppDelegationPeer::DEL_INDEX, \AppDelayPeer::APP_DEL_INDEX);
$oCriteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$oCriteria->add(\AppDelegationPeer::TAS_UID, $sTaskUID);
$oCriteria->add(\AppDelayPeer::APP_DISABLE_ACTION_USER, "0");
$oResult = \AppDelegationPeer::doSelectOne($oCriteria);
if (!empty($oResult)) {
$paused = true;
}
$response->paused = $paused;
$oCriteria = new \Criteria();
$oCriteria->add(\AppDelegationPeer::DEL_THREAD_STATUS, "OPEN");
$oCriteria->add(\AppDelegationPeer::TAS_UID, $sTaskUID);
if ($caseType == 'unassigned') {
$oCriteria->add(\AppDelegationPeer::USR_UID, "", \Criteria::EQUAL);
}
$oApplication = \AppDelegationPeer::doSelectOne($oCriteria);
$response->result = true;
if (!empty($oApplication) || $paused) {
$response->result = false;
$response->message = G::LoadTranslation('ID_CURRENT_ASSING_TYPE_WITH_CASES');
}
return $response;
}
示例11: getOwnersByType
public function getOwnersByType($data)
{
$this->setResponseType('json');
$result = new stdclass();
$result->status = 'OK';
try {
switch ($data->type) {
case 'EVERYBODY':
$result->total = 0;
$result->owners = array();
break;
case 'USER':
require_once 'classes/model/Users.php';
$users = array();
$usersInstance = new Users();
$allUsers = $usersInstance->getAll();
foreach ($allUsers->data as $user) {
$users[] = array('OWNER_UID' => $user['USR_UID'], 'OWNER_NAME' => $user['USR_FIRSTNAME'] . ' ' . $user['USR_LASTNAME']);
}
usort($users, function ($str1, $str2) {
return strcmp(strtolower($str1["OWNER_NAME"]), strtolower($str2["OWNER_NAME"]));
});
$result->total = $allUsers->totalCount;
$result->owners = $users;
break;
case 'DEPARTMENT':
require_once 'classes/model/Department.php';
require_once 'classes/model/Content.php';
$departments = array();
//SELECT
$criteria = new Criteria('workflow');
$criteria->setDistinct();
$criteria->addSelectColumn(DepartmentPeer::DEP_UID);
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
//FROM
$conditions = array();
$conditions[] = array(DepartmentPeer::DEP_UID, ContentPeer::CON_ID);
$conditions[] = array(ContentPeer::CON_CATEGORY, DBAdapter::getStringDelimiter() . 'DEPO_TITLE' . DBAdapter::getStringDelimiter());
$conditions[] = array(ContentPeer::CON_LANG, DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter());
$criteria->addJoinMC($conditions, Criteria::LEFT_JOIN);
//WHERE
$criteria->add(DepartmentPeer::DEP_STATUS, 'ACTIVE');
//ORDER BY
$criteria->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
$dataset = DepartmentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
while ($row = $dataset->getRow()) {
$departments[] = array('OWNER_UID' => $row['DEP_UID'], 'OWNER_NAME' => $row['CON_VALUE']);
$dataset->next();
}
$result->total = DepartmentPeer::doCount($criteria);
$result->owners = $departments;
break;
case 'GROUP':
require_once 'classes/model/Groupwf.php';
require_once 'classes/model/Content.php';
$groups = array();
//SELECT
$criteria = new Criteria('workflow');
$criteria->setDistinct();
$criteria->addSelectColumn(GroupwfPeer::GRP_UID);
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
//FROM
$conditions = array();
$conditions[] = array(GroupwfPeer::GRP_UID, ContentPeer::CON_ID);
$conditions[] = array(ContentPeer::CON_CATEGORY, DBAdapter::getStringDelimiter() . 'GRP_TITLE' . DBAdapter::getStringDelimiter());
$conditions[] = array(ContentPeer::CON_LANG, DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter());
$criteria->addJoinMC($conditions, Criteria::LEFT_JOIN);
//WHERE
$criteria->add(GroupwfPeer::GRP_STATUS, 'ACTIVE');
//ORDER BY
$criteria->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
$dataset = GroupwfPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
while ($row = $dataset->getRow()) {
$groups[] = array('OWNER_UID' => $row['GRP_UID'], 'OWNER_NAME' => $row['CON_VALUE']);
$dataset->next();
}
$result->total = GroupwfPeer::doCount($criteria);
$result->owners = $groups;
break;
}
} catch (Exception $error) {
$result->status = 'ERROR';
$result->message = $error->getMessage();
}
return $result;
}
示例12: Criteria
/**
* This function looks for an special case it has a condition
*
*
* @name generatedReport2_filter
*
* @param string $from
* @param string $to
* @param string $startedby
* @return object
*/
function generatedReport2_filter($from, $to, $startedby)
{
$this->reportsPatch();
require_once 'classes/model/AppDelegation.php';
require_once 'classes/model/Application.php';
require_once 'classes/model/Users.php';
$oCriteria = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$oCriteria->addSelectColumn(AppDelegationPeer::PRO_UID);
$oCriteria->addAsColumn("MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")");
$oCriteria->addAsColumn("MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")");
$oCriteria->addAsColumn('PRO_TITLE', 'C1.CON_VALUE');
$oCriteria->addAlias("C1", 'CONTENT');
$proTitleConds = array();
$proTitleConds[] = array(AppDelegationPeer::PRO_UID, 'C1.CON_ID');
$proTitleConds[] = array('C1.CON_CATEGORY', $del . 'PRO_TITLE' . $del);
$proTitleConds[] = array('C1.CON_LANG', $del . SYS_LANG . $del);
$oCriteria->addJoinMC($proTitleConds, Criteria::LEFT_JOIN);
$oCriteria->addGroupByColumn(AppDelegationPeer::PRO_UID);
$oCriteria->addGroupByColumn('C1.CON_VALUE');
$oCriteria->add($oCriteria->getNewCriterion(AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL)->addAnd($oCriteria->getNewCriterion(AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL)));
if ($startedby != '') {
$oCriteria->add(AppDelegationPeer::USR_UID, $startedby);
}
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$month = date('Y-m-d', mktime(0, 0, 0, date("m") - 1, date("d"), date("Y")));
$lastmonth = date('Y-m-d', mktime(0, 0, 0, date("m") - 2, date("d"), date("Y")));
$day = mktime(0, 0, 0, date("m"), date("d") - 1, date("Y"));
$lastday = mktime(0, 0, 0, date("m"), date("d") - 2, date("Y"));
$aProcess[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'CASELASTMONTH' => 'integer', 'CASELASTDAY' => 'integer');
while ($aRow = $oDataset->getRow()) {
$oCriteria2 = new Criteria('workflow');
$oCriteria2->addSelectColumn(ApplicationPeer::PRO_UID);
$oCriteria2->addAsColumn("CANTCASES", "COUNT(*)");
$oCriteria2->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
if ($startedby != '') {
$oCriteria2->add(ApplicationPeer::APP_INIT_USER, $startedby);
}
$oCriteria2->addGroupByColumn(ApplicationPeer::PRO_UID);
$oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2);
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset2->next();
$aRow2 = $oDataset2->getRow();
$cant = $aRow2['CANTCASES'];
$oCriteria2 = new Criteria('workflow');
$oCriteria2->addSelectColumn(ApplicationPeer::PRO_UID);
$oCriteria2->addAsColumn("CANTCASES", "COUNT(*)");
$oCriteria2->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $lastmonth, Criteria::GREATER_EQUAL);
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $month, Criteria::LESS_EQUAL);
if ($startedby != '') {
$oCriteria2->add(ApplicationPeer::APP_INIT_USER, $startedby);
}
$oCriteria2->addGroupByColumn(ApplicationPeer::PRO_UID);
$oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2);
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset2->next();
$aRow2 = $oDataset2->getRow();
$cant1 = $aRow2['CANTCASES'];
$oCriteria2 = new Criteria('workflow');
$oCriteria2->addSelectColumn(ApplicationPeer::PRO_UID);
$oCriteria2->addAsColumn("CANTCASES", "COUNT(*)");
$oCriteria2->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $lastday, Criteria::GREATER_EQUAL);
$oCriteria2->add(ApplicationPeer::APP_INIT_DATE, $day, Criteria::LESS_EQUAL);
if ($startedby != '') {
$oCriteria2->add(ApplicationPeer::APP_INIT_USER, $startedby);
}
$oCriteria2->addGroupByColumn(ApplicationPeer::PRO_UID);
$oDataset2 = AppDelegationPeer::doSelectRS($oCriteria2);
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset2->next();
$aRow2 = $oDataset2->getRow();
$cant2 = $aRow2['CANTCASES'];
/*$aProcess[] = array('PRO_UID' => $aRow['PRO_UID'],
'PRO_TITLE' => $aRow['PRO_TITLE'],
'CANTCASES' => $cant,
'CASELASTMONTH' => $cant1,
'CASELASTDAY' => $cant2
);*/
$aProcess[] = array('PRO_UID' => $aRow['PRO_UID'], 'PRO_TITLE' => $aRow['PRO_TITLE'], 'CANTCASES' => $cant, 'MIN' => number_format($aRow['MIN'], 2), 'MAX' => number_format($aRow['MAX'], 2), 'CASELASTMONTH' => number_format($cant1, 2), 'CASELASTDAY' => number_format($cant2, 2));
$oDataset->next();
}
global $_DBArray;
$_DBArray['reports'] = $aProcess;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
//.........这里部分代码省略.........
示例13: calculateExecutionDateMultiple
function calculateExecutionDateMultiple()
{
try {
$rowsCreated = 0;
$rowsRejected = 0;
G::LoadClass('dates');
$oDates = new dates();
// SELECT TASK2.* ,
// EVENT.EVN_UID, EVENT.PRO_UID, EVENT.EVN_TAS_UID_FROM,
// EVENT.EVN_TAS_ESTIMATED_DURATION, EVENT.EVN_WHEN,
// EVENT.EVN_WHEN_OCCURS, EVENT.EVN_RELATED_TO, APP_DELEGATION.APP_UID, APP_DELEGATION.DEL_INDEX, APP_DELEGATION.TAS_UID,
// APP_DELEGATION.DEL_DELEGATE_DATE, APP_DELEGATION.DEL_INIT_DATE, APP_DELEGATION.DEL_TASK_DUE_DATE,
// APP_DELEGATION.DEL_FINISH_DATE
// FROM
// APP_DELEGATION
// LEFT JOIN EVENT ON (APP_DELEGATION.TAS_UID=EVENT.EVN_TAS_UID_FROM)
// LEFT JOIN APP_EVENT ON (APP_DELEGATION.APP_UID=APP_EVENT.APP_UID AND APP_DELEGATION.DEL_INDEX=APP_EVENT.DEL_INDEX)
// LEFT JOIN APP_DELEGATION AS TASK2 ON (TASK2.TAS_UID = EVENT.EVN_TAS_UID_TO AND TASK2.APP_UID = APP_DELEGATION.APP_UID )
//
// WHERE
// APP_EVENT.APP_UID IS NULL
// AND EVENT.EVN_STATUS='ACTIVE'
// AND EVENT.EVN_RELATED_TO='MULTIPLE'
// AND TASK2.DEL_FINISH_DATE IS NULL
//get info about the Event and the APP_DELEGATION to process
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(EventPeer::EVN_UID);
$oCriteria->addSelectColumn(EventPeer::PRO_UID);
$oCriteria->addSelectColumn(EventPeer::EVN_TAS_UID_FROM);
$oCriteria->addSelectColumn(EventPeer::EVN_TAS_ESTIMATED_DURATION);
$oCriteria->addSelectColumn(EventPeer::EVN_WHEN);
$oCriteria->addSelectColumn(EventPeer::EVN_WHEN_OCCURS);
$oCriteria->addSelectColumn(EventPeer::EVN_RELATED_TO);
$oCriteria->addSelectColumn(AppDelegationPeer::APP_UID);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
$oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
$aConditions = array();
$aConditions[] = array(AppDelegationPeer::TAS_UID, EventPeer::EVN_TAS_UID_FROM);
//$aConditions[] = array(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::IS_NULL );
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$aConditions = array();
$aConditions[] = array(AppDelegationPeer::APP_UID, AppEventPeer::APP_UID);
$aConditions[] = array(AppDelegationPeer::DEL_INDEX, AppEventPeer::DEL_INDEX);
$aConditions[] = array(EventPeer::EVN_UID, AppEventPeer::EVN_UID);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->addAlias('DEL2', 'APP_DELEGATION');
$aConditions = array();
$aConditions[] = array(AppDelegationPeer::APP_UID, 'DEL2.APP_UID');
$aConditions[] = array(EventPeer::EVN_TAS_UID_TO, 'DEL2.TAS_UID');
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(AppEventPeer::APP_UID, null, Criteria::ISNULL);
$oCriteria->add(EventPeer::EVN_STATUS, 'ACTIVE');
$oCriteria->add(EventPeer::EVN_RELATED_TO, 'MULTIPLE');
$oCriteria->add('DEL2.DEL_FINISH_DATE', null, Criteria::ISNULL);
// $oCriteria->add(AppDelegationPeer::DEL_DELEGATE_DATE, date('Y-m-d') , Criteria::GREATER_THAN );
$oDataset = EventPeer::doSelectRs($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aData = $oDataset->getRow()) {
$estimatedDuration = (double) $aData['EVN_TAS_ESTIMATED_DURATION'];
$when = (double) $aData['EVN_WHEN'];
$whenOccurs = $aData['EVN_WHEN_OCCURS'];
if ($whenOccurs == 'AFTER_TIME') {
//for multiple $sDueDate = date('Y-m-d H:i:s', $oDates->calculateDate($aData['DEL_DELEGATE_DATE'], $estimatedDuration, 'days', 1));
$sDueDate = $aData['DEL_TASK_DUE_DATE'];
$calculatedDueDateA = $oDates->calculateDate($sDueDate, $when, 'days', 1);
$sActionDate = date('Y-m-d H:i:s', $calculatedDueDateA['DUE_DATE_SECONDS']);
$validStartDate = $sActionDate >= $aData['DEL_DELEGATE_DATE'];
} else {
$sDueDate = $aData['DEL_DELEGATE_DATE'];
$calculatedDueDateA = $oDates->calculateDate($sDueDate, $when, 'days', 1);
$sActionDate = date('Y-m-d H:i:s', $calculatedDueDateA['DUE_DATE_SECONDS']);
$validStartDate = $sActionDate >= $aData['DEL_DELEGATE_DATE'];
}
$aData['APP_EVN_ACTION_DATE'] = $sActionDate;
if ($validStartDate) {
$rowsCreated++;
$oAppEvent = new AppEvent();
$oAppEvent->create($aData);
} else {
$rowsRejected++;
$aData['APP_EVN_STATUS'] = 'INVALID';
$oAppEvent = new AppEvent();
$oAppEvent->create($aData);
}
$oDataset->next();
}
return "Created {$rowsCreated} MULTIPLE rows in APP_EVENT and rejected {$rowsRejected} rows ";
} catch (Exception $oError) {
throw new Exception($oError->getMessage());
}
}
示例14: Publisher
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'tracker/tracker_StageTasks', $oCriteria, array('PRO_UID' => $oData->pro_uid, 'STG_UID' => $oData->stg_uid));
G::RenderPage('publish', 'raw');
break;
case 'availableTasksForTheStage':
require_once 'classes/model/Process.php';
require_once 'classes/model/Task.php';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(TaskPeer::TAS_UID);
$oCriteria->addAsColumn('TAS_TITLE', ContentPeer::CON_VALUE);
$aConditions = array();
$aConditions[] = array(0 => TaskPeer::TAS_UID, 1 => ContentPeer::CON_ID);
$aConditions[] = array(0 => ContentPeer::CON_CATEGORY, 1 => DBAdapter::getStringDelimiter() . 'TAS_TITLE' . DBAdapter::getStringDelimiter());
$aConditions[] = array(0 => ContentPeer::CON_LANG, 1 => DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter());
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(TaskPeer::PRO_UID, $_POST['PRO_UID']);
$oCriteria->add(TaskPeer::STG_UID, '');
$oCriteria->addAscendingOrderByColumn('TAS_TITLE');
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'tracker/tracker_AvailableStageTasks', $oCriteria, array('STG_UID' => $_POST['STG_UID']));
G::RenderPage('publish', 'raw');
break;
case 'assignTaskToStage':
require_once 'classes/model/Task.php';
$oCriteria1 = new Criteria('workflow');
$oCriteria1->add(TaskPeer::TAS_UID, $_POST['TAS_UID']);
$oCriteria2 = new Criteria('workflow');
$oCriteria2->add(TaskPeer::STG_UID, $_POST['STG_UID']);
BasePeer::doUpdate($oCriteria1, $oCriteria2, Propel::getConnection('workflow'));
示例15: getSelfServiceCasesByEvaluate
public function getSelfServiceCasesByEvaluate($userUid)
{
try {
G::LoadClass("groups");
$arrayAppAssignSelfServiceValueData = array();
//Get APP_UIDs
$group = new Groups();
$arrayUid = $group->getActiveGroupsForAnUser($userUid); //Set UIDs of Groups (Groups of User)
$arrayUid[] = $userUid; //Set UID of User
$criteria = new Criteria("workflow");
$criteria->setDistinct();
$criteria->addSelectColumn(AppAssignSelfServiceValuePeer::APP_UID);
$criteria->addSelectColumn(AppAssignSelfServiceValuePeer::DEL_INDEX);
$criteria->addSelectColumn(AppAssignSelfServiceValuePeer::TAS_UID);
$arrayCondition = array();
$arrayCondition[] = array(AppAssignSelfServiceValuePeer::APP_UID, AppDelegationPeer::APP_UID, Criteria::EQUAL);
$arrayCondition[] = array(AppAssignSelfServiceValuePeer::DEL_INDEX, AppDelegationPeer::DEL_INDEX, Criteria::EQUAL);
$arrayCondition[] = array(AppAssignSelfServiceValuePeer::TAS_UID, AppDelegationPeer::TAS_UID, Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
$criteria->add(AppDelegationPeer::USR_UID, "", Criteria::EQUAL);
$criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, "OPEN", Criteria::EQUAL);
$criterionAux = null;
foreach ($arrayUid as $value) {
if (is_null($criterionAux)) {
$criterionAux = $criteria->getNewCriterion(AppAssignSelfServiceValuePeer::GRP_UID, "%$value%", Criteria::LIKE);
} else {
$criterionAux = $criteria->getNewCriterion(AppAssignSelfServiceValuePeer::GRP_UID, "%$value%", Criteria::LIKE)->addOr($criterionAux);
}
}
$criteria->add($criterionAux);
$rsCriteria = AppAssignSelfServiceValuePeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$arrayAppAssignSelfServiceValueData[] = array(
"APP_UID" => $row["APP_UID"],
"DEL_INDEX" => $row["DEL_INDEX"],
//.........这里部分代码省略.........