diff --git a/workflow/engine/classes/model/Process.php b/workflow/engine/classes/model/Process.php index fa953c44d..d843f2544 100755 --- a/workflow/engine/classes/model/Process.php +++ b/workflow/engine/classes/model/Process.php @@ -340,6 +340,8 @@ class Process extends BaseProcess public function getAll () { + $bpmn = new \ProcessMaker\Project\Bpmn(); + $oCriteria = new Criteria( 'workflow' ); $oCriteria->addSelectColumn( ProcessPeer::PRO_UID ); @@ -359,7 +361,9 @@ class Process extends BaseProcess $processes = Array (); $uids = array (); 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']; } //process details will have the info about the processes diff --git a/workflow/engine/templates/pmTables/editReport.js b/workflow/engine/templates/pmTables/editReport.js index 0a4e678ab..54f3df41e 100755 --- a/workflow/engine/templates/pmTables/editReport.js +++ b/workflow/engine/templates/pmTables/editReport.js @@ -427,10 +427,10 @@ Ext.onReady(function(){ } /*----------------------------------********---------------------------------*/ ]; - + function validateFieldSizeAutoincrement(valueType, defaultValue) { if (Ext.getCmp("sizeEdit").getEl()) { - + if (valueType === 'INTEGER' || valueType === 'BIGINT' || valueType === 'SMALLINT' || valueType === 'TINYINT') { Ext.getCmp("sizeEdit").enable(); Ext.getCmp("sizeEdit").setMaxValue(99); @@ -438,13 +438,13 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) { if (defaultValue) { Ext.getCmp("sizeEdit").setValue(''); } - + Ext.getCmp("field_incre").enable(); if (defaultValue) { Ext.getCmp("field_incre").setValue(false); } } - + if (valueType === 'CHAR' || valueType === 'VARCHAR' || valueType === 'LONGVARCHAR') { Ext.getCmp("sizeEdit").enable(); Ext.getCmp("sizeEdit").setMaxValue(((valueType === 'CHAR') ? 255 : 999)); @@ -452,15 +452,15 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) { if (defaultValue) { Ext.getCmp("sizeEdit").setValue(''); } - + Ext.getCmp("field_incre").disable(); Ext.getCmp("field_incre").setValue(false); } - + if (valueType === 'BOOLEAN' || valueType === 'DATE' || valueType === 'DATETIME' || valueType === 'TIME' || valueType === 'DECIMAL' || valueType === 'DOUBLE' || valueType === 'FLOAT' || valueType === 'REAL') { Ext.getCmp("sizeEdit").disable(); Ext.getCmp("sizeEdit").setValue(''); - + Ext.getCmp("field_incre").disable(); Ext.getCmp("field_incre").setValue(false); } @@ -721,9 +721,14 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) { } }); - var types = new Ext.data.SimpleStore({ - fields: ['REP_TAB_TYPE', 'type'], - data : [['NORMAL',_("ID_GLOBAL")],['GRID',_("ID_GRID")]] + var arrayBpmnTypeData = [["NORMAL", _("ID_GLOBAL")]]; + var arrayClassicTypeData = [["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({ @@ -876,7 +881,7 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) { } } }); - + comboReport.setReadOnly(isBpmn); processStore = new Ext.data.Store( { @@ -889,7 +894,7 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) { action: 'getProcessList' }, 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: { load: function() { @@ -952,6 +957,18 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) { listeners:{ 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()}}); if (Ext.getCmp('REP_TAB_TYPE').getValue() == 'GRID') { gridsListStore.reload({params:{PRO_UID : Ext.getCmp('PROCESS').getValue()}});