Commit 650083b4 authored by Anatole Rakotoson's avatar Anatole Rakotoson

verification siret + correction params multiRadio multiCheck

parent a029dac6
......@@ -109,7 +109,7 @@ $cle = $key ;
$value = (!empty($answers)) ? " value='".$answers."' " : "";
$inpClass = " saveOneByOne";
$editParamsBtn = ($canEditForm) ? " <a href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='costum.form.params.".$kunik."' class='previewTpl edit".$kunik."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : "";
$editParamsBtn = ($canEditForm) ? " <a href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='params.".$kunik."' class='previewTpl edit".$kunik."Params btn btn-xs btn-danger'><i class='fa fa-cog'></i> </a>" : "";
......@@ -239,7 +239,7 @@ if($mode == "r")
{
echo " <a href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='costum.form.params.".$kunik."' class='previewTpl paramsonebtn editone".$kunik."Params".$ix." '><i class='fa fa-cog'></i> </a>";
echo " <a href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='params.".$kunik."' class='previewTpl paramsonebtn editone".$kunik."Params".$ix." '><i class='fa fa-cog'></i> </a>";
......@@ -251,7 +251,7 @@ if($mode == "r")
{
if($value == "cplx")
{
echo " <a alt='placeholder' href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='costum.form.params.".$kunik."' class='previewTpl paramsonebtnP editonep".$kunik."Params".$ix." '><i class='fa fa-pencil'></i> </a>";
echo " <a alt='placeholder' href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='params.".$kunik."' class='previewTpl paramsonebtnP editonep".$kunik."Params".$ix." '><i class='fa fa-pencil'></i> </a>";
}
}
}
......@@ -382,7 +382,7 @@ if($mode == "r")
{
echo " <a href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='costum.form.params.".$kunik."' class='previewTpl paramsonebtn editone".$kunik."Params".$ix." '><i class='fa fa-cog'></i> </a>";
echo " <a href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='params.".$kunik."' class='previewTpl paramsonebtn editone".$kunik."Params".$ix." '><i class='fa fa-cog'></i> </a>";
......@@ -394,7 +394,7 @@ if($mode == "r")
{
if($value == "cplx")
{
echo " <a alt='placeholder' href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='costum.form.params.".$kunik."' class='previewTpl paramsonebtnP editonep".$kunik."Params".$ix." '><i class='fa fa-pencil'></i> </a>";
echo " <a alt='placeholder' href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='params.".$kunik."' class='previewTpl paramsonebtnP editonep".$kunik."Params".$ix." '><i class='fa fa-pencil'></i> </a>";
}
}
}
......
......@@ -213,7 +213,7 @@ if($mode == "r"){ ?>
if($canEditForm){
echo " <a href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='costum.form.params.".$kunik."' class='previewTpl paramsonebtn edit".$kunik."ParamsMt '><i class='fa fa-cog' style='padding: 4px;'></i> </a>";
echo " <a href='javascript:;' data-id='".$parentForm["_id"]."' data-collection='".Form::COLLECTION."' data-path='params.".$kunik."' class='previewTpl paramsonebtn edit".$kunik."ParamsMt '><i class='fa fa-cog' style='padding: 4px;'></i> </a>";
}
?>
......@@ -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 = "<?php echo $answer["_id"]; ?>";
answer.value = $(this).val();
dataHelper.path2Value(answer , function(params) {
//toastr.success('saved');
});
} else {
toastr.error('cette organisation existe déjà');
}
}
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment