mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 03:46:42 +02:00
MDL-48595 logstore: Replacing references to deprecated interfaces
This commit is contained in:
parent
1cfce08e63
commit
59aebbed70
19 changed files with 44 additions and 44 deletions
|
@ -79,7 +79,7 @@ $PAGE->set_title($course->shortname .': '. $strparticipation);
|
|||
$PAGE->set_heading($course->fullname);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
$uselegacyreader = false; // Use legacy reader with sql_internal_reader to aggregate records.
|
||||
$uselegacyreader = false; // Use legacy reader with sql_internal_table_reader to aggregate records.
|
||||
$onlyuselegacyreader = false; // Use only legacy log table to aggregate records.
|
||||
|
||||
$logtable = report_participation_get_log_table_name(); // Log table to use for fetaching records.
|
||||
|
@ -100,7 +100,7 @@ if (!$onlyuselegacyreader && empty($logtable)) {
|
|||
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
|
||||
$minloginternalreader = 0; // Time of first record in sql_internal_reader.
|
||||
$minloginternalreader = 0; // Time of first record in sql_internal_table_reader.
|
||||
|
||||
if ($onlyuselegacyreader) {
|
||||
// If no sql_inrenal_reader enabled then get min. time from log table.
|
||||
|
@ -119,7 +119,7 @@ if ($onlyuselegacyreader) {
|
|||
$minlog = $minloginternalreader;
|
||||
}
|
||||
|
||||
// If timefrom is greater then first record in sql_internal_reader then get record from sql_internal_reader only.
|
||||
// If timefrom is greater then first record in sql_internal_table_reader then get record from sql_internal_table_reader only.
|
||||
if (!empty($timefrom) && ($minloginternalreader < $timefrom)) {
|
||||
$uselegacyreader = false;
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ if (!empty($instanceid) && !empty($roleid)) {
|
|||
}
|
||||
}
|
||||
|
||||
// Get record from sql_internal_reader and merge with records got from legacy log (if needed).
|
||||
// Get record from sql_internal_table_reader and merge with records got from legacy log (if needed).
|
||||
if (!$onlyuselegacyreader) {
|
||||
$sql = "SELECT ra.userid, $usernamefields, u.idnumber, COUNT(l.actioncount) AS count
|
||||
FROM (SELECT DISTINCT userid FROM {role_assignments} WHERE contextid $relatedctxsql AND roleid = :roleid ) ra
|
||||
|
|
|
@ -65,8 +65,8 @@ function report_participation_page_type_list($pagetype, $parentcontext, $current
|
|||
* @return bool returns true if the store is supported by the report, false otherwise.
|
||||
*/
|
||||
function report_participation_supports_logstore($instance) {
|
||||
if ($instance instanceof \core\log\sql_internal_reader || $instance instanceof \logstore_legacy\log\store) {
|
||||
if ($instance instanceof \core\log\sql_internal_table_reader || $instance instanceof \logstore_legacy\log\store) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die();
|
|||
* @return string table name
|
||||
*/
|
||||
function report_participation_get_log_table_name() {
|
||||
// Get prefered sql_internal_reader reader (if enabled).
|
||||
// Get prefered sql_internal_table_reader reader (if enabled).
|
||||
$logmanager = get_log_manager();
|
||||
$readers = $logmanager->get_readers();
|
||||
$logtable = '';
|
||||
|
@ -43,8 +43,8 @@ function report_participation_get_log_table_name() {
|
|||
break;
|
||||
}
|
||||
|
||||
// If sql_internal_reader is preferred reader.
|
||||
if ($reader instanceof \core\log\sql_internal_reader) {
|
||||
// If sql_internal_table_reader is preferred reader.
|
||||
if ($reader instanceof \core\log\sql_internal_table_reader) {
|
||||
$logtable = $reader->get_internal_log_table_name();
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue