From 40c146dac0a1c198a231824856572ca814588f44 Mon Sep 17 00:00:00 2001 From: LouisGac Date: Mon, 24 Jul 2017 15:28:40 +0200 Subject: [PATCH] Dev: added "surveys in this group" list --- .../controllers/admin/SurveysGroupsController.php | 6 +++++- application/models/Survey.php | 2 ++ application/views/admin/surveysgroups/update.php | 12 +++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/application/controllers/admin/SurveysGroupsController.php b/application/controllers/admin/SurveysGroupsController.php index 99fb93f67e9..9443fca136d 100644 --- a/application/controllers/admin/SurveysGroupsController.php +++ b/application/controllers/admin/SurveysGroupsController.php @@ -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); } diff --git a/application/models/Survey.php b/application/models/Survey.php index f25c4dfd512..7b057ded9ac 100644 --- a/application/models/Survey.php +++ b/application/models/Survey.php @@ -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)) { diff --git a/application/views/admin/surveysgroups/update.php b/application/views/admin/surveysgroups/update.php index e2fca25dce6..9c2458f3a70 100644 --- a/application/views/admin/surveysgroups/update.php +++ b/application/views/admin/surveysgroups/update.php @@ -18,4 +18,14 @@ renderPartial('./surveysgroups/_form', array('model'=>$model)); ?> - +
+

+ widget('ext.admin.survey.ListSurveysWidget.ListSurveysWidget', array( + 'model' => $oSurveySearch, + 'bRenderSearchBox' => false, + )); + ?> +
+ +