1
0
mirror of https://github.com/moodle/moodle.git synced 2025-03-26 18:42:40 +01:00

1591 Commits

Author SHA1 Message Date
Ilya Tregubov
192211b51d Merge branch 'MDL-71954-master' of git://github.com/rezaies/moodle 2021-08-19 09:10:16 +02:00
Víctor Déniz
1e9118f4d6 MDL-71500 calendar_threemonth: fix wrong behat step 2021-08-12 11:35:31 +01:00
Eloy Lafuente (stronk7)
962b7f56a8 Merge branch 'MDL-71500-master' of git://github.com/lameze/moodle 2021-08-11 20:10:40 +02:00
Ilya Tregubov
3d2e6b7932 Merge branch 'MDL-71946-master' of git://github.com/dcai/moodle 2021-07-27 13:41:05 +02:00
Jun Pataleta
68fa468885 MDL-71817 calendar: Use root node to find the target elements
Instead of passing querying for the root element again by its ID
which changed in this issue, use the already existing root element
at the beginning of this Mustache JS code. It also makes maintenance
simpler in the future.
2021-07-22 17:39:01 +08:00
Jun Pataleta
68bd3a1158 Merge branch 'MDL-71817-master' of git://github.com/lameze/moodle 2021-07-22 11:27:08 +08:00
Jun Pataleta
8a2c797cc0 MDL-71817 calendar: Set the calendar view mode properly for month view
* Store the view mode of the calendar in the calendar_information
   object.
 * Let the month exporter handle the production of context data by
   moving 'viewingmonth', 'showviewselector', and 'viewinginblock'
   inside it.
 * Set the proper calendar view mode in the core_calendar/month_detailed
   template.
 * Pass the calendar view mode to the
   core_calendar_get_calendar_monthly_view WS function.
2021-07-22 09:04:44 +08:00
Simey Lameze
d748c71693 MDL-71817 calendar: change the calendar heading to h4 in the block
This commit adds the logic that change the size of the calendar
header depending if the user is viewing in the block or in the
full view.
2021-07-22 09:04:44 +08:00
Simey Lameze
b0133904bf MDL-71817 calendar: behat changes for calendar block
This commit does few things:

1) Remove unnecessary "I hover over today in the calendar"
steps as it's not necessary to hover onto the day to see the events
any more.

2) Replace "I follow This month" steps to "I follow Full calendar"

3) Update i_create_a_calendar_event_with_form_data() to use the new
fullcalendar lang string.
2021-07-22 09:00:30 +08:00
Jun Pataleta
73a14b1075 MDL-71817 calendar: Fix duplicate IDs for multiple calendar blocks
Done by:
* Designating instance IDs for each month_exporter instances and
assigning these instance IDs in templates.
* Adding the instance ID as an optional parameter for the
core_calendar_renderer::course_filter_selector() to generate
course filters with unique element IDs.
2021-07-22 08:46:01 +08:00
Simey Lameze
f0897dce80 MDL-71817 calendar: clicking on day link should redirect to day view
This patch prevents the full day view to be loaded
in the calendar block as this won't be supported.
When clicking in the day link it will redirect the
user to day view in the full calendar.
2021-07-22 08:46:01 +08:00
Simey Lameze
2e11059734 MDL-71817 calendar: make calendar block look like full calendar
This commit does few things:

1) Removes .path-calendar specificity styles from full view can
work on the Dashboard.

2) The new event button colour has been changed to btn-primary.

