Browse Source

Rename at-risk report to absentee report.

MOODLE_34_STABLE
Dan Marsden 7 years ago
parent
commit
5d8a4152d9
  1. 12
      absentee.php
  2. 4
      classes/structure.php
  3. 4
      lang/en/attendance.php
  4. 4
      lib.php
  5. 8
      renderables.php
  6. 2
      resetcalendar.php

12
atrisk.php → absentee.php

@ -55,13 +55,13 @@ if (!empty($category)) {
// Check permissions. // Check permissions.
require_capability('mod/attendance:viewreports', $context); require_capability('mod/attendance:viewreports', $context);
$exportfilename = 'attendanceatrisk.csv'; $exportfilename = 'attendance-absentee.csv';
$PAGE->set_url('/mod/attendance/atrisk.php', array('category' => $category, 'id' => $attendancecm)); $PAGE->set_url('/mod/attendance/absentee.php', array('category' => $category, 'id' => $attendancecm));
$PAGE->set_heading($SITE->fullname); $PAGE->set_heading($SITE->fullname);
$table = new flexible_table('attendanceatrisk'); $table = new flexible_table('attendanceabsentee');
$table->define_baseurl($PAGE->url); $table->define_baseurl($PAGE->url);
if (!$table->is_downloading($download, $exportfilename)) { if (!$table->is_downloading($download, $exportfilename)) {
@ -69,16 +69,16 @@ if (!$table->is_downloading($download, $exportfilename)) {
$pageparams = new mod_attendance_sessions_page_params(); $pageparams = new mod_attendance_sessions_page_params();
$att = new mod_attendance_structure($att, $cm, $course, $context, $pageparams); $att = new mod_attendance_structure($att, $cm, $course, $context, $pageparams);
$output = $PAGE->get_renderer('mod_attendance'); $output = $PAGE->get_renderer('mod_attendance');
$tabs = new attendance_tabs($att, attendance_tabs::TAB_ATRISK); $tabs = new attendance_tabs($att, attendance_tabs::TAB_ABSENTEE);
echo $output->header(); echo $output->header();
echo $output->heading(get_string('attendanceforthecourse', 'attendance').' :: ' .format_string($course->fullname)); echo $output->heading(get_string('attendanceforthecourse', 'attendance').' :: ' .format_string($course->fullname));
echo $output->render($tabs); echo $output->render($tabs);
} else { } else {
echo $OUTPUT->header(); echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('atriskreport', 'mod_attendance')); echo $OUTPUT->heading(get_string('absenteereport', 'mod_attendance'));
if (empty($category)) { if (empty($category)) {
// Only show tabs if displaying via the admin page. // Only show tabs if displaying via the admin page.
$tabmenu = attendance_print_settings_tabs('atrisk'); $tabmenu = attendance_print_settings_tabs('absentee');
echo $tabmenu; echo $tabmenu;
} }
} }

4
classes/structure.php

@ -373,9 +373,9 @@ class mod_attendance_structure {
* @param array $params * @param array $params
* @return moodle_url of report.php for attendance instance * @return moodle_url of report.php for attendance instance
*/ */
public function url_atrisk($params=array()) { public function url_absentee($params=array()) {
$params = array_merge(array('id' => $this->cm->id), $params); $params = array_merge(array('id' => $this->cm->id), $params);
return new moodle_url('/mod/attendance/atrisk.php', $params); return new moodle_url('/mod/attendance/absentee.php', $params);
} }
/** /**

4
lang/en/attendance.php

@ -31,6 +31,7 @@ $string['Lfull'] = 'Late';
$string['Pacronym'] = 'P'; $string['Pacronym'] = 'P';
$string['Pfull'] = 'Present'; $string['Pfull'] = 'Present';
$string['acronym'] = 'Acronym'; $string['acronym'] = 'Acronym';
$string['absenteereport'] = 'Absentee report';
$string['add'] = 'Add'; $string['add'] = 'Add';
$string['addmultiplesessions'] = 'Multiple sessions'; $string['addmultiplesessions'] = 'Multiple sessions';
$string['addwarning'] = 'Add warning'; $string['addwarning'] = 'Add warning';
@ -40,7 +41,6 @@ $string['all'] = 'All';
$string['allcourses'] = 'All courses'; $string['allcourses'] = 'All courses';
$string['allpast'] = 'All past'; $string['allpast'] = 'All past';
$string['allsessions'] = 'All sessions'; $string['allsessions'] = 'All sessions';
$string['atriskreport'] = 'At-risk report';
$string['attendance:addinstance'] = 'Add a new attendance activity'; $string['attendance:addinstance'] = 'Add a new attendance activity';
$string['attendance:canbelisted'] = 'Appears in the roster'; $string['attendance:canbelisted'] = 'Appears in the roster';
$string['attendance:changeattendances'] = 'Changing Attendances'; $string['attendance:changeattendances'] = 'Changing Attendances';
@ -52,7 +52,7 @@ $string['attendance:takeattendances'] = 'Taking Attendances';
$string['attendance:view'] = 'Viewing Attendances'; $string['attendance:view'] = 'Viewing Attendances';
$string['attendance:viewreports'] = 'Viewing Reports'; $string['attendance:viewreports'] = 'Viewing Reports';
$string['attendance:viewsummaryreports'] = 'View course summary reports'; $string['attendance:viewsummaryreports'] = 'View course summary reports';
$string['attendance:warningemails'] = 'Can be subscribed to emails with at-risk users'; $string['attendance:warningemails'] = 'Can be subscribed to emails with absentee users';
$string['attendance_already_submitted'] = 'You may not self register attendance that has already been set.'; $string['attendance_already_submitted'] = 'You may not self register attendance that has already been set.';
$string['attendancedata'] = 'Attendance data'; $string['attendancedata'] = 'Attendance data';
$string['attendanceforthecourse'] = 'Attendance for the course'; $string['attendanceforthecourse'] = 'Attendance for the course';

4
lib.php

@ -483,8 +483,8 @@ function attendance_print_settings_tabs($selected = 'settings') {
get_string('coursesummary', 'attendance'), get_string('coursesummary', 'attendance'), false); get_string('coursesummary', 'attendance'), get_string('coursesummary', 'attendance'), false);
if (get_config('attendance', 'enablewarnings')) { if (get_config('attendance', 'enablewarnings')) {
$tabs[] = new tabobject('atrisk', $CFG->wwwroot . '/mod/attendance/atrisk.php', $tabs[] = new tabobject('absentee', $CFG->wwwroot . '/mod/attendance/absentee.php',
get_string('atriskreport', 'attendance'), get_string('atriskreport', 'attendance'), false); get_string('absenteereport', 'attendance'), get_string('absenteereport', 'attendance'), false);
} }
$tabs[] = new tabobject('resetcalendar', $CFG->wwwroot.'/mod/attendance/resetcalendar.php', $tabs[] = new tabobject('resetcalendar', $CFG->wwwroot.'/mod/attendance/resetcalendar.php',

8
renderables.php

@ -53,8 +53,8 @@ class attendance_tabs implements renderable {
const TAB_UPDATE = 7; const TAB_UPDATE = 7;
/** Warnings tab */ /** Warnings tab */
const TAB_WARNINGS = 8; const TAB_WARNINGS = 8;
/** At-risk tab */ /** Absentee tab */
const TAB_ATRISK = 9; const TAB_ABSENTEE = 9;
/** @var int current tab */ /** @var int current tab */
public $currenttab; public $currenttab;
@ -102,8 +102,8 @@ class attendance_tabs implements renderable {
if (has_capability('mod/attendance:viewreports', $context) && if (has_capability('mod/attendance:viewreports', $context) &&
get_config('attendance', 'enablewarnings')) { get_config('attendance', 'enablewarnings')) {
$toprow[] = new tabobject(self::TAB_ATRISK, $this->att->url_atrisk()->out(), $toprow[] = new tabobject(self::TAB_ABSENTEE, $this->att->url_absentee()->out(),
get_string('atriskreport', 'attendance')); get_string('absenteereport', 'attendance'));
} }
if (has_capability('mod/attendance:export', $context)) { if (has_capability('mod/attendance:export', $context)) {

2
resetcalendar.php

@ -35,7 +35,7 @@ $context = context_system::instance();
// Check permissions. // Check permissions.
require_capability('mod/attendance:viewreports', $context); require_capability('mod/attendance:viewreports', $context);
$exportfilename = 'attendanceatrisk.csv'; $exportfilename = 'attendance-absentee.csv';
$PAGE->set_url('/mod/attendance/resetcalendar.php'); $PAGE->set_url('/mod/attendance/resetcalendar.php');

Loading…
Cancel
Save