Squashed commit of the following:
commit 2c2164a7e27bd2b81102251420892386e39edecc
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date: Tue Aug 20 12:59:47 2013 +0100
MDL-40347 theme: Modified upgrade.txt and created bootstrapbase/upgrade.txt.
commit 4449975a0f9249785ed152f63786bf7974c1776e
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date: Tue Aug 13 18:42:20 2013 +0100
MDL-40347 grade/report/grader: added RTL css previously in bootstrapbase/less/moodle/grade.less to styles.css
commit b0af8f05a411b3dbb1d9c162a0d65c7f9c069c0f
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date: Tue Aug 13 12:42:02 2013 +0100
MDL-40347_M26 grade/report/grader: cleaned up grade/report/grader/styles.css.
commit 52627137dc662d47cbfdf023d056baf102f29d8a
Author: Mary Evans <lazydaisy@visible-expression.co.uk>
Date: Sat Jul 6 17:15:12 2013 +0100
MDL-40347 grade/report/grader: Grade report does not highlight some cells properly.
Merged/squashed original commit by Marina Glancy who:
- added class 'i123' to each cell in the column
- changed JS to highlight the cells with this class instead that cells with the column number
- changed grade report css so the .vmarked and .hmarked classes have higher priority for all rows
- made cells in 'average range' row td instead of th
- little corrections to css: removed background image for some cells with .header css class
- MyMobile theme disabled cells highlighting, make sure it disables it in all cases
Merged/squashed original commit Mary Evans who:
- removed theme/bootstrapbase/less/moodle/grade.less
- removed @import "moodle/grade"; from bootstrapbase/less/moodle.less
- removed reference to plugins_exclude_sheets for grader in both bootstrapbase/config.php and clean themes/config.php
- commented out .hidden from bootstrapbase/less/bootstrap/responsive_utilities.less
- made minor changes to grader/style.css
By parsing php://input in chunks, we can bypass max_input_vars for
forms which do not use the "multipart/form-data" enctype. This can
be (and is) safely skipped if there are fewer than max_input_vars
fields submitted as part of $_POST.
For example, a user may create a date/time profile field and set the 'Start year'
field to '2012'. Another user, using the Hijri calendar, may edit the name of
this field. They visit the settings page and in this case the date '1/1/2012'
is converted to '7/2/1433' in Hijri. So, the year '1433' is then displayed.
The user then changes the name of this field and saves the form. This is where
the issue occurs, as the date '1/1/1433' is converted into Gregorian, which
converts to the year '26/09/2011', so the year '2011' is saved in the DB, not
'2012'.
The usergetdate function is not only used to display dates, it is also passed
to the function make_timestamp. This means users using another calendar type
other than Gregorian will generate incorrect timestamps which may be saved in
the DB or used to populate the date_selector and date_time_selector elements.
For example, when creating an assignment using another calendar type other
than Gregorian, the mod_form.php file calls $this->apply_admin_defaults()
which uses the function usergetmidnight to set the "Allow submissions from"
date to today's date and the "Due date" field to 7 days in the future. The
usergetmidnight function calls usergetdate which is then passed to
make_timestamp. Since the usergetdate function was using the calendar
type's timestamp_to_date_array function the date being passed to
make_timestamp was not in Gregorian. So, when using the hijri calendar the
year 1434 was being passed which was generating a large negative number as
the timestamp which was then used to populate the date fields.
Renamed the userdate/usergetdate functions in the calendar type to be more
descriptive and made them abstract to ensure developers implement this
functionality in their calendar type.
Also tidied up PHPDocs for these functions.
1) Moved the calendar types location to a sub-folder in the calendar directory.
2) Removed/moved language strings.
3) Removed calendar types that should be downloaded as plugins.
4) Removed a Non-English language pack for the Gregorian calendar type that
should be downloaded separately.
5) Removed custom files responsible for checking for updates and uninstalling
calendar types, which should be done by core.
6) Removed JS from the calendar_month block as there is no non-JS alternative
provided and the JS written does not make use of the YUI library to ensure
multiple browser support.
7) Removed code from the base class responsible for creating timestamps that
are saved in the DB.
8) Added PHPDocs.
Note: In the original patch we are editing core functions responsible for saving
time in the database in the calendar base class. This is very dangerous, we do
not want to touch these functions as it could cause a complete fubar of the
database. There are places we are forcing the use of the gregorian calendar as
we are passing dates generated by the PHP date function, where as sometimes
we pass dates from usergetdate (which was being overwritten to return the
date specific to the calendar). We can not expect third party modules to
change the calendar type depending on the format they pass to these functions.
While working on the issue, I spotted these two places that were worth of
fixing. The first one is a trivial reminiscence of a previous refactoring,
after which both branches of the if() statement became equal.
The second one is actually a typo as in theory it could generate unexpected
input fields with the name like qPP1. Luckily this never happened due to the
way how survey questions are hardcoded (there are no questions with the type 2
that would require two answers to their subquestions).