Browse Source

Fix #220 remove bulk functions not needed.

MOODLE_31_STABLE
Dan Marsden 8 years ago
parent
commit
0cfc155d91
  1. 2
      classes/sessions_page_params.php
  2. 4
      lang/en/attendance.php
  3. 4
      renderer.php
  4. 14
      sessions.php

2
classes/sessions_page_params.php

@ -36,8 +36,6 @@ class mod_attendance_sessions_page_params {
const ACTION_DELETE_SELECTED = 4;
const ACTION_CHANGE_DURATION = 5;
const ACTION_DELETE_HIDDEN = 6;
const ACTION_CREATE_CAL_EVENTS = 7;
const ACTION_DELETE_CAL_EVENTS = 8;
/** @var int view mode of taking attendance page*/
public $action;

4
lang/en/attendance.php

@ -77,8 +77,6 @@ $string['commonsessions'] = 'All students';
$string['confirmdeleteuser'] = 'Are you sure you want to delete user \'{$a->fullname}\' ({$a->email})?<br/>All of their attendance records will be permanently deleted.';
$string['countofselected'] = 'Count of selected';
$string['copyfrom'] = 'Copy attendance data from';
$string['createcalevents'] = 'Create calendar events';
$string['createcheckcalevents'] = 'Are you sure you want to create the calendar events for the following sessions?';
$string['createmultiplesessions'] = 'Create multiple sessions';
$string['createmultiplesessions_help'] = 'This function allows you to create multiple sessions in one simple step.
The sessions begin on the date of the base session and continue until the \'repeat until\' date.
@ -92,8 +90,6 @@ $string['days'] = 'Days';
$string['defaults'] = 'Defaults';
$string['defaultdisplaymode'] = 'Default display mode';
$string['delete'] = 'Delete';
$string['deletecalevents'] = 'Delete calendar events';
$string['deletecheckcalevents'] = 'Are you absolutely sure you want to delete the calendar events for the following sessions?';
$string['deletelogs'] = 'Delete attendance data';
$string['deleteselected'] = 'Delete selected';
$string['deletesession'] = 'Delete session';

4
renderer.php

@ -320,9 +320,7 @@ class mod_attendance_renderer extends plugin_renderer_base {
}
$options = array(mod_attendance_sessions_page_params::ACTION_DELETE_SELECTED => get_string('delete'),
mod_attendance_sessions_page_params::ACTION_CHANGE_DURATION => get_string('changeduration', 'attendance'),
mod_attendance_sessions_page_params::ACTION_CREATE_CAL_EVENTS => get_string('createcalevents', 'attendance'),
mod_attendance_sessions_page_params::ACTION_DELETE_CAL_EVENTS => get_string('deletecalevents', 'attendance'));
mod_attendance_sessions_page_params::ACTION_CHANGE_DURATION => get_string('changeduration', 'attendance'));
$controls = html_writer::select($options, 'action');
$attributes = array(

14
sessions.php

@ -133,8 +133,6 @@ switch ($att->pageparams->action) {
echo $OUTPUT->footer();
exit;
case mod_attendance_sessions_page_params::ACTION_DELETE_SELECTED:
case mod_attendance_sessions_page_params::ACTION_CREATE_CAL_EVENTS:
case mod_attendance_sessions_page_params::ACTION_DELETE_CAL_EVENTS:
$confirm = optional_param('confirm', null, PARAM_INT);
$message = get_string('deletecheckfull', '', get_string('session', 'attendance'));
@ -145,12 +143,6 @@ switch ($att->pageparams->action) {
$att->delete_sessions($sessionsids);
attendance_update_users_grade($att);
redirect($att->url_manage(), get_string('sessiondeleted', 'attendance'));
} else if ($att->pageparams->action == mod_attendance_sessions_page_params::ACTION_CREATE_CAL_EVENTS) {
create_calendar_events($sessionsids);
redirect($att->url_manage(), get_string('createcheckcalevents', 'attendance'));
} else if ($att->pageparams->action == mod_attendance_sessions_page_params::ACTION_DELETE_CAL_EVENTS) {
delete_calendar_events($sessionsids);
redirect($att->url_manage(), get_string('deletecheckcalevents', 'attendance'));
}
}
$sessid = optional_param_array('sessid', '', PARAM_SEQUENCE);
@ -159,12 +151,6 @@ switch ($att->pageparams->action) {
}
$sessionsinfo = $att->get_sessions_info($sessid);
if ($att->pageparams->action == mod_attendance_sessions_page_params::ACTION_CREATE_CAL_EVENTS) {
$message = get_string('createcheckcalevents', 'attendance');
} else if ($att->pageparams->action == mod_attendance_sessions_page_params::ACTION_DELETE_CAL_EVENTS) {
$message = get_string('deletecheckcalevents', 'attendance');
}
$message .= html_writer::empty_tag('br');
foreach ($sessionsinfo as $sessinfo) {
$message .= html_writer::empty_tag('br');

Loading…
Cancel
Save