本文整理汇总了PHP中ProcessPeer::doSelectRS方法的典型用法代码示例。如果您正苦于以下问题:PHP ProcessPeer::doSelectRS方法的具体用法?PHP ProcessPeer::doSelectRS怎么用?PHP ProcessPeer::doSelectRS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProcessPeer
的用法示例。
在下文中一共展示了ProcessPeer::doSelectRS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PROPFIND
/**
* PROPFIND method handler
*
* @param array general parameter passing array
* @param array return array for file properties
* @return bool true on success
*/
function PROPFIND(&$options, &$files)
{
$paths = $this->paths;
// prepare property array
$files["files"] = array();
$pathClasses = PATH_DB . PATH_SEP . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
if (count($paths) == 0 && is_dir($pathClasses)) {
$props = array();
$props[] = $this->mkprop("displayname", 'Classes');
$props[] = $this->mkprop("creationdate", filectime($pathClasses));
$props[] = $this->mkprop("getlastmodified", filemtime($pathClasses));
$props[] = $this->mkprop("lastaccessed", filemtime($pathClasses));
$props[] = $this->mkprop("resourcetype", 'collection');
$props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory');
$files["files"][] = array('path' => 'classes', 'props' => $props);
}
if (count($paths) > 0 && $paths[0] == 'classes' && is_dir($pathClasses)) {
// try to open directory
$handle = @opendir($pathClasses);
if ($handle) {
while ($filename = readdir($handle)) {
$ext = array_pop(explode('.', $filename));
if ($filename != "." && $filename != ".." && !is_dir($pathClasses . $filename) && $ext == 'php') {
$props = array();
$props[] = $this->mkprop("displayname", $filename);
$props[] = $this->mkprop("creationdate", filectime($pathClasses . $filename));
$props[] = $this->mkprop("getlastmodified", filemtime($pathClasses . $filename));
$props[] = $this->mkprop("getetag", fileatime($pathClasses . $filename));
$props[] = $this->mkprop("lastaccessed", filemtime($pathClasses . $filename));
$props[] = $this->mkprop("resourcetype", '');
$props[] = $this->mkprop("getcontenttype", 'text/plain');
$props[] = $this->mkprop("getcontentlength", filesize($pathClasses . $filename));
if (count($paths) == 1 || count($paths) == 2 && $paths[1] == $filename) {
$files["files"][] = array('path' => "classes/{$filename}", 'props' => $props);
}
}
}
}
}
//path classes
$pathProcesses = PATH_DB . SYS_SYS . PATH_SEP;
if (count($paths) == 0 && is_dir($pathProcesses)) {
$props = array();
$props[] = $this->mkprop("displayname", 'Processes');
$props[] = $this->mkprop("creationdate", filectime($pathProcesses));
$props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses));
$props[] = $this->mkprop("resourcetype", 'collection');
$props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory');
$files["files"][] = array('path' => 'processes', 'props' => $props);
}
//list all active processes
if (count($paths) == 1 && $paths[0] == 'processes' && is_dir($pathProcesses)) {
// try to get the process directory list
G::LoadClass('processMap');
G::LoadClass('model/Process');
$oProcessMap = new processMap();
$oProcess = new Process();
$c = $oProcessMap->getConditionProcessList();
$oDataset = ProcessPeer::doSelectRS($c);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
if ($aRow['PRO_STATUS'] == 'ACTIVE') {
$aProcess = $oProcess->load($aRow['PRO_UID']);
$props = array();
$props[] = $this->mkprop("displayname", $aProcess['PRO_TITLE']);
$props[] = $this->mkprop("creationdate", filectime($pathProcesses));
$props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses));
$props[] = $this->mkprop("lastaccessed", filemtime($pathProcesses));
$props[] = $this->mkprop("resourcetype", 'collection');
$props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory');
$files["files"][] = array('path' => "processes/" . $aRow['PRO_UID'], 'props' => $props);
}
$oDataset->next();
}
}
//dir of processes
//content of any process ( the three major folders of Processes )
$pathXmlform = $pathProcesses . 'xmlForms' . PATH_SEP;
if (count($paths) == 2 && $paths[0] == 'processes' && is_dir($pathProcesses)) {
$props = array();
$props[] = $this->mkprop("displayname", 'xmlforms');
$props[] = $this->mkprop("creationdate", filectime($pathXmlform));
$props[] = $this->mkprop("getlastmodified", filemtime($pathXmlform));
$props[] = $this->mkprop("lastaccessed", filemtime($pathXmlform));
$props[] = $this->mkprop("resourcetype", 'collection');
$props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory');
$files["files"][] = array('path' => 'processes/' . $paths[1] . '/xmlforms', 'props' => $props);
$props[] = $this->mkprop("displayname", 'mailTemplates');
$props[] = $this->mkprop("creationdate", filectime($pathProcesses));
$props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses));
$props[] = $this->mkprop("lastaccessed", filemtime($pathProcesses));
$props[] = $this->mkprop("resourcetype", 'collection');
//.........这里部分代码省略.........
示例2: Criteria
$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':
示例3: getAllProcesses
/**
* get all the Active process
*
* SELECT PROCESS.PRO_UID AS UID, CONTENT.CON_VALUE AS VALUE FROM PROCESS, CONTENT
* WHERE (PROCESS.PRO_UID=CONTENT.CON_ID AND PROCESS.PRO_STATUS!='DISABLED' AND CONTENT.CON_CATEGORY='PRO_TITLE' AND CONTENT.CON_LANG='en')
* ORDER BY CONTENT.CON_VALUE
* ]]>
*/
public function getAllProcesses()
{
$aProcesses = array();
//$aProcesses [] = array ('PRO_UID' => 'char', 'PRO_TITLE' => 'char');
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessPeer::PRO_UID);
$oCriteria->add(ProcessPeer::PRO_STATUS, 'DISABLED', Criteria::NOT_EQUAL);
$oDataset = ProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$oProcess = new Process();
while ($aRow = $oDataset->getRow()) {
$aProcess = $oProcess->load($aRow['PRO_UID']);
$aProcesses[] = array('value' => $aProcess['PRO_UID'], 'name' => $aProcess['PRO_TITLE']);
$oDataset->next();
}
//$oJSON = new Services_JSON();
return Bootstrap::json_encode($aProcesses);
//$oJSON->encode( $aProcesses );
}
示例4: 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>';
示例5: doSelect
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return ProcessPeer::populateObjects(ProcessPeer::doSelectRS($criteria, $con));
}
示例6: processList
/**
* get all groups
*
* @param none
* @return $result will return an object
*/
public function processList ()
{
try {
$result = array ();
$oCriteria = new Criteria( 'workflow' );
//$oCriteria->add(ProcessPeer::PRO_STATUS , 'ACTIVE');
$oCriteria->add( ProcessPeer::PRO_STATUS, 'DISABLED', Criteria::NOT_EQUAL );
$oDataset = ProcessPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oProcess = new Process();
$arrayProcess = $oProcess->Load( $aRow['PRO_UID'] );
$result[] = array ('guid' => $aRow['PRO_UID'],'name' => $arrayProcess['PRO_TITLE']
);
$oDataset->next();
}
return $result;
} catch (Exception $e) {
$result[] = array ('guid' => $e->getMessage(),'name' => $e->getMessage()
);
return $result;
}
}
示例7: getProcessDescription
public function getProcessDescription ()
{
$c = new Criteria( 'workflow' );
$c->clearSelectColumns();
$c->addSelectColumn( ProcessPeer::PRO_UID );
$oDataset = ProcessPeer::doSelectRS( $c );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aRows = Array ();
while ($aRow = $oDataset->getRow()) {
$aRows[] = $aRow;
$oDataset->next();
}
foreach ($aRows as $k => $aRow) {
$oProcess = new Process();
$aProcessRow = $oProcess->load( $aRow['PRO_UID'] );
$aRows[$k] = array_merge( $aRow, array ('PRO_TITLE' => $aProcessRow['PRO_TITLE']
) );
}
return $aRows;
}
示例8: updateTables
/**
* Function updateTables
* This function updated the Report Tables
*
* @access public
* @param string $sProcessUid
* @param string $sApplicationUid
* @param string $iApplicationNumber
* @param string $aFields
* @return void
*/
public function updateTables($sProcessUid, $sApplicationUid, $iApplicationNumber, $aFields)
{
try {
$c = new Criteria('workflow');
$c->addSelectColumn(BpmnProjectPeer::PRJ_UID);
$c->add(BpmnProjectPeer::PRJ_UID, $sProcessUid, Criteria::EQUAL);
$ds = ProcessPeer::doSelectRS($c);
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$ds->next();
$row = $ds->getRow();
$isBpmn = isset($row['PRJ_UID']);
if (!class_exists('ReportTablePeer')) {
require_once 'classes/model/ReportTablePeer.php';
}
//get all Active Report Tables
$oCriteria = new Criteria('workflow');
$oCriteria->add(ReportTablePeer::PRO_UID, $sProcessUid);
$oCriteria->add(ReportTablePeer::REP_TAB_STATUS, 'ACTIVE');
$oDataset = ReportTablePeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aVars = array();
while ($aRow = $oDataset->getRow()) {
$aRow['REP_TAB_NAME'] = $this->sPrefix . $aRow['REP_TAB_NAME'];
$PropelDatabase = $this->chooseDB($aRow['REP_TAB_CONNECTION']);
$con = Propel::getConnection($PropelDatabase);
$stmt = $con->createStatement();
switch (DB_ADAPTER) {
case 'mysql':
$aTableFields = $this->getTableVars($aRow['REP_TAB_UID'], true);
if ($aRow['REP_TAB_TYPE'] == 'NORMAL') {
$sqlExists = "SELECT * FROM `" . $aRow['REP_TAB_NAME'] . "` WHERE APP_UID = '" . $sApplicationUid . "'";
$rsExists = $stmt->executeQuery($sqlExists, ResultSet::FETCHMODE_ASSOC);
$rsExists->next();
$aRow2 = $rsExists->getRow();
if (is_array($aRow2)) {
$sQuery = 'UPDATE `' . $aRow['REP_TAB_NAME'] . '` SET ';
foreach ($aTableFields as $aField) {
$sQuery .= '`' . $aField['sFieldName'] . '` = ';
if (!$isBpmn && !isset($aFields[$aField['sFieldName']])) {
foreach ($aFields as $row) {
if (is_array($row) && isset($row[count($row)])) {
$aFields = $row[count($row)];
}
}
}
switch ($aField['sType']) {
case 'number':
$sQuery .= (isset($aFields[$aField['sFieldName']]) ? (double) str_replace(',', '', $aFields[$aField['sFieldName']]) : '0') . ',';
break;
case 'char':
case 'text':
if (!isset($aFields[$aField['sFieldName']])) {
$aFields[$aField['sFieldName']] = '';
}
if (!isset($aFields[$aField['sFieldName'] . '_label'])) {
$aFields[$aField['sFieldName'] . '_label'] = '';
}
if (is_array($aFields[$aField['sFieldName']])) {
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']][0] : '') . "',";
} else {
if (!isset($aFields[$aField['sFieldName'] . '_label'])) {
$aFields[$aField['sFieldName'] . '_label'] = '';
}
if ($aFields[$aField['sFieldName']] == $aFields[$aField['sFieldName'] . '_label']) {
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? @mysql_real_escape_string($aFields[$aField['sFieldName']]) : '') . "',";
} else {
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? @mysql_real_escape_string($aFields[$aField['sFieldName'] . '_label']) : '') . "',";
}
}
break;
case 'date':
$mysqlDate = isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '';
if ($mysqlDate != '') {
$mysqlDate = str_replace('/', '-', $mysqlDate);
$mysqlDate = date('Y-m-d', strtotime($mysqlDate));
}
$value = trim($mysqlDate) != '' ? "'" . $mysqlDate . "'" : 'NULL';
$sQuery .= $value . ",";
break;
}
}
$sQuery = substr($sQuery, 0, -1);
$sQuery .= " WHERE APP_UID = '" . $sApplicationUid . "'";
} else {
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
$sQuery .= '`APP_UID`,`APP_NUMBER`';
foreach ($aTableFields as $aField) {
$sQuery .= ',`' . $aField['sFieldName'] . '`';
//.........这里部分代码省略.........
示例9: Criteria
<?php
if ($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
//G::header('location: ../login/login');
die;
}
try {
$form = $_POST['form'];
$CategoryUid = $form['CATEGORY_UID'];
require_once "classes/model/ProcessCategory.php";
require_once 'classes/model/Process.php';
//we'are looking for data into process with this CategoryUid
$oCriteria = new Criteria('workflow');
$oCriteria->add(ProcessPeer::PRO_CATEGORY, $CategoryUid);
$oDataset = ProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
$aDataProcess = $oDataset->getRow();
$oCriteria1 = new Criteria('workflow');
$oCriteria1->add(ProcessPeer::PRO_CATEGORY, '');
$oCriteria2 = new Criteria('workflow');
$oCriteria2->add(ProcessPeer::PRO_UID, $aDataProcess['PRO_UID']);
BasePeer::doUpdate($oCriteria2, $oCriteria1, Propel::getConnection('workflow'));
}
//if exists the row in the database propel will update it, otherwise will insert.
$tr = ProcessCategoryPeer::retrieveByPK($CategoryUid);
if (is_object($tr) && get_class($tr) == 'ProcessCategory') {
$tr->delete();
}
G::Header('location: processCategoryList');
} catch (Exception $e) {
示例10: Exception
</script>');
}
try {
if ($_GET['APP_UID'] !== $_SESSION['APPLICATION']) {
throw new Exception( G::LoadTranslation( 'ID_INVALID_APPLICATION_ID_MSG', array ('<a href=\'' . $_SERVER['HTTP_REFERER'] . '\'>{1}</a>',G::LoadTranslation( 'ID_REOPEN' ) ) ) );
}
/*
* PMDynaform
* DYN_VERSION is 1: classic Dynaform,
* DYN_VERSION is 2: responsive form, Pmdynaform.
*/
$a = new Criteria("workflow");
$a->addSelectColumn(DynaformPeer::DYN_VERSION);
$a->add(DynaformPeer::DYN_UID, $_GET['UID'], Criteria::EQUAL);
$a = ProcessPeer::doSelectRS($a);
$a->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$a->next();
$row = $a->getRow();
$swpmdynaform = isset($row) && $row["DYN_VERSION"] == 2;
if ($swpmdynaform) {
$pmdynaform = $_POST["form"];
}
$oForm = new Form( $_SESSION["PROCESS"] . "/" . $_GET["UID"], PATH_DYNAFORM );
$oForm->validatePost();
//Includes
G::LoadClass( "case" );
//Load the variables
示例11: 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 );
//.........这里部分代码省略.........
示例12: getAllProcessesByCategory
function getAllProcessesByCategory()
{
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
$oCriteria->addSelectColumn('COUNT(*) AS CNT');
$oCriteria->addGroupByColumn(ProcessPeer::PRO_CATEGORY);
$oDataSet = ProcessPeer::doSelectRS($oCriteria);
$oDataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aProc = array();
while ($oDataSet->next()) {
$row = $oDataSet->getRow();
$aProc[$row['PRO_CATEGORY']] = $row['CNT'];
}
return $aProc;
}
示例13: existsTitle
/**
* Verify if exists the title of a Process
*
* @param string $processTitle Title
* @param string $processUidExclude Unique id of Process to exclude
*
* return bool Return true if exists the title of a Process, false otherwise
*/
public function existsTitle($processTitle, $processUidExclude = "")
{
try {
$delimiter = \DBAdapter::getStringDelimiter();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ProcessPeer::PRO_UID);
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\ProcessPeer::PRO_UID, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "PRO_TITLE" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
if ($processUidExclude != "") {
$criteria->add(\ProcessPeer::PRO_UID, $processUidExclude, \Criteria::NOT_EQUAL);
}
$criteria->add("CT.CON_VALUE", $processTitle, \Criteria::EQUAL);
$rsCriteria = \ProcessPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
return true;
} else {
return false;
}
} catch (\Exception $e) {
throw $e;
}
}
示例14: 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 )) {
//.........这里部分代码省略.........
示例15: listLanguage
public function listLanguage($dyn_uid)
{
$list = array();
$a = new Criteria("workflow");
$a->addSelectColumn(DynaformPeer::DYN_LABEL);
$a->add(DynaformPeer::DYN_UID, $dyn_uid, Criteria::EQUAL);
$ds = ProcessPeer::doSelectRS($a);
$ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$ds->next();
$row = $ds->getRow();
if ($row["DYN_LABEL"] === null || $row["DYN_LABEL"] === "") {
return $list;
}
$dyn_label = \G::json_decode($row["DYN_LABEL"]);
foreach ($dyn_label as $key => $value) {
array_push($list, array(
"Lang" => $key,
"File-Name" => isset($value->{"File-Name"}) ? $value->{"File-Name"} : "",
"Project-Id-Version" => isset($value->{"Project-Id-Version"}) ? $value->{"Project-Id-Version"} : "",
"POT-Creation-Date" => isset($value->{"POT-Creation-Date"}) ? $value->{"POT-Creation-Date"} : "",
"PO-Revision-Date" => isset($value->{"PO-Revision-Date"}) ? $value->{"PO-Revision-Date"} : "",
"Last-Translator" => isset($value->{"Last-Translator"}) ? $value->{"Last-Translator"} : "",
"Language-Team" => isset($value->{"Language-Team"}) ? $value->{"Language-Team"} : "",
"MIME-Version" => isset($value->{"MIME-Version"}) ? $value->{"MIME-Version"} : "",
"Content-Type" => isset($value->{"Content-Type"}) ? $value->{"Content-Type"} : "",
"Content-Transfer_Encoding" => isset($value->{"Content-Transfer_Encoding"}) ? $value->{"Content-Transfer_Encoding"} : "",
"X-Poedit-Language" => isset($value->{"X-Poedit-Language"}) ? $value->{"X-Poedit-Language"} : "",
"X-Poedit-Country" => isset($value->{"X-Poedit-Country"}) ? $value->{"X-Poedit-Country"} : "",
"X-Poedit-SourceCharset" => isset($value->{"X-Poedit-SourceCharset"}) ? $value->{"X-Poedit-SourceCharset"} : "",
"Content-Transfer-Encoding" => isset($value->{"Content-Transfer-Encoding"}) ? $value->{"Content-Transfer-Encoding"} : ""
));
}
return $list;
}