Commit bbd6e972 authored by Anatole Rakotoson's avatar Anatole Rakotoson
Browse files

Merge branch 'qa' of https://gitlab.adullact.net/pixelhumain/survey into qa

parents db381318 2d84b409
......@@ -37,12 +37,16 @@ class DeleteAction extends CAction
$where = array("_id" => new MongoId($project["id"]));
$action = array('$unset' => array('category' => ""));
PHDB::update(Project::COLLECTION, $where, $action);
PHDB::update( Project::COLLECTION, $where, $action );
}
//******************************************
Form::delAnswer( $id );
$ctrl->redirect(Yii::app()->request->urlReferrer);
$res = Form::delAnswer( $id );
if(!Yii::app()->request->isAjaxRequest)
$ctrl->redirect(Yii::app()->request->urlReferrer);
else
Rest::json($res);
} else
$ctrl->render("co2.views.default.unTpl",array("msg"=>"Réponse introuvable ou ","icon"=>"fa-search"));
......
......@@ -124,7 +124,7 @@ mode <?php echo $mode ?>
$liBg = ($todo>0) ? "style='background-color:lightGreen'" : "";
?>
<li class="answerLi col-xs-12" <?php echo $liBg ?>>
<li class="answerLi col-xs-12 " id="ansline<?php echo $ans["_id"] ?>" <?php echo $liBg ?>>
<div class="col-xs-3 text-center">
<a href="<?php echo Yii::app()->createUrl("/costum")?>/co/index/slug/<?php echo $el["slug"] ?>/answer/<?php echo (String) $ans["_id"] ?>"> <?php echo $lbl; ?></a>
</div>
......@@ -231,8 +231,9 @@ jQuery(document).ready(function() {
label: "Ok",
className: "btn btn-primary pull-left",
callback: function() {
getAjax("",baseUrl+"/survey/co/delete/id/"+id,function(){
getAjax("", baseUrl+"/survey/co/delete/id/"+id , function(){
//urlCtrl.loadByHash(location.hash);
$("#ansline"+id).remove();
},"html");
}
......
......@@ -4,6 +4,6 @@ if ($canEdit){
?>
<a href='javascript:;' data-id='<?php echo $id?>' data-collection='<?php echo $collection?>' data-key='<?php echo $q?>' data-path='<?php echo $path?>' class='edit<?php echo $keyTpl ?> previewTpl btn btn-xs btn-default'><i class='fa fa-pencil'></i></a>
<a href='javascript:;' data-id='<?php echo $id?>' data-collection='<?php echo $collection?>' data-key='<?php echo $keyTpl.$q?>' data-path='<?php echo $path ?>' class='deleteLinex previewTpl btn btn-xs btn-danger'><i class='fa fa-times'></i></a>
<a href='javascript:;' data-id='<?php echo $id?>' data-collection='<?php echo $collection?>' data-key='<?php echo $keyTpl.$q?>' data-path='<?php echo $path ?>' class='deleteLine previewTpl btn btn-xs btn-danger'><i class='fa fa-times'></i></a>
<?php } ?>
\ No newline at end of file
......@@ -159,7 +159,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -143,7 +143,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -170,7 +170,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -132,7 +132,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -285,7 +285,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -134,7 +134,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -145,7 +145,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -145,7 +145,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -198,7 +198,7 @@ $actualNbr1 = 0;
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -150,7 +150,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -121,7 +121,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -121,7 +121,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -137,7 +137,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -125,7 +125,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
......@@ -815,7 +815,7 @@ $actualNbr1 = 0;
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik,
"type" => "reg"
] ); ?>
......@@ -842,7 +842,7 @@ $actualNbr1 = 0;
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik,
"type" => "crt"
] ); ?>
......@@ -868,7 +868,7 @@ $actualNbr1 = 0;
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik,
"type" => "lbl"
] ); ?>
......
......@@ -1062,7 +1062,7 @@ $actualNbr1 = 0;
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik,
"type" => "reg"
] ); ?>
......@@ -1089,7 +1089,7 @@ $actualNbr1 = 0;
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik,
"type" => "crt"
] ); ?>
......@@ -1115,7 +1115,7 @@ $actualNbr1 = 0;
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik,
"type" => "lbl"
] ); ?>
......
......@@ -225,7 +225,7 @@
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"keyTpl"=>$kunik
] ); ?>
......
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