コード例 #1
0
ファイル: Department.php プロジェクト: emildev35/processmaker
 public function getUsersFromDepartment($sDepUid, $sManagerUid)
 {
     try {
         $oCriteria = new Criteria('workflow');
         $oCriteria->addSelectColumn(UsersPeer::USR_UID);
         $oCriteria->addSelectColumn(UsersPeer::USR_REPORTS_TO);
         $oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
         $oCriteria->add(UsersPeer::DEP_UID, $sDepUid);
         $rs = UsersPeer::doSelectRS($oCriteria);
         $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oUser = new Users();
         $aUsers[] = array('USR_UID' => 'char', 'USR_USERNAME' => 'char', 'USR_FULLNAME' => 'char', 'USR_REPORTS_TO' => 'char', 'USR_MANAGER' => 'char');
         $rs->next();
         $row = $rs->getRow();
         while (is_array($row)) {
             $usrFields = $oUser->LoadDetails($row['USR_UID']);
             $row['USR_USERNAME'] = $usrFields['USR_USERNAME'];
             $row['USR_FULLNAME'] = $usrFields['USR_FULLNAME'];
             $row['USR_MANAGER'] = $row['USR_UID'] == $sManagerUid ? G::loadTranslation("ID_YES") : G::loadTranslation("ID_NO");
             $row['DEP_UID'] = $sDepUid;
             if ($row['USR_REPORTS_TO'] != '') {
                 try {
                     $managerFields = $oUser->LoadDetails($row['USR_REPORTS_TO']);
                     $row['USR_REPORTS_NAME'] = $managerFields['USR_FULLNAME'];
                 } catch (exception $e) {
                     $row['USR_REPORTS_NAME'] = '.';
                 }
             } else {
                 $row['USR_REPORTS_NAME'] = '.';
             }
             $aUsers[] = $row;
             $rs->next();
             $row = $rs->getRow();
         }
         G::LoadClass('ArrayPeer');
         global $_DBArray;
         $_DBArray['DepartmentUserList'] = $aUsers;
         $_SESSION['_DBArray'] = $_DBArray;
         $oCriteriaT = new Criteria('dbarray');
         $oCriteriaT->setDBArrayTable('DepartmentUserList');
         return $oCriteriaT;
     } catch (exception $e) {
         throw $e;
     }
 }
コード例 #2
0
 public function getHistoryMessagesTrackerExt($sApplicationUID)
 {
     G::LoadClass('ArrayPeer');
     global $_DBArray;
     $oAppDocument = new AppDocument();
     $oCriteria = new Criteria('workflow');
     $oCriteria->add(AppMessagePeer::APP_UID, $sApplicationUID);
     $oCriteria->addAscendingOrderByColumn(AppMessagePeer::APP_MSG_DATE);
     $oDataset = AppMessagePeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     $aMessages = array();
     while ($aRow = $oDataset->getRow()) {
         $aMessages[] = array('APP_MSG_UID' => $aRow['APP_MSG_UID'], 'APP_UID' => $aRow['APP_UID'], 'DEL_INDEX' => $aRow['DEL_INDEX'], 'APP_MSG_TYPE' => $aRow['APP_MSG_TYPE'], 'APP_MSG_SUBJECT' => $aRow['APP_MSG_SUBJECT'], 'APP_MSG_FROM' => $aRow['APP_MSG_FROM'], 'APP_MSG_TO' => $aRow['APP_MSG_TO'], 'APP_MSG_BODY' => $aRow['APP_MSG_BODY'], 'APP_MSG_DATE' => $aRow['APP_MSG_DATE'], 'APP_MSG_CC' => $aRow['APP_MSG_CC'], 'APP_MSG_BCC' => $aRow['APP_MSG_BCC'], 'APP_MSG_TEMPLATE' => $aRow['APP_MSG_TEMPLATE'], 'APP_MSG_STATUS' => $aRow['APP_MSG_STATUS'], 'APP_MSG_ATTACH' => $aRow['APP_MSG_ATTACH'], 'APP_MSG_SHOW_MESSAGE' => $aRow['APP_MSG_SHOW_MESSAGE']);
         $oDataset->next();
     }
     $_DBArray['messages'] = $aMessages;
     $_SESSION['_DBArray'] = $_DBArray;
     $oCriteria = new Criteria('dbarray');
     $oCriteria->setDBArrayTable('messages');
     return $aMessages;
 }
コード例 #3
0
 public function getExtTaskUsersAdHocCriteria($start, $limit, $sTaskUID = '', $iType = 1)
 {
     try {
         $aUsers = array();
         $aUsers[] = array('LABEL' => 'char', 'TAS_UID' => 'char', 'USR_UID' => 'char', 'TU_TYPE' => 'integer', 'TU_RELATION' => 'integer');
         $sDelimiter = DBAdapter::getStringDelimiter();
         $oCriteria = new Criteria('workflow');
         $oCriteria->addAsColumn('GRP_TITLE', 'C.CON_VALUE');
         $oCriteria->addSelectColumn(TaskUserPeer::TAS_UID);
         $oCriteria->addSelectColumn(TaskUserPeer::USR_UID);
         $oCriteria->addSelectColumn(TaskUserPeer::TU_TYPE);
         $oCriteria->addSelectColumn(TaskUserPeer::TU_RELATION);
         $oCriteria->addAlias('C', 'CONTENT');
         $aConditions = array();
         $aConditions[] = array(TaskUserPeer::USR_UID, 'C.CON_ID');
         $aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'GRP_TITLE' . $sDelimiter);
         $aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
         $oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
         $oCriteria->add(TaskUserPeer::TAS_UID, $sTaskUID);
         $oCriteria->add(TaskUserPeer::TU_TYPE, $iType);
         $oCriteria->add(TaskUserPeer::TU_RELATION, 2);
         $this->tmpCriteria = clone $oCriteria;
         if ($start != '') {
             $oCriteria->setOffset($start);
         }
         if ($limit != '') {
             $oCriteria->setLimit($limit);
         }
         $oDataset = TaskUserPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         $c = 0;
         while ($aRow = $oDataset->getRow()) {
             $c++;
             $oGroup = new Groupwf();
             $aFields = $oGroup->load($aRow['USR_UID']);
             if ($aFields['GRP_STATUS'] == 'ACTIVE') {
                 $oCriteria = new Criteria('workflow');
                 $oCriteria->addSelectColumn('COUNT(*) AS MEMBERS_NUMBER');
                 $oCriteria->add(GroupUserPeer::GRP_UID, $aRow['USR_UID']);
                 $oDataset2 = GroupUserPeer::doSelectRS($oCriteria);
                 $oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
                 $oDataset2->next();
                 $aRow2 = $oDataset2->getRow();
             } else {
                 $aRow2['GROUP_INACTIVE'] = '<strong>(' . G::LoadTranslation('ID_GROUP_INACTIVE') . ')</strong>';
             }
             $aUsers[] = array('LABEL' => !isset($aRow2['GROUP_INACTIVE']) ? $aRow['GRP_TITLE'] . ' <a href="#" onclick="usersGroup(\'' . $aRow['USR_UID'] . '\', \'' . $c . '\');return false;"><font color="green"><strong>(' . $aRow2['MEMBERS_NUMBER'] . ' ' . ((int) $aRow2['MEMBERS_NUMBER'] == 1 ? G::LoadTranslation('ID_USER') : G::LoadTranslation('ID_USERS')) . ')</strong></font></a> <br /><div id="users' . $c . '" style="display: none"></div>' : $aRow['GRP_TITLE'] . ' ' . $aRow2['GROUP_INACTIVE'], 'TAS_UID' => $aRow['TAS_UID'], 'USR_UID' => $aRow['USR_UID'], 'TU_TYPE' => $aRow['TU_TYPE'], 'TU_RELATION' => $aRow['TU_RELATION']);
             $oDataset->next();
         }
         $oCriteria = new Criteria('workflow');
         $oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
         $oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
         $oCriteria->addSelectColumn(TaskUserPeer::TAS_UID);
         $oCriteria->addSelectColumn(TaskUserPeer::USR_UID);
         $oCriteria->addSelectColumn(TaskUserPeer::TU_TYPE);
         $oCriteria->addSelectColumn(TaskUserPeer::TU_RELATION);
         $oCriteria->addJoin(TaskUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
         $oCriteria->add(TaskUserPeer::TAS_UID, $sTaskUID);
         $oCriteria->add(TaskUserPeer::TU_TYPE, $iType);
         $oCriteria->add(TaskUserPeer::TU_RELATION, 1);
         $oDataset = TaskUserPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             $aUsers[] = array('LABEL' => $aRow['USR_FIRSTNAME'] . ' ' . $aRow['USR_LASTNAME'], 'TAS_UID' => $aRow['TAS_UID'], 'USR_UID' => $aRow['USR_UID'], 'TU_TYPE' => $aRow['TU_TYPE'], 'TU_RELATION' => $aRow['TU_RELATION']);
             $oDataset->next();
         }
         global $_DBArray;
         $_DBArray = isset($_SESSION['_DBArray']) ? $_SESSION['_DBArray'] : '';
         $_DBArray['taskUsers'] = $aUsers;
         $_SESSION['_DBArray'] = $_DBArray;
         G::LoadClass('ArrayPeer');
         $oCriteria = new Criteria('dbarray');
         $oCriteria->setDBArrayTable('taskUsers');
         $oCriteria->addDescendingOrderByColumn(TaskUserPeer::TU_RELATION);
         $oCriteria->addAscendingOrderByColumn('LABEL');
         return $oCriteria;
     } catch (Exception $oError) {
         throw $oError;
     }
 }
