Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.9.4, 2.3.7, 2.4, 2.5
-
cross platform
-
MOODLE_19_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
-
MOODLE_26_STABLE
-
MDL-18375_master -
Difficult
-
Hide
To tester - this looks like a lot, but it really isn't. The steps have been broken down.
Test 1 - Check all PHPUnit tests pass.
- Run phpunit tests and ensure there are no errors.
Test 2 - Check that installing and updating create expected database columns.
- Perform a fresh install and an upgrade to the latest integration branch.
- Check that there is a new column in the user and course table called 'calendartype' for both the fresh install and upgrade.
- Make sure that the default value for the course is blank and the default for the user is 'gregorian' for both the fresh install and upgrade.
Test 3 - Test that the calendar does not display when there is no other Calendar type besides 'Gregorian'.
- Log in as an administrator.
- Visit the edit profile page, ensure there is no field with the label 'Preferred calendar'.
- Visit a course settings page, ensure there is no field with the label 'Force calendar' under 'Appearance'.
Test 4 - Test the 'Date/Time' user profile field works as expected.
- Log in as an administrator.
- Visit <yoursite>/user/profile/index.php
- Click to add a 'Date/Time' field.
- Set the 'Short name' and 'name' field to whatever you like.
- Set the 'Start year' to 1950.
- Set the 'End year' to 2020.
- Click to save changes.
- Run the command "git clone https://github.com/markn86/moodle-calendartype_hijri.git hijri" in the folder calendar/type.
- Visit the admin/index.php page to install the new plugin.
- Visit the edit profile page and ensure there is a field with the label 'Preferred calendar'.
- Ensure this field contains the options 'Gregorian' and 'Hijri'.
- Scroll down to 'Other fields' and check that the 'Date/Time' field you created earlier is listed there.
- Enable this field and check that it is displaying today's date.
- Change the date to 16th August 2013.
- Scroll back up and change the preferred calendar to 'Hijri'.
- Save the user profile page.
- On the next page check that the 'Date/Time' user profile field is listed and says '10 Shawwāl 1434' (the day may be a 9 depending on your location).
- Click to edit your profile again and check that this date is also displayed in the select boxes then save.
- Click to edit your profile again and change 'Preferred calendar' back to 'Gregorian' then save.
- Click to edit your profile again and check it displays '16th August 2013'.
- Click to edit your profile again and change 'Preferred calendar' back to 'Hijri' then save.
- Visit <yoursite>/user/profile/index.php.
- Click to edit the profile field you created.
- Check that the 'Short name' is set to '1369'.
- Check that the 'End year' is set to '1441'.
- Click 'Save changes'.
- Click to edit the profile field you created.
- Check that the 'Short name' is set to '1369'.
- Check that the 'End year' is set to '1441'.
- Visit the edit profile page and change 'Preferred calendar' back to 'Gregorian'.
- Visit the settings for the profile field you created.
- Check that the 'Short name' is set to '1950'.
- Check that the 'End year' is set to '2020'.
Test 5 - Test dates are saved correctly.
- Log in as an administrator.
- Visit the edit profile page and set 'Preferred calendar' to 'Hijri'.
- Visit a course and create an assignment.
- Set the name and description to whatever you want and save.
- Go back to edit your profile and change 'Preferred calendar' to 'Gregorian'.
- Click to view the assignment and check that dates displayed are today's date.
Test 6 - Test that the course calendar setting takes preference.
- Log in as a student.
- Go to edit your profile and set the 'Preferred calendar' to 'Hijri'.
- As an administrator do the same to your profile.
- As an administrator visit the course settings for a course that student belongs to and set 'Force calendar' to 'Gregorian'.
- Visit that course and create an assignment and ensure the dates you can select are in Gregorian.
- Click on the assignment as the student and ensure the dates are displayed in Gregorian.
- Change the course setting 'Force calendar' to 'Do not force'.
- Repeat steps 5-6 but instead check the dates are in Hijri.
Test 7 - Test that uninstalling the calendar does not break everything.
- Log in as an administrator.
- Visit the edit profile page and set your 'Preferred calendar' to 'Hijri'.
- Do the same as a student.
- Visit a course and set 'Force calendar' to 'Hijri'.
- As the admin visit <yoursite>/admin/plugins.php and scroll down to 'Calendar types'.
- Check that you cannot uninstall the Gregorian calendar type.
- Click to uninstall the Hijri calendar.
- Once you see the screen saying that it was successful remove the directory calendar/type/hijri.
- Click on continue.
- Visit your profile page and ensure dates are shown in Gregorian with no warnings.
- Visit the course page and ensure dates are shown in Gregorian with no warnings.
ShowTo tester - this looks like a lot, but it really isn't. The steps have been broken down. Test 1 - Check all PHPUnit tests pass. Run phpunit tests and ensure there are no errors. Test 2 - Check that installing and updating create expected database columns. Perform a fresh install and an upgrade to the latest integration branch. Check that there is a new column in the user and course table called 'calendartype' for both the fresh install and upgrade. Make sure that the default value for the course is blank and the default for the user is 'gregorian' for both the fresh install and upgrade. Test 3 - Test that the calendar does not display when there is no other Calendar type besides 'Gregorian'. Log in as an administrator. Visit the edit profile page, ensure there is no field with the label 'Preferred calendar'. Visit a course settings page, ensure there is no field with the label 'Force calendar' under 'Appearance'. Test 4 - Test the 'Date/Time' user profile field works as expected. Log in as an administrator. Visit <yoursite>/user/profile/index.php Click to add a 'Date/Time' field. Set the 'Short name' and 'name' field to whatever you like. Set the 'Start year' to 1950. Set the 'End year' to 2020. Click to save changes. Run the command "git clone https://github.com/markn86/moodle-calendartype_hijri.git hijri" in the folder calendar/type. Visit the admin/index.php page to install the new plugin. Visit the edit profile page and ensure there is a field with the label 'Preferred calendar'. Ensure this field contains the options 'Gregorian' and 'Hijri'. Scroll down to 'Other fields' and check that the 'Date/Time' field you created earlier is listed there. Enable this field and check that it is displaying today's date. Change the date to 16th August 2013. Scroll back up and change the preferred calendar to 'Hijri'. Save the user profile page. On the next page check that the 'Date/Time' user profile field is listed and says '10 Shawwāl 1434' (the day may be a 9 depending on your location). Click to edit your profile again and check that this date is also displayed in the select boxes then save. Click to edit your profile again and change 'Preferred calendar' back to 'Gregorian' then save. Click to edit your profile again and check it displays '16th August 2013'. Click to edit your profile again and change 'Preferred calendar' back to 'Hijri' then save. Visit <yoursite>/user/profile/index.php. Click to edit the profile field you created. Check that the 'Short name' is set to '1369'. Check that the 'End year' is set to '1441'. Click 'Save changes'. Click to edit the profile field you created. Check that the 'Short name' is set to '1369'. Check that the 'End year' is set to '1441'. Visit the edit profile page and change 'Preferred calendar' back to 'Gregorian'. Visit the settings for the profile field you created. Check that the 'Short name' is set to '1950'. Check that the 'End year' is set to '2020'. Test 5 - Test dates are saved correctly. Log in as an administrator. Visit the edit profile page and set 'Preferred calendar' to 'Hijri'. Visit a course and create an assignment. Set the name and description to whatever you want and save. Go back to edit your profile and change 'Preferred calendar' to 'Gregorian'. Click to view the assignment and check that dates displayed are today's date. Test 6 - Test that the course calendar setting takes preference. Log in as a student. Go to edit your profile and set the 'Preferred calendar' to 'Hijri'. As an administrator do the same to your profile. As an administrator visit the course settings for a course that student belongs to and set 'Force calendar' to 'Gregorian'. Visit that course and create an assignment and ensure the dates you can select are in Gregorian. Click on the assignment as the student and ensure the dates are displayed in Gregorian. Change the course setting 'Force calendar' to 'Do not force'. Repeat steps 5-6 but instead check the dates are in Hijri. Test 7 - Test that uninstalling the calendar does not break everything. Log in as an administrator. Visit the edit profile page and set your 'Preferred calendar' to 'Hijri'. Do the same as a student. Visit a course and set 'Force calendar' to 'Hijri'. As the admin visit <yoursite>/admin/plugins.php and scroll down to 'Calendar types'. Check that you cannot uninstall the Gregorian calendar type. Click to uninstall the Hijri calendar. Once you see the screen saying that it was successful remove the directory calendar/type/hijri. Click on continue. Visit your profile page and ensure dates are shown in Gregorian with no warnings. Visit the course page and ensure dates are shown in Gregorian with no warnings.
-
100
-
BACKEND Sprint 4
Description
I implemented a patch to add the capability of working with other calendar systems than just Gregorian.
I'll provide the instructions to apply the patch in following post
Attachments
Issue Links
- Discovered while testing
-
MDL-41721 Error while creating user profile field
-
- Closed
-
- has a non-specific relationship to
-
MDL-41792 The calendar itself should display dates depending on the calendar type used
-
- Closed
-
- has been marked as being related by
-
MDL-41664 Add the ability to format the years in the new calendar plugin.
-
- Closed
-
- is duplicated by
-
MDL-39502 persian calendar
-
- Closed
-
- will help resolve
-
MDL-7149 stats don't show day names in course or user language
-
- Closed
-