3) CSS fix to make the calendar controls inline on small block.
2021-07-22 08:46:01 +08:00
Simey Lameze
47ca6c017a MDL-71817 calendar: remove year from prev/next links 2021-07-22 08:46:01 +08:00
Simey Lameze
98612827b0 MDL-71817 calendar: only update url on full view
This patch prevents the URL from being updated on the calendar
block. It only updates the url if viewing the full calendar.
2021-07-22 08:46:01 +08:00
Simey Lameze
d2f612ab24 MDL-71817 block_calendar_month: load month view in the block 2021-07-22 08:46:01 +08:00
Michael Hawkins
dffe445923 MDL-72154 calendar: Add manage subscription to export page breadcrumbs 2021-07-21 16:41:13 +08:00
Michael Hawkins
45fc997e84 MDL-72154 calendar: Remove unnecessary strings/link from import page 2021-07-21 16:41:13 +08:00
Shamim Rezaie
c96d24be88 MDL-71954 calendar: improve form validation
For client-side validation benefits refer to
https://www.w3.org/WAI/tutorials/forms/validation/#client-side-validation-benefits
2021-07-21 02:38:10 +10:00
boygr49p
897300cbbd MDL-71500 calendar_threemonth: add behat step and coverage 2021-07-16 14:46:51 +08:00
boygr49p
15e311a1fd MDL-71500 calendar_threemonth: clicking in a diff day should refresh day view
Clicking in a day in the three month block replaces the div with id starting
with calendar- so we can do so repeatedly and successfully and test that it does (with behat).
2021-07-16 14:46:40 +08:00
Eloy Lafuente (stronk7)
f861b7a9bf Merge branch 'MDL-71788-master-fix' of git://github.com/junpataleta/moodle 2021-07-15 16:13:11 +08:00
Jun Pataleta
6c131ead99 Merge branch 'MDL-71775-master' of git://github.com/lameze/moodle 2021-07-15 16:10:48 +08:00
Jun Pataleta
a067fc1df1 MDL-71788 calendar: Remove ready state listener
Adding a document ready state change listener might be too late by the
time this AMD module gets loaded. So there's really no point listening
for it. It's better to enable the Copy URL button by the time this
the calendar export module gets loaded since at this point, the
copy to clipboard JS module would have been loaded as well.
2021-07-15 14:55:16 +08:00
Simey Lameze
f58750c2a5 MDL-71775 block_calendar_month: add footer options 2021-07-15 10:20:54 +08:00
Eloy Lafuente (stronk7)
43d77b9574 Merge branch 'MDL-71788-master-7' of git://github.com/junpataleta/moodle 2021-07-15 02:58:31 +02:00
Huong Nguyen
48d21af177 MDL-71790 calendar: Revamp the manage subscriptions page 2021-07-13 13:21:20 +07:00
Dongsheng Cai
ff035c0aa7 MDL-71790 calendar: Create a new calendar import page
The commit was originally from MDL-71808
2021-07-13 13:19:57 +07:00
Dongsheng Cai
a4de29ced3 MDL-71978 core_calendar: only allow owner to edit user subscriptions 2021-07-08 23:30:34 +02:00
Jun Pataleta
5c70150450 MDL-71788 calendar: Make it easier to copy the calendar URL
Converted the Calendar URL string to a read-only text input containing
the calendar URL. Pressing the "Copy URL" button will copy the calendar
URL to the clipboard.
Fixed Behat tests as well for the export feature. With the calendar URL
in a text input that clips the whole URL, the `preset_what` URL
parameter cannot be seen by the "I should see" step. Worked around
this by checking that the actual value attribute of the calendar URL
text input contains the preset_what parameter.

Plus: Deprecate the calendarurl string. It will be replaced by a new
lang string that does not contain the actual calendar URL.
2021-07-08 12:33:55 +08:00
Andrew Nicols
1cb50a3a7d Merge branch 'MDL-71771-master' of git://github.com/HuongNV13/moodle 2021-07-01 10:11:14 +08:00
Sara Arjona
fd0321eede Merge branch 'MDL-67208-master' of git://github.com/lameze/moodle 2021-06-30 16:55:31 +02:00
Sara Arjona
6ec8364449 Merge branch 'MDL-71789-master' of git://github.com/lameze/moodle 2021-06-30 16:29:33 +02:00
Dongsheng Cai
2f9e38a6fb MDL-71946 core_calendar: remove icons from calendar events 2021-06-28 18:58:56 +10:00
Simey Lameze
1834f1c9ce MDL-67208 calendar: fix manage subscription redirection
This patch fix the subcription page only adding the course parameter
only when viewing the calendar on course context. It also passes the
url to the form instance, so we have the course parameter on the
form action attribute.
2021-06-24 16:32:59 +08:00
Andrew Nicols
fa0ce04e63 Merge branch 'MDL-71837' of git://github.com/paulholden/moodle 2021-06-24 10:58:12 +08:00
Huong Nguyen
2140d3e55c MDL-71771 core_calendar: Convert the calendar footer buttons to links 2021-06-23 09:41:04 +07:00
Simey Lameze
29979f21ed MDL-71789 calendar: fix subscription url validation 2021-06-23 07:46:46 +08:00
Andrew Nicols
4f422785c6 MDL-71113 javascript: Improve basic JS Documentation 2021-06-18 09:38:05 +08:00
Andrew Nicols
92179b7057 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Paul Holden
2f6e07d240 MDL-71837 calendar: turn off export form double submit protection. 2021-06-02 19:50:38 +01:00
Andrew Nicols
acd9d9823b MDL-70990 core_form: Replace FORM_SUBMIT_AJAX event
The legacy M.core.event.FORM_SUBMIT_AJAX ecent has been replaced with a
new core_form/events::formSubmittedByJavascript native DOM event.

