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

Support for location on Calendar

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.19, 2.1.8, 2.1.9, 2.1.10, 2.2.5, 2.2.6, 2.2.7, 2.3.2, 2.3.3, 2.3.4, 2.4, 2.4.1, 3.4, 3.5
    • Fix Version/s: 3.6
    • Component/s: Calendar
    • Testing Instructions:
      Hide

      Testing backup and restore

      NOTE:  This set up part should be tested BEFORE upgrading to this issue's branch, since it requires a backup from a site without location support.**

      Set up (creating an 'old' backup)

      1. Open your terminal and go to your Moodle instance's root directory and checkout the latest weekly release:

        git checkout f61ee4e857a894a5b8b69516b00be88ae499964b
        

      2. Log into your test Moodle site as an admin.
        Note: If ever you encounter an error indicating that you are running an older version of the code, simply run "mdk run version" and refresh the page.
      3. Create a course called calcourse1.
      4. Open the course, and click on Calendar, to open the course's calendar.
      5. Click New event, add an event with title 'backup event', Type of event 'Course' and click Save.
      6. Navigate to the calcourse1 course view page.
      7. Click the settings cog at the top right and click Backup from the dropdown options.
      8. Ensure 'Include calendar events' is checked, then click 'Jump to final step'.
      9. Once the backup is created, click continue.
      10. Under Course backup area, note down the Filename of the backup you have just performed.
      11. Navigate back to the Calendar for calcourse1.
      12. Click on the 'backup event' event you created earlier.
      13. In the modal popup, click Delete and then Delete event in the confirmation prompt.
      14. CONFIRM the event no longer exists in the calendar.
      15. Check out this issue's branch (MDL-37624-master).

      Testing old backups can be restored

      1. Reset the codebase with the patch now applied.

        git checkout master
        

      2. Log into your test Moodle site as an admin, performing the site upgrade steps that will prompt you after switching to the latest version of the branch.
      3. Navigate to the calcourse1 course view page.
      4. Click the settings cog at the top right and click Restore from the dropdown options.
      5. Under Course backup area, find the filename of the backup you performed in the setup above.
      6. Click Restore for that backup.
      7. Scroll down and click Continue on the page that loads.
      8. Under 'Restore into this course', click Continue.
      9. Ensure 'Include calendar events' is checked, then click Next.
      10. Scroll down and click Next.
      11. Scroll down and click Perform restore.
      12. Once the restore completes, click Continue, which will redirect you to the course view page.
      13. Open the Calendar.
      14. CONFIRM the 'backup event' event is displayed in the calendar.
      15. Click the 'backup event' event, CONFIRM the details appear correct in the modal popup, and CONFIRM the location row is NOT visible.
      16. Click Edit, then click 'Show more...'.
      17. CONFIRM the Location input is visible, but empty.
      18. Type 'Test location' into the location input, then click Save.
      19. Click the 'backup event' event again, and CONFIRM the location row is now visible, with the text 'Test location'.

      Note: Keep this course/event to be used for the next test.

      Testing location is backed up and restored
      Set up (Creating a backup with location)
      Note: This follows on directly from the above test.

      1. Log into your test Moodle site as an admin (if you are not still logged in from the previous test).
      2. Repeat steps 6-14 of "Set up (creating an 'old' backup)" above. (You result should be you perform a backup, then delete the 'backup event' calendar event).

      Testing backups restore events with location

      1. Repeat steps 1-13 from "Testing old backups can be restored" above (this should restore the 'backup event' event into the course calendar).
      2. Click the 'backup event' event, and CONFIRM the details appear correct in the modal popup, and CONFIRM location row is visible, with the text 'Test location'.

      Testing add/edit calendar entries

      1. Log into your test Moodle site as an admin user, ensure Boost theme is active.
      2. Click calendar in the navigation on the left of the page.
      3. Click New event button.
      4. Click Show more... and populate as follows: Event title 'user event', Date (today's date), Type of event 'User', Description 'user description', Event location 'https://moodle.org, event location'.
      5. Click Save button.
      6. CONFIRM 'user event' appears in the calendar for today's date.
      7. Click 'user event' event, to open the event.
      8. CONFIRM modal popup appears, including the location. Location should have an icon, and the text you typed above in plain text.
      9. Return to the test site tab, and click the edit button in the modal popup, then click Show more...
      10. CONFIRM all details appear as you input them earlier.
      11. Switch the site theme to Clean.
      12. Return to the calendar, and click on your test 'user event'.
      13. Click the Edit button, then Show more....
      14. Remove all text from Event location and click the Save button.
      15. Click 'user event' event, to reopen the modal popup, and CONFIRM the location row is not showing at all, now that no location is set.
      16. Create events for the remaining 3 event types, Course, Category and Site, using the details from step 4 above, replacing the title/description as appropriate.
      17. View the calendar entries for each, with a user that has appropriate access to view them (for example Course, using a student enrolled in the course). In each case, CONFIRM they appear as expected in all cases.
      18. Log in as the admin user. Switch the site theme to Clean.
      19. Open a calendar event containing a location, CONFIRM the modal popup, as well as Edit screens still show the location correctly (the modal should show a map tag icon for both Clean and Boost themes).
      20. Remove the location from the event and save.
      21. Reopen the even and CONFIRM the modal popup no longer shows a location row, now the location has been removed from the event.

      Testing import calendar

      1. Download the attached testimport.ics file, which contains some sample events.
      2. Log into your test Moodle site as any user (referred to below as user1) that has no existing User calendar events in June 2018 (or remove any that exist - this is to make the next test easier).
      3. Click the calendar navigation item.
      4. On the calendar screen, click the Manage subscriptions button at the bottom of the page.
      5. Set _Calendar name' as 'Test calendar import', Import from as _Calendar file (.ics).
      6. For Calender file, click the Choose a file... button, Browse... and find/select the testimport.ics you downloaded earlier, click open, then click the Upload this file button.
      7. Click the _Add_button at the bottom of the page. CONFIRM the confirmation at the top of the page says "Events imported: 2" and "Events updated: 0".
      8. Click Calendar in the left navigation to return to the calendar page.
      9. If the calendar does not display June 2018, navigate to that month, where you should see tests 1 and 2 listed in order, one in 2nd and one in 3rd June.
      10. Open each test, first looking at the modal popup, then clicking Edit>Show more..., CONFIRMING as follows:
      • Test 1- Has location: CONFIRM modal popup and edit both show location as 'Some text location'.
      • Test 2 - Empty location: CONFIRM location row is omitted from modal popup, Edit screen shows an empty input for Event location.

      Testing export calendar

      1. Log into your test Moodle site as user1 from above (since they only have two test events in June 2018, with and without location).
      2. Navigate to Calendar in the left site navigation.
      3. Ensure you are viewing the June 2018 calendar.
      4. Click the Export calendar button at the bottom of the page.
      5. Select Events to export My personal events, and Time period This month.
      6. Click the Export button and save the .ics file.
      7. Find the icalexport.ics file you have just downloaded on your computer.
      8. Import the .ics file into your preferred calendar/email app, and CONFIRM the two events exist, and contain the same details that exist within the calendar on your test Moodle site. NOTE: If you do not wish to import these, you can open the .ics file in a text editor and confirm the details, it is just harder to read in that format.
      9. You can then delete the two events from your calendar app.

      Testing export request (GDPR)

      1. Log into your test Moodle site as an admin user.
      2. Visit https://docs.moodle.org/35/en/Data_privacy_plugin (referred to below as link1)
      3. Follow the instructions from link1 under Privacy Officer role.
      4. Add two new User calendar events to your admin's calendar, one with a location and one without.
      5. Follow the Data requests instructions from link1.
      6. Run the cron on your Moodle site (so the request is submitted). This is executed by navigating to your wwwroot, and running: php admin/cli/cron.php
      7. Follow the Responding to data requests instructions from link1, and approve your request.
      8. Run the cron on your moodle site again, using the command mentionded above. (this completes the approval).
      9. On the top right of the page, click the admin user's name, and then click Profile in the dropdown.
      10. Under Privacy and policies, click Data requests.
      11. Your recent request should apper with the Complete status. On that row, click Actions, and then Download from the dropdown.
      12. Save the export.zip file.
      13. Open the zip file, find the "User {Admin User n}/Calendar/Events" folder.
      1. This will list folders for each date/time where a user calendar exists. Find and open the entries for the two User calendar events you created for this test.
      2. CONFIRM the details match your calendar entries (in particular, that the location field exists for both, matches your entry for location, and has empty string where you did not enter a location).
      Show
      Testing backup and restore NOTE:     This set up part should be tested BEFORE upgrading to this issue's branch, since it requires a backup from a site without location support. ** Set up (creating an 'old' backup) Open your terminal and go to your Moodle instance's root directory and checkout the latest weekly release: git checkout f61ee4e857a894a5b8b69516b00be88ae499964b Log into your test Moodle site as an admin. Note: If ever you encounter an error indicating that you are running an older version of the code, simply run "mdk run version" and refresh the page. Create a course called calcourse1. Open the course, and click on Calendar, to open the course's calendar. Click New event, add an event with title 'backup event', Type of event 'Course' and click Save. Navigate to the calcourse1 course view page. Click the settings cog at the top right and click Backup from the dropdown options. Ensure 'Include calendar events' is checked, then click 'Jump to final step'. Once the backup is created, click continue. Under Course backup area, note down the Filename of the backup you have just performed. Navigate back to the Calendar for calcourse1. Click on the 'backup event' event you created earlier. In the modal popup, click Delete and then Delete event in the confirmation prompt. CONFIRM the event no longer exists in the calendar. Check out this issue's branch ( MDL-37624 -master). Testing old backups can be restored Reset the codebase with the patch now applied. git checkout master Log into your test Moodle site as an admin, performing the site upgrade steps that will prompt you after switching to the latest version of the branch. Navigate to the calcourse1 course view page. Click the settings cog at the top right and click Restore from the dropdown options. Under Course backup area, find the filename of the backup you performed in the setup above. Click Restore for that backup. Scroll down and click Continue on the page that loads. Under 'Restore into this course', click Continue. Ensure 'Include calendar events' is checked, then click Next. Scroll down and click Next. Scroll down and click Perform restore. Once the restore completes, click Continue, which will redirect you to the course view page. Open the Calendar. CONFIRM the 'backup event' event is displayed in the calendar. Click the 'backup event' event, CONFIRM the details appear correct in the modal popup, and CONFIRM the location row is NOT visible. Click Edit, then click 'Show more...'. CONFIRM the Location input is visible, but empty. Type 'Test location' into the location input, then click Save. Click the 'backup event' event again, and CONFIRM the location row is now visible, with the text 'Test location'. Note: Keep this course/event to be used for the next test. Testing location is backed up and restored Set up (Creating a backup with location) Note: This follows on directly from the above test. Log into your test Moodle site as an admin (if you are not still logged in from the previous test). Repeat steps 6-14 of "Set up (creating an 'old' backup)" above. (You result should be you perform a backup, then delete the 'backup event' calendar event). Testing backups restore events with location Repeat steps 1-13 from "Testing old backups can be restored" above (this should restore the 'backup event' event into the course calendar). Click the 'backup event' event, and CONFIRM the details appear correct in the modal popup, and CONFIRM location row is visible, with the text 'Test location'. Testing add/edit calendar entries Log into your test Moodle site as an admin user, ensure Boost theme is active. Click calendar in the navigation on the left of the page. Click New event button. Click Show more... and populate as follows: Event title 'user event', Date (today's date), Type of event 'User', Description 'user description', Event location 'https://moodle.org, event location'. Click Save button. CONFIRM 'user event' appears in the calendar for today's date. Click 'user event' event, to open the event. CONFIRM modal popup appears, including the location. Location should have an icon, and the text you typed above in plain text. Return to the test site tab, and click the edit button in the modal popup, then click Show more... CONFIRM all details appear as you input them earlier. Switch the site theme to Clean. Return to the calendar, and click on your test 'user event'. Click the Edit button, then Show more... . Remove all text from Event location and click the Save button. Click 'user event' event, to reopen the modal popup, and CONFIRM the location row is not showing at all, now that no location is set. Create events for the remaining 3 event types, Course, Category and Site, using the details from step 4 above, replacing the title/description as appropriate. View the calendar entries for each, with a user that has appropriate access to view them (for example Course, using a student enrolled in the course). In each case, CONFIRM they appear as expected in all cases. Log in as the admin user. Switch the site theme to Clean. Open a calendar event containing a location, CONFIRM the modal popup, as well as Edit screens still show the location correctly (the modal should show a map tag icon for both Clean and Boost themes). Remove the location from the event and save. Reopen the even and CONFIRM the modal popup no longer shows a location row, now the location has been removed from the event. Testing import calendar Download the attached testimport.ics file, which contains some sample events. Log into your test Moodle site as any user (referred to below as user1) that has no existing User calendar events in June 2018 (or remove any that exist - this is to make the next test easier). Click the calendar navigation item. On the calendar screen, click the Manage subscriptions button at the bottom of the page. Set _Calendar name' as 'Test calendar import', Import from as _Calendar file (.ics). For Calender file, click the Choose a file... button, Browse... and find/select the testimport.ics you downloaded earlier, click open , then click the Upload this file button. Click the _Add_button at the bottom of the page. CONFIRM the confirmation at the top of the page says "Events imported: 2" and "Events updated: 0". Click Calendar in the left navigation to return to the calendar page. If the calendar does not display June 2018, navigate to that month, where you should see tests 1 and 2 listed in order, one in 2nd and one in 3rd June. Open each test, first looking at the modal popup, then clicking Edit>Show more..., CONFIRMING as follows: Test 1- Has location: CONFIRM modal popup and edit both show location as 'Some text location'. Test 2 - Empty location: CONFIRM location row is omitted from modal popup, Edit screen shows an empty input for Event location . Testing export calendar Log into your test Moodle site as user1 from above (since they only have two test events in June 2018, with and without location). Navigate to Calendar in the left site navigation. Ensure you are viewing the June 2018 calendar. Click the Export calendar button at the bottom of the page. Select Events to export My personal events , and Time period This month . Click the Export button and save the .ics file. Find the icalexport.ics file you have just downloaded on your computer. Import the .ics file into your preferred calendar/email app, and CONFIRM the two events exist, and contain the same details that exist within the calendar on your test Moodle site. NOTE: If you do not wish to import these, you can open the .ics file in a text editor and confirm the details, it is just harder to read in that format. You can then delete the two events from your calendar app. Testing export request (GDPR) Log into your test Moodle site as an admin user. Visit https://docs.moodle.org/35/en/Data_privacy_plugin (referred to below as link1) Follow the instructions from link1 under Privacy Officer role . Add two new User calendar events to your admin's calendar, one with a location and one without. Follow the Data requests instructions from link1. Run the cron on your Moodle site (so the request is submitted). This is executed by navigating to your wwwroot, and running: php admin/cli/cron.php Follow the Responding to data requests instructions from link1, and approve your request. Run the cron on your moodle site again, using the command mentionded above. (this completes the approval). On the top right of the page, click the admin user's name, and then click Profile in the dropdown. Under Privacy and policies , click Data requests . Your recent request should apper with the Complete status. On that row, click Actions , and then Download from the dropdown. Save the export.zip file. Open the zip file, find the "User {Admin User n}/Calendar/Events" folder. This will list folders for each date/time where a user calendar exists. Find and open the entries for the two User calendar events you created for this test. CONFIRM the details match your calendar entries (in particular, that the location field exists for both, matches your entry for location, and has empty string where you did not enter a location).
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull Master Branch:
      MDL-37624-master

      Description

      We import calendars from url's in our new 2.4.1+ environment (and we are happy it is possible now).
      We get the Title of the event and we get the time slot and note, but no location.
      Location is in the file.

      It seems Moodle does not support location at all - this should be changed.

        Attachments

        1. 1.PNG
          1.PNG
          74 kB
        2. 2.PNG
          2.PNG
          110 kB
        3. 3.PNG
          3.PNG
          87 kB
        4. 4.PNG
          4.PNG
          97 kB
        5. a.PNG
          a.PNG
          96 kB
        6. b.PNG
          b.PNG
          142 kB
        7. c.PNG
          c.PNG
          139 kB
        8. d.PNG
          d.PNG
          121 kB
        9. location.png
          location.png
          0.3 kB
        10. location.svg
          0.3 kB
        11. Screen shot 2013-01-23 at 13.17.59 .png
          Screen shot 2013-01-23 at 13.17.59 .png
          27 kB
        12. Screen shot 2013-01-23 at 13.18.31 .png
          Screen shot 2013-01-23 at 13.18.31 .png
          35 kB
        13. Screenshot from 2018-07-04 14-03-19.png
          Screenshot from 2018-07-04 14-03-19.png
          48 kB
        14. testimport.ics
          1 kB

          Issue Links

            Activity

              People

              • Votes:
                27 Vote for this issue
                Watchers:
                22 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Dec/18

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 20 minutes
                  2h 20m