This commit is contained in:
Julio Cesar Laura Avendaño
2019-01-15 10:46:23 -04:00
parent 28105f8766
commit 67cea3e78b
2 changed files with 5 additions and 0 deletions

View File

@@ -309,6 +309,7 @@ function pauseCase(date){
buttons: [{ buttons: [{
text: _('ID_OK'), text: _('ID_OK'),
handler: function(){ handler: function(){
this.setDisabled(true);
if (Ext.getCmp('noteReason').getValue() != '') { if (Ext.getCmp('noteReason').getValue() != '') {
var noteReasonTxt = _('ID_CASE_PAUSE_LABEL_NOTE') + ' ' + Ext.getCmp('noteReason').getValue(); var noteReasonTxt = _('ID_CASE_PAUSE_LABEL_NOTE') + ' ' + Ext.getCmp('noteReason').getValue();
} else { } else {

View File

@@ -1358,6 +1358,7 @@ Ext.onReady(function(){
Actions.pauseCase = function() Actions.pauseCase = function()
{ {
Ext.getCmp('submitPauseCase').setDisabled(true);
Ext.Ajax.request({ Ext.Ajax.request({
url : 'ajaxListener' , url : 'ajaxListener' ,
params : {action : 'verifySession'}, params : {action : 'verifySession'},
@@ -1389,6 +1390,7 @@ Ext.onReady(function(){
var paramsNote = '&NOTE_REASON=' + noteReasonTxt + '&NOTIFY_PAUSE=' + notifyReasonVal; var paramsNote = '&NOTE_REASON=' + noteReasonTxt + '&NOTIFY_PAUSE=' + notifyReasonVal;
var unpauseDate = Ext.getCmp('unpauseDate').getValue(); var unpauseDate = Ext.getCmp('unpauseDate').getValue();
if( unpauseDate == '') { if( unpauseDate == '') {
Ext.getCmp('submitPauseCase').setDisabled(false);
return; return;
} else { } else {
unpauseDate = unpauseDate.format('Y-m-d'); unpauseDate = unpauseDate.format('Y-m-d');
@@ -1419,6 +1421,7 @@ Ext.onReady(function(){
}, },
failure: function ( res, req) { failure: function ( res, req) {
PMExt.error(_('ID_ERROR'), req.result.msg); PMExt.error(_('ID_ERROR'), req.result.msg);
Ext.getCmp('submitPauseCase').setDisabled(false);
} }
}); });
} }
@@ -1427,6 +1430,7 @@ Ext.onReady(function(){
if (typeof(result.responseText) != 'undefined') { if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText); Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
} }
Ext.getCmp('submitPauseCase').setDisabled(false);
} }
}); });
} }