BUG 0000 new Feature: Report table ver 2 (fixes)
- update phisical table fixed
This commit is contained in:
@@ -71,6 +71,7 @@ class AdditionalTables extends BaseAdditionalTables {
|
||||
$oCriteria->addSelectColumn(FieldsPeer::FLD_FOREIGN_KEY_TABLE);
|
||||
$oCriteria->addSelectColumn(FieldsPeer::FLD_DYN_NAME);
|
||||
$oCriteria->addSelectColumn(FieldsPeer::FLD_DYN_UID);
|
||||
$oCriteria->addSelectColumn(FieldsPeer::FLD_FILTER);
|
||||
$oCriteria->add(FieldsPeer::ADD_TAB_UID, $sUID);
|
||||
$oCriteria->addAscendingOrderByColumn(FieldsPeer::FLD_INDEX);
|
||||
$oDataset = FieldsPeer::doSelectRS($oCriteria);
|
||||
@@ -430,23 +431,40 @@ class AdditionalTables extends BaseAdditionalTables {
|
||||
$aFieldsToAdd = array();
|
||||
$aFieldsToDelete = array();
|
||||
$aFieldsToAlter = array();
|
||||
// echo 'oldfields';
|
||||
// print_R($aOldFields);
|
||||
// echo 'newfields';
|
||||
// print_R($aNewFields);
|
||||
|
||||
|
||||
foreach ($aNewFields as $aNewField) {
|
||||
$aNewField['FLD_NAME'] = strtoupper($aNewField['FLD_NAME']);
|
||||
if (!isset($aOldFields[$aNewField['FLD_UID']])) {
|
||||
$aFieldsToAdd[] = $aNewField;
|
||||
}
|
||||
if ($aNewField['FLD_KEY'] == 1 || $aNewField['FLD_KEY'] == 'on' || $aNewField['FLD_AUTO_INCREMENT'] == 'on') {
|
||||
|
||||
if ($aNewField['FLD_KEY'] == 1 || $aNewField['FLD_KEY'] === 'on' || $aNewField['FLD_AUTO_INCREMENT'] === 'on') {
|
||||
if (!in_array($aNewField['FLD_NAME'], $aKeys)) {
|
||||
$aKeys[] = $aNewField['FLD_NAME'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// echo '$aKeys';
|
||||
// print_R($aKeys);
|
||||
|
||||
// echo '$aFieldsToAdd';
|
||||
// print_R($aFieldsToAdd);
|
||||
foreach ($aOldFields as $aOldField) {
|
||||
$aOldField['FLD_NAME'] = strtoupper($aOldField['FLD_NAME']);
|
||||
if (!isset($aNewFields[$aOldField['FLD_UID']])) {
|
||||
$aFieldsToDelete[] = $aOldField;
|
||||
}
|
||||
}
|
||||
// echo '$aFieldsToDelete';
|
||||
// print_R($aFieldsToDelete);
|
||||
|
||||
|
||||
foreach ($aNewFields as $aNewField) {
|
||||
if (isset($aOldFields[$aNewField['FLD_UID']])) {
|
||||
$bEqual = true;
|
||||
@@ -474,23 +492,35 @@ class AdditionalTables extends BaseAdditionalTables {
|
||||
}
|
||||
}
|
||||
}
|
||||
// echo '$aFieldsToAlter';
|
||||
// print_R($aFieldsToAlter);
|
||||
|
||||
G::LoadSystem('database_' . strtolower(DB_ADAPTER));
|
||||
$oDataBase = new database(DB_ADAPTER, DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||
$oDataBase->iFetchType = MYSQL_NUM;
|
||||
$oDataBase->executeQuery($oDataBase->generateDropPrimaryKeysSQL($sTableName));
|
||||
|
||||
//$oDataBase->executeQuery($oDataBase->generateDropPrimaryKeysSQL($sTableName));
|
||||
$con = Propel::getConnection($sConnection);
|
||||
$stmt = $con->createStatement();
|
||||
$sQuery = $oDataBase->generateDropPrimaryKeysSQL($sTableName);
|
||||
// echo "drop pk->";
|
||||
// var_dump($sQuery);
|
||||
// echo "\n";
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
|
||||
foreach ($aFieldsToAdd as $aFieldToAdd) {
|
||||
switch ($aFieldToAdd['FLD_TYPE']) {
|
||||
case 'VARCHAR':
|
||||
$aData = array(
|
||||
'Type' => 'VARCHAR(' . $aFieldToAdd['FLD_SIZE'] . ')',
|
||||
'Null' => ($aFieldToAdd['FLD_NULL'] == 'on' ? 'YES' : ''),
|
||||
'Null' => ($aFieldToAdd['FLD_NULL'] == 1 || $aFieldToAdd['FLD_NULL'] === 'on' ? 'YES' : ''),
|
||||
'Default' => ''
|
||||
);
|
||||
break;
|
||||
case 'TEXT':
|
||||
$aData = array(
|
||||
'Type' => 'TEXT',
|
||||
'Null' => ($aFieldToAdd['FLD_NULL'] == 'on' ? 'YES' : ''),
|
||||
'Null' => ($aFieldToAdd['FLD_NULL'] == 1 || $aFieldToAdd['FLD_NULL'] === 'on' ? 'YES' : ''),
|
||||
'Default' => ''
|
||||
);
|
||||
break;
|
||||
@@ -504,27 +534,44 @@ class AdditionalTables extends BaseAdditionalTables {
|
||||
case 'INT':
|
||||
$aData = array(
|
||||
'Type' => 'INT(' . (int)$aFieldToAdd['FLD_SIZE'] . ')',
|
||||
'Null' => ($aFieldToAdd['FLD_NULL'] == 'on' ? 'YES' : ''),
|
||||
'Null' => ($aFieldToAdd['FLD_NULL'] == 1 || $aFieldToAdd['FLD_NULL'] === 'on' ? 'YES' : ''),
|
||||
'Default' => '0',
|
||||
'AI' => ($aFieldToAdd['FLD_AUTO_INCREMENT'] == 'on' ? 1 : 0)
|
||||
'AI' => ($aFieldToAdd['FLD_AUTO_INCREMENT'] == 1 || $aFieldToAdd['FLD_AUTO_INCREMENT'] === 'on' ? 1 : 0)
|
||||
);
|
||||
break;
|
||||
case 'FLOAT':
|
||||
$aData = array(
|
||||
'Type' => 'FLOAT(' . (int)$aFieldToAdd['FLD_SIZE'] . ')',
|
||||
'Null' => ($aFieldToAdd['FLD_NULL'] == 'on' ? 'YES' : ''),
|
||||
'Null' => ($aFieldToAdd['FLD_NULL'] == 1 || $aFieldToAdd['FLD_NULL'] == 'on' ? 'YES' : ''),
|
||||
'Default' => '0'
|
||||
);
|
||||
break;
|
||||
}
|
||||
//echo $oDataBase->generateAddColumnSQL($sTableName, $aFieldToAdd['FLD_NAME'], $aData);
|
||||
$oDataBase->executeQuery($oDataBase->generateAddColumnSQL($sTableName, strtoupper($aFieldToAdd['FLD_NAME']), $aData));
|
||||
//$oDataBase->executeQuery($oDataBase->generateAddColumnSQL($sTableName, strtoupper($aFieldToAdd['FLD_NAME']), $aData));
|
||||
$sQuery = $oDataBase->generateAddColumnSQL($sTableName, strtoupper($aFieldToAdd['FLD_NAME']), $aData);
|
||||
// echo "add col->";
|
||||
// var_dump($sQuery);
|
||||
// echo "\n";
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
|
||||
}
|
||||
foreach ($aFieldsToDelete as $aFieldToDelete) {
|
||||
$oDataBase->executeQuery($oDataBase->generateDropColumnSQL($sTableName, strtoupper($aFieldToDelete['FLD_NAME'])));
|
||||
//$oDataBase->executeQuery($oDataBase->generateDropColumnSQL($sTableName, strtoupper($aFieldToDelete['FLD_NAME'])));
|
||||
$sQuery = $oDataBase->generateDropColumnSQL($sTableName, strtoupper($aFieldToDelete['FLD_NAME']));
|
||||
// echo 'drop col->';
|
||||
// var_dump($sQuery);
|
||||
// echo "\n";
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
}
|
||||
//die;
|
||||
$oDataBase->executeQuery($oDataBase->generateAddPrimaryKeysSQL($sTableName, $aKeys));
|
||||
|
||||
//$oDataBase->executeQuery($oDataBase->generateAddPrimaryKeysSQL($sTableName, $aKeys));
|
||||
$sQuery = $oDataBase->generateAddPrimaryKeysSQL($sTableName, $aKeys);
|
||||
// echo 'generate add PK->';
|
||||
// var_dump($sQuery);
|
||||
// echo "\n";
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
|
||||
foreach ($aFieldsToAlter as $aFieldToAlter) {
|
||||
switch ($aFieldToAlter['FLD_TYPE']) {
|
||||
case 'VARCHAR':
|
||||
@@ -564,7 +611,13 @@ class AdditionalTables extends BaseAdditionalTables {
|
||||
);
|
||||
break;
|
||||
}
|
||||
$oDataBase->executeQuery($oDataBase->generateChangeColumnSQL($sTableName, strtoupper($aFieldToAlter['FLD_NAME']), $aData, strtoupper($aFieldToAlter['FLD_NAME_OLD'])));
|
||||
//$oDataBase->executeQuery($oDataBase->generateChangeColumnSQL($sTableName, strtoupper($aFieldToAlter['FLD_NAME']), $aData, strtoupper($aFieldToAlter['FLD_NAME_OLD'])));
|
||||
|
||||
$sQuery = $oDataBase->generateChangeColumnSQL($sTableName, strtoupper($aFieldToAlter['FLD_NAME']), $aData, strtoupper($aFieldToAlter['FLD_NAME_OLD']));
|
||||
// echo 'alter->';
|
||||
// var_dump($sQuery);
|
||||
// echo "\n";
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
}
|
||||
}
|
||||
catch (Exception $oError) {
|
||||
@@ -1802,6 +1855,7 @@ var additionalTablesDataDelete = function(sUID, sKeys) {
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_NAME);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_DESCRIPTION);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_TYPE);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_TAG);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::PRO_UID);
|
||||
|
||||
if (isset($process)) {
|
||||
|
||||
@@ -94,6 +94,8 @@ class FieldsMapBuilder {
|
||||
|
||||
$tMap->addColumn('FLD_FILTER', 'FldFilter', 'int', CreoleTypes::TINYINT, false, null);
|
||||
|
||||
$tMap->addColumn('ADD_TAB_TAG', 'AddTabTag', 'string', CreoleTypes::VARCHAR, false, 256);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // FieldsMapBuilder
|
||||
|
||||
@@ -132,6 +132,13 @@ abstract class BaseFields extends BaseObject implements Persistent {
|
||||
*/
|
||||
protected $fld_filter = 0;
|
||||
|
||||
|
||||
/**
|
||||
* The value for the add_tab_tag field.
|
||||
* @var string
|
||||
*/
|
||||
protected $add_tab_tag = '';
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
@@ -311,6 +318,17 @@ abstract class BaseFields extends BaseObject implements Persistent {
|
||||
return $this->fld_filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [add_tab_tag] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAddTabTag()
|
||||
{
|
||||
|
||||
return $this->add_tab_tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [fld_uid] column.
|
||||
*
|
||||
@@ -641,6 +659,28 @@ abstract class BaseFields extends BaseObject implements Persistent {
|
||||
|
||||
} // setFldFilter()
|
||||
|
||||
/**
|
||||
* Set the value of [add_tab_tag] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setAddTabTag($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->add_tab_tag !== $v || $v === '') {
|
||||
$this->add_tab_tag = $v;
|
||||
$this->modifiedColumns[] = FieldsPeer::ADD_TAB_TAG;
|
||||
}
|
||||
|
||||
} // setAddTabTag()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
@@ -688,12 +728,14 @@ abstract class BaseFields extends BaseObject implements Persistent {
|
||||
|
||||
$this->fld_filter = $rs->getInt($startcol + 14);
|
||||
|
||||
$this->add_tab_tag = $rs->getString($startcol + 15);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 15; // 15 = FieldsPeer::NUM_COLUMNS - FieldsPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 16; // 16 = FieldsPeer::NUM_COLUMNS - FieldsPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating Fields object", $e);
|
||||
@@ -941,6 +983,9 @@ abstract class BaseFields extends BaseObject implements Persistent {
|
||||
case 14:
|
||||
return $this->getFldFilter();
|
||||
break;
|
||||
case 15:
|
||||
return $this->getAddTabTag();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -976,6 +1021,7 @@ abstract class BaseFields extends BaseObject implements Persistent {
|
||||
$keys[12] => $this->getFldDynName(),
|
||||
$keys[13] => $this->getFldDynUid(),
|
||||
$keys[14] => $this->getFldFilter(),
|
||||
$keys[15] => $this->getAddTabTag(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
@@ -1052,6 +1098,9 @@ abstract class BaseFields extends BaseObject implements Persistent {
|
||||
case 14:
|
||||
$this->setFldFilter($value);
|
||||
break;
|
||||
case 15:
|
||||
$this->setAddTabTag($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -1090,6 +1139,7 @@ abstract class BaseFields extends BaseObject implements Persistent {
|
||||
if (array_key_exists($keys[12], $arr)) $this->setFldDynName($arr[$keys[12]]);
|
||||
if (array_key_exists($keys[13], $arr)) $this->setFldDynUid($arr[$keys[13]]);
|
||||
if (array_key_exists($keys[14], $arr)) $this->setFldFilter($arr[$keys[14]]);
|
||||
if (array_key_exists($keys[15], $arr)) $this->setAddTabTag($arr[$keys[15]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1116,6 +1166,7 @@ abstract class BaseFields extends BaseObject implements Persistent {
|
||||
if ($this->isColumnModified(FieldsPeer::FLD_DYN_NAME)) $criteria->add(FieldsPeer::FLD_DYN_NAME, $this->fld_dyn_name);
|
||||
if ($this->isColumnModified(FieldsPeer::FLD_DYN_UID)) $criteria->add(FieldsPeer::FLD_DYN_UID, $this->fld_dyn_uid);
|
||||
if ($this->isColumnModified(FieldsPeer::FLD_FILTER)) $criteria->add(FieldsPeer::FLD_FILTER, $this->fld_filter);
|
||||
if ($this->isColumnModified(FieldsPeer::ADD_TAB_TAG)) $criteria->add(FieldsPeer::ADD_TAB_TAG, $this->add_tab_tag);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1198,6 +1249,8 @@ abstract class BaseFields extends BaseObject implements Persistent {
|
||||
|
||||
$copyObj->setFldFilter($this->fld_filter);
|
||||
|
||||
$copyObj->setAddTabTag($this->add_tab_tag);
|
||||
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ abstract class BaseFieldsPeer {
|
||||
const CLASS_DEFAULT = 'classes.model.Fields';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 15;
|
||||
const NUM_COLUMNS = 16;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
@@ -75,6 +75,9 @@ abstract class BaseFieldsPeer {
|
||||
/** the column name for the FLD_FILTER field */
|
||||
const FLD_FILTER = 'FIELDS.FLD_FILTER';
|
||||
|
||||
/** the column name for the ADD_TAB_TAG field */
|
||||
const ADD_TAB_TAG = 'FIELDS.ADD_TAB_TAG';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
@@ -86,10 +89,10 @@ abstract class BaseFieldsPeer {
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('FldUid', 'AddTabUid', 'FldIndex', 'FldName', 'FldDescription', 'FldType', 'FldSize', 'FldNull', 'FldAutoIncrement', 'FldKey', 'FldForeignKey', 'FldForeignKeyTable', 'FldDynName', 'FldDynUid', 'FldFilter', ),
|
||||
BasePeer::TYPE_COLNAME => array (FieldsPeer::FLD_UID, FieldsPeer::ADD_TAB_UID, FieldsPeer::FLD_INDEX, FieldsPeer::FLD_NAME, FieldsPeer::FLD_DESCRIPTION, FieldsPeer::FLD_TYPE, FieldsPeer::FLD_SIZE, FieldsPeer::FLD_NULL, FieldsPeer::FLD_AUTO_INCREMENT, FieldsPeer::FLD_KEY, FieldsPeer::FLD_FOREIGN_KEY, FieldsPeer::FLD_FOREIGN_KEY_TABLE, FieldsPeer::FLD_DYN_NAME, FieldsPeer::FLD_DYN_UID, FieldsPeer::FLD_FILTER, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('FLD_UID', 'ADD_TAB_UID', 'FLD_INDEX', 'FLD_NAME', 'FLD_DESCRIPTION', 'FLD_TYPE', 'FLD_SIZE', 'FLD_NULL', 'FLD_AUTO_INCREMENT', 'FLD_KEY', 'FLD_FOREIGN_KEY', 'FLD_FOREIGN_KEY_TABLE', 'FLD_DYN_NAME', 'FLD_DYN_UID', 'FLD_FILTER', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
|
||||
BasePeer::TYPE_PHPNAME => array ('FldUid', 'AddTabUid', 'FldIndex', 'FldName', 'FldDescription', 'FldType', 'FldSize', 'FldNull', 'FldAutoIncrement', 'FldKey', 'FldForeignKey', 'FldForeignKeyTable', 'FldDynName', 'FldDynUid', 'FldFilter', 'AddTabTag', ),
|
||||
BasePeer::TYPE_COLNAME => array (FieldsPeer::FLD_UID, FieldsPeer::ADD_TAB_UID, FieldsPeer::FLD_INDEX, FieldsPeer::FLD_NAME, FieldsPeer::FLD_DESCRIPTION, FieldsPeer::FLD_TYPE, FieldsPeer::FLD_SIZE, FieldsPeer::FLD_NULL, FieldsPeer::FLD_AUTO_INCREMENT, FieldsPeer::FLD_KEY, FieldsPeer::FLD_FOREIGN_KEY, FieldsPeer::FLD_FOREIGN_KEY_TABLE, FieldsPeer::FLD_DYN_NAME, FieldsPeer::FLD_DYN_UID, FieldsPeer::FLD_FILTER, FieldsPeer::ADD_TAB_TAG, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('FLD_UID', 'ADD_TAB_UID', 'FLD_INDEX', 'FLD_NAME', 'FLD_DESCRIPTION', 'FLD_TYPE', 'FLD_SIZE', 'FLD_NULL', 'FLD_AUTO_INCREMENT', 'FLD_KEY', 'FLD_FOREIGN_KEY', 'FLD_FOREIGN_KEY_TABLE', 'FLD_DYN_NAME', 'FLD_DYN_UID', 'FLD_FILTER', 'ADD_TAB_TAG', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -99,10 +102,10 @@ abstract class BaseFieldsPeer {
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('FldUid' => 0, 'AddTabUid' => 1, 'FldIndex' => 2, 'FldName' => 3, 'FldDescription' => 4, 'FldType' => 5, 'FldSize' => 6, 'FldNull' => 7, 'FldAutoIncrement' => 8, 'FldKey' => 9, 'FldForeignKey' => 10, 'FldForeignKeyTable' => 11, 'FldDynName' => 12, 'FldDynUid' => 13, 'FldFilter' => 14, ),
|
||||
BasePeer::TYPE_COLNAME => array (FieldsPeer::FLD_UID => 0, FieldsPeer::ADD_TAB_UID => 1, FieldsPeer::FLD_INDEX => 2, FieldsPeer::FLD_NAME => 3, FieldsPeer::FLD_DESCRIPTION => 4, FieldsPeer::FLD_TYPE => 5, FieldsPeer::FLD_SIZE => 6, FieldsPeer::FLD_NULL => 7, FieldsPeer::FLD_AUTO_INCREMENT => 8, FieldsPeer::FLD_KEY => 9, FieldsPeer::FLD_FOREIGN_KEY => 10, FieldsPeer::FLD_FOREIGN_KEY_TABLE => 11, FieldsPeer::FLD_DYN_NAME => 12, FieldsPeer::FLD_DYN_UID => 13, FieldsPeer::FLD_FILTER => 14, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('FLD_UID' => 0, 'ADD_TAB_UID' => 1, 'FLD_INDEX' => 2, 'FLD_NAME' => 3, 'FLD_DESCRIPTION' => 4, 'FLD_TYPE' => 5, 'FLD_SIZE' => 6, 'FLD_NULL' => 7, 'FLD_AUTO_INCREMENT' => 8, 'FLD_KEY' => 9, 'FLD_FOREIGN_KEY' => 10, 'FLD_FOREIGN_KEY_TABLE' => 11, 'FLD_DYN_NAME' => 12, 'FLD_DYN_UID' => 13, 'FLD_FILTER' => 14, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
|
||||
BasePeer::TYPE_PHPNAME => array ('FldUid' => 0, 'AddTabUid' => 1, 'FldIndex' => 2, 'FldName' => 3, 'FldDescription' => 4, 'FldType' => 5, 'FldSize' => 6, 'FldNull' => 7, 'FldAutoIncrement' => 8, 'FldKey' => 9, 'FldForeignKey' => 10, 'FldForeignKeyTable' => 11, 'FldDynName' => 12, 'FldDynUid' => 13, 'FldFilter' => 14, 'AddTabTag' => 15, ),
|
||||
BasePeer::TYPE_COLNAME => array (FieldsPeer::FLD_UID => 0, FieldsPeer::ADD_TAB_UID => 1, FieldsPeer::FLD_INDEX => 2, FieldsPeer::FLD_NAME => 3, FieldsPeer::FLD_DESCRIPTION => 4, FieldsPeer::FLD_TYPE => 5, FieldsPeer::FLD_SIZE => 6, FieldsPeer::FLD_NULL => 7, FieldsPeer::FLD_AUTO_INCREMENT => 8, FieldsPeer::FLD_KEY => 9, FieldsPeer::FLD_FOREIGN_KEY => 10, FieldsPeer::FLD_FOREIGN_KEY_TABLE => 11, FieldsPeer::FLD_DYN_NAME => 12, FieldsPeer::FLD_DYN_UID => 13, FieldsPeer::FLD_FILTER => 14, FieldsPeer::ADD_TAB_TAG => 15, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('FLD_UID' => 0, 'ADD_TAB_UID' => 1, 'FLD_INDEX' => 2, 'FLD_NAME' => 3, 'FLD_DESCRIPTION' => 4, 'FLD_TYPE' => 5, 'FLD_SIZE' => 6, 'FLD_NULL' => 7, 'FLD_AUTO_INCREMENT' => 8, 'FLD_KEY' => 9, 'FLD_FOREIGN_KEY' => 10, 'FLD_FOREIGN_KEY_TABLE' => 11, 'FLD_DYN_NAME' => 12, 'FLD_DYN_UID' => 13, 'FLD_FILTER' => 14, 'ADD_TAB_TAG' => 15, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -233,6 +236,8 @@ abstract class BaseFieldsPeer {
|
||||
|
||||
$criteria->addSelectColumn(FieldsPeer::FLD_FILTER);
|
||||
|
||||
$criteria->addSelectColumn(FieldsPeer::ADD_TAB_TAG);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(FIELDS.FLD_UID)';
|
||||
|
||||
@@ -53,7 +53,7 @@ abstract class BaseTranslation extends BaseObject implements Persistent {
|
||||
* The value for the trn_value field.
|
||||
* @var string
|
||||
*/
|
||||
protected $trn_value = '';
|
||||
protected $trn_value;
|
||||
|
||||
|
||||
/**
|
||||
@@ -232,7 +232,7 @@ abstract class BaseTranslation extends BaseObject implements Persistent {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->trn_value !== $v || $v === '') {
|
||||
if ($this->trn_value !== $v) {
|
||||
$this->trn_value = $v;
|
||||
$this->modifiedColumns[] = TranslationPeer::TRN_VALUE;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
propel.targetPackage = classes.model
|
||||
propel.packageObjectModel = true
|
||||
propel.project = opensource
|
||||
propel.database = mssql
|
||||
propel.database = mysql
|
||||
propel.database.createUrl = mysql://root@localhost/
|
||||
propel.database.url = mysql://root@localhost/wf_os
|
||||
|
||||
|
||||
@@ -2084,6 +2084,7 @@
|
||||
<column name="FLD_DYN_NAME" type="VARCHAR" size="128" required="false" default=""/>
|
||||
<column name="FLD_DYN_UID" type="VARCHAR" size="128" required="false" default=""/>
|
||||
<column name="FLD_FILTER" type="TINYINT" required="false" default="0"/>
|
||||
<column name="ADD_TAB_TAG" type="VARCHAR" size="256" required="false" default=""/>
|
||||
</table>
|
||||
<table name="SHADOW_TABLE">
|
||||
<vendor type="mysql">
|
||||
|
||||
@@ -974,6 +974,7 @@ CREATE TABLE `FIELDS`
|
||||
`FLD_DYN_NAME` VARCHAR(128) default '',
|
||||
`FLD_DYN_UID` VARCHAR(128) default '',
|
||||
`FLD_FILTER` TINYINT default 0,
|
||||
`ADD_TAB_TAG` VARCHAR(256) default '',
|
||||
PRIMARY KEY (`FLD_UID`)
|
||||
)ENGINE=MyISAM DEFAULT CHARSET='utf8';
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@@ -60,3 +60,7 @@ $G_TMP_MENU->AddIdRawOption('GROUPS', '../groups/groups', G::LoadTranslation('ID
|
||||
$G_TMP_MENU->AddIdRawOption('DEPARTAMENTS', '../departments/departments', G::LoadTranslation('ID_DEPARTMENTS_USERS'), '', '', 'users');
|
||||
$G_TMP_MENU->AddIdRawOption('ROLES', '../roles/roles_List', G::LoadTranslation('ID_ROLES'), '', '', 'users');
|
||||
$G_TMP_MENU->AddIdRawOption('AUTHSOURCES', '../authSources/authSources_List', G::LoadTranslation('ID_AUTH_SOURCES'), '', '', 'users');
|
||||
|
||||
|
||||
|
||||
$G_TMP_MENU->AddIdRawOption('PLUGIN_REPTAB_PERMISSIONS', 'myFunc()', 'Permissions', '', '', 'private');
|
||||
@@ -5,7 +5,6 @@ $table = false;
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->addExtJsScript('reportTables/edit', true );
|
||||
$oHeadPublisher->addContent('reportTables/edit');
|
||||
$oHeadPublisher->assign('ADD_TAB_UID', $id);
|
||||
|
||||
if ($id) { // if is a edit request
|
||||
@@ -20,10 +19,10 @@ if ($id) { // if is a edit request
|
||||
|
||||
// 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') {
|
||||
/*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']);
|
||||
}
|
||||
|
||||
@@ -62,6 +61,7 @@ $repTabPluginPermissions = false;
|
||||
global $G_TMP_MENU;
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('setup');
|
||||
|
||||
foreach( $oMenu->Options as $i=>$option) {
|
||||
if ($oMenu->Types[$i] == 'private' && $oMenu->Id[$i] == 'PLUGIN_REPTAB_PERMISSIONS') {
|
||||
$repTabPluginPermissions = array();
|
||||
|
||||
@@ -23,17 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*$proUid = $_GET['PRO_UID'];
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->addExtJsScript('reportTables/main', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('reportTables/main'); //adding a html file .html.
|
||||
|
||||
|
||||
$oHeadPublisher->assign('PRO_UID', $proUid);
|
||||
|
||||
G::RenderPage('publish', 'extJs');*/
|
||||
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
||||
$G_PUBLISH = new Publisher;
|
||||
@@ -45,8 +34,24 @@ $Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] :
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
|
||||
//$oHeadPublisher->usingExtJs('ux/Ext.ux.fileUploadField');
|
||||
$oHeadPublisher->addExtJsScript('reportTables/main', true); //adding a javascript file .js
|
||||
$repTabPluginPermissions = false;
|
||||
global $G_TMP_MENU;
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('setup');
|
||||
|
||||
$simpleREportsPlugin = false;
|
||||
foreach( $oMenu->Options as $i=>$option) {
|
||||
if ($oMenu->Types[$i] == 'private' && $oMenu->Id[$i] == 'PLUGIN_REPTAB_PERMISSIONS') {
|
||||
$simpleREportsPlugin = array();
|
||||
$simpleREportsPlugin['label'] = $oMenu->Labels[$i];
|
||||
$simpleREportsPlugin['fn'] = $oMenu->Options[$i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$oHeadPublisher->assign('_PLUGIN_SIMPLEREPORTS', $simpleREportsPlugin);
|
||||
|
||||
$oHeadPublisher->addExtJsScript('reportTables/main', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('reportTables/main'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('FORMATS',$c->getFormats());
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
|
||||
@@ -156,43 +156,6 @@ switch($action) {
|
||||
// verify if exists.
|
||||
$aNameTable = $oAdditionalTables->loadByName($data['REP_TAB_NAME']);
|
||||
|
||||
$columns = $data['columns'];
|
||||
//setting default columns
|
||||
$defaultColumns = array();
|
||||
$application = new stdClass(); //APPLICATION KEY
|
||||
$application->field_name = 'APP_UID';
|
||||
$application->field_label = 'APP_UID';
|
||||
$application->field_type = 'VARCHAR';
|
||||
$application->field_size = 32;
|
||||
$application->field_dyn = '';
|
||||
$application->field_key = 1;
|
||||
$application->field_null = 0;
|
||||
array_push($defaultColumns, $application);
|
||||
|
||||
$application = new stdClass(); //APP_NUMBER
|
||||
$application->field_name = 'APP_NUMBER';
|
||||
$application->field_label = 'APP_NUMBER';
|
||||
$application->field_type = 'INT';
|
||||
$application->field_size = 11;
|
||||
$application->field_dyn = '';
|
||||
$application->field_key = 1;
|
||||
$application->field_null = 0;
|
||||
array_push($defaultColumns, $application);
|
||||
|
||||
//if it is a grid report table
|
||||
if ($data['REP_TAB_TYPE'] == 'GRID') { //GRID INDEX
|
||||
$gridIndex = new stdClass();
|
||||
$gridIndex->field_name = 'ROW';
|
||||
$gridIndex->field_label = 'ROW';
|
||||
$gridIndex->field_type = 'INT';
|
||||
$gridIndex->field_size = '11';
|
||||
$gridIndex->field_dyn = '';
|
||||
$gridIndex->field_null = 0;
|
||||
array_push($defaultColumns, $gridIndex);
|
||||
}
|
||||
|
||||
$columns = array_merge($defaultColumns, $columns);
|
||||
|
||||
$repTabClassName = to_camel_case($data['REP_TAB_NAME']);
|
||||
|
||||
$repTabData = array(
|
||||
@@ -207,7 +170,48 @@ switch($action) {
|
||||
'ADD_TAB_GRID' => $data['REP_TAB_GRID']
|
||||
);
|
||||
|
||||
$columns = $data['columns'];
|
||||
|
||||
if ($data['REP_TAB_UID'] == '') { //new report table
|
||||
//setting default columns
|
||||
$defaultColumns = array();
|
||||
$application = new stdClass(); //APPLICATION KEY
|
||||
$application->field_name = 'APP_UID';
|
||||
$application->field_label = 'APP_UID';
|
||||
$application->field_type = 'VARCHAR';
|
||||
$application->field_size = 32;
|
||||
$application->field_dyn = '';
|
||||
$application->field_key = 1;
|
||||
$application->field_null = 0;
|
||||
$application->field_filter = false;
|
||||
array_push($defaultColumns, $application);
|
||||
|
||||
$application = new stdClass(); //APP_NUMBER
|
||||
$application->field_name = 'APP_NUMBER';
|
||||
$application->field_label = 'APP_NUMBER';
|
||||
$application->field_type = 'INT';
|
||||
$application->field_size = 11;
|
||||
$application->field_dyn = '';
|
||||
$application->field_key = 1;
|
||||
$application->field_null =0;
|
||||
$application->field_filter = false;
|
||||
array_push($defaultColumns, $application);
|
||||
|
||||
//if it is a grid report table
|
||||
if ($data['REP_TAB_TYPE'] == 'GRID') { //GRID INDEX
|
||||
$gridIndex = new stdClass();
|
||||
$gridIndex->field_name = 'ROW';
|
||||
$gridIndex->field_label = 'ROW';
|
||||
$gridIndex->field_type = 'INT';
|
||||
$gridIndex->field_size = '11';
|
||||
$gridIndex->field_dyn = '';
|
||||
$gridIndex->field_null = 0;
|
||||
$gridIndex->field_filter = false;
|
||||
array_push($defaultColumns, $gridIndex);
|
||||
}
|
||||
|
||||
$columns = array_merge($defaultColumns, $columns);
|
||||
|
||||
|
||||
/** validations **/
|
||||
if(is_array($aNameTable)) {
|
||||
@@ -230,20 +234,21 @@ switch($action) {
|
||||
//removing old data fields references
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(FieldsPeer::ADD_TAB_UID, $data['REP_TAB_UID']);
|
||||
$oCriteria->add(FieldsPeer::FLD_NAME, 'APP_UID', Criteria::NOT_EQUAL);
|
||||
$oCriteria->add(FieldsPeer::FLD_NAME, 'ROW', Criteria::NOT_EQUAL);
|
||||
//$oCriteria->add(FieldsPeer::FLD_NAME, 'APP_UID', Criteria::NOT_EQUAL);
|
||||
//$oCriteria->add(FieldsPeer::FLD_NAME, 'ROW', Criteria::NOT_EQUAL);
|
||||
FieldsPeer::doDelete($oCriteria);
|
||||
|
||||
//getting old fieldnames
|
||||
$oldFields = array();
|
||||
foreach ($addTabBeforeData['FIELDS'] as $field) {
|
||||
if ($field['FLD_NAME'] == 'APP_UID' || $field['FLD_NAME'] == 'ROW') continue;
|
||||
//if ($field['FLD_NAME'] == 'APP_UID' || $field['FLD_NAME'] == 'ROW') continue;
|
||||
$oldFields[$field['FLD_UID']] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
$aFields = array();
|
||||
$fieldsList = array();
|
||||
$aFields = array();
|
||||
$fieldsList = array();
|
||||
$editFieldsList = array();
|
||||
|
||||
foreach ($columns as $i => $column) {
|
||||
$field = array(
|
||||
@@ -254,28 +259,30 @@ switch($action) {
|
||||
'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_NULL' => (isset($column->field_null) ? $column->field_null : 1),
|
||||
'FLD_AUTO_INCREMENT' => 0,
|
||||
'FLD_KEY' => isset($column->field_key) ? $column->field_key : 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)? 1 : 0)
|
||||
'FLD_FILTER' => (isset($column->field_filter) && $column->field_filter ? 1 : 0)
|
||||
);
|
||||
|
||||
$fieldUid = $oFields->create($field);
|
||||
array_push($fieldsList, $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) ? $defaultColumns[1]->field_null : 1,
|
||||
'bNull' => (isset($column->field_null) ? $column->field_null : 1),
|
||||
'bAI' => 0,
|
||||
'bPrimaryKey' => isset($column->field_key) ? $defaultColumns[1]->field_key : 0
|
||||
'bPrimaryKey' => (isset($column->field_key) ? $column->field_key : 0)
|
||||
);
|
||||
} else { //editing
|
||||
$field['FLD_UID'] = $fieldUid;
|
||||
$aFields[$fieldUid] = $field;
|
||||
}
|
||||
}
|
||||
@@ -368,6 +375,18 @@ switch($action) {
|
||||
echo G::json_encode($addTab);
|
||||
break;
|
||||
|
||||
case 'updateTag':
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
$oAdditionalTables = new AdditionalTables();
|
||||
$uid = $_REQUEST['ADD_TAB_UID'];
|
||||
$value = $_REQUEST['value'];
|
||||
|
||||
$repTabData = array(
|
||||
'ADD_TAB_UID' => $uid,
|
||||
'ADD_TAB_TAG' => $value
|
||||
);
|
||||
$oAdditionalTables->update($repTabData);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -821,3 +821,63 @@ antes funcionaba.
|
||||
opacity: .55;
|
||||
-moz-opacity: .55;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* --Row Editor UX Lib CSS--
|
||||
*/
|
||||
.ext-ie .x-row-editor .x-form-text {
|
||||
margin:0 !important;
|
||||
}
|
||||
.x-row-editor-header {
|
||||
height:2px;
|
||||
overflow:hidden;
|
||||
background: transparent url(../images/ext/default/row-editor-bg.gif) repeat-x 0 0;
|
||||
}
|
||||
.x-row-editor-footer {
|
||||
height:2px;
|
||||
overflow:hidden;
|
||||
background: transparent url(../images/ext/default/row-editor-bg.gif) repeat-x 0 -2px;
|
||||
}
|
||||
.ext-ie .x-row-editor-footer {
|
||||
margin-top:-1px;
|
||||
}
|
||||
|
||||
.x-row-editor-body {
|
||||
overflow:hidden;
|
||||
zoom:1;
|
||||
background: #ebf2fb;
|
||||
padding-top:2px;
|
||||
}
|
||||
.x-row-editor .x-btns {
|
||||
position:absolute;
|
||||
top:28px;
|
||||
left:20px;
|
||||
padding-left:5px;
|
||||
background: transparent url(../images/ext/default/row-editor-btns.gif) no-repeat 0 0;
|
||||
}
|
||||
.x-row-editor .x-btns .x-plain-bwrap {
|
||||
padding-right:5px;
|
||||
background: transparent url(../images/ext/default/row-editor-btns.gif) no-repeat right -31px;
|
||||
}
|
||||
.x-row-editor .x-btns .x-plain-body {
|
||||
background: transparent url(../images/ext/default/row-editor-btns.gif) repeat-x 0 -62px;
|
||||
height:31px;
|
||||
}
|
||||
.x-row-editor .x-btns .x-table-layout-cell {
|
||||
padding:3px;
|
||||
}
|
||||
|
||||
/* Fixes for IE6/7 trigger fields */
|
||||
.ext-ie6 .x-row-editor .x-form-field-wrap .x-form-trigger, .ext-ie7 .x-row-editor .x-form-field-wrap .x-form-trigger {
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.ext-ie6 .x-row-editor .x-form-field-trigger-wrap, .ext-ie7 .x-row-editor .x-form-field-trigger-wrap {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.errorTip .x-tip-body ul{
|
||||
list-style-type:disc;
|
||||
margin-left:15px;
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
<html>
|
||||
<header>
|
||||
<style type="text/css">
|
||||
/*!
|
||||
* Ext JS Library 3.3.3
|
||||
* Copyright(c) 2006-2011 Sencha Inc.
|
||||
* licensing@sencha.com
|
||||
* http://www.sencha.com/license
|
||||
*/
|
||||
.ext-ie .x-row-editor .x-form-text {
|
||||
margin:0 !important;
|
||||
}
|
||||
.x-row-editor-header {
|
||||
height:2px;
|
||||
overflow:hidden;
|
||||
background: transparent url(../images/row-editor-bg.gif) repeat-x 0 0;
|
||||
}
|
||||
.x-row-editor-footer {
|
||||
height:2px;
|
||||
overflow:hidden;
|
||||
background: transparent url(../images/row-editor-bg.gif) repeat-x 0 -2px;
|
||||
}
|
||||
.ext-ie .x-row-editor-footer {
|
||||
margin-top:-1px;
|
||||
}
|
||||
|
||||
.x-row-editor-body {
|
||||
overflow:hidden;
|
||||
zoom:1;
|
||||
background: #ebf2fb;
|
||||
padding-top:2px;
|
||||
}
|
||||
.x-row-editor .x-btns {
|
||||
position:absolute;
|
||||
top:28px;
|
||||
left:20px;
|
||||
padding-left:5px;
|
||||
background: transparent url(../images/row-editor-btns.gif) no-repeat 0 0;
|
||||
}
|
||||
.x-row-editor .x-btns .x-plain-bwrap {
|
||||
padding-right:5px;
|
||||
background: transparent url(../images/row-editor-btns.gif) no-repeat right -31px;
|
||||
}
|
||||
.x-row-editor .x-btns .x-plain-body {
|
||||
background: transparent url(../images/row-editor-btns.gif) repeat-x 0 -62px;
|
||||
height:31px;
|
||||
}
|
||||
.x-row-editor .x-btns .x-table-layout-cell {
|
||||
padding:3px;
|
||||
}
|
||||
|
||||
/* Fixes for IE6/7 trigger fields */
|
||||
.ext-ie6 .x-row-editor .x-form-field-wrap .x-form-trigger, .ext-ie7 .x-row-editor .x-form-field-wrap .x-form-trigger {
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.ext-ie6 .x-row-editor .x-form-field-trigger-wrap, .ext-ie7 .x-row-editor .x-form-field-trigger-wrap {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.errorTip .x-tip-body ul{
|
||||
list-style-type:disc;
|
||||
margin-left:15px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</header>
|
||||
|
||||
</html>
|
||||
@@ -30,6 +30,7 @@ var reportTablesGlobal = {};
|
||||
reportTablesGlobal.REP_TAB_UID = "";
|
||||
reportTablesGlobal.REP_TAB_UID_EDIT = "";
|
||||
reportTablesGlobal.REP_TAB_TITTLE = "";
|
||||
var oo;
|
||||
|
||||
Ext.onReady(function(){
|
||||
|
||||
@@ -138,6 +139,16 @@ Ext.onReady(function(){
|
||||
dataIndex: 'field_uid',
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
id: 'field_key',
|
||||
dataIndex: 'field_key',
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
id: 'field_null',
|
||||
dataIndex: 'field_null',
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
id: 'field_dyn',
|
||||
header: 'Dynaform Field',
|
||||
@@ -205,16 +216,17 @@ Ext.onReady(function(){
|
||||
})
|
||||
}
|
||||
];
|
||||
|
||||
//if permissions plugin is enabled
|
||||
if (_plugin_permissions !== false) {
|
||||
if (TABLE !== false && TABLE.ADD_TAB_TAG == 'plugin@simplereport') {
|
||||
cmColumns.push({
|
||||
xtype: 'booleancolumn',
|
||||
header: 'Filter',
|
||||
dataIndex: 'field_filter',
|
||||
align: 'center',
|
||||
width: 50,
|
||||
trueText: 'on',
|
||||
falseText: 'off',
|
||||
trueText: 'Yes',
|
||||
falseText: 'No',
|
||||
editor: {
|
||||
xtype: 'checkbox'
|
||||
}
|
||||
@@ -234,10 +246,13 @@ Ext.onReady(function(){
|
||||
fields: [
|
||||
{name: 'uid', type: 'string'},
|
||||
{name: 'field_uid', type: 'string'},
|
||||
{name: 'field_key', type: 'string'},
|
||||
{name: 'field_name', type: 'string'},
|
||||
{name: 'field_label', type: 'string'},
|
||||
{name: 'field_type'},
|
||||
{name: 'field_size', type: 'float'}
|
||||
{name: 'field_size', type: 'float'},
|
||||
{name: 'field_null', type: 'float'},
|
||||
{name: 'field_filter', type: 'string'}
|
||||
]
|
||||
});
|
||||
//row editor for table columns grid
|
||||
@@ -245,6 +260,18 @@ Ext.onReady(function(){
|
||||
saveText: 'Update'
|
||||
});
|
||||
|
||||
editor.on({
|
||||
afteredit: function(roweditor, changes, record, rowIndex) {
|
||||
//
|
||||
},
|
||||
beforeedit: function(roweditor, rowIndex) {
|
||||
row = assignedGrid.getSelectionModel().getSelected();
|
||||
if (row.get('field_name') == 'APP_UID' || row.get('field_name') == 'APP_NUMBER' || row.get('field_name') == 'ROW') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//table columns grid
|
||||
assignedGrid = new Ext.grid.GridPanel({
|
||||
//title: 'Columns',
|
||||
@@ -271,19 +298,26 @@ Ext.onReady(function(){
|
||||
field_name : '',
|
||||
field_label : '',
|
||||
field_type : '',
|
||||
field_size : ''
|
||||
field_size : '',
|
||||
field_key : 0,
|
||||
field_null : 1
|
||||
});
|
||||
|
||||
//store.add(row);
|
||||
editor.stopEditing();
|
||||
store.insert(0, row);
|
||||
assignedGrid.getView().refresh();
|
||||
assignedGrid.getSelectionModel().selectRow(1);
|
||||
assignedGrid.getSelectionModel().selectRow(0);
|
||||
editor.startEditing(0);
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
assignedGrid.getSelectionModel().on('selectionchange', function(sm){
|
||||
//alert('s');
|
||||
});
|
||||
|
||||
// (vertical) selection buttons
|
||||
buttonsPanel = new Ext.Panel({
|
||||
width : 40,
|
||||
@@ -582,7 +616,8 @@ Ext.onReady(function(){
|
||||
});
|
||||
|
||||
var tbar = new Array();
|
||||
if (_plugin_permissions !== false) {
|
||||
//if (_plugin_permissions !== false) {
|
||||
if (TABLE !== false && TABLE.ADD_TAB_TAG == 'plugin@simplereport') {
|
||||
tbar = [
|
||||
{
|
||||
text: _plugin_permissions.label,
|
||||
@@ -784,7 +819,9 @@ AssignFieldsAction = function(){
|
||||
field_name : records[i].data['FIELD_NAME'].toUpperCase(),
|
||||
field_label : records[i].data['FIELD_NAME'].toUpperCase(),
|
||||
field_type : meta.type,
|
||||
field_size : meta.size
|
||||
field_size : meta.size,
|
||||
field_key : 0,
|
||||
field_null : 1
|
||||
});
|
||||
|
||||
store.add(row);
|
||||
@@ -799,12 +836,15 @@ RemoveFieldsAction = function(){
|
||||
records = Ext.getCmp('assignedGrid').getSelectionModel().getSelections();
|
||||
var PMRow = availableGrid.getStore().recordType;
|
||||
for(i=0; i < records.length; i++){
|
||||
var row = new PMRow({
|
||||
FIELD_UID : records[i].data['field_uid'],
|
||||
FIELD_NAME : records[i].data['field_name']
|
||||
});
|
||||
|
||||
availableGrid.getStore().add(row);
|
||||
if (records[i].data['field_dyn'] != '' && records[i].data['field_name'] != 'APP_UID' && records[i].data['field_name'] != 'APP_NUMBER' && records[i].data['field_name'] != 'ROW') {
|
||||
var row = new PMRow({
|
||||
FIELD_UID : records[i].data['field_uid'],
|
||||
FIELD_NAME : records[i].data['field_dyn']
|
||||
});
|
||||
availableGrid.getStore().add(row);
|
||||
} else {
|
||||
records[i] = null;
|
||||
}
|
||||
}
|
||||
//remove from source grid
|
||||
Ext.each(records, Ext.getCmp('assignedGrid').store.remove, Ext.getCmp('assignedGrid').store);
|
||||
@@ -829,7 +869,9 @@ AssignAllFieldsAction = function(){
|
||||
field_name : records[i].data['FIELD_NAME'].toUpperCase(),
|
||||
field_label : records[i].data['FIELD_NAME'].toUpperCase(),
|
||||
field_type : meta.type,
|
||||
field_size : meta.size
|
||||
field_size : meta.size,
|
||||
field_key : 0,
|
||||
field_null : 1
|
||||
});
|
||||
|
||||
store.add(row);
|
||||
@@ -848,11 +890,15 @@ RemoveAllFieldsAction = function(){
|
||||
var PMRow = availableGrid.getStore().recordType;
|
||||
for (var i=0; i < allRows.getCount(); i++){
|
||||
records[i] = allRows.getAt(i);
|
||||
var row = new PMRow({
|
||||
FIELD_UID : records[i].data['field_uid'],
|
||||
FIELD_NAME : records[i].data['field_name']
|
||||
});
|
||||
availableGrid.getStore().add(row);
|
||||
if (records[i].data['field_dyn'] != '' && records[i].data['field_name'] != 'APP_UID' && records[i].data['field_name'] != 'APP_NUMBER' && records[i].data['field_name'] != 'ROW') {
|
||||
var row = new PMRow({
|
||||
FIELD_UID : records[i].data['field_uid'],
|
||||
FIELD_NAME : records[i].data['field_dyn']
|
||||
});
|
||||
availableGrid.getStore().add(row);
|
||||
} else {
|
||||
records[i] = null;
|
||||
}
|
||||
}
|
||||
//remove from source grid
|
||||
Ext.each(records, Ext.getCmp('assignedGrid').store.remove, Ext.getCmp('assignedGrid').store);
|
||||
@@ -1051,11 +1097,15 @@ var DDLoadFields = function(){
|
||||
var PMRow = availableGrid.getStore().recordType;
|
||||
|
||||
for (i=0; i < records.length; i++){
|
||||
var row = new PMRow({
|
||||
FIELD_UID: records[i].data['field_uid'],
|
||||
FIELD_NAME: records[i].data['field_dyn']
|
||||
});
|
||||
availableGrid.getStore().add(row);
|
||||
if (records[i].data['field_dyn'] != '' && records[i].data['field_name'] != 'APP_UID' && records[i].data['field_name'] != 'APP_NUMBER' && records[i].data['field_name'] != 'ROW') {
|
||||
var row = new PMRow({
|
||||
FIELD_UID: records[i].data['field_uid'],
|
||||
FIELD_NAME: records[i].data['field_dyn']
|
||||
});
|
||||
availableGrid.getStore().add(row);
|
||||
} else if (records[i].data['field_dyn'] != '') {
|
||||
records[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
Ext.each(records, ddSource.grid.store.remove, ddSource.grid.store);
|
||||
@@ -1083,7 +1133,9 @@ var DDLoadFields = function(){
|
||||
field_name : records[i].data['FIELD_NAME'].toUpperCase(),
|
||||
field_label : records[i].data['FIELD_NAME'].toUpperCase(),
|
||||
field_type : meta.type,
|
||||
field_size : meta.size
|
||||
field_size : meta.size,
|
||||
field_key : 0,
|
||||
field_null : 1
|
||||
});
|
||||
|
||||
store.add(row);
|
||||
@@ -1107,10 +1159,13 @@ function loadTableRowsFromArray(records)
|
||||
uid : records[i].FLD_UID,
|
||||
field_uid : records[i].FLD_DYN_UID,
|
||||
field_dyn : records[i].FLD_DYN_NAME,
|
||||
field_name : records[i].FLD_NAME,
|
||||
field_label : records[i].FLD_DESCRIPTION,
|
||||
field_type : records[i].FLD_TYPE,
|
||||
field_size : records[i].FLD_SIZE
|
||||
field_name : records[i].FLD_NAME,
|
||||
field_label: records[i].FLD_DESCRIPTION,
|
||||
field_type : records[i].FLD_TYPE,
|
||||
field_size : records[i].FLD_SIZE,
|
||||
field_key : records[i].FLD_KEY,
|
||||
field_null : records[i].FLD_NULL,
|
||||
field_filter: records[i].FLD_FILTER == '1' ? true : false,
|
||||
});
|
||||
|
||||
store.add(row);
|
||||
@@ -1192,8 +1247,3 @@ Ext.override(Ext.form.TextField, {
|
||||
return value;
|
||||
}
|
||||
});
|
||||
|
||||
function myFunc()
|
||||
{
|
||||
alert('permissi11111');
|
||||
}
|
||||
@@ -37,6 +37,7 @@ var viewport;
|
||||
var smodel;
|
||||
|
||||
var rowsSelected;
|
||||
var externalOption;
|
||||
|
||||
Ext.onReady(function(){
|
||||
Ext.QuickTips.init();
|
||||
@@ -100,13 +101,26 @@ Ext.onReady(function(){
|
||||
handler: DoSearch
|
||||
});
|
||||
|
||||
|
||||
|
||||
var contextMenuItems = new Array();
|
||||
contextMenuItems.push(editButton);
|
||||
contextMenuItems.push(deleteButton);
|
||||
if (_PLUGIN_SIMPLEREPORTS !== false) {
|
||||
|
||||
externalOption = new Ext.Action({
|
||||
text:'',
|
||||
handler: function() {
|
||||
updateTag('plugin@simplereport');
|
||||
},
|
||||
disabled: false
|
||||
});
|
||||
|
||||
contextMenuItems.push(externalOption);
|
||||
}
|
||||
|
||||
contextMenu = new Ext.menu.Menu({
|
||||
items: [
|
||||
editButton,
|
||||
deleteButton
|
||||
//dataButton,'-',
|
||||
//exportButton
|
||||
]
|
||||
items: contextMenuItems
|
||||
});
|
||||
|
||||
searchText = new Ext.form.TextField ({
|
||||
@@ -169,16 +183,22 @@ Ext.onReady(function(){
|
||||
cmodelColumns = new Array();
|
||||
|
||||
cmodelColumns.push({id:'ADD_TAB_UID', dataIndex: 'ADD_TAB_UID', hidden:true, hideable:false});
|
||||
cmodelColumns.push({dataIndex: 'ADD_TAB_TAG', hidden:true, hideable:false});
|
||||
cmodelColumns.push({header: _('ID_NAME'), dataIndex: 'ADD_TAB_NAME', width: 300, align:'left', renderer: function(v,p,r){
|
||||
return r.get('TYPE') == 'CLASSIC'? v + ' <span style="font-size:9px; color:green">(old version)</font>' : v;
|
||||
}});
|
||||
cmodelColumns.push({header: _('ID_DESCRIPTION'), dataIndex: 'ADD_TAB_DESCRIPTION', width: 400, hidden:false, align:'left'});
|
||||
cmodelColumns.push({header: _('ID_DESCRIPTION'), dataIndex: 'ADD_TAB_DESCRIPTION', width: 400, hidden:false, align:'left', renderer: function(v,p,r){
|
||||
if (r.get('ADD_TAB_TAG')) {
|
||||
tag = r.get('ADD_TAB_TAG').replace('plugin@', '');
|
||||
tag = tag.charAt(0).toUpperCase() + tag.slice(1);
|
||||
}
|
||||
return r.get('ADD_TAB_TAG') ? '<span style="font-size:9px; color:green">'+tag+':</span> '+ v : v;
|
||||
}});
|
||||
if (PRO_UID === false) {
|
||||
cmodelColumns.push({header: _('ID_PROCESS'), dataIndex: 'PRO_TITLE', width: 300, align:'left'});
|
||||
}
|
||||
|
||||
cmodelColumns.push({header: _('ID_TYPE'), dataIndex: 'ADD_TAB_TYPE', width: 400, hidden:true, align:'left'});
|
||||
cmodelColumns.push({header: _('ID_TYPE'), dataIndex: 'ADD_TAB_TYPE', width: 150, hidden:false, align:'left'});
|
||||
|
||||
cmodel = new Ext.grid.ColumnModel({
|
||||
defaults: {
|
||||
@@ -201,7 +221,8 @@ Ext.onReady(function(){
|
||||
{name : 'ADD_TAB_DESCRIPTION'},
|
||||
{name : 'PRO_TITLE'},
|
||||
{name : 'TYPE'},
|
||||
{name : 'ADD_TAB_TYPE'}
|
||||
{name : 'ADD_TAB_TYPE'},
|
||||
{name : 'ADD_TAB_TAG'}
|
||||
]
|
||||
})
|
||||
});
|
||||
@@ -337,6 +358,13 @@ Ext.onReady(function(){
|
||||
function (grid, rowIndex, evt) {
|
||||
var sm = grid.getSelectionModel();
|
||||
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
||||
|
||||
var rowsSelected = Ext.getCmp('infoGrid').getSelectionModel().getSelections();
|
||||
tag = rowsSelected[0].get('ADD_TAB_TAG');
|
||||
text = tag? 'Convert to native Report Table': 'Convert to Simple Report';
|
||||
if (externalOption) {
|
||||
externalOption.setText(text);
|
||||
}
|
||||
},
|
||||
this
|
||||
);
|
||||
@@ -489,4 +517,24 @@ GridByDefault = function(){
|
||||
GridByDefault1 = function(){
|
||||
Ext.getCmp('PROCESS').setValue('');
|
||||
infoGrid.store.load();
|
||||
};
|
||||
};
|
||||
|
||||
function updateTag(value)
|
||||
{
|
||||
var rowsSelected = Ext.getCmp('infoGrid').getSelectionModel().getSelections();
|
||||
|
||||
Ext.Ajax.request({
|
||||
url: 'reportTables_Ajax',
|
||||
params: {
|
||||
action: 'updateTag',
|
||||
ADD_TAB_UID: rowsSelected[0].get('ADD_TAB_UID'),
|
||||
value: rowsSelected[0].get('ADD_TAB_TAG') ? '': value
|
||||
},
|
||||
success: function(resp){
|
||||
Ext.getCmp('infoGrid').store.reload();
|
||||
},
|
||||
failure: function(obj, resp){
|
||||
Ext.Msg.alert( _('ID_ERROR'), resp.result.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
BIN
workflow/public_html/images/ext/default/row-editor-bg.gif
Normal file
BIN
workflow/public_html/images/ext/default/row-editor-bg.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 819 B |
BIN
workflow/public_html/images/ext/default/row-editor-btns.gif
Normal file
BIN
workflow/public_html/images/ext/default/row-editor-btns.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user