The new event can be listened to at any point in the DOM using the
following syntax:

```
import {eventTypes} from 'core_form/events';

document.addEventListener(eventTypes.formSubmittedByJavascript, handler);
```

A backward-compatabibility layer is included to ensure that any
legacy YUI event triggered on a form is still respected and the new
native event is also fired.

A similar handler is also included to ensure that any legacy YUI event
listener is still called with the same arguments.

These legacy bridges will be removed after Moodle 4.3.
2021-05-26 10:46:49 +08:00
Marina Glancy
b46badb130 MDL-70926 core: getuserdate() shoud show debugging if null was passed
passing null to getdate() has different results in PHP7 and PHP8
2021-05-06 19:55:32 +02:00
Marina Glancy
8974874018 MDL-71051 core_user: create user profile field form is now modal form 2021-04-28 11:47:22 +02:00
Marina Glancy
4a159a0947 MDL-71051 core_user: move user profile edit field form to classes 2021-04-28 11:47:22 +02:00
Simey Lameze
5b0282847e MDL-71156 core: machinery to recover orphaned calendar events
The machinery to fix orphaned calendar events that were broken by MDL-67494.

The solution consists of:

1) Upgrade step that checks if this site has executed the problematic upgrade steps and
   if positive, it will schedule a new run for calendar_fix_orphaned_events adhoc task.

2) Adhoc task that will self-spawn calling the recovery machinery, running until
   all the orphaned calendar events are fixed. It also sets the maximum runtime of
   60 seconds. It is also possible to override that number by specifing the desired
   number setting the ->calendareventsmaxseconds in your config.php

3) CLI script that will look for all the calendar events which userids
   where broken by a wrong upgrade step, affecting to Moodle 3.9.5
   and up.

   It performs checks to both:
     a) Detect if the site was affected (ran the wrong upgrade step).
     b) Look for orphaned calendar events, categorising them as:
       - standard: site / category / course / group / user events
       - subscription: events created via subscriptions.
       - action: normal action events, created to show common important dates.
       - override: user and group override events, particular, that some activities support.
       - custom: other events, not being any of the above, common or particular.

   By specifying it (--fix) try to recover as many broken events (missing userid) as
   possible. Standard, subscription, action, override events in core are fully supported but
   override or custom events should be fixed by each plugin as far as there isn't any standard
   API (plugin-wise) to launch a rebuild of the calendar events.

4) Unit tests and helper functions to generate calendar events. We have decided to
   keep the tests simple, testing only true and false and not using data generators because
   the code is purely to recover the calendar events and won't turn into an API or something
   and also due to the urgency of this issue.
   The helpers have been created in calendar/tests/helpers.php since there are no data generators
   for calendar.
2021-04-22 10:28:52 +08:00
Simey Lameze
beff5c6685 MDL-71182 calendar: add logic for category events in get_context
This commit adds the missing logic for category events in
get_context() method. Without this fix, users will get errors
if they have category events with userid set to 0.
2021-03-24 17:31:33 +08:00
Simey Lameze
1fcd850859 MDL-71182 calendar: Revert "Merge branch 'MDL-67494-master' of git://github.com/lameze/moodle"
This reverts commit 9d58d4de46e9415eb4ac405a340381de44c510c1, reversing
changes made to 535c0277de3547f02d94959fbe103e44a6706d4e.
2021-03-24 09:11:01 +08:00
Adrian Greeve
8790de8fcf Merge branch 'MDL-70924' of git://github.com/paulholden/moodle 2021-03-18 11:53:58 +08:00
Eloy Lafuente (stronk7)
cfba0366db Merge branch 'MDL-70893-master' of git://github.com/marinaglancy/moodle 2021-03-18 00:23:26 +01:00
Paul Holden
584f874e50 MDL-70924 course: ensure required fields present when getting courses. 2021-03-15 12:46:27 +00:00