From 650083b458c856e943c768f8a9890b917b04e8a1 Mon Sep 17 00:00:00 2001 From: Anatole Date: Thu, 25 Jun 2020 17:13:22 +0300 Subject: [PATCH] verification siret + correction params multiRadio multiCheck --- views/tpls/forms/cplx/multiCheckboxPlus.php | 10 +++++----- views/tpls/forms/cplx/multitextvalidation.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/views/tpls/forms/cplx/multiCheckboxPlus.php b/views/tpls/forms/cplx/multiCheckboxPlus.php index 64ee96b..fd0cfbc 100644 --- a/views/tpls/forms/cplx/multiCheckboxPlus.php +++ b/views/tpls/forms/cplx/multiCheckboxPlus.php @@ -109,7 +109,7 @@ $cle = $key ; $value = (!empty($answers)) ? " value='".$answers."' " : ""; $inpClass = " saveOneByOne"; -$editParamsBtn = ($canEditForm) ? " " : ""; +$editParamsBtn = ($canEditForm) ? " " : ""; @@ -239,7 +239,7 @@ if($mode == "r") { - echo " "; + echo " "; @@ -251,7 +251,7 @@ if($mode == "r") { if($value == "cplx") { - echo " "; + echo " "; } } } @@ -382,7 +382,7 @@ if($mode == "r") { - echo " "; + echo " "; @@ -394,7 +394,7 @@ if($mode == "r") { if($value == "cplx") { - echo " "; + echo " "; } } } diff --git a/views/tpls/forms/cplx/multitextvalidation.php b/views/tpls/forms/cplx/multitextvalidation.php index 6e6bf96..7c72fad 100644 --- a/views/tpls/forms/cplx/multitextvalidation.php +++ b/views/tpls/forms/cplx/multitextvalidation.php @@ -213,7 +213,7 @@ if($mode == "r"){ ?> if($canEditForm){ - echo " "; + echo " "; } ?> @@ -300,16 +300,16 @@ if($mode == "r"){ ?> if($(this).attr('type') == 'unique' ) { ajaxPost(null, baseUrl+"/co2/search/globalautocomplete", {"searchType" : ["organizations"], "filters": { "siret" : [$(this).val()] }}, function (data){ - if (data.results.lenght != 0){ - toastr.error('cette organisation existe déjà'); - } else { - answer.path = "answers."+$(this).data("form")+"."+$(this).data("id"); + if (Object.entries(data.results).length === 0){ + answer.path = "answers."+$(this).data("form")+"."+$(this).data("id"); answer.collection = "answers" ; answer.id = ""; answer.value = $(this).val(); dataHelper.path2Value(answer , function(params) { //toastr.success('saved'); }); + } else { + toastr.error('cette organisation existe déjà'); } } ); -- GitLab