MDL-75362 gradereport_singleview: Move classes

This commit is contained in:
Mathew May 2022-09-14 14:44:54 +02:00
parent 547bf73ea7
commit 0b6d841806
3 changed files with 10 additions and 14 deletions

View File

@ -79,7 +79,7 @@ class select extends screen {
$html = '';
$types = gradereport_singleview::valid_screens();
$types = gradereport_singleview\report\singleview::valid_screens();
foreach ($types as $type) {
$classname = "gradereport_singleview\\local\\screen\\${type}";

View File

@ -14,13 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Base lib class for singleview functionality.
*
* @package gradereport_singleview
* @copyright 2014 Moodle Pty Ltd (http://moodle.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace gradereport_singleview\report;
use context_course;
use grade_report;
use moodle_url;
defined('MOODLE_INTERNAL') || die;
@ -33,7 +31,7 @@ require_once($CFG->dirroot . '/grade/report/lib.php');
* @copyright 2014 Moodle Pty Ltd (http://moodle.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class gradereport_singleview extends grade_report {
class singleview extends grade_report {
/**
* Return the list of valid screens, used to validate the input.
@ -110,4 +108,3 @@ class gradereport_singleview extends grade_report {
return $OUTPUT->container($this->screen->html(), 'reporttable');
}
}

View File

@ -27,7 +27,6 @@ define('NO_OUTPUT_BUFFERING', true);
require_once('../../../config.php');
require_once($CFG->dirroot.'/lib/gradelib.php');
require_once($CFG->dirroot.'/grade/lib.php');
require_once($CFG->dirroot.'/grade/report/singleview/lib.php');
$courseid = required_param('id', PARAM_INT);
$groupid = optional_param('group', null, PARAM_INT);
@ -66,7 +65,7 @@ if (!$course = $DB->get_record('course', $courseparams)) {
require_login($course);
if (!in_array($itemtype, gradereport_singleview::valid_screens())) {
if (!in_array($itemtype, gradereport_singleview\report\singleview::valid_screens())) {
throw new \moodle_exception('notvalid', 'gradereport_singleview', '', $itemtype);
}
@ -89,7 +88,7 @@ if (!isset($USER->grade_last_report)) {
}
$USER->grade_last_report[$course->id] = 'singleview';
$report = new gradereport_singleview($courseid, $gpr, $context, $itemtype, $itemid);
$report = new gradereport_singleview\report\singleview($courseid, $gpr, $context, $itemtype, $itemid);
$reportname = $report->screen->heading();
@ -151,7 +150,7 @@ if (!empty($options)) {
$optionkeys = array_keys($options);
$optionitemid = array_shift($optionkeys);
$relreport = new gradereport_singleview(
$relreport = new gradereport_singleview\report\singleview(
$courseid, $gpr, $context,
$report->screen->item_type(), $optionitemid
);