Commit 74026502 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

tweaks

parent cfc58444
......@@ -12,9 +12,12 @@ class DeleteAction extends CAction
{
// if( Authorisation::isElementAdmin($id, Form::ANSWER_COLLECTION, Yii::app()->session["userId"], false)) {
if(isset($form["ids"])){
$formId = implode("|", $form["ids"]);
PHDB::remove( Form::ANSWER_COLLECTION, ["formId" => $formId]);
if(isset($form["ids"]))
{
PHDB::remove( Form::ANSWER_COLLECTION, ["formId" => implode("|", $form["ids"]) ]);
foreach ($form["ids"] as $ix => $fid) {
PHDB::remove( Form::COLLECTION, ["id" => $fid]);
}
}
PHDB::remove( Form::COLLECTION, ["_id" => new MongoId($id)] );
echo Rest::json(['result' => true ]);
......
......@@ -133,7 +133,6 @@ if( isset( $form["inputs"] ) ){ ?>
<?php } ?>
</form>
<?php }
var_dump($canEditForm);
if ($canEditForm) { ?>
<div class="text-center">
<a href="javascript:;" class="addQuestion btn btn-danger" data-form="<?php echo $formId ?>" data-id="<?php echo $form['_id'] ?>" ><i class="fa fa-plus"></i> Ajouter Une Question</a>
......
......@@ -242,7 +242,7 @@ var oformParams = {
tplCtx.value[k] = getArray('.'+k+val.inputType);
if(k=="ids"){
$.each(tplCtx.value[k],function(ix,fName) {
if(!$.inArray(fName, subForms) == -1 )
if(!$.inArray(fName, subForms) == -1 ){
var newFormId = "<?php echo $el["slug"] ?>"+subForms.length;
tplCtx.value[k][ix] = newFormId;
var newForm ={
......
......@@ -88,11 +88,9 @@ if( isset($this->costum["tpls"][$keyTpl]) ) {
foreach ($formList as $k => $v) {
$hide = ($k==$activeStep) ? "" : "hide";
?>
<div id='<?php echo $v ; ?>' class='col-sm-offset-1 col-sm-10 sectionStep <?php echo $hide ;?>' style="padding-bottom:40px">
<?php
$form = PHDB::findOne( Form::COLLECTION,[ "id"=>$v ] );
?>
......
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