From fc2fb235a27d6410dff200515ed03d5d6d5990ca Mon Sep 17 00:00:00 2001 From: acognet Date: Thu, 2 Apr 2020 17:46:18 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B01344=20-=20Save=20without=20all=20mandat?= =?UTF-8?q?ory=20attributes=20(ajax=20reload=20not=20finished)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dictionaries/en.dictionary.itop.ui.php | 1 + dictionaries/fr.dictionary.itop.ui.php | 1 + js/forms-json-utils.js | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/dictionaries/en.dictionary.itop.ui.php b/dictionaries/en.dictionary.itop.ui.php index 87514f453..5126122ab 100644 --- a/dictionaries/en.dictionary.itop.ui.php +++ b/dictionaries/en.dictionary.itop.ui.php @@ -422,6 +422,7 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:Button:Insert' => 'Insert', 'UI:Button:More' => 'More', 'UI:Button:Less' => 'Less', + 'UI:Button:Wait' => 'Please wait while updating fields', 'UI:SearchToggle' => 'Search', 'UI:ClickToCreateNew' => 'Create a new %1$s', diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php index 2adf16393..cbcf2d87a 100644 --- a/dictionaries/fr.dictionary.itop.ui.php +++ b/dictionaries/fr.dictionary.itop.ui.php @@ -405,6 +405,7 @@ Dict::Add('FR FR', 'French', 'Français', array( 'UI:Button:Insert' => 'Insérer', 'UI:Button:More' => 'Plus', 'UI:Button:Less' => 'Moins', + 'UI:Button:Wait' => 'Patientez pendant la mise à jour des champs', 'UI:SearchToggle' => 'Recherche', 'UI:ClickToCreateNew' => 'Créer un nouvel objet de type %1$s', diff --git a/js/forms-json-utils.js b/js/forms-json-utils.js index 8976e2741..c1eb96c36 100644 --- a/js/forms-json-utils.js +++ b/js/forms-json-utils.js @@ -143,6 +143,13 @@ var oFormErrors = { err_form0: 0 }; function CheckFields(sFormId, bDisplayAlert) { +// if some fields are in wait, no submit is allowed + if ($('#'+sFormId+' .blockMsg').length>0) + { + alert(Dict.S('UI:Button:Wait')); + return false; + } + $('#'+sFormId+' :submit').prop('disable', true); $('#'+sFormId+' :button[type=submit]').prop('disable', true); firstErrorId = ''; @@ -171,6 +178,7 @@ function CheckFields(sFormId, bDisplayAlert) $('#'+oFormErrors['input_'+sFormId]).focus(); } } + return (oFormErrors['err_'+sFormId] == 0); // If no error, submit the form }