mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-39876 Change get_record('course') calls to get_course
This commit is contained in:
parent
838d78a9ff
commit
ab7632b74c
189 changed files with 231 additions and 233 deletions
|
@ -14,7 +14,7 @@ $PAGE->set_url($url);
|
|||
$entry = $DB->get_record('glossary_entries', array('id'=> $eid), '*', MUST_EXIST);
|
||||
$glossary = $DB->get_record('glossary', array('id'=> $entry->glossaryid), '*', MUST_EXIST);
|
||||
$cm = get_coursemodule_from_instance('glossary', $glossary->id, 0, false, MUST_EXIST);
|
||||
$course = $DB->get_record('course', array('id'=> $cm->course), '*', MUST_EXIST);
|
||||
$course = get_course($cm->course);
|
||||
|
||||
require_login($course, false, $cm);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
if ($COURSE->id == $cm->course) {
|
||||
$course = $COURSE;
|
||||
} else {
|
||||
$course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST);
|
||||
$course = get_course($cm->course);
|
||||
}
|
||||
//context id from db should match the submitted one
|
||||
if ($context->id != $modcontext->id || !has_capability('mod/glossary:view', $modcontext)) {
|
||||
|
|
|
@ -23,7 +23,7 @@ if ($eid) {
|
|||
$entry = $DB->get_record('glossary_entries', array('id'=>$eid), '*', MUST_EXIST);
|
||||
$glossary = $DB->get_record('glossary', array('id'=>$entry->glossaryid), '*', MUST_EXIST);
|
||||
$cm = get_coursemodule_from_instance('glossary', $glossary->id, 0, false, MUST_EXIST);
|
||||
$course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST);
|
||||
$course = get_course($cm->course);
|
||||
require_course_login($course, true, $cm);
|
||||
$entry->glossaryname = $glossary->name;
|
||||
$entry->cmid = $cm->id;
|
||||
|
@ -31,7 +31,7 @@ if ($eid) {
|
|||
$entries = array($entry);
|
||||
|
||||
} else if ($concept) {
|
||||
$course = $DB->get_record('course', array('id'=>$courseid), '*', MUST_EXIST);
|
||||
$course = get_course($courseid);
|
||||
require_course_login($course);
|
||||
$entries = glossary_get_entries_search($concept, $courseid);
|
||||
|
||||
|
@ -45,7 +45,7 @@ if ($entries) {
|
|||
foreach ($entries as $key => $entry) {
|
||||
// Need to get the course where the entry is,
|
||||
// in order to check for visibility/approve permissions there
|
||||
$entrycourse = $DB->get_record('course', array('id' => $entry->courseid), '*', MUST_EXIST);
|
||||
$entrycourse = get_course($entry->courseid);
|
||||
$modinfo = get_fast_modinfo($entrycourse);
|
||||
// make sure the entry is visible
|
||||
if (empty($modinfo->cms[$entry->cmid]->uservisible)) {
|
||||
|
|
|
@ -25,7 +25,7 @@ if ($eid) {
|
|||
$entry = $DB->get_record('glossary_entries', array('id'=>$eid), '*', MUST_EXIST);
|
||||
$glossary = $DB->get_record('glossary', array('id'=>$entry->glossaryid), '*', MUST_EXIST);
|
||||
$cm = get_coursemodule_from_instance('glossary', $glossary->id, 0, false, MUST_EXIST);
|
||||
$course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST);
|
||||
$course = get_course($cm->course);
|
||||
require_course_login($course, true, $cm);
|
||||
$entry->glossaryname = $glossary->name;
|
||||
$entry->cmid = $cm->id;
|
||||
|
@ -33,7 +33,7 @@ if ($eid) {
|
|||
$entries = array($entry);
|
||||
|
||||
} else if ($concept) {
|
||||
$course = $DB->get_record('course', array('id'=>$courseid), '*', MUST_EXIST);
|
||||
$course = get_course($courseid);
|
||||
require_course_login($course);
|
||||
$entries = glossary_get_entries_search($concept, $courseid);
|
||||
|
||||
|
@ -45,7 +45,7 @@ if ($entries) {
|
|||
foreach ($entries as $key => $entry) {
|
||||
// Need to get the course where the entry is,
|
||||
// in order to check for visibility/approve permissions there
|
||||
$entrycourse = $DB->get_record('course', array('id' => $entry->courseid), '*', MUST_EXIST);
|
||||
$entrycourse = get_course($entry->courseid);
|
||||
$modinfo = get_fast_modinfo($entrycourse);
|
||||
// make sure the entry is visible
|
||||
if (empty($modinfo->cms[$entry->cmid]->uservisible)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue