HOR-133-3018 "Validar reports tables para grids..." SOLVED

This commit is contained in:
Luis Fernando Saisa Lopez
2016-01-29 18:24:50 -04:00
parent bf0110ab58
commit 8af71f089a
2 changed files with 34 additions and 13 deletions

View File

@@ -340,6 +340,8 @@ class Process extends BaseProcess
public function getAll () public function getAll ()
{ {
$bpmn = new \ProcessMaker\Project\Bpmn();
$oCriteria = new Criteria( 'workflow' ); $oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( ProcessPeer::PRO_UID ); $oCriteria->addSelectColumn( ProcessPeer::PRO_UID );
@@ -359,7 +361,9 @@ class Process extends BaseProcess
$processes = Array (); $processes = Array ();
$uids = array (); $uids = array ();
while ($oDataset->next()) { while ($oDataset->next()) {
$processes[] = $oDataset->getRow(); $row = $oDataset->getRow();
$row['PRO_PROCESS_TYPE'] = ($bpmn->exists($row['PRO_UID']))? 'BPMN' : 'CLASSIC';
$processes[] = $row;
$uids[] = $processes[sizeof( $processes ) - 1]['PRO_UID']; $uids[] = $processes[sizeof( $processes ) - 1]['PRO_UID'];
} }
//process details will have the info about the processes //process details will have the info about the processes

View File

@@ -427,10 +427,10 @@ Ext.onReady(function(){
} }
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
]; ];
function validateFieldSizeAutoincrement(valueType, defaultValue) { function validateFieldSizeAutoincrement(valueType, defaultValue) {
if (Ext.getCmp("sizeEdit").getEl()) { if (Ext.getCmp("sizeEdit").getEl()) {
if (valueType === 'INTEGER' || valueType === 'BIGINT' || valueType === 'SMALLINT' || valueType === 'TINYINT') { if (valueType === 'INTEGER' || valueType === 'BIGINT' || valueType === 'SMALLINT' || valueType === 'TINYINT') {
Ext.getCmp("sizeEdit").enable(); Ext.getCmp("sizeEdit").enable();
Ext.getCmp("sizeEdit").setMaxValue(99); Ext.getCmp("sizeEdit").setMaxValue(99);
@@ -438,13 +438,13 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
if (defaultValue) { if (defaultValue) {
Ext.getCmp("sizeEdit").setValue(''); Ext.getCmp("sizeEdit").setValue('');
} }
Ext.getCmp("field_incre").enable(); Ext.getCmp("field_incre").enable();
if (defaultValue) { if (defaultValue) {
Ext.getCmp("field_incre").setValue(false); Ext.getCmp("field_incre").setValue(false);
} }
} }
if (valueType === 'CHAR' || valueType === 'VARCHAR' || valueType === 'LONGVARCHAR') { if (valueType === 'CHAR' || valueType === 'VARCHAR' || valueType === 'LONGVARCHAR') {
Ext.getCmp("sizeEdit").enable(); Ext.getCmp("sizeEdit").enable();
Ext.getCmp("sizeEdit").setMaxValue(((valueType === 'CHAR') ? 255 : 999)); Ext.getCmp("sizeEdit").setMaxValue(((valueType === 'CHAR') ? 255 : 999));
@@ -452,15 +452,15 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
if (defaultValue) { if (defaultValue) {
Ext.getCmp("sizeEdit").setValue(''); Ext.getCmp("sizeEdit").setValue('');
} }
Ext.getCmp("field_incre").disable(); Ext.getCmp("field_incre").disable();
Ext.getCmp("field_incre").setValue(false); Ext.getCmp("field_incre").setValue(false);
} }
if (valueType === 'BOOLEAN' || valueType === 'DATE' || valueType === 'DATETIME' || valueType === 'TIME' || valueType === 'DECIMAL' || valueType === 'DOUBLE' || valueType === 'FLOAT' || valueType === 'REAL') { if (valueType === 'BOOLEAN' || valueType === 'DATE' || valueType === 'DATETIME' || valueType === 'TIME' || valueType === 'DECIMAL' || valueType === 'DOUBLE' || valueType === 'FLOAT' || valueType === 'REAL') {
Ext.getCmp("sizeEdit").disable(); Ext.getCmp("sizeEdit").disable();
Ext.getCmp("sizeEdit").setValue(''); Ext.getCmp("sizeEdit").setValue('');
Ext.getCmp("field_incre").disable(); Ext.getCmp("field_incre").disable();
Ext.getCmp("field_incre").setValue(false); Ext.getCmp("field_incre").setValue(false);
} }
@@ -721,9 +721,14 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
} }
}); });
var types = new Ext.data.SimpleStore({ var arrayBpmnTypeData = [["NORMAL", _("ID_GLOBAL")]];
fields: ['REP_TAB_TYPE', 'type'], var arrayClassicTypeData = [["NORMAL", _("ID_GLOBAL")], ["GRID", _("ID_GRID")]];
data : [['NORMAL',_("ID_GLOBAL")],['GRID',_("ID_GRID")]]
var types = new Ext.data.ArrayStore({
storeId: "types",
autoDestroy: true,
fields: ["REP_TAB_TYPE", "type"]
}); });
comboReport = new Ext.form.ComboBox({ comboReport = new Ext.form.ComboBox({
@@ -876,7 +881,7 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
} }
} }
}); });
comboReport.setReadOnly(isBpmn); comboReport.setReadOnly(isBpmn);
processStore = new Ext.data.Store( { processStore = new Ext.data.Store( {
@@ -889,7 +894,7 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
action: 'getProcessList' action: 'getProcessList'
}, },
reader : new Ext.data.JsonReader( { reader : new Ext.data.JsonReader( {
fields : [{name : 'PRO_UID'}, {name : 'PRO_TITLE'},{name : 'PRO_DESCRIPTION'}] fields : [{name : 'PRO_UID'}, {name : 'PRO_TITLE'},{name : 'PRO_DESCRIPTION'}, {name: "PRO_PROCESS_TYPE"}]
}), }),
listeners: { listeners: {
load: function() { load: function() {
@@ -952,6 +957,18 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
listeners:{ listeners:{
select: function(){ select: function(){
var dataStore = Ext.getCmp('PROCESS').store.getRange();
var i = Ext.getCmp('PROCESS').store.find("PRO_UID", Ext.getCmp('PROCESS').getValue());
types.loadData(
(dataStore[i].data.PRO_PROCESS_TYPE == "BPMN")? arrayBpmnTypeData : arrayClassicTypeData, false
);
var dataStoreAux = types.getRange(0);
comboReport.setValue(dataStoreAux[0].data.REP_TAB_TYPE);
comboGridsList.setVisible(false);
comboDbConnections.getStore().reload({params:{PRO_UID : Ext.getCmp('PROCESS').getValue()}}); comboDbConnections.getStore().reload({params:{PRO_UID : Ext.getCmp('PROCESS').getValue()}});
if (Ext.getCmp('REP_TAB_TYPE').getValue() == 'GRID') { if (Ext.getCmp('REP_TAB_TYPE').getValue() == 'GRID') {
gridsListStore.reload({params:{PRO_UID : Ext.getCmp('PROCESS').getValue()}}); gridsListStore.reload({params:{PRO_UID : Ext.getCmp('PROCESS').getValue()}});