CODE STYLE workflow/engine/methods/reportTables/
FILES: edit.php main.php reportTables_Ajax.php reportTables_Delete.php reportTables_Edit.php reportTables_Save.php
This commit is contained in:
@@ -32,9 +32,7 @@ if ($id) { // if is a edit request
|
||||
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']
|
||||
$fieldsList[] = array ('FIELD_UID' => $field['sName'] . '-' . $field['sType'],'FIELD_NAME' => $field['sName']
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -46,9 +44,7 @@ if ($id) { // if is a edit request
|
||||
|
||||
foreach ($gridFields as $gfield) {
|
||||
if (! in_array( $gfield['sName'], $tableFields )) {
|
||||
$fieldsList[] = array(
|
||||
'FIELD_UID' => $gfield['sName'] . '-' . $gfield['sType'],
|
||||
'FIELD_NAME' => $gfield['sName']
|
||||
$fieldsList[] = array ('FIELD_UID' => $gfield['sName'] . '-' . $gfield['sType'],'FIELD_NAME' => $gfield['sName']
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -76,5 +72,4 @@ $oHeadPublisher->assign('_plugin_permissions', $repTabPluginPermissions);
|
||||
$oHeadPublisher->assign( 'PRO_UID', isset( $_GET['PRO_UID'] ) ? $_GET['PRO_UID'] : false );
|
||||
$oHeadPublisher->assign( 'TABLE', $table );
|
||||
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
@@ -20,12 +20,11 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions( 'PM_SETUP_ADVANCE' );
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
G::LoadClass( 'case' );
|
||||
@@ -48,18 +47,14 @@ switch($action) {
|
||||
$gridFields = getGridDynafields( $_POST['PRO_UID'], $gridId );
|
||||
|
||||
foreach ($gridFields as $gfield) {
|
||||
$aProcessGridFields[] = array(
|
||||
'FIELD_UID' => $gfield['name'] . '-' . $gfield['type'],
|
||||
'FIELD_NAME' => $gfield['name']
|
||||
$aProcessGridFields[] = array ('FIELD_UID' => $gfield['name'] . '-' . $gfield['type'],'FIELD_NAME' => $gfield['name']
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$gridFields = getGridFields( $aFields['PRO_UID'] );
|
||||
|
||||
foreach ($gridFields as $gfield) {
|
||||
$aProcessGridFields[] = array(
|
||||
'FIELD_UID' => $gfield['name'] . '-' . $gfield['xmlform'],
|
||||
'FIELD_NAME' => $gfield['name']
|
||||
$aProcessGridFields[] = array ('FIELD_UID' => $gfield['name'] . '-' . $gfield['xmlform'],'FIELD_NAME' => $gfield['name']
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -71,9 +66,7 @@ switch($action) {
|
||||
$dynFields = getDynafields( $aFields['PRO_UID'] );
|
||||
|
||||
foreach ($dynFields as $dfield) {
|
||||
$aProcessFields[] = array(
|
||||
'FIELD_UID' => $dfield['name'] . '-' . $dfield['type'],
|
||||
'FIELD_NAME' => $dfield['name']
|
||||
$aProcessFields[] = array ('FIELD_UID' => $dfield['name'] . '-' . $dfield['type'],'FIELD_NAME' => $dfield['name']
|
||||
);
|
||||
}
|
||||
$resultList['processFields'] = $aProcessFields;
|
||||
@@ -83,8 +76,6 @@ switch($action) {
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 'fieldsList':
|
||||
|
||||
G::LoadClass( 'reportTables' );
|
||||
@@ -100,13 +91,11 @@ switch($action) {
|
||||
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']);
|
||||
$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 );
|
||||
@@ -117,9 +106,9 @@ switch($action) {
|
||||
$proUid = $_POST['PRO_UID'];
|
||||
$dbConn = new DbConnections();
|
||||
$dbConnections = $dbConn->getConnectionsProUid( $proUid );
|
||||
$defaultConnections = array (
|
||||
array('DBS_UID'=>'workflow', 'DBS_NAME'=>'Workflow'),
|
||||
array('DBS_UID'=>'rp', 'DBS_NAME'=>'REPORT')
|
||||
$defaultConnections = array (array ('DBS_UID' => 'workflow','DBS_NAME' => 'Workflow'
|
||||
),array ('DBS_UID' => 'rp','DBS_NAME' => 'REPORT'
|
||||
)
|
||||
);
|
||||
|
||||
echo G::json_encode( array_merge( $defaultConnections, $dbConnections ) );
|
||||
@@ -133,7 +122,6 @@ switch($action) {
|
||||
echo G::json_encode( $process->getAll() );
|
||||
break;
|
||||
|
||||
|
||||
case 'save':
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
require_once 'classes/model/Fields.php';
|
||||
@@ -141,13 +129,9 @@ switch($action) {
|
||||
$data = $_POST;
|
||||
$data['columns'] = G::json_decode( $_POST['columns'] ); //decofing data columns
|
||||
|
||||
|
||||
// Reserved Words
|
||||
$aReservedWords = array(
|
||||
'ALTER', 'CLOSE', 'COMMIT', 'CREATE', 'DECLARE',
|
||||
'DELETE', 'DROP', 'FETCH', 'FUNCTION', 'GRANT',
|
||||
'INDEX', 'INSERT', 'OPEN', 'REVOKE', 'ROLLBACK',
|
||||
'SELECT', 'SYNONYM', 'TABLE', 'UPDATE', 'VIEW',
|
||||
'APP_UID', 'ROW'
|
||||
$aReservedWords = array ('ALTER','CLOSE','COMMIT','CREATE','DECLARE','DELETE','DROP','FETCH','FUNCTION','GRANT','INDEX','INSERT','OPEN','REVOKE','ROLLBACK','SELECT','SYNONYM','TABLE','UPDATE','VIEW','APP_UID','ROW'
|
||||
);
|
||||
|
||||
$oAdditionalTables = new AdditionalTables();
|
||||
@@ -158,16 +142,7 @@ switch($action) {
|
||||
|
||||
$repTabClassName = to_camel_case( $data['REP_TAB_NAME'] );
|
||||
|
||||
$repTabData = array(
|
||||
'ADD_TAB_UID' => $data['REP_TAB_UID'],
|
||||
'ADD_TAB_NAME' => $data['REP_TAB_NAME'],
|
||||
'ADD_TAB_CLASS_NAME' => $repTabClassName,
|
||||
'ADD_TAB_DESCRIPTION' => $data['REP_TAB_DSC'],
|
||||
'ADD_TAB_PLG_UID' => '',
|
||||
'DBS_UID' => $data['REP_TAB_CONNECTION'],
|
||||
'PRO_UID' => $data['PRO_UID'],
|
||||
'ADD_TAB_TYPE' => $data['REP_TAB_TYPE'],
|
||||
'ADD_TAB_GRID' => $data['REP_TAB_GRID']
|
||||
$repTabData = array ('ADD_TAB_UID' => $data['REP_TAB_UID'],'ADD_TAB_NAME' => $data['REP_TAB_NAME'],'ADD_TAB_CLASS_NAME' => $repTabClassName,'ADD_TAB_DESCRIPTION' => $data['REP_TAB_DSC'],'ADD_TAB_PLG_UID' => '','DBS_UID' => $data['REP_TAB_CONNECTION'],'PRO_UID' => $data['PRO_UID'],'ADD_TAB_TYPE' => $data['REP_TAB_TYPE'],'ADD_TAB_GRID' => $data['REP_TAB_GRID']
|
||||
);
|
||||
|
||||
$columns = $data['columns'];
|
||||
@@ -221,8 +196,9 @@ switch($action) {
|
||||
|
||||
$columns = array_merge( $defaultColumns, $columns );
|
||||
|
||||
|
||||
/** validations **/
|
||||
/**
|
||||
* validations *
|
||||
*/
|
||||
if (is_array( $aNameTable )) {
|
||||
throw new Exception( 'The table "' . $data['REP_TAB_NAME'] . '" already exits.' );
|
||||
}
|
||||
@@ -260,35 +236,14 @@ switch($action) {
|
||||
$editFieldsList = array ();
|
||||
|
||||
foreach ($columns as $i => $column) {
|
||||
$field = array(
|
||||
'FLD_UID' => $column->uid,
|
||||
'FLD_INDEX' => $i,
|
||||
'ADD_TAB_UID' => $addTabUid,
|
||||
'FLD_NAME' => $column->field_name,
|
||||
'FLD_DESCRIPTION' => $column->field_label,
|
||||
'FLD_TYPE' => $column->field_type,
|
||||
'FLD_SIZE' => $column->field_size,
|
||||
'FLD_NULL' => (isset($column->field_null) ? $column->field_null : 1),
|
||||
'FLD_AUTO_INCREMENT' => 0,
|
||||
'FLD_KEY' => (isset($column->field_key) ? $column->field_key : 0),
|
||||
'FLD_FOREIGN_KEY' => 0,
|
||||
'FLD_FOREIGN_KEY_TABLE' => '',
|
||||
'FLD_DYN_NAME' => $column->field_dyn,
|
||||
'FLD_DYN_UID' => $column->field_uid,
|
||||
'FLD_FILTER' => (isset($column->field_filter) && $column->field_filter ? 1 : 0)
|
||||
$field = array ('FLD_UID' => $column->uid,'FLD_INDEX' => $i,'ADD_TAB_UID' => $addTabUid,'FLD_NAME' => $column->field_name,'FLD_DESCRIPTION' => $column->field_label,'FLD_TYPE' => $column->field_type,'FLD_SIZE' => $column->field_size,'FLD_NULL' => (isset( $column->field_null ) ? $column->field_null : 1),'FLD_AUTO_INCREMENT' => 0,'FLD_KEY' => (isset( $column->field_key ) ? $column->field_key : 0),'FLD_FOREIGN_KEY' => 0,'FLD_FOREIGN_KEY_TABLE' => '','FLD_DYN_NAME' => $column->field_dyn,'FLD_DYN_UID' => $column->field_uid,'FLD_FILTER' => (isset( $column->field_filter ) && $column->field_filter ? 1 : 0)
|
||||
);
|
||||
|
||||
$fieldUid = $oFields->create( $field );
|
||||
$fieldsList[] = $field;
|
||||
|
||||
if ($data['REP_TAB_UID'] == '') { //new
|
||||
$aFields[] = array(
|
||||
'sType' => $column->field_type,
|
||||
'iSize' => $column->field_size,
|
||||
'sFieldName' => $column->field_name,
|
||||
'bNull' => (isset($column->field_null) ? $column->field_null : 1),
|
||||
'bAI' => 0,
|
||||
'bPrimaryKey' => (isset($column->field_key) ? $column->field_key : 0)
|
||||
$aFields[] = array ('sType' => $column->field_type,'iSize' => $column->field_size,'sFieldName' => $column->field_name,'bNull' => (isset( $column->field_null ) ? $column->field_null : 1),'bAI' => 0,'bPrimaryKey' => (isset( $column->field_key ) ? $column->field_key : 0)
|
||||
);
|
||||
} else { //editing
|
||||
$field['FLD_UID'] = $fieldUid;
|
||||
@@ -306,7 +261,6 @@ switch($action) {
|
||||
|
||||
$oAdditionalTables->populateReportTable( $data['REP_TAB_NAME'], $data['REP_TAB_CONNECTION'], $data['REP_TAB_TYPE'], $fieldsList, $data['PRO_UID'], $data['REP_TAB_GRID'] );
|
||||
|
||||
|
||||
$result->success = true;
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
@@ -355,7 +309,9 @@ switch($action) {
|
||||
$filter = isset( $_REQUEST['textFilter'] ) ? $_REQUEST['textFilter'] : '';
|
||||
$pro_uid = isset( $_REQUEST['pro_uid'] ) ? $_REQUEST['pro_uid'] : '';
|
||||
|
||||
$process = $pro_uid == '' ? array('not_equal'=>$pro_uid) : array('equal'=>$pro_uid);
|
||||
$process = $pro_uid == '' ? array ('not_equal' => $pro_uid
|
||||
) : array ('equal' => $pro_uid
|
||||
);
|
||||
$addTab = AdditionalTables::getAll( $start, $limit, $filter, $process );
|
||||
|
||||
if ($pro_uid != '') {
|
||||
@@ -369,13 +325,7 @@ switch($action) {
|
||||
$addTab['count'] += count( $reportTablesOldList );
|
||||
|
||||
foreach ($reportTablesOldList as $i => $oldRepTab) {
|
||||
$addTab['rows'][] = array(
|
||||
'ADD_TAB_UID' => $oldRepTab['REP_TAB_UID'],
|
||||
'PRO_UID' => $oldRepTab['PRO_UID'],
|
||||
'ADD_TAB_DESCRIPTION' => $oldRepTab['REP_TAB_TITLE'],
|
||||
'ADD_TAB_NAME' => $oldRepTab['REP_TAB_NAME'],
|
||||
'ADD_TAB_TYPE' => $oldRepTab['REP_TAB_TYPE'],
|
||||
'TYPE' => 'CLASSIC'
|
||||
$addTab['rows'][] = array ('ADD_TAB_UID' => $oldRepTab['REP_TAB_UID'],'PRO_UID' => $oldRepTab['PRO_UID'],'ADD_TAB_DESCRIPTION' => $oldRepTab['REP_TAB_TITLE'],'ADD_TAB_NAME' => $oldRepTab['REP_TAB_NAME'],'ADD_TAB_TYPE' => $oldRepTab['REP_TAB_TYPE'],'TYPE' => 'CLASSIC'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -390,23 +340,22 @@ switch($action) {
|
||||
$uid = $_REQUEST['ADD_TAB_UID'];
|
||||
$value = $_REQUEST['value'];
|
||||
|
||||
$repTabData = array(
|
||||
'ADD_TAB_UID' => $uid,
|
||||
'ADD_TAB_TAG' => $value
|
||||
$repTabData = array ('ADD_TAB_UID' => $uid,'ADD_TAB_TAG' => $value
|
||||
);
|
||||
$oAdditionalTables->update( $repTabData );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Translates a string with underscores into camel case (e.g. first_name -> firstName)
|
||||
* Translates a string with underscores into camel case (e.g.
|
||||
* first_name -> firstName)
|
||||
*
|
||||
* @param string $str String in underscore format
|
||||
* @param bool $capitalise_first_char If true, capitalise the first char in $str
|
||||
* @return string $str translated into camel caps
|
||||
*/
|
||||
function to_camel_case($str, $capitalise_first_char = true) {
|
||||
function to_camel_case ($str, $capitalise_first_char = true)
|
||||
{
|
||||
if ($capitalise_first_char) {
|
||||
$str[0] = strtoupper( $str[0] );
|
||||
}
|
||||
@@ -414,8 +363,6 @@ switch($action) {
|
||||
return preg_replace_callback( '/_([a-z])/', $func, $str );
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getDynafields ($proUid, $type = 'xmlform')
|
||||
{
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
@@ -430,10 +377,11 @@ switch($action) {
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
|
||||
$excludeFieldsList = array('title', 'subtitle', 'link', 'file', 'button', 'reset', 'submit',
|
||||
'listbox', 'checkgroup', 'grid', 'javascript');
|
||||
$excludeFieldsList = array ('title','subtitle','link','file','button','reset','submit','listbox','checkgroup','grid','javascript'
|
||||
);
|
||||
|
||||
$labelFieldsTypeList = array('dropdown', 'checkbox', 'radiogroup', 'yesno');
|
||||
$labelFieldsTypeList = array ('dropdown','checkbox','radiogroup','yesno'
|
||||
);
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if (file_exists( PATH_DYNAFORM . PATH_SEP . $aRow['DYN_FILENAME'] . '.xml' )) {
|
||||
@@ -442,11 +390,13 @@ switch($action) {
|
||||
if ($G_FORM->type == 'xmlform' || $G_FORM->type == '') {
|
||||
foreach ($G_FORM->fields as $fieldName => $fieldNode) {
|
||||
if (! in_array( $fieldNode->type, $excludeFieldsList ) && ! in_array( $fieldName, $fieldsNames )) {
|
||||
$fields[] = array('name' => $fieldName, 'type' => $fieldNode->type, 'label'=> $fieldNode->label);
|
||||
$fields[] = array ('name' => $fieldName,'type' => $fieldNode->type,'label' => $fieldNode->label
|
||||
);
|
||||
$fieldsNames[] = $fieldName;
|
||||
|
||||
if (in_array( $fieldNode->type, $labelFieldsTypeList ) && ! in_array( $fieldName . '_label', $fieldsNames )) {
|
||||
$fields[] = array('name' => $fieldName . '_label', 'type' => $fieldNode->type, 'label'=>$fieldNode->label . '_label');
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label'
|
||||
);
|
||||
$fieldsNames[] = $fieldName;
|
||||
}
|
||||
}
|
||||
@@ -463,21 +413,24 @@ switch($action) {
|
||||
{
|
||||
$fields = array ();
|
||||
$fieldsNames = array ();
|
||||
$excludeFieldsList = array('title', 'subtitle', 'link', 'file', 'button', 'reset', 'submit',
|
||||
'listbox', 'checkgroup', 'grid', 'javascript');
|
||||
$excludeFieldsList = array ('title','subtitle','link','file','button','reset','submit','listbox','checkgroup','grid','javascript'
|
||||
);
|
||||
|
||||
$labelFieldsTypeList = array('dropdown', 'checkbox', 'radiogroup', 'yesno');
|
||||
$labelFieldsTypeList = array ('dropdown','checkbox','radiogroup','yesno'
|
||||
);
|
||||
|
||||
$G_FORM = new Form( $proUid . '/' . $gridId, PATH_DYNAFORM, SYS_LANG, false );
|
||||
|
||||
if ($G_FORM->type == 'grid') {
|
||||
foreach ($G_FORM->fields as $fieldName => $fieldNode) {
|
||||
if (! in_array( $fieldNode->type, $excludeFieldsList ) && ! in_array( $fieldName, $fieldsNames )) {
|
||||
$fields[] = array('name' => $fieldName, 'type' => $fieldNode->type, 'label'=> $fieldNode->label);
|
||||
$fields[] = array ('name' => $fieldName,'type' => $fieldNode->type,'label' => $fieldNode->label
|
||||
);
|
||||
$fieldsNames[] = $fieldName;
|
||||
|
||||
if (in_array( $fieldNode->type, $labelFieldsTypeList ) && ! in_array( $fieldName . '_label', $fieldsNames )) {
|
||||
$fields[] = array('name' => $fieldName . '_label', 'type' => $fieldNode->type, 'label'=>$fieldNode->label . '_label');
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label'
|
||||
);
|
||||
$fieldsNames[] = $fieldName;
|
||||
}
|
||||
}
|
||||
@@ -504,7 +457,8 @@ switch($action) {
|
||||
foreach ($G_FORM->fields as $k => $v) {
|
||||
if ($v->type == 'grid') {
|
||||
if (! in_array( $k, $aFieldsNames )) {
|
||||
$aFields[] = array('name' => $k, 'xmlform' => str_replace($proUid . '/', '', $v->xmlGrid));
|
||||
$aFields[] = array ('name' => $k,'xmlform' => str_replace( $proUid . '/', '', $v->xmlGrid )
|
||||
);
|
||||
$aFieldsNames[] = $k;
|
||||
}
|
||||
}
|
||||
@@ -520,7 +474,8 @@ switch($action) {
|
||||
$G_FORM = new Form( $filepath, PATH_DYNAFORM, SYS_LANG );
|
||||
$fields = array ();
|
||||
$fieldsNames = array ();
|
||||
$labelFieldsTypeList = array('dropdown', 'checkbox', 'radiogroup', 'yesno');
|
||||
$labelFieldsTypeList = array ('dropdown','checkbox','radiogroup','yesno'
|
||||
);
|
||||
|
||||
if ($G_FORM->type == 'xmlform' || $G_FORM->type == '') {
|
||||
|
||||
@@ -531,11 +486,13 @@ switch($action) {
|
||||
|
||||
if (count( $includeTypes ) > 0) {
|
||||
if (in_array( $fieldNode->type, $includeTypes ) && ! in_array( $fieldName, $fieldsNames )) {
|
||||
$fields[] = array('name' => $fieldName, 'type' => $fieldNode->type, 'label'=> $fieldNode->label);
|
||||
$fields[] = array ('name' => $fieldName,'type' => $fieldNode->type,'label' => $fieldNode->label
|
||||
);
|
||||
$fieldsNames[] = $fieldName;
|
||||
|
||||
if (in_array( $fieldNode->type, $labelFieldsTypeList ) && ! in_array( $fieldName . '_label', $fieldsNames )) {
|
||||
$fields[] = array('name' => $fieldName . '_label', 'type' => $fieldNode->type, 'label'=>$fieldNode->label . '_label');
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label'
|
||||
);
|
||||
$fieldsNames[] = $fieldName;
|
||||
}
|
||||
}
|
||||
@@ -544,11 +501,13 @@ switch($action) {
|
||||
|
||||
if (! in_array( $fieldName, $fieldsNames )) {
|
||||
|
||||
$fields[] = array('name' => $fieldName, 'type' => $fieldNode->type, 'label'=> $fieldNode->label);
|
||||
$fields[] = array ('name' => $fieldName,'type' => $fieldNode->type,'label' => $fieldNode->label
|
||||
);
|
||||
$fieldsNames[] = $fieldName;
|
||||
|
||||
if (in_array( $fieldNode->type, $labelFieldsTypeList ) && ! in_array( $fieldName . '_label', $fieldsNames )) {
|
||||
$fields[] = array('name' => $fieldName . '_label', 'type' => $fieldNode->type, 'label'=>$fieldNode->label . '_label');
|
||||
$fields[] = array ('name' => $fieldName . '_label','type' => $fieldNode->type,'label' => $fieldNode->label . '_label'
|
||||
);
|
||||
$fieldsNames[] = $fieldName;
|
||||
}
|
||||
}
|
||||
@@ -559,4 +518,3 @@ switch($action) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1)
|
||||
return $RBAC_Response;
|
||||
G::LoadClass( 'reportTables' );
|
||||
try {
|
||||
$oReportTables = new ReportTables();
|
||||
|
||||
@@ -20,14 +20,13 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1)
|
||||
return $RBAC_Response;
|
||||
G::LoadClass( 'reportTables' );
|
||||
G::LoadClass( 'xmlfield_InputPM' );
|
||||
$aFields['FIELDS'] = array ();
|
||||
if (isset($_GET['REP_TAB_UID']))
|
||||
{
|
||||
if (isset( $_GET['REP_TAB_UID'] )) {
|
||||
$oReportTable = new ReportTable();
|
||||
$aFields = $oReportTable->load( $_GET['REP_TAB_UID'] );
|
||||
$aTheFields = getDynaformsVars( $aFields['PRO_UID'], false );
|
||||
@@ -39,26 +38,24 @@ if (isset($_GET['REP_TAB_UID']))
|
||||
$aFields['FIELDS'][] = $aField['sName'] . '-' . $aField['sType'];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$aFields['PRO_UID'] = $_GET['PRO_UID'];
|
||||
$aFields['FIELDS'] = array ();
|
||||
$aTheFields = getDynaformsVars( $aFields['PRO_UID'], false );
|
||||
}
|
||||
$aProcessFields[] = array('FIELD_UID' => 'char',
|
||||
'FIELD_NAME' => 'char');
|
||||
$aProcessFields[] = array ('FIELD_UID' => 'char','FIELD_NAME' => 'char'
|
||||
);
|
||||
$aTheFields = getDynaformsVars( $aFields['PRO_UID'], false );
|
||||
foreach ($aTheFields as $aField) {
|
||||
$aProcessFields[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sType'],
|
||||
'FIELD_NAME' => $aField['sName']);
|
||||
$aProcessFields[] = array ('FIELD_UID' => $aField['sName'] . '-' . $aField['sType'],'FIELD_NAME' => $aField['sName']
|
||||
);
|
||||
}
|
||||
$aProcessGridFields[] = array('FIELD_UID' => 'char',
|
||||
'FIELD_NAME' => 'char');
|
||||
$aProcessGridFields[] = array ('FIELD_UID' => 'char','FIELD_NAME' => 'char'
|
||||
);
|
||||
$aTheFields = getGridsVars( $aFields['PRO_UID'] );
|
||||
foreach ($aTheFields as $aField) {
|
||||
$aProcessGridFields[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sXmlForm'],
|
||||
'FIELD_NAME' => $aField['sName']);
|
||||
$aProcessGridFields[] = array ('FIELD_UID' => $aField['sName'] . '-' . $aField['sXmlForm'],'FIELD_NAME' => $aField['sName']
|
||||
);
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['processFields'] = $aProcessFields;
|
||||
|
||||
@@ -20,21 +20,19 @@
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1)
|
||||
return $RBAC_Response;
|
||||
|
||||
G::LoadClass( 'reportTables' );
|
||||
|
||||
if (isset( $_POST['form'] ))
|
||||
$values = $_POST['form']; //For Old processmap
|
||||
else
|
||||
{
|
||||
else {
|
||||
$values = $_POST; //For extjs,since we are not using form
|
||||
$values['FIELDS'] = explode( ',', $_POST['FIELDS'] );
|
||||
}
|
||||
|
||||
|
||||
$oReportTable = new ReportTable();
|
||||
if (! isset( $values['REP_TAB_CONNECTION'] )) {
|
||||
$values['REP_TAB_CONNECTION'] = 'report';
|
||||
@@ -43,8 +41,7 @@ if ($values['REP_TAB_UID'] != '') {
|
||||
$aReportTable = $oReportTable->load( $values['REP_TAB_UID'] );
|
||||
$sOldTableName = $aReportTable['REP_TAB_NAME'];
|
||||
$sOldConnection = $aReportTable['REP_TAB_CONNECTION'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sOldTableName = $values['REP_TAB_NAME'];
|
||||
$sOldConnection = $values['REP_TAB_CONNECTION'];
|
||||
$oReportTable->create( $values );
|
||||
@@ -91,11 +88,10 @@ foreach ($values['FIELDS'] as $sField) {
|
||||
$sType = 'char';
|
||||
break;
|
||||
}
|
||||
$oReportVar->create(array('REP_TAB_UID' => $values['REP_TAB_UID'],
|
||||
'PRO_UID' => $values['PRO_UID'],
|
||||
'REP_VAR_NAME' => $aField[0],
|
||||
'REP_VAR_TYPE' => $sType));
|
||||
$aFields[] = array('sFieldName' => $aField[0], 'sType' => $sType);
|
||||
$oReportVar->create( array ('REP_TAB_UID' => $values['REP_TAB_UID'],'PRO_UID' => $values['PRO_UID'],'REP_VAR_NAME' => $aField[0],'REP_VAR_TYPE' => $sType
|
||||
) );
|
||||
$aFields[] = array ('sFieldName' => $aField[0],'sType' => $sType
|
||||
);
|
||||
}
|
||||
$oReportTables->dropTable( $sOldTableName, $sOldConnection );
|
||||
$oReportTables->createTable( $values['REP_TAB_NAME'], $values['REP_TAB_CONNECTION'], $values['REP_TAB_TYPE'], $aFields );
|
||||
|
||||
Reference in New Issue
Block a user