コード例 #4
0
 /**
  * Prints the DynaformEditor
  *
  * @return void
  */
 public function _render()
 {
     global $G_PUBLISH;
     $script = '';
     /* Start Block: Load (Create if doesn't exist) the xmlform */
     $Parameters = array('SYS_LANG' => SYS_LANG, 'URL' => G::encrypt($this->file, URL_KEY), 'DYN_UID' => $this->dyn_uid, 'PRO_UID' => $this->pro_uid, 'DYNAFORM_NAME' => $this->dyn_title, 'FILE' => $this->file, 'DYN_EDITOR' => $this->dyn_editor);
     $_SESSION['Current_Dynafom']['Parameters'] = $Parameters;
     $XmlEditor = array('URL' => G::encrypt($this->file, URL_KEY), 'XML' => '');
     $JSEditor = array('URL' => G::encrypt($this->file, URL_KEY));
     $A = G::encrypt($this->file, URL_KEY);
     try {
         $openDoc = new Xml_Document();
         $fileName = $this->home . $this->file . '.xml';
         if (file_exists($fileName)) {
             $openDoc->parseXmlFile($fileName);
         } else {
             $this->_createDefaultXmlForm($fileName);
             $openDoc->parseXmlFile($fileName);
         }
         //$form = new Form( $this->file , $this->home, SYS_LANG, true );
         $Properties = dynaformEditorAjax::get_properties($A, $this->dyn_uid);
         /* Start Block: Prepare the XMLDB connection */
         define('DB_XMLDB_HOST', PATH_DYNAFORM . $this->file . '.xml');
         define('DB_XMLDB_USER', '');
         define('DB_XMLDB_PASS', '');
         define('DB_XMLDB_NAME', '');
         define('DB_XMLDB_TYPE', 'myxml');
         /* Start Block: Prepare the dynaformEditor */
         $G_PUBLISH = new Publisher();
         $sName = 'dynaformEditor';
         $G_PUBLISH->publisherId = $sName;
         $oHeadPublisher =& headPublisher::getSingleton();
         $oHeadPublisher->setTitle(G::LoadTranslation('ID_DYNAFORM_EDITOR') . ' - ' . $Properties['DYN_TITLE']);
         $G_PUBLISH->AddContent('blank');
         $this->panelConf['title'] = '';
         $G_PUBLISH->AddContent('panel-init', 'mainPanel', $this->panelConf);
         if ($Properties['DYN_TYPE'] == 'xmlform') {
             $G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_Toolbar', 'display:none', $Parameters, '', '');
         } else {
             $G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_ToolbarGrid', 'display:none', $Parameters, '', '');
         }
         $G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_Editor', 'display:none', $Parameters, '', '');
         $G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_XmlEditor', 'display:none', $XmlEditor, '', '');
         $G_PUBLISH->AddContent('blank');
         $i = 0;
         $aFields = array();
         $aFields[] = array('XMLNODE_NAME' => 'char', 'TYPE' => 'char', 'UP' => 'char', 'DOWN' => 'char');
         $oSession = new DBSession(new DBConnection(PATH_DYNAFORM . $this->file . '.xml', '', '', '', 'myxml'));
         $oDataset = $oSession->Execute('SELECT * FROM dynaForm WHERE NOT( XMLNODE_NAME = "" ) AND TYPE <> "pmconnection"');
         $iMaximun = $oDataset->count();
         while ($aRow = $oDataset->Read()) {
             $aFields[] = array('XMLNODE_NAME' => $aRow['XMLNODE_NAME'], 'TYPE' => $aRow['TYPE'], 'UP' => $i > 0 ? G::LoadTranslation('ID_UP') : '', 'DOWN' => $i < $iMaximun - 1 ? G::LoadTranslation('ID_DOWN') : '', 'row__' => $i + 1);
             $i++;
             break;
         }
         global $_DBArray;
         $_DBArray['fields'] = $aFields;
         $_SESSION['_DBArray'] = $_DBArray;
         G::LoadClass('ArrayPeer');
         $oCriteria = new Criteria('dbarray');
         $oCriteria->setDBArrayTable('fields');
         /**
          * *@Erik-> this is deprecated,.
          * (unuseful) $G_PUBLISH->AddContent('propeltable', 'paged-table', 'dynaforms/fields_List', $oCriteria, $Parameters, '', SYS_URI.'dynaforms/dynaforms_PagedTableAjax');**
          */
         $G_PUBLISH->AddContent('blank');
         $G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_JSEditor', 'display:none', $JSEditor, '', '');
     } catch (Exception $e) {
     }
     $G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_Properties', 'display:none', $Properties, '', '');
     //for showHide tab option @Neyek
     $G_PUBLISH->AddContent('blank');
     $G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PREVIEW"), $sName . '[3]', 'dynaformEditor.changeToPreview', 'dynaformEditor.saveCurrentView');
     $G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_XML"), $sName . '[4]', 'dynaformEditor.changeToXmlCode', 'dynaformEditor.saveCurrentView');
     if ($Properties['DYN_TYPE'] != 'grid') {
         $G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_HTML"), $sName . '[5]', 'dynaformEditor.changeToHtmlCode', 'dynaformEditor.saveCurrentView');
     }
     $G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_FIELDS_LIST"), $sName . '[6]', 'dynaformEditor.changeToFieldsList', 'dynaformEditor.saveCurrentView');
     if ($Properties["DYN_TYPE"] != "grid") {
         $G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_JAVASCRIPTS"), $sName . '[7]', 'dynaformEditor.changeToJavascripts', 'dynaformEditor.saveCurrentView');
     }
     $G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PROPERTIES"), $sName . '[8]', 'dynaformEditor.changeToProperties', 'dynaformEditor.saveCurrentView');
     //for showHide tab option @Neyek
     if ($Properties["DYN_TYPE"] != "grid") {
         $G_PUBLISH->AddContent("panel-tab", G::LoadTranslation("ID_CONDITIONS_EDITOR"), $sName . "[9]", "dynaformEditor.changeToShowHide", "dynaformEditor.saveShowHide");
     }
     $G_PUBLISH->AddContent('panel-close');
     $oHeadPublisher->addScriptFile("/js/maborak/core/maborak.loader.js", 2);
     $oHeadPublisher->addScriptFile('/jscore/dynaformEditor/core/dynaformEditor.js');
     //$oHeadPublisher->addScriptFile('/js/dveditor/core/dveditor.js');
     //$oHeadPublisher->addScriptFile('/codepress/codepress.js',1);
     $oHeadPublisher->addScriptFile('/js/codemirrorOld/js/codemirror.js', 1);
     $oHeadPublisher->addScriptFile('/js/grid/core/grid.js');
     $oHeadPublisher->addScriptCode('
     var DYNAFORM_URL="' . $Parameters['URL'] . '";
     leimnud.event.add(window,"load",function(){ loadEditor(); });
     ');
     $oHeadPublisher->addScriptCode(' var jsMeta;var __usernameLogged__ = "' . (isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '') . '";var SYS_LANG = "' . SYS_LANG . '";var __DYN_UID__ = "' . $this->dyn_uid . '";');
     $oHeadPublisher->addScriptCode('var dynaformEditorParams = \'' . serialize($Parameters) . '\';');
     G::RenderPage("publish", 'blank');
 }
コード例 #5
0
ファイル: AppHistory.php プロジェクト: bqevin/processmaker
 public function getDynaformHistory($PRO_UID, $TAS_UID, $APP_UID, $DYN_UID = "")
 {
     G::LoadClass('case');
     $oCase = new Cases();
     $oCase->verifyTable();
     $aObjectPermissions = $oCase->getAllObjects($PRO_UID, $APP_UID, $TAS_UID, $_SESSION['USER_LOGGED']);
     if (!is_array($aObjectPermissions)) {
         $aObjectPermissions = array('DYNAFORMS' => array(-1), 'INPUT_DOCUMENTS' => array(-1), 'OUTPUT_DOCUMENTS' => array(-1));
     }
     if (!isset($aObjectPermissions['DYNAFORMS'])) {
         $aObjectPermissions['DYNAFORMS'] = array(-1);
     } else {
         if (!is_array($aObjectPermissions['DYNAFORMS'])) {
             $aObjectPermissions['DYNAFORMS'] = array(-1);
         }
     }
     if (!isset($aObjectPermissions['INPUT_DOCUMENTS'])) {
         $aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
     } else {
         if (!is_array($aObjectPermissions['INPUT_DOCUMENTS'])) {
             $aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
         }
     }
     if (!isset($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
         $aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
     } else {
         if (!is_array($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
             $aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
         }
     }
     $c = new Criteria('workflow');
     $c->addSelectColumn(AppHistoryPeer::APP_UID);
     $c->addSelectColumn(AppHistoryPeer::DEL_INDEX);
     $c->addSelectColumn(AppHistoryPeer::PRO_UID);
     $c->addSelectColumn(AppHistoryPeer::TAS_UID);
     $c->addSelectColumn(AppHistoryPeer::DYN_UID);
     $c->addSelectColumn(AppHistoryPeer::USR_UID);
     $c->addSelectColumn(AppHistoryPeer::APP_STATUS);
     $c->addSelectColumn(AppHistoryPeer::HISTORY_DATE);
     $c->addSelectColumn(AppHistoryPeer::HISTORY_DATA);
     $c->addSelectColumn(UsersPeer::USR_FIRSTNAME);
     $c->addSelectColumn(UsersPeer::USR_LASTNAME);
     $c->addAsColumn('USR_NAME', "CONCAT(USR_LASTNAME, ' ', USR_FIRSTNAME)");
     $c->addJoin(AppHistoryPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
     //WHERE
     $c->add(AppHistoryPeer::DYN_UID, $aObjectPermissions['DYNAFORMS'], Criteria::IN);
     $c->add(AppHistoryPeer::PRO_UID, $PRO_UID);
     $c->add(AppHistoryPeer::APP_UID, $APP_UID);
     if (isset($DYN_UID) && $DYN_UID != "") {
         $c->add(AppHistoryPeer::DYN_UID, $DYN_UID);
     }
     //ORDER BY
     $c->clearOrderByColumns();
     $c->addDescendingOrderByColumn(AppHistoryPeer::HISTORY_DATE);
     //Execute
     $oDataset = AppHistoryPeer::doSelectRS($c);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     $aDynHistory = array();
     $aDynHistory[] = array('DYN_TITLE' => 'char');
     while ($aRow = $oDataset->getRow()) {
         $o = new Dynaform();
         $o->setDynUid($aRow['DYN_UID']);
         $aRow['DYN_TITLE'] = $o->getDynTitle();
         $changedValues = unserialize($aRow['HISTORY_DATA']);
         $html = "<table border='0' cellpadding='0' cellspacing='0'>";
         $sw_add = false;
         foreach ($changedValues as $key => $value) {
             if ($value != null && !is_array($value)) {
                 $sw_add = true;
                 $html .= "<tr>";
                 $html .= "<td><b>{$key}:</b> </td>";
                 $html .= "<td>{$value}</td>";
                 $html .= "</tr>";
             }
             if (is_array($value)) {
                 $html .= "<tr>";
                 $html .= "<td><b>{$key} (grid):</b> </td>";
                 $html .= "<td>";
                 $html .= "<table>";
                 foreach ($value as $key1 => $value1) {
                     $html .= "<tr>";
                     $html .= "<td><b>{$key1}</b></td>";
                     $html .= "<td>";
                     if (is_array($value1)) {
                         $sw_add = true;
                         $html .= "<table>";
                         foreach ($value1 as $key2 => $value2) {
                             $html .= "<tr>";
                             $html .= "<td><b>{$key2}</b></td>";
                             $html .= "<td>{$value2}</td>";
                             $html .= "</tr>";
                         }
                         $html .= "</table>";
                     }
                     $html .= "</td>";
                     $html .= "</tr>";
                 }
                 $html .= "</table>";
                 $html .= "</td>";
                 $html .= "</tr>";
                 $html .= "</td>";
             }
         }
         $html .= "</table>";
         $aRow['FIELDS'] = $html;
         if ($sw_add) {
             $aDynHistory[] = $aRow;
         }
         $oDataset->next();
     }
     global $_DBArray;
     $_DBArray['DynaformsHistory'] = $aDynHistory;
     $_SESSION['_DBArray'] = $_DBArray;
     G::LoadClass('ArrayPeer');
     $oCriteria = new Criteria('dbarray');
     $oCriteria->setDBArrayTable('DynaformsHistory');
     $oCriteria->addDescendingOrderByColumn(AppHistoryPeer::HISTORY_DATE);
     return $oCriteria;
 }
コード例 #6
0
ファイル: class.report.php プロジェクト: nshong/processmaker
 /** 
  * This function generates a filter to report 5
  * 
  * 
  * @name generatedReport5_filter
  *
  * @param string process
  * @param string task
  * @return object
  */
 function generatedReport5_filter($process, $task)
 {
     $this->reportsPatch();
     require_once 'classes/model/AppDelegation.php';
     require_once 'classes/model/Application.php';
     require_once 'classes/model/Process.php';
     require_once 'classes/model/Users.php';
     $oCriteria = new Criteria('workflow');
     $del = DBAdapter::getStringDelimiter();
     if ($process == '') {
         $var = " WHERE AD.DEL_FINISH_DATE IS NULL";
     } else {
         if ($task == '') {
             $var = " LEFT JOIN TASK AS T ON (AD.TAS_UID = T.TAS_UID)\n                WHERE AD.PRO_UID='" . $process . "' AND AD.DEL_FINISH_DATE IS NULL";
         } else {
             $var = " LEFT JOIN TASK AS T ON (AD.TAS_UID = T.TAS_UID)\n             WHERE AD.PRO_UID='" . $process . "' AND AD.TAS_UID='" . $task . "' ";
         }
     }
     $sql = "SELECT CONCAT(U.USR_LASTNAME,' ',USR_FIRSTNAME) AS USER,\n              COUNT(*) AS CANTCASES,\n              MIN(AD.DEL_DURATION) AS MIN,\n              MAX(AD.DEL_DURATION) AS MAX,\n              SUM(AD.DEL_DURATION) AS TOTALDUR,\n              AVG(AD.DEL_DURATION) AS PROMEDIO\n              FROM APP_DELEGATION AS AD\n              LEFT JOIN PROCESS AS P ON (P.PRO_UID = AD.PRO_UID)\n              LEFT JOIN USERS AS U ON(U.USR_UID = AD.USR_UID)\n              " . $var . "\n              GROUP BY USER";
     $con = Propel::getConnection("workflow");
     $stmt = $con->prepareStatement($sql);
     $rs = $stmt->executeQuery();
     $ROW[] = array('USER' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float');
     while ($rs->next()) {
         $ROW[] = array('USER' => $rs->getString('USER'), 'CANTCASES' => $rs->getString('CANTCASES'), 'MIN' => number_format($rs->getString('MIN'), 2), 'MAX' => number_format($rs->getString('MAX'), 2), 'TOTALDUR' => number_format($rs->getString('TOTALDUR'), 2), 'PROMEDIO' => number_format($rs->getString('PROMEDIO'), 2));
     }
     global $_DBArray;
     $_DBArray['reports'] = $ROW;
     $_SESSION['_DBArray'] = $_DBArray;
     G::LoadClass('ArrayPeer');
     $oCriteria = new Criteria('dbarray');
     $oCriteria->setDBArrayTable('reports');
     return $oCriteria;
 }
コード例 #7
0
             // add replace to change D'Souza to D*Souza by krlos
             $sCheckbox = '<div align="center"><input type="checkbox" name="aUsers[' . $i . ']" id="aUsers[' . $i . ']" value=\'' . str_replace("\\'", "*", addslashes($oJSON->encode($aUser))) . '\' /></div>';
             $i++;
         } else {
             $sCheckbox = G::LoadTranslation('ID_USER_REGISTERED') . ':<br />(' . $aUser['sUsername'] . ')';
         }
         // note added by gustavo cruz gustavo-at-colosa.com
         // assign the user data to the DBArray variable.
         $aUsers[] = array('Checkbox' => $sCheckbox, 'Username' => $aUser['sUsername'], 'FullName' => $aUser['sFullname'], 'FirstName' => $aUser['sFirstname'], 'LastName' => $aUser['sLastname'], 'Email' => $aUser['sEmail'], 'DistinguishedName' => $aUser['sDN']);
     }
     global $_DBArray;
     $_DBArray['users'] = $aUsers;
     $_SESSION['_DBArray'] = $_DBArray;
     G::LoadClass('ArrayPeer');
     $oCriteria = new Criteria('dbarray');
     $oCriteria->setDBArrayTable('users');
     $aData = array('Checkbox' => '0', 'FullName' => '0');
     global $G_PUBLISH;
     $G_PUBLISH = new Publisher();
     if ($aFields['AUTH_SOURCE_PROVIDER'] != 'ldap') {
         $G_PUBLISH->AddContent('propeltable', 'pagedTableLdap', 'authSources/ldapSearchResults', $oCriteria, ' ', array('Checkbox' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
     } else {
         if (file_exists(PATH_XMLFORM . 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
             $G_PUBLISH->AddContent('propeltable', 'pagedTableLdap', 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'SearchResults', $oCriteria, ' ', array('Checkbox' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
         } else {
             $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $aFields['AUTH_SOURCE_PROVIDER'] . 'SearchResults.xml' . ' doesn\'t exist.'));
         }
     }
     G::RenderPage('publish', 'raw');
     break;
 case 'authSourcesList':
コード例 #8
0
ファイル: AppHistory.php プロジェクト: emildev35/processmaker
 public function getDynaformHistory($PRO_UID, $TAS_UID, $APP_UID, $DYN_UID = "")
 {
     G::LoadClass('case');
     $oCase = new Cases();
     $oCase->verifyTable();
     $aObjectPermissions = $oCase->getAllObjects($PRO_UID, $APP_UID, $TAS_UID, $_SESSION['USER_LOGGED']);
     if (!is_array($aObjectPermissions)) {
         $aObjectPermissions = array('DYNAFORMS' => array(-1), 'INPUT_DOCUMENTS' => array(-1), 'OUTPUT_DOCUMENTS' => array(-1));
     }
     if (!isset($aObjectPermissions['DYNAFORMS'])) {
         $aObjectPermissions['DYNAFORMS'] = array(-1);
     } else {
         if (!is_array($aObjectPermissions['DYNAFORMS'])) {
             $aObjectPermissions['DYNAFORMS'] = array(-1);
         }
     }
     if (!isset($aObjectPermissions['INPUT_DOCUMENTS'])) {
         $aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
     } else {
         if (!is_array($aObjectPermissions['INPUT_DOCUMENTS'])) {
             $aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
         }
     }
     if (!isset($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
         $aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
     } else {
         if (!is_array($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
             $aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
         }
     }
     $appDocument = new AppDocument();
     foreach (array("INPUT_DOCUMENTS", "OUTPUT_DOCUMENTS") as $value) {
         $key = $value;
         if ($aObjectPermissions[$key]) {
             foreach ($aObjectPermissions[$key] as $key2 => $value2) {
                 $appDocumentUid = $value2;
                 try {
                     $arrayAppDocumentData = $appDocument->load($appDocumentUid);
                     $aObjectPermissions[$key][$key2] = $arrayAppDocumentData["DOC_UID"];
                 } catch (Exception $e) {
                 }
             }
         }
     }
     $dynaForm = new Dynaform();
     $inputDocument = new InputDocument();
     $outputDocument = new OutputDocument();
     $c = new Criteria('workflow');
     $c->addSelectColumn(AppHistoryPeer::APP_UID);
     $c->addSelectColumn(AppHistoryPeer::DEL_INDEX);
     $c->addSelectColumn(AppHistoryPeer::PRO_UID);
     $c->addSelectColumn(AppHistoryPeer::TAS_UID);
     $c->addSelectColumn(AppHistoryPeer::DYN_UID);
     $c->addSelectColumn(AppHistoryPeer::OBJ_TYPE);
     $c->addSelectColumn(AppHistoryPeer::USR_UID);
     $c->addSelectColumn(AppHistoryPeer::APP_STATUS);
     $c->addSelectColumn(AppHistoryPeer::HISTORY_DATE);
     $c->addSelectColumn(AppHistoryPeer::HISTORY_DATA);
     $c->addSelectColumn(UsersPeer::USR_FIRSTNAME);
     $c->addSelectColumn(UsersPeer::USR_LASTNAME);
     $c->addAsColumn('USR_NAME', "CONCAT(USR_LASTNAME, ' ', USR_FIRSTNAME)");
     $c->addJoin(AppHistoryPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
     //WHERE
     $c->add($c->getNewCriterion(AppHistoryPeer::DYN_UID, $aObjectPermissions["DYNAFORMS"], Criteria::IN)->addOr($c->getNewCriterion(AppHistoryPeer::DYN_UID, $aObjectPermissions["INPUT_DOCUMENTS"], Criteria::IN))->addOr($c->getNewCriterion(AppHistoryPeer::DYN_UID, $aObjectPermissions["OUTPUT_DOCUMENTS"], Criteria::IN)));
     $c->add(AppHistoryPeer::PRO_UID, $PRO_UID);
     $c->add(AppHistoryPeer::APP_UID, $APP_UID);
     $c->add(AppHistoryPeer::TAS_UID, $TAS_UID);
     if (isset($DYN_UID) && $DYN_UID != "") {
         $c->add(AppHistoryPeer::DYN_UID, $DYN_UID);
     }
     //Execute
     $oDataset = AppHistoryPeer::doSelectRS($c);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $aDynHistory = array();
     $aDynHistory[] = array('DYN_TITLE' => 'char');
     while ($oDataset->next()) {
         $aRow = $oDataset->getRow();
         $title = "";
         switch ($aRow["OBJ_TYPE"]) {
             case "DYNAFORM":
                 $arrayDynaFormData = $dynaForm->Load($aRow["DYN_UID"]);
                 $title = $arrayDynaFormData["DYN_TITLE"] . " (" . G::LoadTranslation("ID_DYNAFORM") . ")";
                 break;
             case "INPUT_DOCUMENT":
                 $arrayInputDocumentData = $inputDocument->load($aRow["DYN_UID"]);
                 $title = $arrayInputDocumentData["INP_DOC_TITLE"] . " (" . G::LoadTranslation("ID_INPUT_DOCUMENT") . ")";
                 break;
             case "OUTPUT_DOCUMENT":
                 $arrayOutputDocumentData = $outputDocument->load($aRow["DYN_UID"]);
                 $title = $arrayOutputDocumentData["OUT_DOC_TITLE"] . " (" . G::LoadTranslation("ID_OUTPUT_DOCUMENT") . ")";
                 break;
             case "ASSIGN_TASK":
                 $title = G::LoadTranslation("ID_ASSIGN_TASK") . " (" . G::LoadTranslation("ID_TRIGGERS") . ")";
                 break;
         }
         $aRow["DYN_TITLE"] = $title;
         $changedValues = unserialize($aRow['HISTORY_DATA']);
         $html = "<table border='0' cellpadding='0' cellspacing='0'>";
         $sw_add = false;
         foreach ($changedValues as $key => $value) {
             if ($value != null && !is_array($value)) {
                 $sw_add = true;
                 $html .= "<tr>";
                 $html .= "<td><b>{$key}:</b> </td>";
                 $html .= "<td>{$value}</td>";
                 $html .= "</tr>";
             }
             if (is_array($value)) {
                 $html .= "<tr>";
                 $html .= "<td><b>{$key} (grid):</b> </td>";
                 $html .= "<td>";
                 $html .= "<table>";
                 foreach ($value as $key1 => $value1) {
                     $html .= "<tr>";
                     $html .= "<td><b>{$key1}</b></td>";
                     $html .= "<td>";
                     if (is_array($value1)) {
                         $sw_add = true;
                         $html .= "<table>";
                         foreach ($value1 as $key2 => $value2) {
                             $html .= "<tr>";
                             $html .= "<td><b>{$key2}</b></td>";
                             $html .= "<td>{$value2}</td>";
                             $html .= "</tr>";
                         }
                         $html .= "</table>";
                     }
                     $html .= "</td>";
                     $html .= "</tr>";
                 }
                 $html .= "</table>";
                 $html .= "</td>";
                 $html .= "</tr>";
                 $html .= "</td>";
             }
         }
         $html .= "</table>";
         $aRow['FIELDS'] = $html;
         if ($sw_add) {
             $aDynHistory[] = $aRow;
         }
     }
     global $_DBArray;
     $_DBArray['DynaformsHistory'] = $aDynHistory;
     $_SESSION['_DBArray'] = $_DBArray;
     G::LoadClass('ArrayPeer');
     $oCriteria = new Criteria('dbarray');
     $oCriteria->setDBArrayTable('DynaformsHistory');
     $oCriteria->addAscendingOrderByColumn(AppHistoryPeer::HISTORY_DATE);
     return $oCriteria;
 }
コード例 #9
0
     $sFilter = isset($_POST['filter']) ? $_POST['filter'] : '';
     $oDynaformHandler = new dynaFormHandler(PATH_DYNAFORM . $_DYN_FILENAME . '.xml');
     $aFilter = explode(',', $sFilter);
     $aAvailableFields = $oDynaformHandler->getFieldNames($aFilter);
     $aFieldNames = array('id' => 'char', 'name' => 'char');
     $aRows = array();
     foreach ($aAvailableFields as $sFieldname) {
         array_push($aRows, array('id' => $sFieldname, 'name' => $sFieldname));
     }
     $rows = array_merge(array($aFieldNames), $aRows);
     global $_DBArray;
     $_DBArray['DYNAFIELDS'] = $rows;
     $_SESSION['_DBArray'] = $_DBArray;
     G::LoadClass('ArrayPeer');
     $oCriteria = new Criteria('dbarray');
     $oCriteria->setDBArrayTable('DYNAFIELDS');
     $G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_vars', '', '');
     G::RenderPage('publish', 'raw');
     break;
 case 'testSetup':
     $sFields = $_POST['sFields'];
     $aFields = array();
     $aFieldsTmp = $sFields == '' ? array() : explode(',', $sFields);
     $i = 1;
     foreach ($aFieldsTmp as $aField) {
         $aFields['gFields'][$i++] = array('dynaid' => $aField, 'dynafield' => $aField, 'dynavalue' => '');
     }
     if (sizeof($aFields) > 0) {
         $G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_ConditionalShowHideTest', '', $aFields);
         G::RenderPage('publish', 'raw');
     } else {
コード例 #10
0
ファイル: casesDemo.php プロジェクト: emildev35/processmaker
 $rows[] = array('uid' => 11, 'name' => 'john', 'age' => 44, 'balance' => 123423);
 $rows[] = array('uid' => 22, 'name' => 'bobby', 'age' => 33, 'balance' => 23456);
 $rows[] = array('uid' => 33, 'name' => 'Dan', 'age' => 22, 'balance' => 34567);
 $rows[] = array('uid' => 33, 'name' => 'Mike', 'age' => 21, 'balance' => 4567);
 $rows[] = array('uid' => 44, 'name' => 'Paul', 'age' => 22, 'balance' => 567);
 $rows[] = array('uid' => 55, 'name' => 'Will', 'age' => 23, 'balance' => 67);
 $rows[] = array('uid' => 66, 'name' => 'Ernest', 'age' => 24, 'balance' => 7);
 $rows[] = array('uid' => 77, 'name' => 'Albert', 'age' => 25, 'balance' => 84567);
 $rows[] = array('uid' => 88, 'name' => 'Sue', 'age' => 26, 'balance' => 94567);
 $rows[] = array('uid' => 99, 'name' => 'Freddy', 'age' => 22, 'balance' => 04567);
 $_DBArray['user'] = $rows;
 $_SESSION['_DBArray'] = $_DBArray;
 //krumo ( $_DBArray );
 G::LoadClass('ArrayPeer');
 $c = new Criteria('dbarray');
 $c->setDBArrayTable('user');
 //    $c->add ( 'user.age', 22 , Criteria::GREATER_EQUAL );
 //    $c->add ( 'user.age', 22 , Criteria::EQUAL );
 $c->add('user.name', '%au%', Criteria::LIKE);
 //    $c->add ( 'user.balance', 3456 , Criteria::GREATER_EQUAL );
 $c->addAscendingOrderByColumn('name');
 $G_MAIN_MENU = 'processmaker';
 $G_ID_MENU_SELECTED = 'CASES';
 $G_PUBLISH = new Publisher();
 //  $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/casesDemo', $c );
 //$G_PUBLISH->AddContent('smarty', 'cases/casesDemo', '', '', $Fields);
 //  G::RenderPage( "publish" );
 //die;
 /* Includes */
 G::LoadClass('pmScript');
 G::LoadClass('case');
コード例 #11
0
$oCaseScheduler = new CaseScheduler();
$aRows = $oCaseScheduler->getAllByProcess($process);
//$oCaseScheduler->caseSchedulerCron();
// g::pr($aRows); die;
$fieldNames = array('SCH_UID' => 'char', 'SCH_NAME' => 'char', 'PRO_UID' => 'char', 'TAS_UID' => 'char', 'SCH_TIME_NEXT_RUN' => 'char', 'SCH_LAST_RUN_TIME' => 'char', 'SCH_STATE' => 'char', 'SCH_LAST_STATE' => 'char', 'USR_UID' => 'char', 'SCH_OPTION' => 'char', 'SCH_START_TIME' => 'char', 'SCH_START_DATE' => 'char', 'SCH_DAYS_PERFORM_TASK' => 'char', 'SCH_EVERY_DAYS' => 'char', 'SCH_WEEK_DAYS' => 'char', 'SCH_START_DAY' => 'char', 'SCH_MONTHS' => 'char', 'SCH_END_DATE' => 'char', 'SCH_REPEAT_EVERY' => 'char', 'SCH_REPEAT_UNTIL' => 'char', 'SCH_REPEAT_STOP_IF_RUNNING' => 'char', 'PRO_PARENT' => 'char', 'PRO_TIME' => 'char', 'PRO_TIMEUNIT' => 'char', 'PRO_STATUS' => 'char', 'PRO_TYPE_DAY' => 'char', 'PRO_TYPE' => 'char', 'PRO_ASSIGNMENT' => 'char', 'PRO_SHOW_MAP' => 'char', 'PRO_SHOW_MESSAGE' => 'char', 'PRO_SUBPROCESS' => 'char', 'PRO_TRI_DELETED' => 'char', 'PRO_TRI_CANCELED' => 'char', 'PRO_TRI_PAUSED' => 'char', 'PRO_TRI_REASSIGNED' => 'char', 'PRO_SHOW_DELEGATE' => 'char', 'PRO_SHOW_DYNAFORM' => 'char', 'PRO_CATEGORY' => 'char', 'PRO_SUB_CATEGORY' => 'char', 'PRO_INDUSTRY' => 'char', 'PRO_UPDATE_DATE' => 'char', 'PRO_CREATE_DATE' => 'char', 'PRO_CREATE_USER' => 'char', 'PRO_HEIGHT' => 'char', 'PRO_WIDTH' => 'char', 'PRO_TITLE_X' => 'char', 'PRO_TITLE_Y' => 'char', 'PRO_DEBUG' => 'char', 'PRO_TITLE' => 'char', 'PRO_DESCRIPTION' => 'char', 'TAS_TYPE' => 'char', 'TAS_DURATION' => 'char', 'TAS_DELAY_TYPE' => 'char', 'TAS_TEMPORIZER' => 'char', 'TAS_TYPE_DAY' => 'char', 'TAS_TIMEUNIT' => 'char', 'TAS_ALERT' => 'char', 'TAS_PRIORITY_VARIABLE' => 'char', 'TAS_ASSIGN_TYPE' => 'char', 'TAS_ASSIGN_VARIABLE' => 'char', 'TAS_ASSIGN_LOCATION' => 'char', 'TAS_ASSIGN_LOCATION_ADHOC' => 'char', 'TAS_TRANSFER_FLY' => 'char', 'TAS_LAST_ASSIGNED' => 'char', 'TAS_USER' => 'char', 'TAS_CAN_UPLOAD' => 'char', 'TAS_VIEW_UPLOAD' => 'char', 'TAS_VIEW_ADDITIONAL_DOCUMENTATION' => 'char', 'TAS_CAN_CANCEL' => 'char', 'TAS_OWNER_APP' => 'char', 'STG_UID' => 'char', 'TAS_CAN_PAUSE' => 'char', 'TAS_CAN_SEND_MESSAGE' => 'char', 'TAS_CAN_DELETE_DOCS' => 'char', 'TAS_SELF_SERVICE' => 'char', 'TAS_START' => 'char', 'TAS_TO_LAST_USER' => 'char', 'TAS_SEND_LAST_EMAIL' => 'char', 'TAS_DERIVATION' => 'char', 'TAS_POSX' => 'char', 'TAS_POSY' => 'char', 'TAS_COLOR' => 'char', 'TAS_TITLE' => 'char', 'TAS_DESCRIPTION' => 'char', 'TAS_DEF_TITLE' => 'char', 'TAS_DEF_DESCRIPTION' => 'char', 'TAS_DEF_PROC_CODE' => 'char', 'TAS_DEF_MESSAGE' => 'char');
$aRows = array_merge(array($fieldNames), $aRows);
//krumo ($aRows);
for ($j = 0; $j < count($aRows); $j++) {
    if ($aRows[$j]['SCH_STATE'] == 'PROCESSED') {
        $aRows[$j]['SCH_TIME_NEXT_RUN'] = '';
    }
}
// g::pr($aRows); die;
global $_DBArray;
$_DBArray['cases_scheduler'] = $aRows;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('cases_scheduler');
//krumo ($oCriteria);
//var_dump ($oCriteria);
//$oCriteria->add('PRO_UID', $_SESSION['PROCESS']);
//krumo($_SESSION);
$G_PUBLISH = new Publisher();
$G_PUBLISH->ROWS_PER_PAGE = 10;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_Scheduler_List', $oCriteria, array('CONFIRM' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
if (!isset($G_PUBLISH->oPropelTable) || !is_object($G_PUBLISH->oPropelTable)) {
    $G_PUBLISH->oPropelTable = new stdclass();
}
$G_PUBLISH->oPropelTable->rowsPerPage = 10;
G::RenderPage('publishBlank', 'blank');
コード例 #12
0
ファイル: Cases.php プロジェクト: nhenderson/processmaker
    public function getAllGeneratedDocumentsCriteria($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID)
    {
        \G::LoadClass("configuration");
        $conf = new \Configurations();
        $confEnvSetting = $conf->getFormats();
        //verifica si la tabla OBJECT_PERMISSION
        $cases = new \cases();
        $cases->verifyTable();
        $listing = false;
        $oPluginRegistry = & \PMPluginRegistry::getSingleton();
        if ($oPluginRegistry->existsTrigger(PM_CASE_DOCUMENT_LIST)) {
            $folderData = new \folderData(null, null, $sApplicationUID, null, $sUserUID);
            $folderData->PMType = "OUTPUT";
            $folderData->returnList = true;
            //$oPluginRegistry = & PMPluginRegistry::getSingleton();
            $listing = $oPluginRegistry->executeTriggers(PM_CASE_DOCUMENT_LIST, $folderData);
        }
        $aObjectPermissions = $cases->getAllObjects($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID);
        if (!is_array($aObjectPermissions)) {
            $aObjectPermissions = array('DYNAFORMS' => array(-1),'INPUT_DOCUMENTS' => array(-1),'OUTPUT_DOCUMENTS' => array(-1));
        }
        if (!isset($aObjectPermissions['DYNAFORMS'])) {
            $aObjectPermissions['DYNAFORMS'] = array(-1);
        } else {
            if (!is_array($aObjectPermissions['DYNAFORMS'])) {
                $aObjectPermissions['DYNAFORMS'] = array(-1);
            }
        }
        if (!isset($aObjectPermissions['INPUT_DOCUMENTS'])) {
            $aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
        } else {
            if (!is_array($aObjectPermissions['INPUT_DOCUMENTS'])) {
                $aObjectPermissions['INPUT_DOCUMENTS'] = array(-1);
            }
        }
        if (!isset($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
            $aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
        } else {
            if (!is_array($aObjectPermissions['OUTPUT_DOCUMENTS'])) {
                $aObjectPermissions['OUTPUT_DOCUMENTS'] = array(-1);
            }
        }
        $aDelete = $cases->getAllObjectsFrom($sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID, 'DELETE');
        $oAppDocument = new \AppDocument();
        $oCriteria = new \Criteria('workflow');
        $oCriteria->add(\AppDocumentPeer::APP_UID, $sApplicationUID);
        $oCriteria->add(\AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
        $oCriteria->add(\AppDocumentPeer::APP_DOC_STATUS, array('ACTIVE'), \Criteria::IN);
        //$oCriteria->add(AppDocumentPeer::APP_DOC_UID, $aObjectPermissions['OUTPUT_DOCUMENTS'], Criteria::IN);
        $oCriteria->add(
            $oCriteria->getNewCriterion(
                \AppDocumentPeer::APP_DOC_UID, $aObjectPermissions['OUTPUT_DOCUMENTS'], \Criteria::IN)->addOr($oCriteria->getNewCriterion(\AppDocumentPeer::USR_UID, $sUserUID, \Criteria::EQUAL))
        );
        $aConditions = array();
        $aConditions[] = array(\AppDocumentPeer::APP_UID, \AppDelegationPeer::APP_UID);
        $aConditions[] = array(\AppDocumentPeer::DEL_INDEX, \AppDelegationPeer::DEL_INDEX);
        $oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
        $oCriteria->add(\AppDelegationPeer::PRO_UID, $sProcessUID);
        $oCriteria->addAscendingOrderByColumn(\AppDocumentPeer::APP_DOC_INDEX);
        $oDataset = \AppDocumentPeer::doSelectRS($oCriteria);
        $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
        $oDataset->next();
        $aOutputDocuments = array();
        $aOutputDocuments[] = array(
            'APP_DOC_UID' => 'char',
            'DOC_UID' => 'char',
            'APP_DOC_COMMENT' => 'char',
            'APP_DOC_FILENAME' => 'char',
            'APP_DOC_INDEX' => 'integer'
        );
        $oUser = new \Users();
        while ($aRow = $oDataset->getRow()) {
            $oCriteria2 = new \Criteria('workflow');
            $oCriteria2->add(\AppDelegationPeer::APP_UID, $sApplicationUID);
            $oCriteria2->add(\AppDelegationPeer::DEL_INDEX, $aRow['DEL_INDEX']);
            $oDataset2 = \AppDelegationPeer::doSelectRS($oCriteria2);
            $oDataset2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
            $oDataset2->next();
            $aRow2 = $oDataset2->getRow();
            $oTask = new \Task();
            if ($oTask->taskExists($aRow2['TAS_UID'])) {
                $aTask = $oTask->load($aRow2['TAS_UID']);
            } else {
                $aTask = array('TAS_TITLE' => '(TASK DELETED)');
            }
            $lastVersion = $oAppDocument->getLastDocVersion($aRow['DOC_UID'], $sApplicationUID);
            if ($lastVersion == $aRow['DOC_VERSION']) {
                //Only show last document Version
                $aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']);
                //Get output Document information
                $oOutputDocument = new \OutputDocument();
                $aGields = $oOutputDocument->load($aRow['DOC_UID']);
                //OUTPUTDOCUMENT
                $outDocTitle = $aGields['OUT_DOC_TITLE'];
                switch ($aGields['OUT_DOC_GENERATE']) {
                    //G::LoadTranslation(ID_DOWNLOAD)
                    case "PDF":
                        $fileDoc = 'javascript:alert("NO DOC")';
                        $fileDocLabel = " ";
                        $filePdf = 'cases_ShowOutputDocument?a=' .
                            $aRow['APP_DOC_UID'] . '&v=' . $aRow['DOC_VERSION'] . '&ext=pdf&random=' . rand();
                        $filePdfLabel = ".pdf";
                        if (is_array($listing)) {
                            foreach ($listing as $folderitem) {
                                if (($folderitem->filename == $aRow['APP_DOC_UID']) && ($folderitem->type == "PDF")) {
                                    $filePdfLabel = \G::LoadTranslation('ID_GET_EXTERNAL_FILE') . " .pdf";
                                    $filePdf = $folderitem->downloadScript;
                                    continue;
                                }
                            }
                        }
                        break;
                    case "DOC":
                        $fileDoc = 'cases_ShowOutputDocument?a=' .
                            $aRow['APP_DOC_UID'] . '&v=' . $aRow['DOC_VERSION'] . '&ext=doc&random=' . rand();
                        $fileDocLabel = ".doc";
                        $filePdf = 'javascript:alert("NO PDF")';
                        $filePdfLabel = " ";
                        if (is_array($listing)) {
                            foreach ($listing as $folderitem) {
                                if (($folderitem->filename == $aRow['APP_DOC_UID']) && ($folderitem->type == "DOC")) {
                                    $fileDocLabel = \G::LoadTranslation('ID_GET_EXTERNAL_FILE') . " .doc";
                                    $fileDoc = $folderitem->downloadScript;
                                    continue;
                                }
                            }
                        }
                        break;
                    case "BOTH":
                        $fileDoc = 'cases_ShowOutputDocument?a=' .
                            $aRow['APP_DOC_UID'] . '&v=' . $aRow['DOC_VERSION'] . '&ext=doc&random=' . rand();
                        $fileDocLabel = ".doc";
                        if (is_array($listing)) {
                            foreach ($listing as $folderitem) {
                                if (($folderitem->filename == $aRow['APP_DOC_UID']) && ($folderitem->type == "DOC")) {
                                    $fileDocLabel = G::LoadTranslation('ID_GET_EXTERNAL_FILE') . " .doc";
                                    $fileDoc = $folderitem->downloadScript;
                                    continue;
                                }
                            }
                        }
                        $filePdf = 'cases_ShowOutputDocument?a=' .
                            $aRow['APP_DOC_UID'] . '&v=' . $aRow['DOC_VERSION'] . '&ext=pdf&random=' . rand();
                        $filePdfLabel = ".pdf";

                        if (is_array($listing)) {
                            foreach ($listing as $folderitem) {
                                if (($folderitem->filename == $aRow['APP_DOC_UID']) && ($folderitem->type == "PDF")) {
                                    $filePdfLabel = \G::LoadTranslation('ID_GET_EXTERNAL_FILE') . " .pdf";
                                    $filePdf = $folderitem->downloadScript;
                                    continue;
                                }
                            }
                        }
                        break;
                }
                try {
                    $aAux1 = $oUser->load($aAux['USR_UID']);
                    $sUser = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $aAux1["USR_USERNAME"], $aAux1["USR_FIRSTNAME"], $aAux1["USR_LASTNAME"]);
                } catch (\Exception $oException) {
                    $sUser = '******';
                }
                //if both documents were generated, we choose the pdf one, only if doc was
                //generate then choose the doc file.
                $firstDocLink = $filePdf;
                $firstDocLabel = $filePdfLabel;
                if ($aGields['OUT_DOC_GENERATE'] == 'DOC') {
                    $firstDocLink = $fileDoc;
                    $firstDocLabel = $fileDocLabel;
                }
                $aFields = array(
                    'APP_DOC_UID' => $aAux['APP_DOC_UID'],
                    'DOC_UID' => $aAux['DOC_UID'],
                    'APP_DOC_COMMENT' => $aAux['APP_DOC_COMMENT'],
                    'APP_DOC_FILENAME' => $aAux['APP_DOC_FILENAME'],
                    'APP_DOC_INDEX' => $aAux['APP_DOC_INDEX'],
                    'ORIGIN' => $aTask['TAS_TITLE'],
                    'CREATE_DATE' => $aAux['APP_DOC_CREATE_DATE'],
                    'CREATED_BY' => $sUser,
                    'FILEDOC' => $fileDoc,
                    'FILEPDF' => $filePdf,
                    'OUTDOCTITLE' => $outDocTitle,
                    'DOC_VERSION' => $aAux['DOC_VERSION'],
                    'TYPE' => $aAux['APP_DOC_TYPE'] . ' ' . $aGields['OUT_DOC_GENERATE'],
                    'DOWNLOAD_LINK' => $firstDocLink,
                    'DOWNLOAD_FILE' => $aAux['APP_DOC_FILENAME'] . $firstDocLabel
                );
                if (trim($fileDocLabel) != '') {
                    $aFields['FILEDOCLABEL'] = $fileDocLabel;
                }
                if (trim($filePdfLabel) != '') {
                    $aFields['FILEPDFLABEL'] = $filePdfLabel;
                }
                if ($aFields['APP_DOC_FILENAME'] != '') {
                    $aFields['TITLE'] = $aFields['APP_DOC_FILENAME'];
                } else {
                    $aFields['TITLE'] = $aFields['APP_DOC_COMMENT'];
                }
                //$aFields['POSITION'] = $_SESSION['STEP_POSITION'];
                $aFields['CONFIRM'] = \G::LoadTranslation('ID_CONFIRM_DELETE_ELEMENT');
                if (in_array($aRow['APP_DOC_UID'], $aObjectPermissions['OUTPUT_DOCUMENTS'])) {
                    if (in_array($aRow['APP_DOC_UID'], $aDelete['OUTPUT_DOCUMENTS'])) {
                        $aFields['ID_DELETE'] = \G::LoadTranslation('ID_DELETE');
                    }
                }
                $aOutputDocuments[] = $aFields;
            }
            $oDataset->next();
        }
        global $_DBArray;
        $_DBArray['outputDocuments'] = $aOutputDocuments;
        \G::LoadClass('ArrayPeer');
        $oCriteria = new \Criteria('dbarray');
        $oCriteria->setDBArrayTable('outputDocuments');
        $oCriteria->addDescendingOrderByColumn('CREATE_DATE');
        return $oCriteria;
    }
コード例 #13
0
ファイル: appFolderAjax.php プロジェクト: rrsc/processmaker
function documentVersionHistory()
{
    $folderID = $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ? "" : $_POST ['folderID'] : $rootFolder;
    $folderContent = $oPMFolder->getFolderContent ($folderID, array ($_POST ['appDocId']));

    array_unshift ($folderContent, array ('id' => 'char'));
    if (! is_array ($folderContent)) {
        echo $folderContent;
        exit ();
    }

    $_DBArray ['PM_FOLDER_DOC_HISTORY'] = $folderContent;
    $_SESSION ['_DBArray'] = $_DBArray;

    G::LoadClass ('ArrayPeer');
    $c = new Criteria ('dbarray');
    $c->setDBArrayTable ('PM_FOLDER_DOC_HISTORY');
    $c->addAscendingOrderByColumn ('id');
    $G_PUBLISH = new Publisher ();
    require_once ('classes/class.xmlfield_InputPM.php');

    $G_PUBLISH->AddContent ('propeltable', 'paged-table', 'appFolder/appFolderDocumentListHistory', $c,
        array ('folderID' => $_POST ['folderID'] != '0' ? $_POST ['folderID'] == 'NA' ?
        "/" : $_POST ['folderID'] : $rootFolder));

    G::RenderPage ('publish', 'raw');
}
コード例 #14
0
ファイル: myInfo_Edit.php プロジェクト: nshong/processmaker
    global $G_TMP_MENU;
    $oMenu = new Menu();
    $oMenu->load('cases');
    $rowsCasesMenu[] = array('id' => 'char', 'name' => 'char');
    foreach ($oMenu->Id as $i => $item) {
        if ($oMenu->Types[$i] != 'blockHeader') {
            $rowsCasesMenu[] = array('id' => $item, 'name' => $oMenu->Labels[$i]);
        }
    }
    //G::pr($rows); die;
    global $_DBArray;
    $_DBArray['menutab'] = $rows;
    $_SESSION['_DBArray'] = $_DBArray;
    $_DBArray['CASES_MENU'] = $rowsCasesMenu;
    $_SESSION['_DBArray'] = $_DBArray;
    G::LoadClass('ArrayPeer');
    $oCriteria = new Criteria('dbarray');
    $oCriteria->setDBArrayTable('menutab');
    $oCriteria2 = new Criteria('dbarray');
    $oCriteria2->setDBArrayTable('CASES_MENU');
    if ($RBAC->userCanAccess('PM_EDITPERSONALINFO') == 1) {
        //he has permitions for edit his profile
        $G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/myInfo.xml', '', $aFields, 'myInfo_Save');
    } else {
        //he has not permitions for edit his profile, so just view mode will be displayed
        $G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/myInfo2.xml', '', $aFields, '');
    }
    G::RenderPage('publish');
} catch (Exception $oException) {
    die($oException->getMessage());
}
コード例 #15
0
ファイル: eventsAjax.php プロジェクト: nshong/processmaker
        $aDynaformFields = array();
        foreach ($aDynaforms as $dyn) {
            if ($dyn['DYN_TYPE'] == 'xmlform') {
                if (is_file(PATH_DYNAFORM . "{$_SESSION['PROCESS']}/{$dyn['DYN_UID']}" . '.xml')) {
                    $oDynaformHandler = new dynaFormHandler(PATH_DYNAFORM . "{$_SESSION['PROCESS']}/{$dyn['DYN_UID']}" . '.xml');
                    $aDynaformFields[$dyn['DYN_TITLE']] = $oDynaformHandler->getFieldNames();
                } else {
                    continue;
                }
            }
        }
        //G::pr($aDynaformFields); die;
        $aRows = array();
        $aRows[0] = array('id' => 'char', 'dynaform' => 'char', 'name' => 'char');
        foreach ($aDynaformFields as $dynName => $aFields) {
            foreach ($aFields as $sField) {
                array_push($aRows, array('id' => $sField, 'dynaform' => $dynName, 'name' => $sField));
            }
        }
        //g::pr($aRows); die;
        global $_DBArray;
        $_DBArray['virtualtable'] = $aRows;
        $_SESSION['_DBArray'] = $_DBArray;
        G::LoadClass('ArrayPeer');
        $oCriteria = new Criteria('dbarray');
        $oCriteria->setDBArrayTable('virtualtable');
        $G_PUBLISH = new Publisher();
        $G_PUBLISH->AddContent('propeltable', 'paged-table', 'events/dynavarsList', $oCriteria);
        G::RenderPage('publish', 'raw');
        break;
}
コード例 #16
0
                         $guid = $item->guid;
                     }
                     if (isset($item->name)) {
                         $name = $item->name;
                     }
                 }
             }
             $rows[] = array('guid' => $guid, 'name' => $name);
         }
         global $_DBArray;
         $_DBArray = isset($_SESSION['_DBArray']) ? $_SESSION['_DBArray'] : '';
         $_DBArray['taskCases'] = $rows;
         $_SESSION['_DBArray'] = $_DBArray;
         G::LoadClass('ArrayPeer');
         $c = new Criteria('dbarray');
         $c->setDBArrayTable('taskCases');
         $c->addAscendingOrderByColumn('name');
         $G_PUBLISH->AddContent('propeltable', 'paged-table', 'setup/wsrTaskCase', $c);
     } else {
         if (is_object($result)) {
             $_SESSION['WS_SESSION_ID'] = '';
             $fields['status_code'] = $result->status_code;
             $fields['message'] = $result->message;
             $fields['time_stamp'] = date("Y-m-d H:i:s");
             $G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/wsShowResult', null, $fields);
         }
     }
     G::RenderPage('publish', 'raw');
     break;
 case "wsSendFiles":
     if (isset($_FILES['form'])) {
コード例 #17
0
    public function getHistoryMessagesTrackerExt($sApplicationUID, $onlyVisibles = false, $start = null, $limit = null)

    {

        G::LoadClass('ArrayPeer');

        global $_DBArray;



        $oAppDocument = new AppDocument();

        $oCriteria = new Criteria('workflow');

        $oCriteria->add(AppMessagePeer::APP_UID, $sApplicationUID);

        if ($onlyVisibles) {

            $oCriteria->add(AppMessagePeer::APP_MSG_SHOW_MESSAGE, 1);

        }

        $oCriteria->addAscendingOrderByColumn(AppMessagePeer::APP_MSG_DATE);



        $oDataset = AppMessagePeer::doSelectRS($oCriteria);

        $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);

        $oDataset->next();

        $aMessages = array();



        while ($aRow = $oDataset->getRow()) {

            //Head for IE quirks mode

            $sBody = '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />'.$aRow['APP_MSG_BODY'];

            $aMessages[] = array('APP_MSG_UID' => $aRow['APP_MSG_UID'],

                'APP_UID' => $aRow['APP_UID'],

                'DEL_INDEX' => $aRow['DEL_INDEX'],

                'APP_MSG_TYPE' => $aRow['APP_MSG_TYPE'],

                'APP_MSG_SUBJECT' => $aRow['APP_MSG_SUBJECT'],

                'APP_MSG_FROM' => $aRow['APP_MSG_FROM'],

                'APP_MSG_TO' => $aRow['APP_MSG_TO'],

                'APP_MSG_BODY' => $sBody,

                'APP_MSG_DATE' => $aRow['APP_MSG_DATE'],

                'APP_MSG_CC' => $aRow['APP_MSG_CC'],

                'APP_MSG_BCC' => $aRow['APP_MSG_BCC'],

                'APP_MSG_TEMPLATE' => $aRow['APP_MSG_TEMPLATE'],

                'APP_MSG_STATUS' => $aRow['APP_MSG_STATUS'],

                'APP_MSG_ATTACH' => $aRow['APP_MSG_ATTACH'],

                'APP_MSG_SHOW_MESSAGE' => $aRow['APP_MSG_SHOW_MESSAGE']

            );

            $oDataset->next();

        }



        $_DBArray['messages'] = $aMessages;

        $_SESSION['_DBArray'] = $_DBArray;



        $oCriteria = new Criteria('dbarray');

        $oCriteria->setDBArrayTable('messages');



        usort( $aMessages, array($this, "ordProcess") );

        return $aMessages;

    }
コード例 #18
0
                    $aConditions[] = array(ContentPeer::CON_LANG, $del . SYS_LANG . $del);
                    $oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
                    $oCriteria->add(AppDelegationPeer::USR_UID, $_POST['USR_UID']);
                    $oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
                    $oCriteria->addGroupByColumn(AppDelegationPeer::PRO_UID);
                    /*
                     * Adding grouped by standardization.
                     */
                    $oCriteria->addGroupByColumn(ContentPeer::CON_VALUE);
                    $oDataset = AppDelegationPeer::doSelectRS($oCriteria);
                    $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
                    $oDataset->next();
                    while ($aRow = $oDataset->getRow()) {
                        $aProcesses[] = array('CHECKBOX' => '<input type="checkbox" name="PROCESS[' . $aRow['PRO_UID'] . ']" id="PROCESS[' . $aRow['PRO_UID'] . ']" />', 'PROCESS' => $aRow['PRO_TITLE'], 'CANTITY' => $aRow['CANTITY'], 'USERS' => '<select name="USER[' . $aRow['PRO_UID'] . ']" id="USER[' . $aRow['PRO_UID'] . ']">' . $sUsers . '</select>');
                        $oDataset->next();
                    }
                    global $_DBArray;
                    $_DBArray['processesToReassign'] = $aProcesses;
                    $_SESSION['_DBArray'] = $_DBArray;
                    G::LoadClass('ArrayPeer');
                    $oCriteria = new Criteria('dbarray');
                    $oCriteria->setDBArrayTable('processesToReassign');
                    $G_PUBLISH->AddContent('propeltable', 'cases/paged-table-reassign', 'users/users_ReassignCases', $oCriteria, $_POST);
                    break;
            }
            break;
    }
    G::RenderPage('publish', 'raw');
} catch (Exception $oException) {
    die($oException->getMessage());
}
コード例 #19
0
try {
    G::LoadClass('processes');
    $oProcess = new Processes();
    $oProcess->ws_open_public();
    $result = $oProcess->ws_ProcessList();
    $processes[] = array('uid' => 'char', 'name' => 'char', 'age' => 'integer', 'balance' => 'float');
    if ($result->status_code == 0 && isset($result->processes)) {
        foreach ($result->processes as $key => $val) {
            $process = parseItemArray($val);
            $processes[] = $process;
        }
    }
    $_DBArray['processes'] = $processes;
    $_SESSION['_DBArray'] = $_DBArray;
    G::LoadClass('ArrayPeer');
    $c = new Criteria('dbarray');
    $c->setDBArrayTable('processes');
    $G_MAIN_MENU = 'processmaker';
    $G_ID_MENU_SELECTED = 'PROCESSES';
    $G_PUBLISH = new Publisher();
    $G_PUBLISH->AddContent('propeltable', 'paged-table', 'processes/processes_ListPublic', $c);
    $oHeadPublisher =& headPublisher::getSingleton();
    //$oHeadPublisher->addScriptCode('leimnud.Package.Load("newAccount",{Type:"file",Absolute:true,Path:"/jscore/newAccount.js"});');
    $oHeadPublisher->addScriptCode("\n  var oPanel;\n  var oPanel2;\n  var showDetails = function(sUID) {\n    oPanel = new leimnud.module.panel();\n    oPanel.options = {\n    \tsize:{w:650,h:550},\n    \tposition:{x:0,y:0,center:true},\n    \ttitle:'',\n    \ttheme:'firefox',\n    \tstatusBar:true,\n    \tcontrol\t:{resize:false,roll:false,drag:true},\n    \tfx\t:{modal:true,opacity:true,blinkToFront:false,fadeIn:false}\n    };\n    oPanel.events = {\n\t    remove: function() { delete(oPanel); }.extend(this)\n    };\n    oPanel.make();\n    oPanel.loader.show();\n    var oRPC = new leimnud.module.rpc.xmlhttp({\n    \turl : 'processes_Ajax',\n    \targs: 'action=showDetailsPMDWL&data=' + {pro_uid:sUID}.toJSONString()\n    });\n    oRPC.callback = function(rpc){\n    \toPanel.loader.hide();\n    \tvar scs = rpc.xmlhttp.responseText.extractScript();\n    \toPanel.addContent(rpc.xmlhttp.responseText);\n    \tscs.evalScript();\n    }.extend(this);\n    oRPC.make();\n  };\n  ");
    G::RenderPage('publish', 'blank');
} catch (Exception $e) {
    $G_PUBLISH = new Publisher();
    $aMessage['MESSAGE'] = $e->getMessage();
    $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
    G::RenderPage('publish', 'blank');
}
コード例 #20
0
foreach ($aFields as $aField) {
    switch ($aType) {
        case "system":
            if ($aField['sType'] == "system") {
                $aRows[] = array('fieldname' => $_POST['sFieldName'], 'variable' => $_POST['sSymbol'] . $aField['sName'], 'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\'' . $_POST['sFieldName'] . '\',\'' . $_POST['sSymbol'] . $aField['sName'] . '\');">' . $_POST['sSymbol'] . $aField['sName'] . '</a></div>', 'type' => $aField['sType'], 'label' => $aField['sLabel']);
            }
            break;
        case "process":
            if ($aField['sType'] != "system") {
                $aRows[] = array('fieldname' => $_POST['sFieldName'], 'variable' => $_POST['sSymbol'] . $aField['sName'], 'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\'' . $_POST['sFieldName'] . '\',\'' . $_POST['sSymbol'] . $aField['sName'] . '\');">' . $_POST['sSymbol'] . $aField['sName'] . '</a></div>', 'type' => $aField['sType'], 'label' => $aField['sLabel']);
            }
            break;
        default:
            $aRows[] = array('fieldname' => $_POST['sFieldName'], 'variable' => $_POST['sSymbol'] . $aField['sName'], 'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\'' . $_POST['sFieldName'] . '\',\'' . $_POST['sSymbol'] . $aField['sName'] . '\');">' . $_POST['sSymbol'] . $aField['sName'] . '</a></div>', 'type' => $aField['sType'], 'label' => $aField['sLabel']);
            break;
    }
}
// Use and make a load translation variable call to the titles of the tabs
$cssTabs = "<div id=\"" . strtolower($_POST['type']) . "\">\n                <ul id=\"tabnav\">\n                    <li class=\"all\"><a href=\"#\" onclick=\"changeVariables('all','" . $_POST['sProcess'] . "','" . $_POST['sFieldName'] . "','" . $_POST['sSymbol'] . "','processVariablesContent');\">All variables</a></li>\n                    <li class=\"system\"><a href=\"#\" onclick=\"changeVariables('system','" . $_POST['sProcess'] . "','" . $_POST['sFieldName'] . "','" . $_POST['sSymbol'] . "','processVariablesContent');\">System</a></li>\n                    <li class=\"process\"><a href=\"#\" onclick=\"changeVariables('process','" . $_POST['sProcess'] . "','" . $_POST['sFieldName'] . "','" . $_POST['sSymbol'] . "','processVariablesContent');\">Process</a></li>\n                </ul>\n            </div>\n            ";
echo $cssTabs;
G::LoadClass('ArrayPeer');
global $_DBArray;
$_DBArray['dynavars'] = $aRows;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('dynavars');
$aFields = array();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'triggers/dynavars', $oCriteria);
G::RenderPage('publish', 'raw');
コード例 #21
0
ファイル: skinsList.php プロジェクト: emildev35/processmaker
            $prop = unserialize($serial);
            error_reporting($previousErrorRep);
            if (!is_object($prop)) {
                @unlink(PATH_SKINS . $key . '.cnf');
            }
            if (isset($prop) && isset($prop->description)) {
                $description = $prop->description;
            }
            if (isset($prop) && isset($prop->version)) {
                $version = $prop->version;
            }
        }
        $linkPackValue = G::LoadTranslation('ID_EXPORT');
        $link = 'skinsExport?id=' . $key;
        $items[] = array('id' => count($items), 'name' => $key, 'filename' => $key, 'description' => $description, 'version' => $version, 'url' => $link, 'linkPackValue' => $linkPackValue);
    }
    $folders['items'] = $items;
}
$_DBArray['plugins'] = $items;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$c = new Criteria('dbarray');
$c->setDBArrayTable('plugins');
$c->addAscendingOrderByColumn('id');
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'SETUP';
$G_SUB_MENU = 'setup';
$G_ID_SUB_MENU_SELECTED = 'SKINS';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'setup/skinsList', $c);
G::RenderPage('publishBlank', 'blank');
コード例 #22
0
ファイル: roles_Ajax.php プロジェクト: bqevin/processmaker
     $aData['ROL_CODE'] = trim($_POST['code']);
     $aData['ROL_NAME'] = $_POST['name'];
     $aData['ROL_UPDATE_DATE'] = date("Y-M-d H:i:s");
     $aData['ROL_STATUS'] = $_POST['status'];
     $oCriteria = $RBAC->updateRole($aData);
     echo '{success: true}';
     break;
 case 'show':
     G::LoadClass('ArrayPeer');
     $aRoles = $RBAC->getAllRoles();
     $fields = array('ROL_UID' => 'char', 'ROL_PARENT' => 'char', 'ROL_SYSTEM' => 'char', 'ROL_CREATE_DATE' => 'char', 'ROL_UPDATE_DATE' => 'char', 'ROL_STATUS' => 'char');
     $rows = array_merge(array($fields), $aRoles);
     global $_DBArray;
     $_DBArray['virtual_roles'] = $rows;
     $oCriteria = new Criteria('dbarray');
     $oCriteria->setDBArrayTable('virtual_roles');
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->AddContent('propeltable', 'paged-table', 'roles/roles_List', $oCriteria);
     G::RenderPage('publish', 'raw');
     break;
 case 'deleteRole':
     $oCriteria = $RBAC->removeRole($_POST['ROL_UID']);
     break;
 case 'canDeleteRole':
     if ($RBAC->numUsersWithRole($_POST['ROL_UID']) == 0) {
         echo 'true';
     } else {
         echo 'false';
     }
     break;
 case 'verifyNewRole':
