diff --git a/.upgradenotes/MDL-82503-2024081605135370.yml b/.upgradenotes/MDL-82503-2024081605135370.yml new file mode 100644 index 00000000000..00b00b2bfc5 --- /dev/null +++ b/.upgradenotes/MDL-82503-2024081605135370.yml @@ -0,0 +1,7 @@ +issueNumber: MDL-82503 +notes: + core_badges: + - message: >- + The course_badges systemreport has been deprecated and merged with the + badges systemreport. Please, use the badges systemreport instead. + type: deprecated diff --git a/badges/classes/reportbuilder/local/systemreports/course_badges.php b/badges/classes/reportbuilder/local/systemreports/course_badges.php index f415e287b66..5a28d6b04db 100644 --- a/badges/classes/reportbuilder/local/systemreports/course_badges.php +++ b/badges/classes/reportbuilder/local/systemreports/course_badges.php @@ -37,13 +37,19 @@ require_once("{$CFG->libdir}/badgeslib.php"); * @package core_badges * @copyright 2023 David Carrillo * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @deprecated since 4.5. Use badges system_report instead. + * @todo MDL-82383 This class will be deleted in Moodle 6.0. */ class course_badges extends system_report { /** * Initialise report, we need to set the main table, load our entities and set columns/filters + * + * @deprecated since 4.5. Use badges system_report instead. */ + #[\core\attribute\deprecated('course_badges::initialise', since: '4.5', mdl: 'MDL-82503')] protected function initialise(): void { + \core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]); global $USER; // Our main entity, it contains all of the column definitions that we need. $badgeentity = new badge(); @@ -84,8 +90,11 @@ class course_badges extends system_report { * Validates access to view this report * * @return bool + * @deprecated since 4.5. Use badges system_report instead. */ + #[\core\attribute\deprecated('course_badges::can_view', since: '4.5', mdl: 'MDL-82503')] protected function can_view(): bool { + \core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]); return has_capability('moodle/badges:viewbadges', $this->get_context()); } @@ -94,8 +103,13 @@ class course_badges extends system_report { * * They are provided by the entities we previously added in the {@see initialise} method, referencing each by their * unique identifier. If custom columns are needed just for this report, they can be defined here. + * + * @param string $badgeissuedalias + * @deprecated since 4.5. Use badges system_report instead. */ + #[\core\attribute\deprecated('course_badges::add_columns', since: '4.5', mdl: 'MDL-82503')] protected function add_columns(): void { + \core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]); $badgeissuedalias = $this->get_entity('badge_issued')->get_table_alias('badge_issued'); $this->add_columns_from_entities([ @@ -128,8 +142,12 @@ class course_badges extends system_report { * * They are all provided by the entities we previously added in the {@see initialise} method, referencing each by their * unique identifier + * + * @deprecated since 4.5. Use badges system_report instead. */ + #[\core\attribute\deprecated('course_badges::add_filters', since: '4.5', mdl: 'MDL-82503')] protected function add_filters(): void { + \core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]); $this->add_filters_from_entities([ 'badge:name', 'badge_issued:issued',