本文整理汇总了PHP中Propel::getDbConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP Propel::getDbConnection方法的具体用法?PHP Propel::getDbConnection怎么用?PHP Propel::getDbConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel
的用法示例。
在下文中一共展示了Propel::getDbConnection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStatusArray
function getStatusArray($action, $userUid)
{
global $oAppCache;
$status = array();
$status[] = array('', G::LoadTranslation('ID_ALL_STATUS'));
//get the list based in the action provided
switch ($action) {
case 'sent':
$cStatus = $oAppCache->getSentListProcessCriteria($userUid);
// a little slow
break;
case 'simple_search':
case 'search':
$cStatus = new Criteria('workflow');
$cStatus->clearSelectColumns();
$cStatus->setDistinct();
$cStatus->addSelectColumn(ApplicationPeer::APP_STATUS);
$oDataset = ApplicationPeer::doSelectRS($cStatus);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$status[] = array($aRow['APP_STATUS'], G::LoadTranslation('ID_CASES_STATUS_' . $aRow['APP_STATUS']));
//here we can have a translation for the status ( the second param)
$oDataset->next();
}
return $status;
break;
case 'selfservice':
$cStatus = $oAppCache->getUnassignedListCriteria($userUid);
break;
case 'paused':
$cStatus = $oAppCache->getPausedListCriteria($userUid);
break;
case 'to_revise':
$cStatus = $oAppCache->getToReviseListCriteria($userUid);
// $cStatus = $oAppCache->getPausedListCriteria($userUid);
break;
case 'to_reassign':
$cStatus = $oAppCache->getToReassignListCriteria($userUid);
break;
case 'todo':
case 'draft':
case 'gral':
// case 'to_revise' :
// case 'to_revise' :
default:
return $status;
break;
}
//get the status for this user in this action only for participated, unassigned, paused
// if ( $action != 'todo' && $action != 'draft' && $action != 'to_revise') {
if ($action != 'todo' && $action != 'draft') {
//$cStatus = new Criteria('workflow');
$cStatus->clearSelectColumns();
$cStatus->setDistinct();
$cStatus->addSelectColumn(AppCacheViewPeer::APP_STATUS);
$oDataset = AppCacheViewPeer::doSelectRS($cStatus, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$status[] = array($aRow['APP_STATUS'], G::LoadTranslation('ID_CASES_STATUS_' . $aRow['APP_STATUS']));
//here we can have a translation for the status ( the second param)
$oDataset->next();
}
}
return $status;
}
示例2: verifySession
/**
* This function checks the user session
*
*
* @name verifySession
*
* @param string sSessionId
* @return array
*/
public function verifySession($sSessionId = NULL)
{
try {
if ($sSessionId != NULL) {
$this->sessionId = $sSessionId;
} else {
if ($this->sessionId == NULL) {
throw new Exception('session id was not set.');
}
}
$date = date('Y-m-d H:i:s');
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(SessionPeer::USR_UID);
$oCriteria->addSelectColumn(SessionPeer::SES_STATUS);
$oCriteria->addSelectColumn(SessionPeer::SES_DUE_DATE);
$oCriteria->add(SessionPeer::SES_UID, $this->sessionId);
$oCriteria->add(SessionPeer::SES_STATUS, 'ACTIVE');
$oCriteria->add(SessionPeer::SES_DUE_DATE, $date, Criteria::GREATER_EQUAL);
$oDataset = SessionPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
if (!is_array($aRow)) {
$this->deleteTmpfile();
}
return $aRow;
} catch (Exception $oError) {
throw $oError;
}
}
示例3: strtolower
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$oCriteria->addAsColumn('USR_COMPLETENAME', $oDataBase->concatString("USR_LASTNAME", "' '", "USR_FIRSTNAME"));
//$oCriteria->addAsColumn('USR_PHOTO', $oDataBase->concatString("'".PATH_IMAGES_ENVIRONMENT_USERS."'", "USR_UID","'.gif'"));
}
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
$oCriteria->addSelectColumn(UsersPeer::USR_ROLE);
$oCriteria->addSelectColumn(UsersPeer::USR_DUE_DATE);
//$oCriteria->addAsColumn('USR_VIEW', $sDelimiter . G::LoadTranslation('ID_DETAIL') . $sDelimiter);
//$oCriteria->addAsColumn('USR_EDIT', $sDelimiter . G::LoadTranslation('ID_EDIT') . $sDelimiter);
//$oCriteria->addAsColumn('USR_DELETE', $sDelimiter . G::LoadTranslation('ID_DELETE') . $sDelimiter);
//$oCriteria->addAsColumn('USR_AUTH', $sDelimiter . G::LoadTranslation('ID_AUTHENTICATION') . $sDelimiter);
//$oCriteria->addAsColumn('USR_REASSIGN', $sDelimiter . G::LoadTranslation('ID_REASSIGN_CASES') . $sDelimiter);
$oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN);
if ($filter != '') {
$cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE)));
$oCriteria->add($cc);
//echo $oCriteria->toString();
}
$rs = UsersPeer::DoSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rows = array();
while ($rs->next()) {
$rows[] = $rs->getRow();
// if (!file_exists($aux['USR_PHOTO'])) $aux['USR_PHOTO'] = 'public_html/images/user.gif';
// $rows[] = $aux;
}
echo '{users: ' . G::json_encode($rows) . '}';
示例4: getInputDocumentsCriteria
public function getInputDocumentsCriteria($sProcessUID = '')
{
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(InputDocumentPeer::INP_DOC_UID);
$oCriteria->addSelectColumn(InputDocumentPeer::PRO_UID);
$oCriteria->addAsColumn('INP_DOC_TITLE', 'C1.CON_VALUE');
$oCriteria->addAsColumn('INP_DOC_DESCRIPTION', 'C2.CON_VALUE');
$oCriteria->addAlias('C1', 'CONTENT');
$oCriteria->addAlias('C2', 'CONTENT');
$aConditions = array();
$aConditions[] = array(InputDocumentPeer::INP_DOC_UID, 'C1.CON_ID' );
$aConditions[] = array('C1.CON_CATEGORY', $sDelimiter . 'INP_DOC_TITLE' . $sDelimiter );
$aConditions[] = array('C1.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter );
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$aConditions = array();
$aConditions[] = array(InputDocumentPeer::INP_DOC_UID, 'C2.CON_ID' );
$aConditions[] = array('C2.CON_CATEGORY', $sDelimiter . 'INP_DOC_DESCRIPTION' . $sDelimiter );
$aConditions[] = array('C2.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter );
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(InputDocumentPeer::PRO_UID, $sProcessUID);
$oDataset = InputDocumentPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$inputDocArray = "";
$inputDocArray[] = array('INP_DOC_UID' => 'char', 'PRO_UID' => 'char', 'INP_DOC_TITLE' => 'char', 'INP_DOC_DESCRIPTION' => 'char' );
while ($aRow = $oDataset->getRow()) {
if (($aRow['INP_DOC_TITLE'] == null) || ($aRow['INP_DOC_TITLE'] == "")) {
// There is no transaltion for this Document name, try to get/regenerate the label
$inputDocument = new InputDocument();
$inputDocumentObj = $inputDocument->load($aRow['INP_DOC_UID']);
$aRow['INP_DOC_TITLE'] = $inputDocumentObj['INP_DOC_TITLE'];
$aRow['INP_DOC_DESCRIPTION'] = $inputDocumentObj['INP_DOC_DESCRIPTION'];
}
$inputDocArray[] = $aRow;
$oDataset->next();
}
global $_DBArray;
$_DBArray = (isset($_SESSION['_DBArray']) ? $_SESSION['_DBArray'] : '');
$_DBArray['inputDocArrayMain'] = $inputDocArray;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('inputDocArrayMain');
return $oCriteria;
}
示例5: Criteria
$html .= '<label for="prefix_label">' . $filter->xssFilterHard(G::LoadTranslation('ID_PREFIX')) . '</label>';
$html .= '</td>';
$html .= '<td width="25%">';
$html .= '<label for="variables_label">' . $filter->xssFilterHard(G::LoadTranslation('ID_SEARCH')) . '</label>';
$html .= '</td>';
$html .= '</tr>';
$html .= '<tr>';
$html .= '<td width="25%">';
$html .= '<select name="type_variables" id="type_variables">';
$html .= '<option value="all">' . $filter->xssFilterHard(G::LoadTranslation('ID_TINY_ALL_VARIABLES')) . '</option>';
$html .= '<option value="system">' . $filter->xssFilterHard(G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES')) . '</option>';
$html .= '<option value="process">' . $filter->xssFilterHard(G::LoadTranslation('ID_TINY_PROCESS_VARIABLES')) . '</option>';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(BpmnProjectPeer::PRJ_UID);
$oCriteria->add(BpmnProjectPeer::PRJ_UID, $_REQUEST['sProcess']);
$oDataset = ProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$row = $oDataset->getRow();
$isBpmn = false;
if (isset($row["PRJ_UID"])) {
$isBpmn = true;
$html .= '<option value="grid">' . $filter->xssFilterHard(G::LoadTranslation('ID_TINY_GRID_VARIABLES')) . '</option>';
}
$html .= '</select> ';
$html .= '</td>';
$html .= '<td width="25%">';
$html .= '<select name="prefix" id="prefix">';
if ($isBpmn) {
$html .= '<option value="ID_TO_STRING">@@</option>';
$html .= '<option value="ID_TO_FLOAT">@#</option>';
示例6: get_ajax_value
//$value= $_POST['functions'];
$value = get_ajax_value('functions');
}
switch ($value) {
case 'verifyUsername':
//print_r($_POST); die;
$_POST['sOriginalUsername'] = get_ajax_value('sOriginalUsername');
$_POST['sUsername'] = get_ajax_value('sUsername');
if ($_POST['sOriginalUsername'] == $_POST['sUsername']) {
echo '0';
} else {
require_once 'classes/model/Users.php';
G::LoadClass('Users');
$oUser = new Users();
$oCriteria = $oUser->loadByUsername($_POST['sUsername']);
$oDataset = UsersPeer::doSelectRs($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
//print_r($aRow); die;
//if (!$aRow)
if (!is_array($aRow)) {
echo '0';
} else {
echo '1';
}
}
break;
case 'availableUsers':
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
示例7: checkAutomaticRegister
/**
* verification the register automatic
*
*
* @access public
* @param string $strUser the system
* @param string $strPass the password
* @return $res
*/
public function checkAutomaticRegister($strUser, $strPass)
{
$result = -1;
//default return value,
foreach ($this->aRbacPlugins as $sClassName) {
$plugin = new $sClassName();
if (method_exists($plugin, 'automaticRegister')) {
$oCriteria = new Criteria('rbac');
$oCriteria->add(AuthenticationSourcePeer::AUTH_SOURCE_PROVIDER, $sClassName);
$oCriteria->addAscendingOrderByColumn(AuthenticationSourcePeer::AUTH_SOURCE_NAME);
$oDataset = AuthenticationSourcePeer::doSelectRS($oCriteria, Propel::getDbConnection('rbac_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
while (is_array($aRow)) {
$aRow = array_merge($aRow, unserialize($aRow['AUTH_SOURCE_DATA']));
//Check if this authsource is enabled for AutoRegister, if not skip this
if ($aRow['AUTH_SOURCE_AUTO_REGISTER'] == 1) {
$plugin->sAuthSource = $aRow['AUTH_SOURCE_UID'];
$plugin->sSystem = $this->sSystem;
//search the usersRolesObj
//create the users in ProcessMaker
$res = $plugin->automaticRegister($aRow, $strUser, $strPass);
if ($res == 1) {
return $res;
}
}
$oDataset->next();
$aRow = $oDataset->getRow();
}
}
}
}
示例8: loadList
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
{
$resp = array();
$criteria = new Criteria();
$criteria->addSelectColumn(ListPausedPeer::APP_UID);
$criteria->addSelectColumn(ListPausedPeer::USR_UID);
$criteria->addSelectColumn(ListPausedPeer::TAS_UID);
$criteria->addSelectColumn(ListPausedPeer::PRO_UID);
$criteria->addSelectColumn(ListPausedPeer::APP_NUMBER);
$criteria->addSelectColumn(ListPausedPeer::APP_TITLE);
$criteria->addSelectColumn(ListPausedPeer::APP_PRO_TITLE);
$criteria->addSelectColumn(ListPausedPeer::APP_TAS_TITLE);
$criteria->addSelectColumn(ListPausedPeer::APP_PAUSED_DATE);
$criteria->addSelectColumn(ListPausedPeer::APP_RESTART_DATE);
$criteria->addSelectColumn(ListPausedPeer::DEL_INDEX);
$criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_UID);
$criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_USERNAME);
$criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_FIRSTNAME);
$criteria->addSelectColumn(ListPausedPeer::DEL_PREVIOUS_USR_LASTNAME);
$criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_FIRSTNAME);
$criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_LASTNAME);
$criteria->addSelectColumn(ListPausedPeer::DEL_CURRENT_USR_USERNAME);
$criteria->addSelectColumn(ListPausedPeer::DEL_DELEGATE_DATE);
$criteria->addSelectColumn(ListPausedPeer::DEL_INIT_DATE);
$criteria->addSelectColumn(ListPausedPeer::DEL_DUE_DATE);
$criteria->addSelectColumn(ListPausedPeer::DEL_PRIORITY);
$criteria->add( ListPausedPeer::USR_UID, $usr_uid, Criteria::EQUAL );
self::loadFilters($criteria, $filters);
$sort = (!empty($filters['sort'])) ? $filters['sort'] : "APP_PAUSED_DATE";
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
$start = isset($filters['start']) ? $filters['start'] : "0";
$limit = isset($filters['limit']) ? $filters['limit'] : "25";
$paged = isset($filters['paged']) ? $filters['paged'] : 1;
if ($dir == "DESC") {
$criteria->addDescendingOrderByColumn($sort);
} else {
$criteria->addAscendingOrderByColumn($sort);
}
if ($paged == 1) {
$criteria->setLimit( $limit );
$criteria->setOffset( $start );
}
$dataset = ListPausedPeer::doSelectRS($criteria, Propel::getDbConnection('workflow_ro') );
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$data = array();
while ($dataset->next()) {
$aRow = (is_null($callbackRecord))? $dataset->getRow() : $callbackRecord($dataset->getRow());
$data[] = $aRow;
}
return $data;
}
示例9: while
break;
}
//get the processes for this user in this action
$cProcess->clearSelectColumns();
$cProcess->addSelectColumn(AppCacheViewPeer::PRO_UID);
$cProcess->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE);
$cProcess->setDistinct(AppCacheViewPeer::PRO_UID);
if ($categoryUid) {
require_once 'classes/model/Process.php';
$cProcess->addAlias('CP', 'PROCESS');
$cProcess->add('CP.PRO_CATEGORY', $categoryUid, Criteria::EQUAL);
$cProcess->addJoin(AppCacheViewPeer::PRO_UID, 'CP.PRO_UID', Criteria::LEFT_JOIN);
$cProcess->addAsColumn('CATEGORY_UID', 'CP.PRO_CATEGORY');
}
$cProcess->addAscendingOrderByColumn(AppCacheViewPeer::APP_PRO_TITLE);
$oDataset = AppCacheViewPeer::doSelectRS($cProcess, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$processes[] = array($aRow['PRO_UID'], $aRow['APP_PRO_TITLE']);
$oDataset->next();
}
return print G::json_encode($processes);
}
if ($actionAjax == "getUsersToReassign") {
$_SESSION['TASK'] = $_REQUEST['TAS_UID'];
$case = new Cases();
G::LoadClass('tasks');
$task = new Task();
$tasks = $task->load($_SESSION['TASK']);
$result = new stdclass();
示例10: getAll
//.........这里部分代码省略.........
$oCriteria->add(FieldsPeer::ADD_TAB_UID, $additionalTableUid);
$oCriteria->add(FieldsPeer::FLD_NAME, $sortTable[1]);
$oCriteria->addAscendingOrderByColumn(FieldsPeer::FLD_INDEX);
$oDataset = FieldsPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$row = $oDataset->getRow();
if (is_array($row)) {
$sort = $tableNameAux . "." . $sortTable[1];
}
}
if ($sort == "") {
$sort = $sortBk;
}
if (!in_array($sort, $Criteria->getSelectColumns())) {
$sort = AppCacheViewPeer::APP_NUMBER; //DEFAULT VALUE
}
if ($dir == "DESC") {
$Criteria->addDescendingOrderByColumn($sort);
} else {
$Criteria->addAscendingOrderByColumn($sort);
}
}
//limit the results according the interface
$Criteria->setLimit( $limit );
$Criteria->setOffset( $start );
//execute the query
$oDataset = AppCacheViewPeer::doSelectRS( $Criteria, Propel::getDbConnection('workflow_ro') );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$result = array ();
$result['totalCount'] = $totalCount;
$rows = array ();
$aPriorities = array ('1' => 'VL','2' => 'L','3' => 'N','4' => 'H','5' => 'VH');
$index = $start;
while ($oDataset->next()) {
$aRow = $oDataset->getRow();
//$aRow = $oAppCache->replaceRowUserData($aRow);
/*
* For participated cases, we want the last step in the case, not only the last step this user participated. To do that we get every case information again for the last step. (This could be solved by a subquery, but Propel might not support it and subqueries can be slower for larger
* datasets).
*/
/*if ($action == 'sent' || $action == 'search') {
$maxCriteria = new Criteria('workflow');
$maxCriteria->add(AppCacheViewPeer::APP_UID, $aRow['APP_UID'], Criteria::EQUAL);
$maxCriteria->addDescendingOrderByColumn(AppCacheViewPeer::DEL_INDEX);
$maxCriteria->setLimit(1);
$maxDataset = AppCacheViewPeer::doSelectRS( $maxCriteria );
$maxDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$maxDataset->next();
$newData = $maxDataset->getRow();
foreach ($aRow as $col => $value) {
if (array_key_exists($col, $newData))
$aRow[$col] = $newData[$col];
示例11: getTriggerWebBotProcess
public function getTriggerWebBotProcess ($proUid, $action)
{
require_once ("classes/model/Triggers.php");
if ((! isset( $proUid ) && $proUid == '') || (! isset( $action ) && $action == '')) {
return false;
}
$action = G::toUpper( $action );
$webBotTrigger = '';
switch ($action) {
case 'DELETED':
$var = ProcessPeer::PRO_TRI_DELETED;
break;
case 'CANCELED':
$var = ProcessPeer::PRO_TRI_CANCELED;
break;
case 'PAUSED':
$var = ProcessPeer::PRO_TRI_PAUSED;
break;
case 'REASSIGNED':
$var = ProcessPeer::PRO_TRI_REASSIGNED;
break;
case "UNPAUSE":
$var = ProcessPeer::PRO_TRI_UNPAUSED;
break;
}
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( $var );
$oCriteria->addSelectColumn( TriggersPeer::TRI_WEBBOT );
$oCriteria->addJoin( $var, TriggersPeer::TRI_UID, Criteria::LEFT_JOIN );
$oCriteria->add( ProcessPeer::PRO_UID, $proUid );
$oDataSet = ProcessPeer::doSelectRS( $oCriteria, Propel::getDbConnection('workflow_ro') );
$oDataSet->setFetchmode( ResultSet::FETCHMODE_ASSOC );
if ($oDataSet->next()) {
$row = $oDataSet->getRow();
$webBotTrigger = $row['TRI_WEBBOT'];
}
return $webBotTrigger;
}
示例12: 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 )) {
//.........这里部分代码省略.........
示例13: getUserRole
public function getUserRole($UsrUid)
{
$con = Propel::getConnection(UsersRolesPeer::DATABASE_NAME);
try {
$c = new Criteria('rbac');
$c->clearSelectColumns();
$c->addSelectColumn(RolesPeer::ROL_UID);
$c->addSelectColumn(RolesPeer::ROL_CODE);
$c->addSelectColumn(RolesPeer::ROL_STATUS);
$c->addJoin(UsersRolesPeer::ROL_UID, RolesPeer::ROL_UID);
$c->add(UsersRolesPeer::USR_UID, $UsrUid);
$rs = UsersRolesPeer::doSelectRs($c, Propel::getDbConnection('rbac_ro'));
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
return $row;
} catch (Exception $oError) {
throw $oError;
}
}
示例14: _getDynafields
public function _getDynafields ($proUid, $type = 'xmlform', $start = null, $limit = null, $filter = null)
{
$cache = 1;
if (! isset( $_SESSION['_cache_pmtables'] ) || (isset( $_SESSION['_cache_pmtables'] ) && $_SESSION['_cache_pmtables']['pro_uid'] != $proUid) || (isset( $_SESSION['_cache_pmtables'] ) && $_SESSION['_cache_pmtables']['dyn_uid'] != $this->dynUid)) {
require_once 'classes/model/Dynaform.php';
$cache = 0;
$fields = array ();
$fieldsNames = array ();
$oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME );
$oCriteria->add( DynaformPeer::PRO_UID, $proUid );
$oCriteria->add( DynaformPeer::DYN_TYPE, $type );
if (isset( $this->dynUid )) {
$oCriteria->add( DynaformPeer::DYN_UID, $this->dynUid );
}
$oDataset = DynaformPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$excludeFieldsList = array ('title','subtitle','link','file','button','reset','submit','listbox','checkgroup','grid','javascript', ''
);
$labelFieldsTypeList = array ('dropdown','radiogroup');
G::loadSystem( 'dynaformhandler' );
$index = 0;
while ($aRow = $oDataset->getRow()) {
if (file_exists( PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml' )) {
$dynaformHandler = new dynaformHandler( PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml' );
$nodeFieldsList = $dynaformHandler->getFields();
foreach ($nodeFieldsList as $node) {
$arrayNode = $dynaformHandler->getArray( $node );
$fieldName = $arrayNode['__nodeName__'];
$fieldType = isset($arrayNode['type']) ? $arrayNode['type']: '';
$fieldValidate = ( isset($arrayNode['validate'])) ? $arrayNode['validate'] : '';
if (! in_array( $fieldType, $excludeFieldsList ) && ! in_array( $fieldName, $fieldsNames ) ) {
$fields[] = array (
'FIELD_UID' => $fieldName . '-' . $fieldType,
'FIELD_NAME' => $fieldName,
'FIELD_VALIDATE'=>$fieldValidate,
'_index' => $index ++,
'_isset' => true
);
$fieldsNames[] = $fieldName;
if (in_array( $fieldType, $labelFieldsTypeList ) && ! in_array( $fieldName . '_label', $fieldsNames )) {
$fields[] = array (
'FIELD_UID' => $fieldName . '_label' . '-' . $fieldType,
'FIELD_NAME' => $fieldName . '_label',
'FIELD_VALIDATE'=>$fieldValidate,
'_index' => $index ++,
'_isset' => true
);
$fieldsNames[] = $fieldName;
}
}
}
}
$oDataset->next();
}
// getting bpmn projects
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(BpmnProcessPeer::PRJ_UID);
$oCriteria->add(BpmnProcessPeer::PRJ_UID, $proUid);
$oDataset = BpmnProcessPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$row = $oDataset->getRow();
if (isset($row["PRJ_UID"])) {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_UID);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_NAME);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_FIELD_TYPE);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_SQL);
$oCriteria->addSelectColumn(ProcessVariablesPeer::VAR_ACCEPTED_VALUES);
$oCriteria->add(ProcessVariablesPeer::PRJ_UID, $row["PRJ_UID"]);
$oDataset = ProcessVariablesPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$index = 0;
while ($oDataset->next()) {
$row = $oDataset->getRow();
$fieldType = isset($row["VAR_FIELD_TYPE"]) ? $row["VAR_FIELD_TYPE"]: '';
$varSql = isset($row["VAR_SQL"]) ? $row["VAR_SQL"] : '';
$varProcessVariable = isset($row["VAR_ACCEPTED_VALUES"]) ? $row["VAR_ACCEPTED_VALUES"] : '[]';
if(! in_array( $fieldType, $excludeFieldsList )){
if(strlen($varSql) == 0 && $varProcessVariable == '[]'){
array_push($fields, array(
"FIELD_UID" => $row["VAR_NAME"] . "-" . $row["VAR_FIELD_TYPE"],
"FIELD_NAME" => $row["VAR_NAME"],
"FIELD_VALIDATE" => "any",
"_index" => $index ++,
"_isset" => true
));
//.........这里部分代码省略.........
示例15: getProcessList
/**
* @param $action
* @param $categoryUid
* @param $userUid
* @return array
* @throws \PropelException
*/
public function getProcessList ($action, $categoryUid, $userUid)
{
//$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
//$categoryUid = isset( $_REQUEST['CATEGORY_UID'] ) ? $_REQUEST['CATEGORY_UID'] : null;
//$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
// global $oAppCache;
$oAppCache = new \AppCacheView();
$processes = array ();
$processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' ));
//get the list based in the action provided
switch ($action) {
case 'draft':
$cProcess = $oAppCache->getDraftListCriteria( $userUid ); //fast enough
break;
case 'sent':
$cProcess = $oAppCache->getSentListProcessCriteria( $userUid ); // fast enough
break;
case 'simple_search':
case 'search':
//in search action, the query to obtain all process is too slow, so we need to query directly to
//process and content tables, and for that reason we need the current language in AppCacheView.
G::loadClass( 'configuration' );
$oConf = new \Configurations();
$oConf->loadConfig( $x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '' );
$appCacheViewEngine = $oConf->aConfig;
$lang = isset( $appCacheViewEngine['LANG'] ) ? $appCacheViewEngine['LANG'] : 'en';
$cProcess = new Criteria( 'workflow' );
$cProcess->clearSelectColumns();
$cProcess->addSelectColumn( \ProcessPeer::PRO_UID );
$cProcess->addSelectColumn( \ContentPeer::CON_VALUE );
if ($categoryUid) {
$cProcess->add( \ProcessPeer::PRO_CATEGORY, $categoryUid );
}
$del = DBAdapter::getStringDelimiter();
$conds = array ();
$conds[] = array (ProcessPeer::PRO_UID,ContentPeer::CON_ID);
$conds[] = array (ContentPeer::CON_CATEGORY,$del . 'PRO_TITLE' . $del);
$conds[] = array (ContentPeer::CON_LANG,$del . $lang . $del);
$cProcess->addJoinMC( $conds, Criteria::LEFT_JOIN );
$cProcess->add( ProcessPeer::PRO_STATUS, 'ACTIVE' );
$cProcess->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
$oDataset = ProcessPeer::doSelectRS( $cProcess );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$processes[] = array ($aRow['PRO_UID'],$aRow['CON_VALUE']
);
$oDataset->next();
}
return print G::json_encode( $processes );
break;
case 'unassigned':
$cProcess = $oAppCache->getUnassignedListCriteria( $userUid );
break;
case 'paused':
$cProcess = $oAppCache->getPausedListCriteria( $userUid );
break;
case 'to_revise':
$cProcess = $oAppCache->getToReviseListCriteria( $userUid );
break;
case 'to_reassign':
$cProcess = $oAppCache->getToReassignListCriteria($userUid);
break;
case 'gral':
$cProcess = $oAppCache->getGeneralListCriteria();
break;
case 'todo':
default:
$cProcess = $oAppCache->getToDoListCriteria( $userUid ); //fast enough
break;
}
//get the processes for this user in this action
$cProcess->clearSelectColumns();
$cProcess->addSelectColumn( \AppCacheViewPeer::PRO_UID );
$cProcess->addSelectColumn( \AppCacheViewPeer::APP_PRO_TITLE );
$cProcess->setDistinct( \AppCacheViewPeer::PRO_UID );
if ($categoryUid) {
require_once 'classes/model/Process.php';
$cProcess->addAlias( 'CP', 'PROCESS' );
$cProcess->add( 'CP.PRO_CATEGORY', $categoryUid, Criteria::EQUAL );
$cProcess->addJoin( \AppCacheViewPeer::PRO_UID, 'CP.PRO_UID', Criteria::LEFT_JOIN );
$cProcess->addAsColumn( 'CATEGORY_UID', 'CP.PRO_CATEGORY' );
}
$cProcess->addAscendingOrderByColumn(\AppCacheViewPeer::APP_PRO_TITLE);
$oDataset = \AppCacheViewPeer::doSelectRS( $cProcess, \Propel::getDbConnection('workflow_ro') );
$oDataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
//.........这里部分代码省略.........