MT-45: Import: ProcessDefinition has only Replace all

This commit is contained in:
mcuiza
2016-03-29 17:34:27 -04:00
parent 48e4948492
commit 10350a68c2

View File

@@ -1039,8 +1039,8 @@ function exportImportProcessObjects(typeAction)
storeActionField = new Ext.data.ArrayStore({ storeActionField = new Ext.data.ArrayStore({
fields: ['value', 'text'], fields: ['value', 'text'],
data: [ data: [
[1, _('ID_UPDATE')], [1, _('ID_ADD_TO_EXISTING')],
[2, _('ID_OVERWRITE')] [2, _('ID_REPLACE_ALL')]
] ]
}); });
checkBoxSelMod = new Ext.grid.CheckboxSelectionModel(); checkBoxSelMod = new Ext.grid.CheckboxSelectionModel();
@@ -1083,7 +1083,8 @@ function exportImportProcessObjects(typeAction)
store: storeActionField, store: storeActionField,
triggerAction: 'all', triggerAction: 'all',
valueField: 'value', valueField: 'value',
lazyRender: true lazyRender: true,
disabled: false
}), }),
renderer: function(value) { renderer: function(value) {
var recordIndex = storeActionField.find('value', value); var recordIndex = storeActionField.find('value', value);
@@ -1098,7 +1099,7 @@ function exportImportProcessObjects(typeAction)
}), }),
store: storeGrid, store: storeGrid,
listeners: { listeners: {
render: function (grid) { render: function(grid) {
colModel = grid.getColumnModel(); colModel = grid.getColumnModel();
if(defaultTypeAction === 'export') { if(defaultTypeAction === 'export') {
colModel.setHidden(3, true); colModel.setHidden(3, true);
@@ -1110,9 +1111,18 @@ function exportImportProcessObjects(typeAction)
if(!inArray(row.get('OBJECT_ID'),importProcessGlobal.objectGranularImport)) { if(!inArray(row.get('OBJECT_ID'),importProcessGlobal.objectGranularImport)) {
store.remove(row); store.remove(row);
} }
if(row.get('OBJECT_ID') === 1) { /*process definition*/
row.set("OBJECT_ACTION","2");
}
}); });
}); });
} }
},
beforeedit: function(editor, e, eOpts) {
var row = editor.record;
if(row.get('OBJECT_ID') === 1) { /*process definition*/
return false;
}
} }
} }
}); });
@@ -1403,10 +1413,11 @@ importProcessExistGroup = function()
} }
}, },
failure: function(o, resp) { failure: function(o, resp) {
var msg = resp.result.msg ? resp.result.msg : resp.response.responseText;
w.close(); w.close();
Ext.MessageBox.show({ Ext.MessageBox.show({
title : _('ID_ERROR'), title : _('ID_ERROR'),
msg : resp.result.msg, msg : msg,
buttons : Ext.MessageBox.OK, buttons : Ext.MessageBox.OK,
animEl : 'mb9', animEl : 'mb9',
fn : function(){}, fn : function(){},
@@ -1602,10 +1613,11 @@ importProcessExistProcess = function()
} }
}, },
failure : function(o, resp) { failure : function(o, resp) {
var msg = resp.result.msg ? resp.result.msg : resp.response.responseText;
w.close(); w.close();
Ext.MessageBox.show({ Ext.MessageBox.show({
title : _('ID_ERROR'), title : _('ID_ERROR'),
msg : resp.result.msg, msg : msg,
buttons : Ext.MessageBox.OK, buttons : Ext.MessageBox.OK,
animEl : 'mb9', animEl : 'mb9',
fn : function(){}, fn : function(){},
@@ -1893,11 +1905,11 @@ importProcess = function()
}, },
failure : function(o, resp) failure : function(o, resp)
{ {
var msg = resp.catchMessage ? resp.catchMessage : resp.response.responseText;
w.close(); w.close();
Ext.MessageBox.show({ Ext.MessageBox.show({
title : "", title : "",
msg : resp.catchMessage, msg : msg,
buttons: Ext.MessageBox.OK, buttons: Ext.MessageBox.OK,
animEl : "mb9", animEl : "mb9",
fn : function(){}, fn : function(){},
@@ -2015,10 +2027,11 @@ importProcessBpmnSubmit = function () {
} }
}, },
failure: function (o, resp) { failure: function (o, resp) {
var msg = resp.catchMessage ? resp.catchMessage : resp.response.responseText;
Ext.getCmp('importProcessWindow').close(); Ext.getCmp('importProcessWindow').close();
Ext.MessageBox.show({ Ext.MessageBox.show({
title: '', title: '',
msg: resp.catchMessage, msg: msg,
buttons: Ext.MessageBox.OK, buttons: Ext.MessageBox.OK,
animEl: 'mb9', animEl: 'mb9',
fn: function () { fn: function () {