File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 467467//$_configuration['allow_required_survey_questions'] = false;
468468// Hide Survey Reporting button
469469//$_configuration['hide_survey_reporting_button'] = false;
470+ // Hide survey edition tools for all or some surveys.
471+ //Set an asterisk to hide for all, otherwise set an array with the survey codes in which the options will be blocked
472+ //$_configuration['hide_survey_edition'] = ['codes' => []];
470473// ------
471474
472475// Allow career diagram, requires a DB change:
Original file line number Diff line number Diff line change 11<?php
22/* For licensing terms, see /license.txt */
3+ use Chamilo \CourseBundle \Entity \CSurvey ;
34
45/**
56 * This class offers a series of general utility functions for survey querying and display
@@ -2662,7 +2663,21 @@ public static function display_survey_list_for_coach()
26622663 */
26632664 public static function modify_filter ($ survey_id , $ drh = false )
26642665 {
2665- $ survey_id = Security::remove_XSS ($ survey_id );
2666+ /** @var CSurvey $survey */
2667+ $ survey = Database::getManager ()->find ('ChamiloCourseBundle:CSurvey ' , $ survey_id );
2668+ $ hideSurveyEdition = api_get_configuration_value ('hide_survey_edition ' );
2669+
2670+ if (false !== $ hideSurveyEdition ) {
2671+ if ('* ' === $ hideSurveyEdition ['codes ' ]) {
2672+ return '' ;
2673+ }
2674+
2675+ if (in_array ($ survey ->getCode (), $ hideSurveyEdition ['codes ' ])) {
2676+ return '' ;
2677+ }
2678+ }
2679+
2680+ $ survey_id = $ survey ->getSurveyId ();
26662681 $ return = '' ;
26672682 $ hideReportingButton = api_get_configuration_value ('hide_survey_reporting_button ' );
26682683
You can’t perform that action at this time.
0 commit comments