/** * edit pmtable * * @param string $httpData->id */ public function edit($httpData) { require_once PATH_CONTROLLERS . 'pmTablesProxy.php'; require_once 'classes/model/AdditionalTables.php'; G::loadClass('pmTable'); $additionalTables = new AdditionalTables(); $table = false; $addTabUid = isset($httpData->id) ? $httpData->id : false; $dataNumRows = 0; $repTabPluginPermissions = false; $columnsTypes = PmTable::getPropelSupportedColumnTypes(); $jsFile = isset($httpData->tableType) && $httpData->tableType == 'report' ? 'editReport' : 'edit'; $columnsTypesList = array(); foreach ($columnsTypes as $columnTypeName => $columnType) { $columnsTypesList[] = array($columnTypeName, $columnType); } if ($addTabUid) { $tableData = $additionalTables->getAllData($httpData->id, 0, 2); $dataNumRows = $tableData['count']; } if ($addTabUid !== false) { // if it is a edit request $tableFields = array(); $fieldsList = array(); $table = $additionalTables->load($addTabUid, true); //fix for backware compatibility $table['DBS_UID'] = $table['DBS_UID'] == null || $table['DBS_UID'] == '' ? 'workflow' : $table['DBS_UID']; $_SESSION['ADD_TAB_UID'] = $addTabUid; //list dynaform fields if ($table['ADD_TAB_TYPE'] == 'NORMAL' || $table['ADD_TAB_TYPE'] == 'GRID') { $repTabPluginPermissions = $this->_getSimpleReportPluginDef(); } } $this->includeExtJS('pmTables/' . $jsFile); $this->setJSVar('flagProcessmap', isset($_REQUEST['flagProcessmap']) ? $_REQUEST['flagProcessmap'] : 0); $this->setJSVar('ADD_TAB_UID', $addTabUid); $this->setJSVar('PRO_UID', isset($_GET['PRO_UID']) ? $_GET['PRO_UID'] : false); $this->setJSVar('TABLE', $table); $this->setJSVar('dbg', isset($httpData->dbg)); $this->setJSVar('columnsTypes', $columnsTypesList); $this->setJSVar('dataNumRows', $dataNumRows); $this->setJSVar('_plugin_permissions', $repTabPluginPermissions); $this->setJSVar('sizeTableName', $this->getSizeTableName()); $isBpmn = 0; if (isset($_GET['PRO_UID'])) { $process = new Process(); $isBpmn = $process->isBpmnProcess($_GET['PRO_UID']); } $this->setJSVar('isBpmn', $isBpmn); G::RenderPage('publish', 'extJs'); }
/** * Validate Field Type * @var string $fld_type. Type for field * * @author Brayan Pereyra (Cochalo) <*****@*****.**> * @copyright Colosa - Bolivia * * @return string */ public function validateFldType($fld_type) { $fld_type = trim($fld_type); if ($fld_type == '') { throw new \Exception("The property fld_type: '{$fld_type}' is incorrect."); } switch ($fld_type) { case 'INT': $fld_type = 'INTEGER'; break; case 'TEXT': $fld_type = 'LONGVARCHAR'; break; case 'DATETIME': $fld_type = 'TIMESTAMP'; break; } G::loadClass('pmTable'); $columnsTypes = \PmTable::getPropelSupportedColumnTypes(); $res = array_search($fld_type, $columnsTypes); if ($res === false) { throw new \Exception("The property fld_type: '{$fld_type}' is incorrect."); } return $fld_type; }