コード例 #23
0
ファイル: cases_Ajax.php プロジェクト: bqevin/processmaker
                 // . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
             }
         }
         $oTmp = new stdClass();
         $oTmp->items = $aUsersInvolved;
         $oTmp->id = $aCase['APP_UID'];
         $aCase['USERS'] = $oTmp;
         array_push($aCasesList, $aCase);
     }
     $filedNames = array("APP_UID", "APP_NUMBER", "APP_UPDATE_DATE", "DEL_PRIORITY", "DEL_INDEX", "TAS_UID", "DEL_INIT_DATE", "DEL_FINISH_DATE", "USR_UID", "APP_STATUS", "DEL_TASK_DUE_DATE", "APP_CURRENT_USER", "APP_TITLE", "APP_PRO_TITLE", "APP_TAS_TITLE", "APP_DEL_PREVIOUS_USER", "USERS");
     $aCasesList = array_merge(array($filedNames), $aCasesList);
     global $_DBArray;
     $_DBArray['reassign_byuser'] = $aCasesList;
     G::LoadClass('ArrayPeer');
     $oCriteria = new Criteria('dbarray');
     $oCriteria->setDBArrayTable('reassign_byuser');
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->AddContent('propeltable', 'cases/paged-table-reassigByUser2', 'cases/cases_ToReassignByUserList2', $oCriteria);
     G::RenderPage('publish', 'raw');
     break;
     /* @Author Erik Amaru Ortiz <*****@*****.**> */
 /* @Author Erik Amaru Ortiz <*****@*****.**> */
 case 'reassignByUser':
     G::LoadClass('case');
     $oCases = new Cases();
     $aCases = array();
     if (isset($_POST['items']) && trim($_POST['items']) != '') {
         $sItems = $_POST['items'];
         $aItems = explode(',', $sItems);
         $FROM_USR_UID = $_POST['USR_UID'];
         foreach ($aItems as $item) {
コード例 #24
0
ファイル: reportsList.php プロジェクト: nshong/processmaker
        $reports[] = array('RPT_NUMBER' => count($reports), 'RPT_UID' => $oReport['uid'], 'RPT_TITLE' => $oReport['title'], 'VIEW' => G::LoadTranslation('ID_VIEW'));
    }
}
//now check if there are customized reports inside the processes
if (file_exists(PATH_DATA_PUBLIC) && is_dir(PATH_DATA_PUBLIC)) {
    if ($handle = opendir(PATH_DATA_PUBLIC)) {
        while (false !== ($dir = readdir($handle))) {
            if ($dir[0] != '.' && file_exists(PATH_DATA_PUBLIC . $dir . PATH_SEP . 'reports.php')) {
                include_once PATH_DATA_PUBLIC . $dir . PATH_SEP . 'reports.php';
                $className = 'report' . $dir;
                if (class_exists($className)) {
                    $oReport = new $className();
                    $aReports = $oReport->getAvailableReports();
                    foreach ($aReports as $oReport) {
                        $reports[] = array('RPT_NUMBER' => count($reports), 'RPT_UID' => $oReport['uid'], 'RPT_TITLE' => $oReport['title'], 'VIEW' => G::LoadTranslation('ID_VIEW'));
                    }
                }
            }
        }
    }
    closedir($handle);
}
global $_DBArray;
$_DBArray['reports'] = $reports;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('reports');
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'reports/reportsList', $oCriteria);
G::RenderPage('publish');