From c61885c86ae9923efc61078f29c59d33e39e8385 Mon Sep 17 00:00:00 2001 From: Olle Haerstedt Date: Fri, 15 Apr 2016 14:19:25 +0200 Subject: [PATCH] Fixed issue #10829: Survey admins presented with inappropriate control buttons Dev: Hide template carousel and survey format (group-by-group etc) Dev: if user lacks survey update permissions. --- .../QuestionGroups/questiongroupbar_view.php | 14 +++-- .../views/admin/survey/surveySummary_view.php | 56 ++++++++++--------- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/application/views/admin/survey/QuestionGroups/questiongroupbar_view.php b/application/views/admin/survey/QuestionGroups/questiongroupbar_view.php index 7c0a932bb39..2f5e2cef182 100644 --- a/application/views/admin/survey/QuestionGroups/questiongroupbar_view.php +++ b/application/views/admin/survey/QuestionGroups/questiongroupbar_view.php @@ -15,12 +15,14 @@ - " > - " href="createUrl('admin/questions/sa/newquestion/surveyid/'.$surveyid.'/gid/'.$gid); ?>" role="button"> - - - - + hasSurveyPermission($surveyid,'surveycontent','create')): ?> + " > + " href="createUrl('admin/questions/sa/newquestion/surveyid/'.$surveyid.'/gid/'.$gid); ?>" role="button"> + + + + + hasSurveyPermission($surveyid,'surveycontent','update')): ?> 1): ?> diff --git a/application/views/admin/survey/surveySummary_view.php b/application/views/admin/survey/surveySummary_view.php index 9f180d0d357..c841fcf0b18 100644 --- a/application/views/admin/survey/surveySummary_view.php +++ b/application/views/admin/survey/surveySummary_view.php @@ -65,28 +65,30 @@ -
-
- - -
- - - + hasSurveyPermission($surveyid,'surveycontent','update')): ?> +
+
+ + +
+ + + +
+ " /> +

+ widget('yiiwheels.widgets.switch.WhSwitch', array( + 'name' => 'groupbygroup', + 'id'=>'switchchangeformat', + 'value'=>$switchvalue, + ));?> + +

+ */?>
- " /> -

- widget('yiiwheels.widgets.switch.WhSwitch', array( - 'name' => 'groupbygroup', - 'id'=>'switchchangeformat', - 'value'=>$switchvalue, - ));?> - -

- */?>
-
+ @@ -260,12 +262,14 @@
- - renderPartial( "/admin/survey/subview/_template_carousel", array( - 'templates'=>$templates, - 'surveyinfo'=>$surveyinfo, - 'iSurveyId'=>$surveyid, - )); ?> + hasSurveyPermission($surveyid,'surveycontent','update')): ?> + + renderPartial( "/admin/survey/subview/_template_carousel", array( + 'templates'=>$templates, + 'surveyinfo'=>$surveyinfo, + 'iSurveyId'=>$surveyid, + )); ?> +