import
This commit is contained in:
@@ -34,7 +34,12 @@ class ExportObjects
|
|||||||
$aObjectsEnable = explode('|', $objectsEnable);
|
$aObjectsEnable = explode('|', $objectsEnable);
|
||||||
foreach ($this->objectsList as $key => $val) {
|
foreach ($this->objectsList as $key => $val) {
|
||||||
$key++;
|
$key++;
|
||||||
$grid[] = array('OBJECT_ID' => $key, 'OBJECT_NAME' => $val, 'OBJECT_ENABLE' => in_array(strtoupper(str_replace(' ', '',$val)), $aObjectsEnable) );
|
$grid[] = array(
|
||||||
|
'OBJECT_ID' => $key,
|
||||||
|
'OBJECT_NAME' => $val,
|
||||||
|
'OBJECT_ACTION' => 1,
|
||||||
|
'OBJECT_ENABLE' => in_array(strtoupper(str_replace(' ', '',$val)), $aObjectsEnable)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = new \stdclass();
|
$r = new \stdclass();
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ importProcessGlobal.groupBeforeAccion="";
|
|||||||
importProcessGlobal.sNewProUid = "";
|
importProcessGlobal.sNewProUid = "";
|
||||||
importProcessGlobal.importOption = "";
|
importProcessGlobal.importOption = "";
|
||||||
importProcessGlobal.processFileType = "";
|
importProcessGlobal.processFileType = "";
|
||||||
|
importProcessGlobal.isGranularImport = false;
|
||||||
|
importProcessGlobal.objectGranularImport;
|
||||||
|
|
||||||
new Ext.KeyMap(document, {
|
new Ext.KeyMap(document, {
|
||||||
key: Ext.EventObject.F5,
|
key: Ext.EventObject.F5,
|
||||||
@@ -988,7 +990,8 @@ function exportImportProcessObjects(typeAction)
|
|||||||
fields : [
|
fields : [
|
||||||
{name : 'OBJECT_ID'},
|
{name : 'OBJECT_ID'},
|
||||||
{name : 'OBJECT_NAME'},
|
{name : 'OBJECT_NAME'},
|
||||||
{name : 'OBJECT_ACTION'}
|
{name : 'OBJECT_ACTION'},
|
||||||
|
{name : 'OBJECT_ENABLE'}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -1016,6 +1019,7 @@ function exportImportProcessObjects(typeAction)
|
|||||||
selModel : checkBoxSelMod,
|
selModel : checkBoxSelMod,
|
||||||
showHeaderCheckbox: true,
|
showHeaderCheckbox: true,
|
||||||
columnLines: true,
|
columnLines: true,
|
||||||
|
//disableSelection : true,
|
||||||
viewConfig: {
|
viewConfig: {
|
||||||
forceFit:true,
|
forceFit:true,
|
||||||
cls:"x-grid-empty",
|
cls:"x-grid-empty",
|
||||||
@@ -1048,7 +1052,8 @@ function exportImportProcessObjects(typeAction)
|
|||||||
}
|
}
|
||||||
return storeActionField.getAt(recordIndex).get('text');
|
return storeActionField.getAt(recordIndex).get('text');
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{header: 'Name', dataIndex: 'OBJECT_ENABLE', hidden: true},
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
store: storeGrid,
|
store: storeGrid,
|
||||||
@@ -1060,10 +1065,17 @@ function exportImportProcessObjects(typeAction)
|
|||||||
} else { /*import*/
|
} else { /*import*/
|
||||||
colModel.setHidden(3, false);
|
colModel.setHidden(3, false);
|
||||||
grid.store.on('load', function(store, records, options){
|
grid.store.on('load', function(store, records, options){
|
||||||
for(i=0; i<grid.getStore().getTotalCount(); i++){
|
var gridStore = grid.getStore();
|
||||||
grid.getSelectionModel().selectRow(i, true);
|
gridStore.each(function(row, j){
|
||||||
|
if(inArray(row.get('OBJECT_ID'),importProcessGlobal.objectGranularImport)) {
|
||||||
|
grid.getSelectionModel().selectRow(j, true);
|
||||||
|
} else {
|
||||||
|
/*disable row*/
|
||||||
|
//grid.getSelectionModel().deselectRow(j, true);
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1086,9 +1098,9 @@ function exportImportProcessObjects(typeAction)
|
|||||||
text : buttonLabel,
|
text : buttonLabel,
|
||||||
handler : function() {
|
handler : function() {
|
||||||
var selectedObjects = gridProcessObjects.getSelectionModel().getSelections();
|
var selectedObjects = gridProcessObjects.getSelectionModel().getSelections();
|
||||||
|
processObjectsArray = [];
|
||||||
if(defaultTypeAction === 'export') {
|
if(defaultTypeAction === 'export') {
|
||||||
if(selectedObjects.length > 0) {
|
if(selectedObjects.length > 0) {
|
||||||
processObjectsArray = [];
|
|
||||||
for (i = 0; i < selectedObjects.length; i++) {
|
for (i = 0; i < selectedObjects.length; i++) {
|
||||||
processObjectsArray.push(selectedObjects[i].get('OBJECT_ID'));
|
processObjectsArray.push(selectedObjects[i].get('OBJECT_ID'));
|
||||||
}
|
}
|
||||||
@@ -1096,7 +1108,20 @@ function exportImportProcessObjects(typeAction)
|
|||||||
exportProcess();
|
exportProcess();
|
||||||
}
|
}
|
||||||
} else { /*import*/
|
} else { /*import*/
|
||||||
|
if(selectedObjects.length > 0) {
|
||||||
|
for (i = 0; i < selectedObjects.length; i++) {
|
||||||
|
processObjectsArray.push(
|
||||||
|
{
|
||||||
|
id: selectedObjects[i].get('OBJECT_ID'),
|
||||||
|
action: selectedObjects[i].get('OBJECT_ACTION') === 1 ? 'merge' : 'replace'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
processObjectsArray = JSON.stringify(processObjectsArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ext.getCmp('objectsToImport').setValue(processObjectsArray);
|
||||||
|
Ext.getCmp('buttonUpload').el.dom.click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@@ -1109,6 +1134,15 @@ function exportImportProcessObjects(typeAction)
|
|||||||
});
|
});
|
||||||
w.show();
|
w.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function inArray(needle, haystack) {
|
||||||
|
var length = haystack.length;
|
||||||
|
for(var i = 0; i < length; i++) {
|
||||||
|
if(haystack[i] == needle) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
function generateBpmn()
|
function generateBpmn()
|
||||||
{
|
{
|
||||||
var record = processesGrid.getSelectionModel().getSelections();
|
var record = processesGrid.getSelectionModel().getSelections();
|
||||||
@@ -1698,6 +1732,11 @@ importProcess = function()
|
|||||||
name: 'generateUid',
|
name: 'generateUid',
|
||||||
xtype: 'hidden',
|
xtype: 'hidden',
|
||||||
value: ''
|
value: ''
|
||||||
|
}, {
|
||||||
|
id: 'objectsToImport',
|
||||||
|
name: 'objectsToImport',
|
||||||
|
xtype: 'hidden',
|
||||||
|
value: ''
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
buttons : [{
|
buttons : [{
|
||||||
@@ -1723,7 +1762,11 @@ importProcess = function()
|
|||||||
success: function(o, resp)
|
success: function(o, resp)
|
||||||
{
|
{
|
||||||
var resp_ = Ext.util.JSON.decode(resp.response.responseText);
|
var resp_ = Ext.util.JSON.decode(resp.response.responseText);
|
||||||
|
if(resp_.isGranularImport) {
|
||||||
|
importProcessGlobal.isGranularImport = resp_.isGranularImport;
|
||||||
|
importProcessGlobal.objectGranularImport = resp_.objectGranularImport;
|
||||||
|
exportImportProcessObjects('import');
|
||||||
|
} else {
|
||||||
if (resp_.status) {
|
if (resp_.status) {
|
||||||
if (resp_.status == "DISABLED-CODE") {
|
if (resp_.status == "DISABLED-CODE") {
|
||||||
Ext.MessageBox.show({
|
Ext.MessageBox.show({
|
||||||
@@ -1750,7 +1793,6 @@ importProcess = function()
|
|||||||
}
|
}
|
||||||
if (resp_.ExistGroupsInDatabase == "0") {
|
if (resp_.ExistGroupsInDatabase == "0") {
|
||||||
var sNewProUid = resp_.sNewProUid;
|
var sNewProUid = resp_.sNewProUid;
|
||||||
|
|
||||||
if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") {
|
if (typeof(resp_.project_type) != "undefined" && resp_.project_type == "bpmn") {
|
||||||
if (typeof(resp_.project_type_aux) != "undefined" && resp_.project_type_aux == "NORMAL") {
|
if (typeof(resp_.project_type_aux) != "undefined" && resp_.project_type_aux == "NORMAL") {
|
||||||
importProcessCallbackFile = false;
|
importProcessCallbackFile = false;
|
||||||
@@ -1786,6 +1828,7 @@ importProcess = function()
|
|||||||
icon : Ext.MessageBox.ERROR
|
icon : Ext.MessageBox.ERROR
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
failure : function(o, resp)
|
failure : function(o, resp)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user