Commit 6bd29e78 authored by Raph El's avatar Raph El
Browse files

Hotfix formList and drap N drop uniquement en mode fa

parent 09c9956f
......@@ -660,6 +660,7 @@ class Form {
$budgetInputList = [];
$allforms = [];
$stockBudgetInputs = false;
if(!empty($params["formList"])){
foreach ($params["formList"] as $i => $formId)
{
$f = PHDB::findOne(Form::COLLECTION, ["id"=>$formId]);
......@@ -676,6 +677,8 @@ class Form {
}
}
}
if(count($budgetInputList))
Yii::app()->session["budgetInputList"] = $budgetInputList;
//var_dump($budgetInputList);
......@@ -743,6 +746,8 @@ class Form {
$showForm = true;
if(!empty($params["formId"])){
$myAnswers = self::getListAnswersBy($params["formId"], $params["el"]["slug"], Yii::app()->session["userId"]);
......@@ -829,6 +834,8 @@ class Form {
echo "<a class='btn btn-primary' href='/costum/co/index/slug/".$el["slug"]."/answer/".$myAnswers[0]."'>Votre réponse</a>";
}
}
}
return $params;
}
......
......@@ -51,8 +51,8 @@ if( isset( $form["inputs"] ) ){ ?>
//fin nouvelle repositionnement
//echo json_encode($form["inputs"]) ;
echo "<ul class='questionList'>";
$dragNDrop = ($canEditForm) ? "dragNDrop" : "" ;
echo "<ul class='questionList ".$dragNDrop."'>";
foreach ( $form["inputs"] as $key => $input) {
$editQuestionBtn = ($canEditForm) ? " <a class='btn btn-xs btn-danger editQuestion' href='javascript:;' data-form='".$form["id"]."' data-id='".$form["_id"]."' data-collection='".Form::COLLECTION."' data-key='".$key."' data-path='inputs.".$key."'><i class='fa fa-pencil'></i></a>".
......@@ -309,7 +309,7 @@ jQuery(document).ready(function() {
}
//questions can be ordered by drag n drop
$( ".questionList" ).sortable({
$( ".dragNDrop" ).sortable({
stop: function(event, ui) {
//alert("New position: " + ui.item.index()+ ui.item.data("key")+ ui.item.data("form"));
tplCtx.id = ui.item.data("id");
......
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