No se puede importar Report Tables en los procesos

Se aumentaron validaciones varias, segun se especifica en el comentario en jira
This commit is contained in:
marcelo.cuiza
2015-05-27 11:37:32 -04:00
parent b4420c2614
commit 4ef02142ad
2 changed files with 105 additions and 19 deletions

View File

@@ -617,7 +617,7 @@ ImportPMTable = function(){
PMExt.warning(_('ID_WARNING'), result.message.replace(/\n/g,' <br>'));
}
else {
if(result.fromAdmin) { /*from admin tab*/
if(result.fromAdmin) { /* from admin tab */
if(result.validationType == 1) {
Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,' <br>'), function(btn, text){
if (btn == 'yes'){
@@ -632,6 +632,7 @@ ImportPMTable = function(){
var result = Ext.util.JSON.decode(resp.responseText);
if (result.success) {
PMExt.notify(_('ID_IMPORT_RESULT'), result.message);
Ext.getCmp('infoGrid').getStore().reload();
} else {
if(result.validationType == 2) {
PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,' <br>'));
@@ -645,14 +646,27 @@ ImportPMTable = function(){
}
}
});
Ext.getCmp('infoGrid').getStore().reload();
} else {
Ext.Ajax.request({
url: 'pmTablesProxy/import',
params: {
'form[FROM_CONFIRM]':'clear',
'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin')
},
success: function(resp) {
var result = Ext.util.JSON.decode(resp.responseText);
PMExt.notify(_('ID_IMPORT_RESULT'), result.message);
Ext.getCmp('infoGrid').getStore().reload();
}
});
}
Ext.getCmp('infoGrid').getStore().reload();
});
return false;
} else {
PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,' <br>'));
}
} else { /*from designer tab*/
} else { /* from designer tab */
if(result.validationType == 1) {
Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,' <br>'), function(btn, text){
if (btn == 'yes'){
@@ -667,6 +681,7 @@ ImportPMTable = function(){
var result = Ext.util.JSON.decode(resp.responseText);
if (result.success) {
PMExt.notify(_('ID_IMPORT_RESULT'), result.message);
Ext.getCmp('infoGrid').getStore().reload();
} else {
if(result.validationType == 2) {
Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,' <br>'), function(btn, text){
@@ -682,6 +697,7 @@ ImportPMTable = function(){
var result = Ext.util.JSON.decode(resp.responseText);
if (result.success) {
PMExt.notify(_('ID_IMPORT_RESULT'), result.message);
Ext.getCmp('infoGrid').getStore().reload();
} else {
PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,' <br>'));
}
@@ -708,7 +724,62 @@ ImportPMTable = function(){
}
});
Ext.getCmp('infoGrid').getStore().reload();
} else {
Ext.Ajax.request({
url: 'pmTablesProxy/import',
params: {
'form[FROM_CONFIRM]':'2',
'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin'),
'form[PRO_UID_HELP]':PRO_UID
},
success: function(resp) {
var result = Ext.util.JSON.decode(resp.responseText);
if(result.validationType == 2) {
/*add code if related process*/
Ext.MessageBox.confirm('Confirmation', result.message.replace(/\n/g,' <br>'), function(btn, text){
if (btn == 'yes'){
Ext.Ajax.request({
url: 'pmTablesProxy/import',
params: {
'form[FROM_CONFIRM]':'overWrite',
'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin'),
'form[PRO_UID_HELP]':PRO_UID
},
success: function(resp){
var result = Ext.util.JSON.decode(resp.responseText);
if (result.success) {
PMExt.notify(_('ID_IMPORT_RESULT'), result.message);
Ext.getCmp('infoGrid').getStore().reload();
} else {
PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,' <br>'));
}
},
failure: function(obj, resp){
PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,' <br>'));
}
});
Ext.getCmp('infoGrid').getStore().reload();
}
});
return false;
} else {
var result = Ext.util.JSON.decode(resp.responseText);
if (result.success) {
PMExt.notify(_('ID_IMPORT_RESULT'), result.message);
Ext.getCmp('infoGrid').getStore().reload();
} else {
PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,' <br>'));
}
}
//PMExt.notify(_('ID_IMPORT_RESULT'), result.message);
},
failure: function(obj, resp){
var result = Ext.util.JSON.decode(resp.responseText);
PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,' <br>'));
}
});
}
Ext.getCmp('infoGrid').getStore().reload();
});
return false;
}
@@ -720,12 +791,14 @@ ImportPMTable = function(){
params: {
'form[FROM_CONFIRM]':'overWrite',
'form[TYPE_TABLE]':(PRO_UID? 'designer' : 'admin'),
'form[OVERWRITE]':true
'form[OVERWRITE]':true,
'form[PRO_UID_HELP]':PRO_UID
},
success: function(resp){
var result = Ext.util.JSON.decode(resp.responseText);
if (result.success) {
PMExt.notify(_('ID_IMPORT_RESULT'), result.message);
Ext.getCmp('infoGrid').getStore().reload();
} else {
PMExt.error(_('ID_ERROR'), result.message.replace(/\n/g,' <br>'));
}