PM-1573 "Boton ID_IMPORT_BPMN dentro del designer..."

> Code Issue:
  Boton ID_IMPORT_BPMN dentro del designer, solo es mostrado en Firefox
> Solution:
  En Home existe dos botones "Import" e "Import BPMN", se quita el boton "Import BPMN" quedanto solo un boton el cual
  permite realizar la importacion de los procesos de tipo pmx y bpmn tal como se hacia anteriormente.
This commit is contained in:
Luis Fernando Saisa Lopez
2015-02-23 17:33:04 -04:00
parent d06f55b1dd
commit 8cfdfb86eb

View File

@@ -308,14 +308,6 @@ Ext.onReady(function(){
importProcessGlobal.processFileType = "pm";
importProcess();
}
},{
text: _('ID_IMPORT_BPMN'),
iconCls: 'silk-add',
icon: '/images/import.gif',
handler : function(){
importProcessGlobal.processFileType = "bpmn";
importProcessBpmn();
}
},{
xtype: 'tbfill'
},{
@@ -1217,6 +1209,10 @@ importProcess = function()
name : 'processFileType',
xtype : 'hidden',
value : processFileType
},{
name: "createMode",
xtype: "hidden",
value: "create"
}, {
xtype : 'fileuploadfield',
id : 'form-file',
@@ -1232,14 +1228,23 @@ importProcess = function()
buttons : [{
text : _('ID_UPLOAD'),
handler : function(){
var uploader = Ext.getCmp('uploader');
var arrayMatch = [];
if ((arrayMatch = eval("/^.+\.(pm|pmx|bpmn)$/i").exec(Ext.getCmp("form-file").getValue()))) {
var fileExtension = arrayMatch[1];
switch (fileExtension) {
case "pm":
case "pmx":
var uploader = Ext.getCmp("uploader");
if (uploader.getForm().isValid()) {
uploader.getForm().submit({
url : 'processes_Import_Ajax',
waitMsg : _('ID_UPLOADING_PROCESS_FILE'),
url : "processes_Import_Ajax",
waitMsg : _("ID_UPLOADING_PROCESS_FILE"),
waitTitle: " ",
success : function(o, resp) {
success: function(o, resp)
{
var resp_ = Ext.util.JSON.decode(resp.response.responseText);
if (resp_.status) {
@@ -1265,12 +1270,13 @@ importProcess = function()
if (typeof(winDesigner) == "undefined" || winDesigner.closed){
winDesigner = window.open(
"../designer?prj_uid=" + sNewProUid,
'winDesigner'
"winDesigner"
);
w.close();
processesGrid.store.reload();
} else {
PMExt.error( _('ID_FAILED'), _('PROCESS_ALREADY_OPENED'));
PMExt.error( _("ID_FAILED"), _("PROCESS_ALREADY_OPENED"));
}
} else {
window.location.href = "../designer?prj_uid=" + sNewProUid;
@@ -1278,46 +1284,53 @@ importProcess = function()
} else {
window.location.href = "processes_Map?PRO_UID=" + sNewProUid;
}
}
else {
} else {
importProcessGlobal.sNewProUid = resp_.sNewProUid;
importProcessGlobal.proFileName = resp_.proFileName;
importProcessGlobal.groupBeforeAccion = resp_.groupBeforeAccion;
importProcessExistGroup();
}
}
else if (resp_.ExistProcessInDatabase == "1") {
} else if (resp_.ExistProcessInDatabase == "1") {
importProcessGlobal.proFileName = resp_.proFileName;
importProcessExistProcess();
}
}
else {
} else {
w.close();
Ext.MessageBox.show({
title : '',
title : "",
msg : resp_.catchMessage,
buttons: Ext.MessageBox.OK,
animEl : 'mb9',
animEl : "mb9",
fn : function(){},
icon : Ext.MessageBox.ERROR
});
}
},
failure : function(o, resp) {
failure : function(o, resp)
{
w.close();
Ext.MessageBox.show({
title : '',
title : "",
msg : resp.catchMessage,
buttons: Ext.MessageBox.OK,
animEl : 'mb9',
animEl : "mb9",
fn : function(){},
icon : Ext.MessageBox.ERROR
});
}
});
}
break;
case "bpmn":
importProcessGlobal.processFileType = "bpmn";
importProcessBpmnSubmit();
break;
}
} else {
Ext.MessageBox.alert(_("ID_ERROR"), _("ID_FILE_UPLOAD_INCORRECT_EXTENSION"));
}
}
},{
text: _('ID_CANCEL'),
@@ -1331,78 +1344,6 @@ importProcess = function()
w.show();
}
importProcessBpmn = function ()
{
var w = new Ext.Window({
id: 'import_process_bpmn',
title: _('ID_IMPORT_PROCESS'),
width: 420,
height: 130,
modal: true,
autoScroll: false,
maximizable: false,
resizable: false,
items: [
new Ext.FormPanel({
id: 'uploader',
fileUpload: true,
width: 400,
height: 90,
frame: true,
title: _('ID_IMPORT_PROCESS'),
header: false,
autoHeight: false,
bodyStyle: 'padding: 10px 10px 0 10px;',
labelWidth: 50,
defaults: {
anchor: '90%',
allowBlank: false,
msgTarget: 'side'
},
items: [
{
name: 'ajaxAction',
xtype: 'hidden',
value: 'uploadFileNewProcess'
}, {
name: 'processFileType',
xtype: 'hidden',
value: importProcessGlobal.processFileType
},{
name: 'createMode',
xtype: 'hidden',
value: 'create'
}, {
xtype: 'fileuploadfield',
id: 'form-file',
emptyText: _('ID_SELECT_PROCESS_FILE'),
fieldLabel: _('ID_LAN_FILE'),
name: 'PROCESS_FILENAME',
buttonText: '',
buttonCfg: {
iconCls: 'upload-icon'
}
}
],
buttons: [
{
text: _('ID_UPLOAD'),
handler: function () {
importProcessBpmnSubmit();
}
}, {
text: _('ID_CANCEL'),
handler: function () {
w.close();
}
}
]
})
]
});
w.show();
}
var windowbpmnoption = new Ext.Window({
title: _('ID_IMPORT_PROCESS'),
header: false,
@@ -1447,7 +1388,7 @@ var windowbpmnoption = new Ext.Window({
}, {
text: _('ID_CANCEL'),
handler: function () {
Ext.getCmp('import_process_bpmn').close();
Ext.getCmp('importProcessWindow').close();
windowbpmnoption.hide();
}
}
@@ -1480,7 +1421,7 @@ importProcessBpmnSubmit = function () {
windowbpmnoption.show();
return;
}
Ext.getCmp('import_process_bpmn').close();
Ext.getCmp('importProcessWindow').close();
var stringxml = document.createElement("input");
stringxml.type = "hidden";
stringxml.name = "stringBpmn";
@@ -1494,7 +1435,7 @@ importProcessBpmnSubmit = function () {
form.submit();
},
failure: function (o, resp) {
Ext.getCmp('import_process_bpmn').close();
Ext.getCmp('importProcessWindow').close();
Ext.MessageBox.show({
title: '',
msg: resp.catchMessage,