From 41ec352b36d628bf6b2fed359c97624831dd3912 Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Fri, 9 Jun 2023 12:44:01 +0800 Subject: [PATCH] MDL-76445 gradereport_singleview: Deprecate initial zero state view Deprecates the \gradereport_singleview\local\screen\select class which is used to generate the initial view to select the singleview item type and the strings used by the related mustache template. This view is no longer used as we do not provide direct links to it anymore. --- .../classes/local/screen/select.php | 31 +++++++++++++++++++ .../report/singleview/lang/en/deprecated.txt | 1 + .../lang/en/gradereport_singleview.php | 4 ++- grade/report/upgrade.txt | 6 ++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/grade/report/singleview/classes/local/screen/select.php b/grade/report/singleview/classes/local/screen/select.php index a10f8cc2f84..4a7968d4562 100644 --- a/grade/report/singleview/classes/local/screen/select.php +++ b/grade/report/singleview/classes/local/screen/select.php @@ -32,6 +32,7 @@ defined('MOODLE_INTERNAL') || die; /** * The gradebook simple view - initial view to select your search options * + * @deprecated since Moodle 4.3 * @package gradereport_singleview * @copyright 2014 Moodle Pty Ltd (http://moodle.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -44,11 +45,15 @@ class select extends screen { /** * Initialise this screen * + * @deprecated since Moodle 4.3 * @param bool $selfitemisempty Has an item been selected (will be false) */ public function init($selfitemisempty = false) { global $DB; + debugging('The function ' . __FUNCTION__ . '() is deprecated as part of the deprecation process of the ' . + '\gradereport_singleview\local\screen\select class which is no longer used.', DEBUG_DEVELOPER); + $roleids = explode(',', get_config('moodle', 'gradebookroles')); $this->items = []; @@ -66,20 +71,28 @@ class select extends screen { /** * Get the type of items on this screen, not valid so return false. * + * @deprecated since Moodle 4.3 * @return string|null */ public function item_type(): ?string { + debugging('The function ' . __FUNCTION__ . '() is deprecated as part of the deprecation process of the ' . + '\gradereport_singleview\local\screen\select class which is no longer used.', DEBUG_DEVELOPER); + return false; } /** * Return the HTML for the page. * + * @deprecated since Moodle 4.3 * @return string */ public function html(): string { global $OUTPUT, $COURSE; + debugging('The function ' . __FUNCTION__ . '() is deprecated as part of the deprecation process of the ' . + '\gradereport_singleview\local\screen\select class which is no longer used.', DEBUG_DEVELOPER); + if ($this->itemid === null) { $userlink = new \moodle_url('/grade/report/singleview/index.php', ['id' => $COURSE->id, 'item' => 'user_select']); $gradelink = new \moodle_url('/grade/report/singleview/index.php', ['id' => $COURSE->id, 'item' => 'grade_select']); @@ -137,17 +150,27 @@ class select extends screen { /** * Should we show the next prev selector? + * + * @deprecated since Moodle 4.3 * @return bool */ public function supports_next_prev(): bool { + debugging('The function ' . __FUNCTION__ . '() is deprecated as part of the deprecation process of the ' . + '\gradereport_singleview\local\screen\select class which is no longer used.', DEBUG_DEVELOPER); + return false; } /** * Should we show the base singlereport group selector? + * + * @deprecated since Moodle 4.3 * @return bool */ public function display_group_selector(): bool { + debugging('The function ' . __FUNCTION__ . '() is deprecated as part of the deprecation process of the ' . + '\gradereport_singleview\local\screen\select class which is no longer used.', DEBUG_DEVELOPER); + if ($this->itemid === null) { return false; } @@ -157,18 +180,26 @@ class select extends screen { /** * Get the heading for the screen. * + * @deprecated since Moodle 4.3 * @return string */ public function heading(): string { + debugging('The function ' . __FUNCTION__ . '() is deprecated as part of the deprecation process of the ' . + '\gradereport_singleview\local\screen\select class which is no longer used.', DEBUG_DEVELOPER); + return ' '; } /** * Does this screen support paging? * + * @deprecated since Moodle 4.3 * @return bool */ public function supports_paging(): bool { + debugging('The function ' . __FUNCTION__ . '() is deprecated as part of the deprecation process of the ' . + '\gradereport_singleview\local\screen\select class which is no longer used.', DEBUG_DEVELOPER); + return false; } } diff --git a/grade/report/singleview/lang/en/deprecated.txt b/grade/report/singleview/lang/en/deprecated.txt index d3a25488b05..ec3b90cad95 100644 --- a/grade/report/singleview/lang/en/deprecated.txt +++ b/grade/report/singleview/lang/en/deprecated.txt @@ -1 +1,2 @@ filtergrades,gradereport_singleview +viewsingleuserorgradeitem,gradereport_singleview diff --git a/grade/report/singleview/lang/en/gradereport_singleview.php b/grade/report/singleview/lang/en/gradereport_singleview.php index a45c8481b8d..b8e31e8d10c 100644 --- a/grade/report/singleview/lang/en/gradereport_singleview.php +++ b/grade/report/singleview/lang/en/gradereport_singleview.php @@ -79,7 +79,6 @@ $string['ariareporttype'] = 'Select a report type to view'; $string['viewby'] = 'View by'; $string['viewsingleuser'] = 'Select a user above to view all their grades'; $string['viewsinglegradeitem'] = 'Select a grade item above'; -$string['viewsingleuserorgradeitem'] = 'View all the grades of a single user or grade item.'; $string['searchgrades'] = 'Search grade items'; $string['selectagrade'] = 'Select a grade item'; $string['selectgradeitemlink'] = 'Select a grade item'; @@ -88,3 +87,6 @@ $string['unsaveddatawarning'] = 'Unsaved data warning'; // Deprecated since Moodle 4.1. $string['filtergrades'] = 'Show grades for {$a}.'; + +// Deprecated since Moodle 4.3. +$string['viewsingleuserorgradeitem'] = 'View all the grades of a single user or grade item.'; diff --git a/grade/report/upgrade.txt b/grade/report/upgrade.txt index 9d11a16f32d..cb533144247 100644 --- a/grade/report/upgrade.txt +++ b/grade/report/upgrade.txt @@ -1,6 +1,12 @@ This files describes API changes in /grade/report/*, information provided here is intended especially for developers. +=== 4.3 === + +* The \gradereport_singleview\local\screen\select has been deprecated. This class generates the output for the initial + view to select the single view item type (user or grade item) which is no longer actively used as we do not provide + direct links to it. + === 4.2 === * 'Show calculations' setting has been removed from grader report (link is moved to grade action menu) * 'Show activity icons' setting has been removed from grader report