From a9cfdd639610ddefd4bc49abcedc589574c6435f Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 16 Nov 2016 13:15:45 +1300 Subject: [PATCH] Fix behat failure with calendar link change, tidy up a few warnings. --- add_form.php | 10 ++++++---- classes/calendar_helpers.php | 2 ++ classes/manage_page_params.php | 1 + classes/page_with_filter_controls.php | 1 + classes/preferences_page_params.php | 1 + classes/report_page_params.php | 1 + tests/behat/calendar_features.feature | 4 ++-- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/add_form.php b/add_form.php index d69dfa0..e7bd185 100644 --- a/add_form.php +++ b/add_form.php @@ -22,6 +22,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + require_once($CFG->libdir.'/formslib.php'); /** @@ -66,10 +68,10 @@ class mod_attendance_add_form extends moodleform { break; case VISIBLEGROUPS: $radio = array(); - $radio[] = &$mform->createElement('radio', 'sessiontype', '', - get_string('commonsession', 'attendance'), mod_attendance_structure::SESSION_COMMON); - $radio[] = &$mform->createElement('radio', 'sessiontype', '', - get_string('groupsession', 'attendance'), mod_attendance_structure::SESSION_GROUP); + $radio[] = &$mform->createElement('radio', 'sessiontype', '', get_string('commonsession', 'attendance'), + mod_attendance_structure::SESSION_COMMON); + $radio[] = &$mform->createElement('radio', 'sessiontype', '', get_string('groupsession', 'attendance'), + mod_attendance_structure::SESSION_GROUP); $mform->addGroup($radio, 'sessiontype', get_string('sessiontype', 'attendance'), ' ', false); $mform->setType('sessiontype', PARAM_INT); $mform->addHelpButton('sessiontype', 'sessiontype', 'attendance'); diff --git a/classes/calendar_helpers.php b/classes/calendar_helpers.php index dc0e0f2..b6fd53f 100644 --- a/classes/calendar_helpers.php +++ b/classes/calendar_helpers.php @@ -21,6 +21,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + require_once(dirname(__FILE__).'/../../../calendar/lib.php'); /** diff --git a/classes/manage_page_params.php b/classes/manage_page_params.php index fc8c9cd..93ba64d 100644 --- a/classes/manage_page_params.php +++ b/classes/manage_page_params.php @@ -22,6 +22,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); /** * stores constants/data passed depending on view. * diff --git a/classes/page_with_filter_controls.php b/classes/page_with_filter_controls.php index cadc9f1..e25d529 100644 --- a/classes/page_with_filter_controls.php +++ b/classes/page_with_filter_controls.php @@ -21,6 +21,7 @@ * @copyright 2016 Dan Marsden http://danmarsden.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); /** * base filter controls class - overridden by different views where needed. diff --git a/classes/preferences_page_params.php b/classes/preferences_page_params.php index a7b8be3..9437b4c 100644 --- a/classes/preferences_page_params.php +++ b/classes/preferences_page_params.php @@ -21,6 +21,7 @@ * @copyright 2016 Dan Marsden http://danmarsden.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); /** * base preferences page param class diff --git a/classes/report_page_params.php b/classes/report_page_params.php index e5b77f9..b40ac43 100644 --- a/classes/report_page_params.php +++ b/classes/report_page_params.php @@ -21,6 +21,7 @@ * @copyright 2016 Dan Marsden http://danmarsden.com * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); /** * contains specific data/functions for report_page. diff --git a/tests/behat/calendar_features.feature b/tests/behat/calendar_features.feature index 7520793..8dbe24e 100644 --- a/tests/behat/calendar_features.feature +++ b/tests/behat/calendar_features.feature @@ -30,9 +30,9 @@ Feature: Test the calendar related features in the attendance module | id_sestime_endhour | 02 | And I click on "id_submitbutton" "button" And I follow "Course 1" - And I follow "Go to calendar" + And I follow "Calendar" Then I should see "Test attendance" And I log out And I log in as "student1" - And I follow "Go to calendar" + And I follow "Calendar" Then I should see "Test attendance" \ No newline at end of file -- 2.11.0