mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-56307 course: Return time updated and times updated
This commit is contained in:
parent
cebce76f61
commit
65b2669d98
13 changed files with 146 additions and 63 deletions
|
@ -4116,12 +4116,18 @@ function glossary_check_updates_since(cm_info $cm, $from, $filter = array()) {
|
|||
|
||||
$updates = course_check_module_updates_since($cm, $from, array('attachment', 'entry'), $filter);
|
||||
|
||||
$updates->entries = (object) array('updated' => false);
|
||||
$select = 'glossaryid = :id AND (timecreated > :since1 OR timemodified > :since2)';
|
||||
$params = array('id' => $cm->instance, 'since1' => $from, 'since2' => $from);
|
||||
if (!has_capability('mod/glossary:approve', $cm->context)) {
|
||||
$select .= ' AND approved = 1';
|
||||
}
|
||||
$updates->entries = $DB->count_records_select('glossary_entries', $select, $params) > 0;
|
||||
|
||||
$entries = $DB->get_records_select('glossary_entries', $select, $params, '', 'id');
|
||||
if (!empty($entries)) {
|
||||
$updates->entries->updated = true;
|
||||
$updates->entries->itemids = array_keys($entries);
|
||||
}
|
||||
|
||||
return $updates;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue