Commit 7e89cc6a authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

tweak

parent 764e7a1e
......@@ -15,7 +15,7 @@ foreach ($forms as $fix => $f) {
<h4 class="letter-turq ">
<span class="col-xs-10"><?php echo (isset($f['name'])) ? $f['name'] : "Formulaire ".$el["slug"] ?></span>
<span class="col-xs-2">
<!-- <a href="javascript:;" class="editFormBtn" data-id="<?php echo $fix ?>"><i class="fa fa-pencil text-dark"></i></a> -->
<a href="javascript:;" class="editFormBtn" data-id="<?php echo $fix ?>"><i class="fa fa-pencil text-dark"></i></a>
<a href="javascript:;" class="deleteFormBtn" data-id="<?php echo $fix ?>"><i class="fa fa-trash text-red"></i></a> </span></h4>
steps : <br/>
<?php
......@@ -30,7 +30,7 @@ foreach ($forms as $fix => $f) {
<a href='javascript:;' data-id='<?php echo $fix ?>' class="configBtn btn btn-xs btn-danger col-sm-4 col-sm-12 bold">
<i class='fa fa-cogs'></i> CONFIG
</a>
<a href='costum/co/index/slug/<?php echo $el["slug"] ?>/form/<?php echo $fix ?>' class="btn btn-xs btn-primary col-sm-4 col-xs-12 bold">
<a href='costum/co/index/slug/<?php echo $el["slug"] ?>/form/<?php echo $fix ?>#answer.id.new' class="btn btn-xs btn-primary col-sm-4 col-xs-12 bold">
<i class='fa fa-file-text-o'></i> RÉPONDRE
</a>
</div>
......@@ -60,7 +60,10 @@ jQuery(document).ready(function() {
mylog.log( "configBtn", tplCtx.id );
dyFObj.openForm( oformParams, null, formsData[$(this).data("id")] )
});
$('.editFormBtn').off().click( function(){
tplCtx.id = $(this).data("id");
dyFObj.openForm( oformParams, null, formsData[$(this).data("id")] )
});
$('.deleteFormBtn').off().click( function(){
tplCtx.id = $(this).data("id");
bootbox.dialog({
......@@ -151,7 +154,7 @@ var oformParams = {
description : "lisez bien les options",
icon : "fa-question",
properties : {
steps : {
ids : {
inputType : "array",
label : "Nommé chaque étape de votre questionnaire",
//subLabel : "Vous remplirez les question de chaques étapes par la suite",
......@@ -217,6 +220,22 @@ var oformParams = {
tplCtx.value[k] = getPairsObj('.'+k+val.inputType);
else if(val.inputType == "array"){
tplCtx.value[k] = getArray('.'+k+val.inputType);
if(k=="ids"){
$.each(tplCtx.value[k],function(ix,fName) {
var newFormId = "<?php echo $el["slug"] ?>"+slugify(fName);
tplCtx.value[k][ix] = newFormId;
var newForm ={
collection : "forms",
value : {
id : newFormId,
name : fName,
type : "openForm",
}
};
dataHelper.path2Value( newForm, function() { } );
})
}
}
else
tplCtx.value[k] = $("#"+k).val();
......
Supports Markdown
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