Browse Source

Fix #220 remove bulk functions not needed.

MOODLE_32_STABLE
Dan Marsden 8 years ago
parent
commit
53145f724d
  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_DELETE_SELECTED = 4;
const ACTION_CHANGE_DURATION = 5; const ACTION_CHANGE_DURATION = 5;
const ACTION_DELETE_HIDDEN = 6; 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*/ /** @var int view mode of taking attendance page*/
public $action; 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['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['countofselected'] = 'Count of selected';
$string['copyfrom'] = 'Copy attendance data from'; $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'] = 'Create multiple sessions';
$string['createmultiplesessions_help'] = 'This function allows you to create multiple sessions in one simple step. $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. 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['defaults'] = 'Defaults';
$string['defaultdisplaymode'] = 'Default display mode'; $string['defaultdisplaymode'] = 'Default display mode';
$string['delete'] = 'Delete'; $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['deletelogs'] = 'Delete attendance data';
$string['deleteselected'] = 'Delete selected'; $string['deleteselected'] = 'Delete selected';
$string['deletesession'] = 'Delete session'; $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'), $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_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'));
$controls = html_writer::select($options, 'action'); $controls = html_writer::select($options, 'action');
$attributes = array( $attributes = array(

14
sessions.php

@ -132,8 +132,6 @@ switch ($att->pageparams->action) {
echo $OUTPUT->footer(); echo $OUTPUT->footer();
exit; exit;
case mod_attendance_sessions_page_params::ACTION_DELETE_SELECTED: 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); $confirm = optional_param('confirm', null, PARAM_INT);
$message = get_string('deletecheckfull', '', get_string('session', 'attendance')); $message = get_string('deletecheckfull', '', get_string('session', 'attendance'));
@ -144,12 +142,6 @@ switch ($att->pageparams->action) {
$att->delete_sessions($sessionsids); $att->delete_sessions($sessionsids);
attendance_update_users_grade($att); attendance_update_users_grade($att);
redirect($att->url_manage(), get_string('sessiondeleted', 'attendance')); redirect($att->url_manage(), get_string('sessiondeleted', 'attendance'));
} else if ($att->pageparams->action == mod_attendance_sessions_page_params::ACTION_CREATE_CAL_EVENTS) {
attendance_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) {
attendance_delete_calendar_events($sessionsids);
redirect($att->url_manage(), get_string('deletecheckcalevents', 'attendance'));
} }
} }
$sessid = optional_param_array('sessid', '', PARAM_SEQUENCE); $sessid = optional_param_array('sessid', '', PARAM_SEQUENCE);
@ -158,12 +150,6 @@ switch ($att->pageparams->action) {
} }
$sessionsinfo = $att->get_sessions_info($sessid); $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'); $message .= html_writer::empty_tag('br');
foreach ($sessionsinfo as $sessinfo) { foreach ($sessionsinfo as $sessinfo) {
$message .= html_writer::empty_tag('br'); $message .= html_writer::empty_tag('br');

Loading…
Cancel
Save