Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-18375

Displaying and selecting dates throughout Moodle should allow the use of multiple calendars

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9.4, 2.3.7, 2.4, 2.5
    • 2.6
    • Calendar
    • 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.
      1. Run phpunit tests and ensure there are no errors.
      Test 2 - Check that installing and updating create expected database columns.
      1. Perform a fresh install and an upgrade to the latest integration branch.
      2. Check that there is a new column in the user and course table called 'calendartype' for both the fresh install and upgrade.
      3. 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'.
      1. Log in as an administrator.
      2. Visit the edit profile page, ensure there is no field with the label 'Preferred calendar'.
      3. 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.
      1. Log in as an administrator.
      2. Visit <yoursite>/user/profile/index.php
      3. Click to add a 'Date/Time' field.
      4. Set the 'Short name' and 'name' field to whatever you like.
      5. Set the 'Start year' to 1950.
      6. Set the 'End year' to 2020.
      7. Click to save changes.
      8. Run the command "git clone https://github.com/markn86/moodle-calendartype_hijri.git hijri" in the folder calendar/type.
      9. Visit the admin/index.php page to install the new plugin.
      10. Visit the edit profile page and ensure there is a field with the label 'Preferred calendar'.
      11. Ensure this field contains the options 'Gregorian' and 'Hijri'.
      12. Scroll down to 'Other fields' and check that the 'Date/Time' field you created earlier is listed there.
      13. Enable this field and check that it is displaying today's date.
      14. Change the date to 16th August 2013.
      15. Scroll back up and change the preferred calendar to 'Hijri'.
      16. Save the user profile page.
      17. 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).
      18. Click to edit your profile again and check that this date is also displayed in the select boxes then save.
      19. Click to edit your profile again and change 'Preferred calendar' back to 'Gregorian' then save.
      20. Click to edit your profile again and check it displays '16th August 2013'.
      21. Click to edit your profile again and change 'Preferred calendar' back to 'Hijri' then save.
      22. Visit <yoursite>/user/profile/index.php.
      23. Click to edit the profile field you created.
      24. Check that the 'Short name' is set to '1369'.
      25. Check that the 'End year' is set to '1441'.
      26. Click 'Save changes'.
      27. Click to edit the profile field you created.
      28. Check that the 'Short name' is set to '1369'.
      29. Check that the 'End year' is set to '1441'.
      30. Visit the edit profile page and change 'Preferred calendar' back to 'Gregorian'.
      31. Visit the settings for the profile field you created.
      32. Check that the 'Short name' is set to '1950'.
      33. Check that the 'End year' is set to '2020'.
      Test 5 - Test dates are saved correctly.
      1. Log in as an administrator.
      2. Visit the edit profile page and set 'Preferred calendar' to 'Hijri'.
      3. Visit a course and create an assignment.
      4. Set the name and description to whatever you want and save.
      5. Go back to edit your profile and change 'Preferred calendar' to 'Gregorian'.
      6. Click to view the assignment and check that dates displayed are today's date.
      Test 6 - Test that the course calendar setting takes preference.
      1. Log in as a student.
      2. Go to edit your profile and set the 'Preferred calendar' to 'Hijri'.
      3. As an administrator do the same to your profile.
      4. As an administrator visit the course settings for a course that student belongs to and set 'Force calendar' to 'Gregorian'.
      5. Visit that course and create an assignment and ensure the dates you can select are in Gregorian.
      6. Click on the assignment as the student and ensure the dates are displayed in Gregorian.
      7. Change the course setting 'Force calendar' to 'Do not force'.
      8. Repeat steps 5-6 but instead check the dates are in Hijri.
      Test 7 - Test that uninstalling the calendar does not break everything.
      1. Log in as an administrator.
      2. Visit the edit profile page and set your 'Preferred calendar' to 'Hijri'.
      3. Do the same as a student.
      4. Visit a course and set 'Force calendar' to 'Hijri'.
      5. As the admin visit <yoursite>/admin/plugins.php and scroll down to 'Calendar types'.
      6. Check that you cannot uninstall the Gregorian calendar type.
      7. Click to uninstall the Hijri calendar.
      8. Once you see the screen saying that it was successful remove the directory calendar/type/hijri.
      9. Click on continue.
      10. Visit your profile page and ensure dates are shown in Gregorian with no warnings.
      11. Visit the course page and ensure dates are shown in Gregorian with no warnings.
      Show
      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.
    • 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

        1. patch.txt
          48 kB
        2. patch.txt
          49 kB
        3. foodle_calendar241.txt
          101 kB
        4. foodle_calendar25_2013051400.08.txt.zip
          21 kB
        5. calendar_block_bug.png
          calendar_block_bug.png
          9 kB

        Issue Links

          Activity

            People

              markn Mark Nelson
              rezaie9 Shamim Rezaie
              Frédéric Massart Frédéric Massart
              Damyon Wiese Damyon Wiese
              Andrew Davis Andrew Davis
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              138 Vote for this issue
              Watchers:
              48 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                18/Nov/13