From 0cfc155d918b3a98a3560fa39f3cfa7bf044bb0c Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Tue, 20 Sep 2016 17:47:08 +1200 Subject: [PATCH] Fix #220 remove bulk functions not needed. --- classes/sessions_page_params.php | 2 -- lang/en/attendance.php | 4 ---- renderer.php | 4 +--- sessions.php | 14 -------------- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/classes/sessions_page_params.php b/classes/sessions_page_params.php index 0731b29..cba5c88 100644 --- a/classes/sessions_page_params.php +++ b/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; diff --git a/lang/en/attendance.php b/lang/en/attendance.php index d1f54ab..e1252ab 100644 --- a/lang/en/attendance.php +++ b/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})?
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'; diff --git a/renderer.php b/renderer.php index ba328f1..ec70c5d 100644 --- a/renderer.php +++ b/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( diff --git a/sessions.php b/sessions.php index 0ffba45..fd07a5d 100644 --- a/sessions.php +++ b/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');