Skip to content

Commit

Permalink
Dev: added "surveys in this group" list
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jul 24, 2017
1 parent ed19706 commit 40c146d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 5 additions & 1 deletion application/controllers/admin/SurveysGroupsController.php
Expand Up @@ -71,9 +71,13 @@ public function update($id)
{
$model->attributes=$_POST['SurveysGroups'];
if($model->save())
$this->redirect(array('admin/surveysgroups/'));
$this->getController()->redirect(array('admin/survey/sa/listsurveys '));
}
$aData['model'] = $model;
$oSurveySearch = new Survey('search');
$oSurveySearch->gsid = $model->gsid;

$aData['oSurveySearch'] = $oSurveySearch;
$this->_renderWrappedTemplate('surveysgroups', 'update', $aData);
}

Expand Down
2 changes: 2 additions & 0 deletions application/models/Survey.php
Expand Up @@ -1391,6 +1391,8 @@ public function search()
$criteria->compare('owner.users_name', $this->searched_value, true, 'OR');
$criteria->compare('correct_relation_defaultlanguage.surveyls_title', $this->searched_value, true, 'OR');
$criteria->compare('surveygroup.title', $this->searched_value, true, 'OR');
$criteria->compare('t.gsid',$this->gsid, true, 'AND');


// Active filter
if(isset($this->active)) {
Expand Down
12 changes: 11 additions & 1 deletion application/views/admin/surveysgroups/update.php
Expand Up @@ -18,4 +18,14 @@

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

</div>
<div class="col-sm-12 list-surveys">
<h2><?php eT('Surveys in this group:'); ?></h2>
<?php
$this->widget('ext.admin.survey.ListSurveysWidget.ListSurveysWidget', array(
'model' => $oSurveySearch,
'bRenderSearchBox' => false,
));
?>
</div>

</div>

0 comments on commit 40c146d

Please sign in to comment.