Browse Source

Fix #461 hard-coded admin path.

nwp90-nwp90-allsessionsreport
Dan Marsden 5 years ago
parent
commit
757358b3ee
  1. 2
      lib.php
  2. 4
      resetcalendar.php

2
lib.php

@ -475,7 +475,7 @@ function attendance_print_settings_tabs($selected = 'settings') {
global $CFG; global $CFG;
// Print tabs for different settings pages. // Print tabs for different settings pages.
$tabs = array(); $tabs = array();
$tabs[] = new tabobject('settings', $CFG->wwwroot.'/admin/settings.php?section=modsettingattendance', $tabs[] = new tabobject('settings', "{$CFG->wwwroot}/{$CFG->admin}/settings.php?section=modsettingattendance",
get_string('settings', 'attendance'), get_string('settings'), false); get_string('settings', 'attendance'), get_string('settings'), false);
$tabs[] = new tabobject('defaultstatus', $CFG->wwwroot.'/mod/attendance/defaultstatus.php', $tabs[] = new tabobject('defaultstatus', $CFG->wwwroot.'/mod/attendance/defaultstatus.php',

4
resetcalendar.php

@ -61,7 +61,7 @@ if (get_config('attendance', 'enablecalendar')) {
} else { } else {
if ($DB->record_exists('attendance_sessions', array('caleventid' => 0, 'calendarevent' => 1))) { if ($DB->record_exists('attendance_sessions', array('caleventid' => 0, 'calendarevent' => 1))) {
$createurl = new moodle_url('/mod/attendance/resetcalendar.php', array('action' => 'create')); $createurl = new moodle_url('/mod/attendance/resetcalendar.php', array('action' => 'create'));
$returnurl = new moodle_url('/admin/settings.php', array('section' => 'modsettingattendance')); $returnurl = new moodle_url("/{$CFG->admin}/settings.php", array('section' => 'modsettingattendance'));
echo $OUTPUT->confirm(get_string('resetcaledarcreate', 'mod_attendance'), $createurl, $returnurl); echo $OUTPUT->confirm(get_string('resetcaledarcreate', 'mod_attendance'), $createurl, $returnurl);
} else { } else {
@ -79,7 +79,7 @@ if (get_config('attendance', 'enablecalendar')) {
// Check to see if there are any events that need to be deleted. // Check to see if there are any events that need to be deleted.
if ($DB->record_exists_select('attendance_sessions', 'caleventid > 0')) { if ($DB->record_exists_select('attendance_sessions', 'caleventid > 0')) {
$deleteurl = new moodle_url('/mod/attendance/resetcalendar.php', array('action' => 'delete')); $deleteurl = new moodle_url('/mod/attendance/resetcalendar.php', array('action' => 'delete'));
$returnurl = new moodle_url('/admin/settings.php', array('section' => 'modsettingattendance')); $returnurl = new moodle_url("/{$CFG->admin}/settings.php", array('section' => 'modsettingattendance'));
echo $OUTPUT->confirm(get_string('resetcaledardelete', 'mod_attendance'), $deleteurl, $returnurl); echo $OUTPUT->confirm(get_string('resetcaledardelete', 'mod_attendance'), $deleteurl, $returnurl);
} else { } else {

Loading…
Cancel
Save