本文整理汇总了PHP中DynaformPeer::doSelectRS方法的典型用法代码示例。如果您正苦于以下问题:PHP DynaformPeer::doSelectRS方法的具体用法?PHP DynaformPeer::doSelectRS怎么用?PHP DynaformPeer::doSelectRS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynaformPeer
的用法示例。
在下文中一共展示了DynaformPeer::doSelectRS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Prints the components of the toolBar
*
* @param string $value
* @return string
*/
public function render($value)
{
$url = $this->file;
if ($this->home === "methods") {
$url = G::encryptlink(SYS_URI . $url);
}
if ($this->home === "public_html") {
$url = '/' . $url;
}
$urlAlt = $this->fileAlt;
if ($this->fileAlt !== '') {
if ($this->home === "methods") {
$urlAlt = G::encryptlink(SYS_URI . $urlAlt);
}
if ($this->home === "public_html") {
$urlAlt = '/' . $urlAlt;
}
}
$this->url = $url;
$this->urlAlt = $urlAlt;
switch ($this->buttonType) {
case 'image':
$html = '';
if ($this->hoverMethod === 'back') {
$html = '<img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . ($this->style ? ' style="' . $this->style . '"' : '') . ' onmouseover=\'backImage(this,"url(' . htmlentities($urlAlt, ENT_QUOTES, 'utf-8') . ') no-repeat")\' onmouseout=\'backImage(this,"")\' title=\'' . addslashes($this->label) . '\' />';
} elseif ($this->hoverMethod === 'switch') {
$html = '<img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . ($this->style ? ' style="' . $this->style . '"' : '') . ' onmouseover=\'switchImage(this,"' . htmlentities($url, ENT_QUOTES, 'utf-8') . '","' . htmlentities($urlAlt, ENT_QUOTES, 'utf-8') . '")\' onmouseout=\'switchImage(this,"' . htmlentities($url, ENT_QUOTES, 'utf-8') . '","' . htmlentities($urlAlt, ENT_QUOTES, 'utf-8') . '")\'/>';
} else {
$html = '<img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . ($this->style ? ' style="' . $this->style . '"' : '') . '/>';
}
break;
case 'text':
$html = $this->htmlentities($this->label, ENT_QUOTES, 'utf-8');
break;
case 'html':
$html = '<div ' . ' onmouseover=\'backImage(this,"url(' . htmlentities($urlAlt, ENT_QUOTES, 'utf-8') . ') no-repeat")\' onmouseout=\'backImage(this,"")\' style="width:25px;height:25px;margin-bottom:3px">' . $this->label . '</div>';
//$html=$this->label;
break;
case 'image/text':
$html = '<img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . ($this->style ? ' style="' . $this->style . '"' : '') . '/><br/>' . $this->htmlentities($this->label, ENT_QUOTES, 'utf-8');
break;
case 'text/image':
$html = $this->htmlentities($this->label, ENT_QUOTES, 'utf-8') . '<br/><img src="' . htmlentities($url, ENT_QUOTES, 'utf-8') . '"' . ($this->style ? ' style="' . $this->style . '"' : '') . '/>';
break;
case 'dropdown':
$html = '';
if (isset($this->owner->values['PRO_UID'])) {
G::LoadClass('processMap');
$criteria = processMap::getDynaformsCriteria($this->owner->values['PRO_UID']);
$dataset = DynaformPeer::doSelectRS($criteria);
if ($dataset->getRecordCount() > 0) {
$html .= '<span style="display:inline-block; font-size: 8pt;margin-left: 5px;margin-bottom: 3px;">' . G::LoadTranslation('ID_DYNAFORM');
$html .= ': <select id="_dynaformsList_" onchange="window.location = \'dynaforms_Editor?PRO_UID=' . $this->owner->values['PRO_UID'];
$html .= '&DYN_UID=\' + this.value;" class="module_app_input___gray">';
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
while ($row = $dataset->getRow()) {
$html .= '<option value="' . $row['DYN_UID'] . '"';
$html .= ($this->owner->values['DYN_UID'] == $row['DYN_UID'] ? ' selected="selected"' : '') . '>';
$html .= htmlentities($row['DYN_TITLE'], ENT_QUOTES, 'utf-8') . '</option>';
$dataset->next();
}
$html .= '</select></span>';
}
}
return $html;
break;
case 'class':
$html = '<a href="#" onclick="' . $this->onclick . '" onmouseover="backImage(this, \'url(/images/dynamicForm/hover.gif) no-repeat\')" onmouseout="backImage(this, \'\')" style="height:25px;margin-bottom:3px">
<div class="' . $this->class . '" title="' . strip_tags($this->label) . '" style="height:25px;margin-bottom:3px"></div>
</a>';
return $html;
}
return '<a class="toolButton" ' . ($this->buttonStyle ? ' style="' . $this->buttonStyle . '"' : '') . ($this->onclick ? ' onclick="' . htmlentities($this->onclick, ENT_QUOTES, 'utf-8') . '"' : '') . '>' . $html . '</a>';
}
示例2: getGridsVars
/**
* Function getGridsVars
*
* @access public
* @param eter string $sProcessUID
* @return array
*/
function getGridsVars($sProcessUID)
{
$aFields = array();
$aFieldsNames = array();
require_once 'classes/model/Dynaform.php';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(DynaformPeer::DYN_FILENAME);
$oCriteria->add(DynaformPeer::PRO_UID, $sProcessUID);
$oDataset = DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$G_FORM = new Form($aRow['DYN_FILENAME'], PATH_DYNAFORM, SYS_LANG);
if ($G_FORM->type == 'xmlform') {
foreach ($G_FORM->fields as $k => $v) {
if ($v->type == 'grid') {
if (!in_array($k, $aFieldsNames)) {
$aFields[] = array('sName' => $k, 'sXmlForm' => str_replace($sProcessUID . '/', '', $v->xmlGrid));
$aFieldsNames[] = $k;
}
}
}
}
$oDataset->next();
}
return $aFields;
}
示例3: DBConnection
G::LoadClass('dynaFormField');
if (!(isset($_GET['A']) && $_GET['A'] !== '')) {
return;
}
$file = G::decrypt($_GET['A'], URL_KEY);
$dbc = new DBConnection(PATH_DYNAFORM . $file . '.xml', '', '', '', 'myxml');
$ses = new DBSession($dbc);
//TODO: Improve how to obtain the PRO_UID.
$aFile = explode('/', str_replace('\\', '/', $file));
$proUid = $aFile[0];
$dynUid = str_replace("_tmp0", "", $aFile[1]);
require_once 'classes/model/Dynaform.php';
$k = new Criteria('workflow');
$k->addSelectColumn(DynaformPeer::DYN_TYPE);
$k->add(DynaformPeer::DYN_UID, $dynUid);
$ods = DynaformPeer::doSelectRS($k);
$ods->next();
$row = $ods->getRow();
$dynType = $row[0];
$Fields['PME_DYN_TYPE'] = $dynType;
$fields = new DynaFormField($dbc);
$fields->Fields['XMLNODE_NAME'] = isset($_GET['XMLNODE_NAME']) ? urldecode($_GET['XMLNODE_NAME']) : '';
$fields->Load($fields->Fields['XMLNODE_NAME']);
/* Start Comment: Modify the options grid to set dynamically the language
* label columns.
*/
// $dbc2 = new DBConnection( PATH_XMLFORM . 'dynaforms/fields/_options.xml' ,'','','','myxml' );
// $ses2 = new DBSession($dbc2);
// $ses2->execute("DELETE FROM dynaForm WHERE XMLNODE_NAME like 'LABEL_%' ");
// $ses2->execute("DELETE FROM dynaForm WHERE XMLNODE_NAME = '' ");
// $langs=array(SYS_LANG/*,'es','fa'*/);
示例4: verifyExistingName
public function verifyExistingName($sName, $sProUid)
{
$sNameDyanform = urldecode($sName);
$sProUid = urldecode($sProUid);
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(DynaformPeer::DYN_UID);
$oCriteria->add(DynaformPeer::PRO_UID, $sProUid);
$oDataset = DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$flag = true;
while ($oDataset->next() && $flag) {
$aRow = $oDataset->getRow();
$oCriteria1 = new Criteria('workflow');
$oCriteria1->addSelectColumn('COUNT(*) AS DYNAFORMS');
$oCriteria1->add(ContentPeer::CON_CATEGORY, 'DYN_TITLE');
$oCriteria1->add(ContentPeer::CON_ID, $aRow['DYN_UID']);
$oCriteria1->add(ContentPeer::CON_VALUE, $sNameDyanform);
$oCriteria1->add(ContentPeer::CON_LANG, SYS_LANG);
$oDataset1 = ContentPeer::doSelectRS($oCriteria1);
$oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset1->next();
$aRow1 = $oDataset1->getRow();
if ($aRow1['DYNAFORMS']) {
$flag = false;
break;
}
}
return $flag;
}
示例5: validateRepGrid
/**
* Validate Report Table Grid
* @var string $rep_tab_grid. Grid for report table
* @var string $pro_uid. Uid for process
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @return string
*/
public function validateRepGrid($rep_tab_grid, $pro_uid)
{
$rep_tab_grid = trim($rep_tab_grid);
if ($rep_tab_grid == '') {
throw new \Exception("The property rep_tab_grid: '{$rep_tab_grid}' is incorrect.");
}
G::loadSystem('dynaformhandler');
$grids = array();
$namesGrid = array();
$aFieldsNames = array();
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\DynaformPeer::DYN_FILENAME);
$oCriteria->add(\DynaformPeer::PRO_UID, $pro_uid);
$oCriteria->add(\DynaformPeer::DYN_TYPE, 'xmlform');
$oDataset = \DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
$aRow = $oDataset->getRow();
$dynaformHandler = new \dynaformHandler(PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml');
$nodeFieldsList = $dynaformHandler->getFields();
foreach ($nodeFieldsList as $node) {
$arrayNode = $dynaformHandler->getArray($node);
$fieldName = $arrayNode['__nodeName__'];
$fieldType = $arrayNode['type'];
if ($fieldType == 'grid') {
if (!in_array($fieldName, $aFieldsNames)) {
$namesGrid[] = $fieldName;
$grids[] = str_replace($pro_uid . '/', '', $arrayNode['xmlgrid']);
}
}
}
}
$find = array_search($rep_tab_grid, $grids);
if ($find === false) {
throw new \Exception("The property rep_tab_grid: '{$rep_tab_grid}' is incorrect.");
} else {
$rep_tab_grid = $namesGrid[$find] . '-' . $rep_tab_grid;
}
return $rep_tab_grid;
}
示例6: isUsed
public function isUsed($processUid, $variable)
{
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(DynaformPeer::DYN_UID);
$criteria->addSelectColumn(DynaformPeer::DYN_CONTENT);
$criteria->add(DynaformPeer::PRO_UID, $processUid, Criteria::EQUAL);
$rsCriteria = DynaformPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$aRow = $rsCriteria->getRow();
$json = G::json_decode($aRow['DYN_CONTENT']);
if ($this->jsoni($json, $variable)) {
return $aRow['DYN_UID'];
}
}
return false;
}
示例7: Exception
if ($_REQUEST['DEL_INDEX'] == '') {
throw new Exception('The parameter DEL_INDEX is empty.');
}
G::LoadClass('case');
G::LoadClass('pmDynaform');
$cases = new Cases();
$caseFields = $cases->loadCase(G::decrypt($_REQUEST['APP_UID'], URL_KEY),G::decrypt($_REQUEST['DEL_INDEX'], URL_KEY));
//
$criteria = new Criteria();
$criteria->addSelectColumn(DynaformPeer::DYN_CONTENT);
$criteria->addSelectColumn(DynaformPeer::PRO_UID);
$criteria->add(DynaformPeer::DYN_UID, G::decrypt($_REQUEST['DYN_UID'], URL_KEY));
$result = DynaformPeer::doSelectRS($criteria);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$result->next();
$configuration = $result->getRow();
$action = 'ActionsByEmailDataFormPost.php?APP_UID=' . $_REQUEST['APP_UID'] . '&DEL_INDEX=' . $_REQUEST['DEL_INDEX'] . '&ABER=' . $_REQUEST['ABER'];
$record['DYN_CONTENT'] = $configuration['DYN_CONTENT'];
$record['PRO_UID'] = $configuration['PRO_UID'];
$record['CURRENT_DYNAFORM'] = G::decrypt($_REQUEST['DYN_UID'], URL_KEY);
$record['APP_UID'] = $_REQUEST['APP_UID'];
$record['DEL_INDEX'] = $_REQUEST['DEL_INDEX'];
$record['ABER'] = $_REQUEST['ABER'];
if (is_null($caseFields['DEL_FINISH_DATE'])) {
$a = new pmDynaform($record);
$a->printABE($action,$record);
} else {
示例8: getAvailableCaseTrackerObjects
/**
* Get available Case Tracker Objects of a Process
*
* @param string $processUid Unique id of Process
*
* return array Return an array with the Case Tracker Objects available of a Process
*/
public function getAvailableCaseTrackerObjects($processUid)
{
try {
$arrayAvailableCaseTrackerObject = array();
//Verify data
$process = new \ProcessMaker\BusinessModel\Process();
$process->throwExceptionIfNotExistsProcess($processUid, "prj_uid");
//Get Uids
$arrayDynaFormUid = array();
$arrayInputDocumentUid = array();
$arrayOutputDocumentUid = array();
$criteria = new \Criteria("workflow");
$criteria->add(\CaseTrackerObjectPeer::PRO_UID, $processUid, \Criteria::EQUAL);
$rsCriteria = \CaseTrackerObjectPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
switch ($row["CTO_TYPE_OBJ"]) {
case "DYNAFORM":
$arrayDynaFormUid[] = $row["CTO_UID_OBJ"];
break;
case "INPUT_DOCUMENT":
$arrayInputDocumentUid[] = $row["CTO_UID_OBJ"];
break;
case "OUTPUT_DOCUMENT":
$arrayOutputDocumentUid[] = $row["CTO_UID_OBJ"];
break;
}
}
//Array DB
$arrayCaseTrackerObject = array();
$delimiter = \DBAdapter::getStringDelimiter();
//DynaForms
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\DynaformPeer::DYN_UID);
$criteria->addAsColumn("DYN_TITLE", "CT.CON_VALUE");
$criteria->addAsColumn("DYN_DESCRIPTION", "CD.CON_VALUE");
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
$criteria->addAlias("CD", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\DynaformPeer::DYN_UID, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "DYN_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(\DynaformPeer::DYN_UID, "CD.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_CATEGORY", $delimiter . "DYN_DESCRIPTION" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$criteria->add(\DynaformPeer::PRO_UID, $processUid, \Criteria::EQUAL);
$criteria->add(\DynaformPeer::DYN_UID, $arrayDynaFormUid, \Criteria::NOT_IN);
$criteria->add(\DynaformPeer::DYN_TYPE, "xmlform", \Criteria::EQUAL);
$rsCriteria = \DynaformPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
if ($row["DYN_TITLE"] . "" == "") {
//There is no transaltion for this Document name, try to get/regenerate the label
$row["DYN_TITLE"] = \Content::Load("DYN_TITLE", "", $row["DYN_UID"], SYS_LANG);
}
$arrayCaseTrackerObject[] = array("obj_uid" => $row["DYN_UID"], "obj_title" => $row["DYN_TITLE"], "obj_description" => $row["DYN_DESCRIPTION"], "obj_type" => "DYNAFORM");
}
//InputDocuments
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_UID);
$criteria->addAsColumn("INP_DOC_TITLE", "CT.CON_VALUE");
$criteria->addAsColumn("INP_DOC_DESCRIPTION", "CD.CON_VALUE");
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
$criteria->addAlias("CD", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\InputDocumentPeer::INP_DOC_UID, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "INP_DOC_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(\InputDocumentPeer::INP_DOC_UID, "CD.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_CATEGORY", $delimiter . "INP_DOC_DESCRIPTION" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$criteria->add(\InputDocumentPeer::PRO_UID, $processUid, \Criteria::EQUAL);
$criteria->add(\InputDocumentPeer::INP_DOC_UID, $arrayInputDocumentUid, \Criteria::NOT_IN);
$rsCriteria = \InputDocumentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
if ($row["INP_DOC_TITLE"] . "" == "") {
//There is no transaltion for this Document name, try to get/regenerate the label
$row["INP_DOC_TITLE"] = \Content::Load("INP_DOC_TITLE", "", $row["INP_DOC_UID"], SYS_LANG);
}
$arrayCaseTrackerObject[] = array("obj_uid" => $row["INP_DOC_UID"], "obj_title" => $row["INP_DOC_TITLE"], "obj_description" => $row["INP_DOC_DESCRIPTION"], "obj_type" => "INPUT_DOCUMENT");
}
//OutputDocuments
$criteria = new \Criteria("workflow");
//.........这里部分代码省略.........
示例9: deleteProcess
public function deleteProcess($sProcessUID, $flagRemoveCases = true)
{
try {
//G::LoadClass('case');
//G::LoadClass('reportTables');
//Instance all classes necesaries
$oProcess = new \Process();
$oDynaform = new \Dynaform();
$oInputDocument = new \InputDocument();
$oOutputDocument = new \OutputDocument();
$oTrigger = new \Triggers();
$oRoute = new \Route();
$oGateway = new \Gateway();
$oEvent = new \Event();
$oSwimlaneElement = new \SwimlanesElements();
$oConfiguration = new \Configuration();
$oDbSource = new \DbSource();
$oReportTable = new \ReportTables();
$oCaseTracker = new \CaseTracker();
$oCaseTrackerObject = new \CaseTrackerObject();
//Update PROCESS_FILES_CHECKED
$configuration = \ConfigurationPeer::retrieveByPK("PROCESS_FILES_CHECKED", "", "", "", "");
if (!is_null($configuration)) {
$arrayProjectUid = unserialize($configuration->getCfgValue());
unset($arrayProjectUid[$sProcessUID]);
$conf = new \Configuration();
$result = $conf->update(array("CFG_UID" => "PROCESS_FILES_CHECKED", "OBJ_UID" => "", "CFG_VALUE" => serialize($arrayProjectUid), "PRO_UID" => "", "USR_UID" => "", "APP_UID" => ""));
}
//Delete the applications of process
if ($flagRemoveCases) {
$case = new \Cases();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ApplicationPeer::APP_UID);
$criteria->add(\ApplicationPeer::PRO_UID, $sProcessUID, \Criteria::EQUAL);
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$result = $case->removeCase($row["APP_UID"]);
}
}
//Delete the tasks of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\TaskPeer::PRO_UID, $sProcessUID);
$oDataset = \TaskPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
//$this->deleteTask($aRow['TAS_UID']);
$oTasks = new \Tasks();
$oTasks->deleteTask($aRow['TAS_UID']);
$oDataset->next();
}
//Delete the dynaforms of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\DynaformPeer::PRO_UID, $sProcessUID);
$oDataset = \DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oDynaform->remove($aRow['DYN_UID']);
$oDataset->next();
}
//Delete the input documents of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\InputDocumentPeer::PRO_UID, $sProcessUID);
$oDataset = \InputDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oInputDocument->remove($aRow['INP_DOC_UID']);
$oDataset->next();
}
//Delete the output documents of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\OutputDocumentPeer::PRO_UID, $sProcessUID);
$oDataset = \OutputDocumentPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oOutputDocument->remove($aRow['OUT_DOC_UID']);
$oDataset->next();
}
//Delete the triggers of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\TriggersPeer::PRO_UID, $sProcessUID);
$oDataset = \TriggersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oTrigger->remove($aRow['TRI_UID']);
$oDataset->next();
}
//Delete the routes of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(\RoutePeer::PRO_UID, $sProcessUID);
$oDataset = \RoutePeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
//.........这里部分代码省略.........
示例10: getDynaformVariables
/**
* Get all dynaform variables
*
* @param $sProcessUID
*/
public function getDynaformVariables($sProcessUID,$excludeFieldsList,$allowed = true)
{
$dynaformVariables = array();
$oC = new Criteria( 'workflow' );
$oC->addSelectColumn( DynaformPeer::DYN_CONTENT );
$oC->add( DynaformPeer::PRO_UID, $sProcessUID );
$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){
foreach($val as $column) {
if($allowed) {
if(isset($column['type']) && !in_array( $column['type'], $excludeFieldsList )){
if(array_key_exists('variable',$column)) {
if($column['variable'] != "") {
$dynaformVariables[] = $column['variable'];
}
}
}
} else {
if(isset($column['type']) && in_array( $column['type'], $excludeFieldsList )){
if(array_key_exists('variable',$column)) {
if($column['variable'] != "") {
$dynaformVariables[] = $column['variable'];
}
}
}
}
}
}
}
$oData->next();
}
return array_unique($dynaformVariables);
}
示例11: getDynaFormFields
/**
* Get data of a DynaForm
*
* @param string $projectUid Unique id of Project
* @param string $dynaFormUid Unique id of DynaForm
*
* return array Return an array with data of a DynaForm
*/
public function getDynaFormFields($projectUid, $dynaFormUid)
{
try {
$arrayVariables = array();
$arrayVariablesDef = array();
//Verify data
Validator::proUid($projectUid, '$prj_uid');
$this->throwExceptionIfNotExistsDynaForm($dynaFormUid, "", $this->arrayFieldNameForException["dynaFormUid"]);
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\DynaformPeer::DYN_CONTENT);
$criteria->add(\DynaformPeer::DYN_UID, $dynaFormUid, \Criteria::EQUAL);
$rsCriteria = \DynaformPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
$aRow = $rsCriteria->getRow();
$contentDecode = json_decode($aRow['DYN_CONTENT'], true);
$content = $contentDecode['items'][0]['items'];
foreach ($content as $key => $value) {
$valueType = isset($value[0]["valueType"]) ? $value[0]["valueType"] : null;
$maxLength = isset($value[0]["maxLength"]) ? $value[0]["maxLength"] : null;
$label = isset($value[0]["label"]) ? $value[0]["label"] : null;
$defaultValue = isset($value[0]["defaultValue"]) ? $value[0]["defaultValue"] : null;
$required = isset($value[0]["required"]) ? $value[0]["required"] : null;
$dbConnection = isset($value[0]["dbConnection"]) ? $value[0]["dbConnection"] : null;
$sql = isset($value[0]["sql"]) ? $value[0]["sql"] : null;
$options = isset($value[0]["options"]) ? $value[0]["options"] : null;
if (isset($value[0]["variable"])) {
$variable = $value[0]["variable"];
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NAME);
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_FIELD_TYPE);
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_FIELD_SIZE);
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_LABEL);
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_DBCONNECTION);
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_SQL);
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NULL);
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_DEFAULT);
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_ACCEPTED_VALUES);
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $projectUid, \Criteria::EQUAL);
$criteria->add(\ProcessVariablesPeer::VAR_NAME, $variable, \Criteria::EQUAL);
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
while ($aRow = $rsCriteria->getRow()) {
$valueTypeMerged = $valueType == null && $valueType == '' ? $aRow['VAR_FIELD_TYPE'] : $valueType;
$maxLengthMerged = $maxLength == null && $maxLength == '' ? (int) $aRow['VAR_FIELD_SIZE'] : $maxLength;
$labelMerged = $label == null && $label == '' ? $aRow['VAR_LABEL'] : $label;
$defaultValueMerged = $defaultValue == null && $defaultValue == '' ? $aRow['VAR_DEFAULT'] : $defaultValue;
$requiredMerged = $required == null && $required == '' ? $aRow['VAR_NULL'] == 1 ? false : true : $required;
$dbConnectionMerged = $dbConnection == null && $dbConnection == '' ? $aRow['VAR_DBCONNECTION'] : $dbConnection;
$sqlMerged = $sql == null && $sql == '' ? $aRow['VAR_SQL'] : $sql;
$optionsMerged = $options == null && $options == '' ? $aRow['VAR_ACCEPTED_VALUES'] : $options;
$aVariables = array('valueType' => $valueTypeMerged, 'maxLength' => $maxLengthMerged, 'label' => $labelMerged, 'defaultValue' => $defaultValueMerged, 'required' => $requiredMerged, 'dbConnection' => $dbConnectionMerged, 'sql' => $sqlMerged, 'options' => $optionsMerged);
//fields properties
if (isset($value[0]["pickType"])) {
$aVariables = array_merge(array('pickType' => $value[0]["pickType"]), $aVariables);
}
if (isset($value[0]["placeHolder"])) {
$aVariables = array_merge(array('placeHolder' => $value[0]["placeHolder"]), $aVariables);
}
if (isset($value[0]["dependentsField"])) {
$aVariables = array_merge(array('dependentsField' => $value[0]["dependentsField"]), $aVariables);
}
if (isset($value[0]["hint"])) {
$aVariables = array_merge(array('hint' => $value[0]["hint"]), $aVariables);
}
if (isset($value[0]["readonly"])) {
$aVariables = array_merge(array('readonly' => $value[0]["readonly"]), $aVariables);
}
if (isset($value[0]["colSpan"])) {
$aVariables = array_merge(array('colSpan' => $value[0]["colSpan"]), $aVariables);
}
if (isset($value[0]["type"])) {
$aVariables = array_merge(array('type' => $value[0]["type"]), $aVariables);
}
if (isset($value[0]["name"])) {
$aVariables = array_merge(array('name' => $value[0]["name"]), $aVariables);
}
$aVariables = array_merge(array('variable' => $variable), $aVariables);
$arrayVariables[] = $aVariables;
$rsCriteria->next();
}
} else {
$arrayVariablesDef[] = $value[0];
}
}
$arrayVariables = array_merge($arrayVariables, $arrayVariablesDef);
//Return
return $arrayVariables;
} catch (\Exception $e) {
throw $e;
}
//.........这里部分代码省略.........
示例12: 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 DynaformPeer::populateObjects(DynaformPeer::doSelectRS($criteria, $con));
}
示例13: lookingforUidGrids
/**
* Get the uids of the grids into a xml form
*
* @param string $sproUid the uid of the process
* @param string $sdbsUid the uid of the db connection
* @author krlos <carlos@colosa.com>
*/
function lookingforUidGrids($sproUid, $sObjUID)
{
require_once "classes/model/DynaformPeer.php";
G::LoadSystem('dynaformhandler');
$uidsGrids = array();
$oC = new Criteria('workflow');
$oC->add(DynaformPeer::DYN_UID, $sObjUID);
$oC->add(DynaformPeer::PRO_UID, $sproUid);
$oDataset = DynaformPeer::doSelectRS($oC);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
if ($aRow['DYN_TYPE'] == 'xmlform') {
$oC1 = new Criteria('workflow');
$oC1->add(DynaformPeer::PRO_UID, $sproUid);
$oC1->add(DynaformPeer::DYN_TYPE, "xmlform");
$oDataset = DynaformPeer::doSelectRS($oC1);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($oDataset->next()) {
$aRow1 = $oDataset->getRow();
$dynHandler = new dynaFormHandler(PATH_DYNAFORM . $sproUid . "/" . $sObjUID . ".xml");
$dynFields = $dynHandler->getFields();
$sxmlgrid = '';
$sType = '';
$check = 0;
foreach ($dynFields as $field) {
$sType = $this->getAttribute($field, 'type');
if ($sType == 'grid') {
$sxmlgrid = $this->getAttribute($field, 'xmlgrid');
//print_r($sxmlgrid);print"<hr>";
$aGridInfo = explode("/", $sxmlgrid);
$uidsGrids[] = $aGridInfo[1];
}
}
}
return $uidsGrids;
}
}
示例14: verifyUse
/**
* Verify if the variable is being used in a Dynaform
*
* @param string $processUid Unique id of Process
* @param string $variableUid Unique id of Variable
*
*/
public function verifyUse($processUid, $variableUid)
{
try {
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\DynaformPeer::DYN_CONTENT);
$criteria->addSelectColumn(\DynaformPeer::DYN_UID);
$criteria->add(\DynaformPeer::PRO_UID, $processUid, \Criteria::EQUAL);
$rsCriteria = \DynaformPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$contentDecode = \G::json_decode($row["DYN_CONTENT"], true);
$content = $contentDecode['items'][0]['items'];
if (is_array($content)) {
foreach ($content as $key => $value) {
if (isset($value[0]["variable"])) {
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NAME);
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $processUid, \Criteria::EQUAL);
$criteria->add(\ProcessVariablesPeer::VAR_NAME, $value[0]["variable"], \Criteria::EQUAL);
$criteria->add(\ProcessVariablesPeer::VAR_UID, $variableUid, \Criteria::EQUAL);
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
if ($rsCriteria->getRow()) {
throw new \Exception(\G::LoadTranslation("ID_VARIABLE_IN_USE", array($variableUid, $row["DYN_UID"])));
}
}
}
}
}
} catch (\Exception $e) {
throw $e;
}
}
示例15: elseif
}
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
require_once 'classes/model/Dynaform.php';
require_once 'classes/model/Content.php';
if (isset($_POST['function'])) {
$sfunction = $_POST['function'];
} elseif (isset($_POST['functions'])) {
$sfunction = $_POST['functions'];
}
if (isset($sfunction) && $sfunction == 'lookforNameDynaform') {
$snameDyanform = urldecode($_POST['NAMEDYNAFORM']);
$sPRO_UID = urldecode($_POST['proUid']);
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(DynaformPeer::DYN_UID);
$oCriteria->add(DynaformPeer::PRO_UID, $sPRO_UID);
$oDataset = DynaformPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$flag = true;
while ($oDataset->next() && $flag) {
$aRow = $oDataset->getRow();
$oCriteria1 = new Criteria('workflow');
$oCriteria1->addSelectColumn('COUNT(*) AS DYNAFORMS');
$oCriteria1->add(ContentPeer::CON_CATEGORY, 'DYN_TITLE');
$oCriteria1->add(ContentPeer::CON_ID, $aRow['DYN_UID']);
$oCriteria1->add(ContentPeer::CON_VALUE, $snameDyanform);
$oCriteria1->add(ContentPeer::CON_LANG, SYS_LANG);
$oDataset1 = ContentPeer::doSelectRS($oCriteria1);
$oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset1->next();
$aRow1 = $oDataset1->getRow();
if ($aRow1['DYNAFORMS']) {