* Api: change default submit to async call and try to block user interfering with submitted popup until the response

This commit is contained in:
Hadi Nategh 2018-10-04 17:22:15 +02:00
parent 8764b72481
commit e2bfd41f24
5 changed files with 18 additions and 5 deletions

View File

@ -666,13 +666,21 @@ etemplate2.prototype.autocomplete_fixer = function ()
* Submit form via ajax
*
* @param {(et2_button|string)} button button widget or string with id
* @param {boolean} async true: do an asynchronious submit, default is synchronious
* @param {boolean|string} async true: do an asynchronious submit, string: spinner message (please wait...)
* default is asynchronoush with message
* @param {boolean} no_validation - Do not do individual widget validation, just submit their current values
* @param {et2_widget|undefined} _container container to submit, default whole template
* @return {boolean} true if submit was send, false if eg. validation stoped submit
*/
etemplate2.prototype.submit = function(button, async, no_validation, _container)
{
var api = this.widgetContainer.egw();
if (typeof async == 'undefined' || typeof async == 'string')
{
api.loading_prompt('et2_submit_spinner', true, api.lang(typeof async == 'string' ? async : 'Please wait...'));
async = true;
}
if(typeof no_validation == 'undefined')
{
no_validation = false;
@ -751,8 +759,10 @@ etemplate2.prototype.submit = function(button, async, no_validation, _container)
// unbind our session-destroy handler, as we are submitting
this.unbind_unload();
var api = this.widgetContainer.egw();
var request = api.json(this.menuaction, [this.etemplate_exec_id, values, no_validation], null, this, async);
var request = api.json(this.menuaction, [this.etemplate_exec_id, values, no_validation], function(){
api.loading_prompt('et2_submit_spinner', false);
}, this, async);
request.sendRequest();
}
else
@ -995,7 +1005,7 @@ etemplate2.prototype.print = function()
this.widgetContainer.iterateOver(function(_widget) {
// Skip widgets from a different etemplate (home)
if(_widget.getInstanceManager() != this) return;
// Skip hidden widgets
if(jQuery(_widget.getDOMNode()).filter(':visible').length === 0) return;

View File

@ -504,6 +504,7 @@ class mail_compose
{
try
{
$GLOBALS['egw']->session->commit_session();
$success = $this->send($_content);
if ($success==false)
{

View File

@ -5270,7 +5270,7 @@ app.classes.mail = AppJS.extend(
});
return false;
}
this.et2._inst.submit();
this.et2._inst.submit(null, 'Please wait while sending your mail');
},
/**

View File

@ -386,6 +386,7 @@ please enter password mail de Bitte geben Sie ein Passwort ein
please select a address mail de Bitte wählen Sie eine Adresse
please select the number of days to wait between responses mail de Bitte wählen wie viele Tage zwischen den Antworten gewartet werden soll.
please supply the message to send with auto-responses mail de Bitte geben Sie eine Nachricht ein, die mit der automatischen Antwort gesendet werden soll
please wait while sending your mail mail de Bitte warten, Ihre Mail wird gesendet
post mail de versenden
prevent managing filters mail de Zugriff auf Filterregeln deaktivieren
prevent managing folders mail de Zugriff auf die Ordnerverwaltung deaktivieren

View File

@ -386,6 +386,7 @@ please enter password mail en Please enter password
please select a address mail en Please select a address
please select the number of days to wait between responses mail en Please select the number of days to wait between responses
please supply the message to send with auto-responses mail en Please supply the message to send with auto-responses
please wait while sending your mail mail en Please wait while sending your mail
post mail en post
prevent managing filters mail en Prevent managing filters
prevent managing folders mail en Prevent managing folders