MDL-39876 Change get_record('course') calls to get_course

This commit is contained in:
sam marshall 2013-06-18 17:00:37 +01:00
parent 838d78a9ff
commit ab7632b74c
189 changed files with 231 additions and 233 deletions

View file

@ -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);

View file

@ -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)) {

View file

@ -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)) {

View file

@ -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)) {