本文整理汇总了PHP中ProcessPeer类的典型用法代码示例。如果您正苦于以下问题:PHP ProcessPeer类的具体用法?PHP ProcessPeer怎么用?PHP ProcessPeer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProcessPeer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index($httpData)
{
if (!isset($httpData->id)) {
throw new Exception('The Process ID was not set!');
}
require_once 'classes/model/Process.php';
$process = ProcessPeer::retrieveByPK($httpData->id);
if (get_class($process) != 'Process') {
throw new Exception("The Process with UID: {$httpData->id} doesn't exist!");
}
$_SESSION['PROCESS'] = $httpData->id;
$_SESSION['PROCESSMAP'] = 'BPMN';
$this->includeExtJS('bpmn/MyWorkflow', true);
$this->includeExtJS('bpmn/pmosExt', true);
$this->includeExtJS('bpmn/TaskContext', true);
$this->includeExtJS('bpmn/designerComponents', true);
$this->includeExtJS('bpmn/designer', true);
$this->includeExtJS('bpmn/Annotation', true);
$this->includeExtJS('bpmn/bpmnShapes', true);
$this->includeExtJS('bpmn/EventEmptyStart');
$this->includeExtJS('bpmn/EventMessageStart');
$this->includeExtJS('bpmn/EventTimerStart');
$this->includeExtJS('bpmn/EventEmptyInter');
$this->includeExtJS('bpmn/EventMessageRecInter');
$this->includeExtJS('bpmn/EventMessageSendInter');
$this->includeExtJS('bpmn/EventTimerInter');
$this->includeExtJS('bpmn/EventEmptyEnd');
$this->includeExtJS('bpmn/EventMessageEnd');
$this->includeExtJS('bpmn/GatewayInclusive');
$this->includeExtJS('bpmn/GatewayExclusiveData');
$this->includeExtJS('bpmn/GatewayParallel');
$this->includeExtJS('bpmn/GridPanel');
$this->includeExtJS('bpmn/SubProcess');
$this->includeExtJS('bpmn/ProcessOptions', true);
$this->includeExtJS('bpmn/ProcessMapContext', true);
$this->includeExtJS('bpmn/ProcessOptions', true);
$this->setJSVar('pro_uid', $httpData->id);
$this->setJSVar('pro_title', $process->getProTitle());
$this->setView('bpmn/designer');
G::RenderPage('publish', 'extJs');
}
示例2: 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>';
示例3: getProcessArray
function getProcessArray($action, $userUid)
{
global $oAppCache;
$processes = array();
$processes[] = array("", G::LoadTranslation("ID_ALL_PROCESS"));
switch ($action) {
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);
$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");
$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 $processes;
break;
case "consolidated":
default:
$cProcess = $oAppCache->getToDoListCriteria($userUid);
//fast enough
break;
}
$cProcess->clearSelectColumns();
$cProcess->setDistinct();
$cProcess->addSelectColumn(AppCacheViewPeer::PRO_UID);
$cProcess->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE);
$oDataset = AppCacheViewPeer::doSelectRS($cProcess);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$processes[] = array($aRow["PRO_UID"], $aRow["APP_PRO_TITLE"]);
$oDataset->next();
}
return $processes;
}
示例4: Publisher
require_once 'classes/model/DbSource.php';
require_once 'classes/model/Content.php';
$G_PUBLISH = new Publisher();
G::LoadClass('processMap');
G::LoadClass('ArrayPeer');
G::LoadClass('dbConnections');
global $_DBArray;
switch ($action) {
case 'loadInfoAssigConnecctionDB':
$oStep = new Step();
return print $oStep->loadInfoAssigConnecctionDB($_POST['PRO_UID'], $_POST['DBS_UID']);
break;
case 'showDbConnectionsList':
$oProcess = new processMap();
$oCriteria = $oProcess->getConditionProcessList();
if (ProcessPeer::doCount($oCriteria) > 0) {
$aProcesses = array();
$aProcesses[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char');
$oDataset = ArrayBasePeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$sProcessUID = '';
while ($aRow = $oDataset->getRow()) {
if ($sProcessUID == '') {
$sProcessUID = $aRow['PRO_UID'];
}
$aProcesses[] = array('PRO_UID' => isset($aRow['PRO_UID']) ? $aRow['PRO_UID'] : '', 'PRO_TITLE' => isset($aRow['PRO_TITLE']) ? $aRow['PRO_TITLE'] : '');
$oDataset->next();
}
$_DBArray['PROCESSES'] = $aProcesses;
$_SESSION['_DBArray'] = $_DBArray;
示例5: 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;
}
}
示例6: 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;
}
示例7: 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');
//.........这里部分代码省略.........
示例8: getWorkspaceInfo
/**
* Will return all the information of a WS.
* - Status
* - # of cases
* - # of processes
* - # of users
* @param string $wsName
* @return array
*/
function getWorkspaceInfo($wsName)
{
$aResult = array('num_processes' => '0', 'num_cases' => '0');
$result = array();
require_once 'classes/model/Process.php';
require_once 'classes/model/Application.php';
require_once 'classes/model/Users.php';
$Criteria = new Criteria('workflow');
$Criteria->add(ProcessPeer::PRO_STATUS, 'ACTIVE', CRITERIA::EQUAL);
$aResult['num_processes'] = ProcessPeer::doCount($Criteria);
$Criteria = new Criteria('workflow');
$Criteria->add(ApplicationPeer::APP_STATUS, 'COMPLETED', CRITERIA::NOT_EQUAL);
$aResult['num_cases'] = ApplicationPeer::doCount($Criteria);
$Criteria = new Criteria('workflow');
$Criteria->add(UsersPeer::USR_STATUS, array('DELETED', 'DISABLED'), CRITERIA::NOT_IN);
$aResult['num_users'] = UsersPeer::doCount($Criteria);
return $aResult;
}
示例9: 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'] . '`';
//.........这里部分代码省略.........
示例10: 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 );
//.........这里部分代码省略.........
示例11: 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
示例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: removeIfExists
public static function removeIfExists($proUid)
{
$process = \ProcessPeer::retrieveByPK($proUid);
if ($process) {
$me = new self();
$me->proUid = $process->getProUid();
$me->remove();
}
}