Skip to content

Commit

Permalink
Dev: create survey group
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jul 24, 2017
1 parent da11127 commit ed19706
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
9 changes: 5 additions & 4 deletions application/controllers/admin/SurveysGroupsController.php
Expand Up @@ -45,13 +45,14 @@ public function create()
if(isset($_POST['SurveysGroups']))
{
$model->attributes=$_POST['SurveysGroups'];
$model->name = sanitize_paranoid_string($_POST['SurveysGroups']['title']);
$model->created_by = $model->owner_uid = Yii::app()->user->id;
if($model->save())
$this->redirect(array('view','id'=>$model->gsid));
$this->getController()->redirect(array('admin/survey/sa/listsurveys '));
}

$this->render('create',array(
'model'=>$model,
));
$aData['model'] = $model;
$this->_renderWrappedTemplate('surveysgroups', 'create', $aData);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions application/views/admin/super/fullpagebar_view.php
Expand Up @@ -16,6 +16,10 @@
<span class="icon-add text-success"></span>
<?php eT("Create a new survey");?>
</a>
<a class="btn btn-default" href="<?php echo $this->createUrl("admin/surveysgroups/sa/create"); ?>" role="button">
<span class="icon-add text-success"></span>
<?php eT("Create a new survey group");?>
</a>
<?php endif;?>
</div>

Expand Down
21 changes: 21 additions & 0 deletions application/views/admin/surveysgroups/create.php
@@ -0,0 +1,21 @@
<?php
/* @var $this SurveysGroupsController */
/* @var $model SurveysGroups */
?>

<div class="col-lg-12 list-surveys">

<?php $this->renderPartial('super/fullpagebar_view', array(
'fullpagebar' => array(
'returnbutton'=>array(
'url'=>'index',
'text'=>gT('Close'),
),
)
)); ?>

<h3><?php eT('Create SurveysGroups:').$model->title; ?></h3>

<?php $this->renderPartial('./surveysgroups/_form', array('model'=>$model)); ?>

</div>

0 comments on commit ed19706

Please sign in to comment.