Commit 2f99a9b3 authored by Ifaliana Arimanana's avatar Ifaliana Arimanana
Browse files

update validateInput lila

parent 21021183
......@@ -76,7 +76,6 @@
"customInput" => "Réponse d'une question"
];
$logo = [
""=>"Par défaut",
"logo"=>"Logo",
"banner" => "Photo de couverture"
];
......@@ -115,7 +114,7 @@
"inputList" => [],
"step" => "",
"contact" => [],
"logo" => "",
"logo" => "logo",
"emailtpl" => "basic",
"object" => "",
"msg" => "",
......@@ -295,7 +294,6 @@ foreach ($mustSendMail as $persk => $persid) {
}
$mailList = array_unique($mailList);
?>
<script>
......@@ -373,12 +371,14 @@ $mailList = array_unique($mailList);
"icon" : "fa-cog",
"properties" : {
inputList : {
placeholder : "Choisir un élément",
inputType : "selectMultiple",
label : "Question obligatoire",
options : <?php echo json_encode($formList) ?>,
values : sectionDyf.<?php echo $kunik ?>ParamsData.inputList
},
step : {
placeholder : "Choisir un élément",
inputType : "select",
label : "Etape à débloquer",
options : <?php echo json_encode($stepList) ?>,
......@@ -392,25 +392,38 @@ $mailList = array_unique($mailList);
inputType : "selectMultiple",
label : "Contact",
options : <?php echo json_encode($contactType) ?>,
values : sectionDyf.<?php echo $kunik ?>ParamsData.contact
values : sectionDyf.<?php echo $kunik ?>ParamsData.contact,
placeholder : "Choisir un élément",
rules:{
"required":true
}
},
inputscontact : {
placeholder : "Choisir un élément",
inputType : "selectMultiple",
label : "Question avec une réponse en format email",
options : <?php echo json_encode($inputListOptions) ?>,
values : sectionDyf.<?php echo $kunik ?>ParamsData.inputscontact
},
emailtpl : {
inputType : "selectMultiple",
inputType : "select",
placeholder : "Choisir un élément",
label : "Template d'email",
options : <?php echo json_encode($emailtpl) ?>,
values : sectionDyf.<?php echo $kunik ?>ParamsData.emailtpl
values : sectionDyf.<?php echo $kunik ?>ParamsData.emailtpl,
rules:{
"required":true
}
},
logo : {
inputType : "selectMultiple",
placeholder : "Choisir un élément",
inputType : "select",
label : "Logo à afficher dans l'email",
options : <?php echo json_encode($logo) ?>,
values : sectionDyf.<?php echo $kunik ?>ParamsData.logo
values : sectionDyf.<?php echo $kunik ?>ParamsData.logo,
rules:{
"required":true
}
},
object : {
inputType : "text",
......@@ -440,22 +453,26 @@ $mailList = array_unique($mailList);
},
save : function () {
tplCtx.value = {};
$.each( sectionDyf.<?php echo $kunik ?>Params.jsonSchema.properties , function(k,val) {
if(val.inputType == "properties")
tplCtx.value[k] = getPairsObj('.'+k+val.inputType);
else if(val.inputType == "array")
tplCtx.value[k] = getArray('.'+k+val.inputType);
else
tplCtx.value[k] = $("#"+k).val();
mylog.log("value",'.'+k+val.inputType,tplCtx.value[k]);
});
mylog.log("save tplCtx",tplCtx);
if(typeof tplCtx.value == "undefined"){
toastr.error('value cannot be empty!');
}
else {
tplCtx.value = {};
$.each( sectionDyf.<?php echo $kunik ?>Params.jsonSchema.properties , function(k,val) {
if(val.inputType == "properties")
tplCtx.value[k] = getPairsObj('.'+k+val.inputType);
else if(val.inputType == "array")
tplCtx.value[k] = getArray('.'+k+val.inputType);
else
tplCtx.value[k] = $("#"+k).val();
mylog.log("value",'.'+k+val.inputType,tplCtx.value[k]);
});
if (tplCtx.value.inputList == null ) {
delete tplCtx.value.inputList;
}else if(tplCtx.value.inputList[0] ==""){
delete tplCtx.value.inputList;
}
mylog.log("save tplCtx",tplCtx.value);
if(typeof tplCtx.value == "undefined"){
toastr.error('value cannot be empty!');
}
else {
dataHelper.path2Value( tplCtx, function(params) {
dyFObj.closeForm();
urlCtrl.loadByHash(location.hash);
......@@ -505,8 +522,9 @@ $mailList = array_unique($mailList);
urlCtrl.loadByHash(location.hash);
<?php }?>
var answerId = <?php echo json_encode((String)$answer['_id']); ?>;
mylog.log("mety", sectionDyf.<?php echo $kunik ?>Params.jsonSchema.properties.emailtpl.values);
var paramsmail<?php echo $kunik ?> = {
tpl : sectionDyf.<?php echo $kunik ?>Params.jsonSchema.properties.emailtpl.values[0],
tpl : sectionDyf.<?php echo $kunik ?>Params.jsonSchema.properties.emailtpl.values,
signature : sectionDyf.<?php echo $kunik ?>Params.jsonSchema.properties.signature.values,
logo : sectionDyf.<?php echo $kunik ?>Params.jsonSchema.properties.logo.values,
tplObject : "<?php echo (isset($parentForm["params"][$kunik]["object"]) ? $parentForm["params"][$kunik]["object"] : "") ?>",
......@@ -518,7 +536,6 @@ $mailList = array_unique($mailList);
label : "Accéder au dossier"
}
};
ajaxPost(
null,
baseUrl+"/co2/mailmanagement/mailfeedback",
......
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