Beispiel #1
0
 G::LoadClass('xmlfield_InputPM');
 $additionalTables = new AdditionalTables();
 $table = $additionalTables->load($id, true);
 $tableFields = array();
 $fieldsList = array();
 // list the case fields
 foreach ($table['FIELDS'] as $i => $field) {
     /*if ($field['FLD_NAME'] == 'APP_UID' || $field['FLD_NAME'] == 'APP_NUMBER' || $field['FLD_NAME'] == 'ROW') {
       unset($table['FIELDS'][$i]);
       continue;
       }*/
     array_push($tableFields, $field['FLD_DYN_NAME']);
 }
 //list dynaform fields
 if ($table['ADD_TAB_TYPE'] == 'NORMAL') {
     $fields = getDynaformsVars($table['PRO_UID'], false);
     foreach ($fields as $field) {
         //select to not assigned fields for available grid
         if (!in_array($field['sName'], $tableFields)) {
             $fieldsList[] = array('FIELD_UID' => $field['sName'] . '-' . $field['sType'], 'FIELD_NAME' => $field['sName']);
         }
     }
 } else {
     list($gridName, $gridId) = explode('-', $table['ADD_TAB_GRID']);
     $G_FORM = new Form($table['PRO_UID'] . '/' . $gridId, PATH_DYNAFORM, SYS_LANG, false);
     $gridFields = $G_FORM->getVars(false);
     foreach ($gridFields as $gfield) {
         if (!in_array($gfield['sName'], $tableFields)) {
             $fieldsList[] = array('FIELD_UID' => $gfield['sName'] . '-' . $gfield['sType'], 'FIELD_NAME' => $gfield['sName']);
         }
     }
            /**
            * returns an array with all Dynaforms Fields
            */
        case 'getVariableList':
            G::LoadClass('xmlfield_InputPM');
            $proUid = isset($_REQUEST['process']) ? $_REQUEST['process'] : '';
            $queryText = isset($_REQUEST['queryText']) ? $_REQUEST['queryText'] : '';
            if ($_REQUEST['type'] == 'system') {
                $isSystem = true;
            } else {
                $isSystem = false;
            }
            if ($_REQUEST['type'] == 'all') {
                $aFields = getDynaformsVars($proUid);
            } else {
                $aFields = getDynaformsVars($proUid, $isSystem, isset($_REQUEST['bIncMulSelFields']) ? $_REQUEST['bIncMulSelFields'] : 1);
            }
            $aVariables = array();

            if ($queryText != "") {
                foreach ($aFields as $key => $value) {
                    if (stristr($aFields[$key]["sName"], $queryText)) {
                        $aVariables[] = $aFields[$key];
                    }
                }
            } else {
                switch ($_REQUEST["type"]) {
                    case "system" :
                        foreach ($aFields as $key => $value) {
                            if ($aFields[$key]["sType"] == "system") {
                                $aVariables[] = $aFields[$key];
Beispiel #3
0
 /**
  * Get PM Variables
  *
  * @param $param{PRO_UID}
  */
 public function getPMVariables($param)
 {
     G::LoadClass('processMap');
     $oProcessMap = new processMap(new DBConnection());
     $rows = getDynaformsVars($param->PRO_UID);
     foreach ($rows as $i => $var) {
         $rows[$i]['sName'] = "@@{$var['sName']}";
     }
     $this->rows = $rows;
 }
Beispiel #4
0
     // unescape the slashes
     $result = $tmpData;
     echo $result;
     break;
 case 'getCaseTracker':
     //$rows = $oProcessMap->caseTracker($_GET['pid']);
     $oCaseTracker = new CaseTracker();
     $rows = $oCaseTracker->load($_GET['pid']);
     $tmpData = G::json_encode($rows);
     $tmpData = str_replace("\\/", "/", '{success:true,data:' . $tmpData . '}');
     // unescape the slashes
     $result = $tmpData;
     echo $result;
     break;
 case 'getVariables':
     $aFields = getDynaformsVars($_GET['pid']);
     if (isset($_GET['type'])) {
         $aType = $_GET['type'];
     } else {
         $aType = '';
     }
     $rows[0] = array('fieldname' => 'char', 'variable' => 'char', 'type' => 'type', 'label' => 'char');
     foreach ($aFields as $aField) {
         switch ($aType) {
             case "system":
                 if ($aField['sType'] == "system") {
                     $rows[] = array('fieldname' => $_GET['sFieldName'], 'variable' => $_GET['sSymbol'] . $aField['sName'], 'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\'' . $_GET['sFieldName'] . '\',\'' . $_GET['sSymbol'] . $aField['sName'] . '\');">' . $_GET['sSymbol'] . $aField['sName'] . '</a></div>', 'type' => $aField['sType'], 'label' => $aField['sLabel']);
                 }
                 break;
             case "process":
                 if ($aField['sType'] != "system") {
 public function getPMVariables($param)
 {
     G::LoadClass('processMap');
     $oProcessMap = new processMap(new DBConnection());
     $response->rows = getDynaformsVars($param['PRO_UID']);
     foreach ($response->rows as $i => $var) {
         $response->rows[$i]['sName'] = "@@{$var['sName']}";
     }
     print G::json_encode($response);
 }
         //$dynFields = getDynaformsVars($aFields['PRO_UID'], false);
         $dynFields = getDynafields($aFields['PRO_UID']);
         foreach ($dynFields as $dfield) {
             $aProcessFields[] = array('FIELD_UID' => $dfield['name'] . '-' . $dfield['type'], 'FIELD_NAME' => $dfield['name']);
         }
         $resultList['processFields'] = $aProcessFields;
     }
     echo G::json_encode($resultList);
     break;
 case 'fieldsList':
     G::LoadClass('reportTables');
     G::LoadClass('xmlfield_InputPM');
     $aFields['FIELDS'] = array();
     $oReportTable = new ReportTable();
     $aFields = $oReportTable->load($_POST['REP_TAB_UID']);
     $aTheFields = getDynaformsVars($aFields['PRO_UID'], false);
     $oReportTables = new ReportTables();
     $aVars = $oReportTables->getTableVars($_POST['REP_TAB_UID']);
     $aFields['FIELDS'] = array();
     foreach ($aTheFields as $aField) {
         if (in_array($aField['sName'], $aVars)) {
             $aResultFields[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sType'], 'FIELD_NAME' => $aField['sName'], 'FIELD_DYNAFORM' => $aField['sName']);
         }
     }
     $result->success = true;
     $result->data = $aResultFields;
     echo G::json_encode($result);
     break;
 case 'getDbConnectionsList':
     G::LoadClass('dbConnections');
     $proUid = $_POST['PRO_UID'];
Beispiel #7
0
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 */
/**
 * the varAjaxByType file as the varAjax.php handle the render of the diferent
 * types of dynaform variables there are 3 of them system, process, and the default
 * that show both system and process variables.
 * uses almost the same variables passed to varsAjax, plus $_POST['type'] that is the
 * type of the variables. Then it render a propel table with all the variables
 * loaded for that type.
 *
 * @author Gustavo Cruz gustavo-at-colosa.com
 * @param $_POST variables
 */
G::LoadClass('xmlfield_InputPM');
$aFields = getDynaformsVars($_POST['sProcess'], true, isset($_POST['bIncMulSelFields']) ? $_POST['bIncMulSelFields'] : 0);
$aType = $_POST['type'];
$aRows[0] = array('fieldname' => 'char', 'variable' => 'char', 'type' => 'type', 'label' => 'char');
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:
<?php

try {
    G::LoadClass('processMap');
    $oProcessMap = new processMap(new DBConnection());
    if (isset($_GET['pid']) && !isset($_GET['type'])) {
        $rows = $oProcessMap->getExtReportTables($_GET['pid']);
    } else {
        if (isset($_GET['pid']) && $_GET['type'] == 'NORMAL') {
            $aTheFields = array();
            $aTheFields = getDynaformsVars($_GET['pid'], false);
            foreach ($aTheFields as $aField) {
                $rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sType'], 'FIELD_NAME' => $aField['sName']);
            }
        } else {
            if (isset($_GET['pid']) && $_GET['type'] == 'GRID') {
                $aTheFields = array();
                $aTheFields = getGridsVars($_GET['pid']);
                foreach ($aTheFields as $aField) {
                    $rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sXmlForm'], 'FIELD_NAME' => $aField['sName']);
                }
            }
        }
    }
    if (isset($_GET['tid'])) {
        require_once 'classes/model/ReportTable.php';
        $o = new ReportTable();
        $rows = $o->load($_GET['tid']);
    }
    $result['totalCount'] = count($rows);
    $result['data'] = $rows;
 $queryText = isset($_REQUEST['queryText']) ? $_REQUEST['queryText'] : '';
 switch ($_REQUEST['type']) {
     case 'system':
         $typeVars = $_REQUEST['type'];
         break;
     case 'process':
         $typeVars = $_REQUEST['type'];
         break;
     case 'grid':
         $typeVars = $_REQUEST['type'];
         break;
 }
 if ($_REQUEST['type'] == 'all') {
     $aFields = getDynaformsVars($proUid);
 } else {
     $aFields = getDynaformsVars($proUid, $typeVars, isset($_REQUEST['bIncMulSelFields']) ? $_REQUEST['bIncMulSelFields'] : 1);
 }
 $aVariables = array();
 if ($queryText != "") {
     foreach ($aFields as $key => $value) {
         if (stristr($aFields[$key]["sName"], $queryText)) {
             $aVariables[] = $aFields[$key];
         }
     }
 } else {
     switch ($_REQUEST["type"]) {
         case "system":
             foreach ($aFields as $key => $value) {
                 if ($aFields[$key]["sType"] == "system") {
                     $aVariables[] = $aFields[$key];
                 }
Beispiel #10
0
         $GROUP_TITLE = strip_tags($group->getGrpTitle());
         $aRows[] = array('GRP_UID' => $UID, 'GROUP_TITLE' => $GROUP_TITLE);
     }
     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/groupmailList', $oCriteria);
     G::RenderPage('publish', 'raw');
     break;
 case 'showDynavars':
     G::LoadClass('xmlfield_InputPM');
     $dynaformFields = getDynaformsVars($_SESSION['PROCESS'], false, false);
     $fields = array(array('id' => 'char', 'dynaform' => 'char', 'name' => 'char'));
     foreach ($dynaformFields as $dynaformField) {
         $fields[] = array('id' => $dynaformField['sName'], 'name' => '<a href="#" style="color: black;" onclick="e.toAdd(\'' . $dynaformField['sName'] . '\', \'' . $dynaformField['sName'] . '\', \'dyn\');oPanel.remove();return false;">@#' . $dynaformField['sName'] . '</a>', 'label' => $dynaformField['sLabel']);
     }
     global $_DBArray;
     $_DBArray['virtualtable'] = $fields;
     $_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;
 case 'eventList':