49 Commits

Author SHA1 Message Date
Davo Smith
5079271b39 MDL-43156 formslib: newly-created repeat elements get the default values 2020-04-30 20:16:07 +02:00
Marina Glancy
57876874c3 MDL-66020 core_form: add date selector js only when rendered 2019-10-01 12:20:24 +02:00
Tim Hunt
223419d92c MDL-60682 forms: date/times should use step 1 minute by default 2017-11-21 14:50:28 +00:00
Eloy Lafuente (stronk7)
a4cdbff86c MDL-59713 forms: prevent php warning when 'optional' option is missing 2017-08-29 20:12:41 +02:00
Nadav Kavalerchik
bb13339a2e
MDL-46714 Calendar: Properly order Date & Time fields in RTL mode 2016-12-12 12:38:04 +08:00
David Monllao
80180e0f92 MDL-55804 forms: Return exported data through _prepareValue 2016-09-27 08:11:56 +08:00
Marina Glancy
721e2def56 MDL-55123 forms: do not call non-static methods statically
this breaks in PHP7.1
2016-09-12 12:06:18 +08:00
Marina Glancy
32fada5cb2 MDL-52081 forms: indicate usage of grandparent constructor 2015-12-10 13:38:04 +08:00
Marina Glancy
1a0df5535e MDL-52081 forms: Use __construct() for constructors 2015-12-10 13:38:01 +08:00
Andrew Nicols
83e9f0ad71 MDL-40119 Forms: Date selector should use images for the calendar popup toggle
The calendar popup toggle must use an image, rather than an input with type
of image as the latter is actually a form of submit button, and hence it
steals the focus away from the real submit button.
2013-12-30 15:53:42 +08:00
Mark Nelson
1d43da0220 MDL-41664 core_calendar: replaced class variables that stored minimum and maximum years with functions
Also made slight changes to the existing functions.
2013-10-30 12:42:12 +08:00
Adrian Greeve
73412d9680 MDL-41664 - Calendar: Add method for formating years in the new calendar plugin. 2013-10-30 11:53:16 +08:00
Mark Nelson
6b7d0d3ec3 MDL-41792 core_form: used the new get_name() calendar function in the date selectors 2013-10-04 16:17:02 +08:00
Mark Nelson
deed22ea39 MDL-18375 calendar: removed usage of the calendar type in the usergetdate function
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.
2013-09-05 18:32:16 +08:00
Mark Nelson
6eafa4ddba MDL-18375 calendar: changed the name of the function factory to be more descriptive 2013-09-05 18:32:16 +08:00
Mark Nelson
022745acd2 MDL-18375 calendar: implemented the usage of the recently introduced automatic class loading 2013-09-05 18:32:16 +08:00
Mark Nelson
29cb1e83b0 MDL-18375 calendar: only display the YUI2 calendar when the Gregorian type is used 2013-09-05 18:30:05 +08:00
Mark Nelson
2f00e1b245 MDL-18375 calendar: huge refactor of the initial patch
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.
2013-09-05 18:30:05 +08:00
Shamim Rezaie
6dd59aabfa MDL-18375 calendar: added multiple calendar support
Conflicts:

	course/edit_form.php
	lib/db/install.xml
	lib/form/dateselector.php
	lib/form/datetimeselector.php
	lib/setup.php
2013-09-05 18:30:05 +08:00
Mark Nelson
e019dcccdf MDL-39463 forms: use the date selectors 'optional' parameter rather than creating additional logic 2013-05-08 16:36:54 +08:00
Mark Nelson
34f9862edf MDL-39187 forms: fixed issue where calendar pop-up did not display when a date selector form element was added to a group 2013-05-03 13:01:58 +08:00
Mark Nelson
f40df210ab MDL-26649 forms: added a calendar icon that will display the calendar pop-up when clicked rather than the select boxes triggering the event 2013-04-09 14:52:57 +08:00
Rajesh Taneja
c106a9bff0 MDL-27562 formslib: applydst should be always true, hence option removed from dateselector and datetimeselector form elements 2012-05-07 15:23:45 +08:00
Rajesh Taneja
fa70f63522 MDL-27562 formslib: Timezone option is passed to usergetdate for dateselector and datetimeselector form element 2012-05-07 15:23:44 +08:00
Petr Skoda
fabbf4398b MDL-32094 some nasty quickforms hacks that should help with E_STRICT
Note: we have stopped tracking our QuickForms hacks long ago.
2012-03-18 18:39:37 +01:00
Rajesh Taneja
6c1fd30484 MDL-30974 form: Checked and updated docblock for form library 2012-02-15 12:55:06 +08:00
sam marshall
6282381d05 MDL-27242 Conditional availability dates should support time as well as day
Change also adds minor feature to date-time selector so you can specify the time it uses as default when the value is 0 (disabled).

Credit: This feature was developed collaboratively by Charles Fulton, Neill Magill, and me.
2011-10-13 10:23:23 +01:00
Petr Skoda
bd69b9dbac MDL-19698 deprecated assign new by ref in our forms code 2010-07-19 08:29:25 +00:00
Tim Hunt
7c1b615060 formslib: MDL-21561 minor bug with disabled datetimeselectors.
Thanks for Matt Petro for finding this and suggesting the fix.
I introduced this error when adding the calendar pop-up.
Strangely, dateselector was not affected.
2010-03-08 14:03:24 +00:00
Petr Skoda
4454447d56 MDL-20700 whitespace terror returns 2009-12-16 22:14:17 +00:00
Petr Skoda
4a0e2e632f MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-01 11:42:23 +00:00
tjhunt
cf6155226c ajaxlib/require_js: MDL-16693 $PAGE->requires->... deprecates require_js etc.
There is a new implementation of require_js in lib/deprecatedlib.php,
based on $PAGE->requires.

There were a few other recently introduced functions in lib/weblib.php,
namely print_js_call, print_delayed_js_call, print_js_config and
standard_js_config. These have been removed, since they were never in
a stable branch, and all the places that used them have been changed
to use the newer $PAGE->requires->... methods.

get_require_js_code is also gone, and the evil places that were calling
it, even though it is an internal function, have been fixed.

Also, I made some minor improvements to the code I committed yesterday
for MDL-16695.

All that remains is to update all the places in core code that are
still using require_js.

(This commit also fixes the problem where the admin tree would not
start with the right categories expanded.)
2009-06-12 12:13:07 +00:00
tjhunt
8e7cebb0d8 formslib dates: MDL-16592 show a pop-up calendar for picking dates.
Not quite finished. There is a small issue with keyboard focus. See bug.
2009-03-13 09:56:53 +00:00
tjhunt
25fe66b094 date form fields: MDL-18502 Change the optional 'disabled' checkbox to an 'enabled' on
Better for usability to avoid a double-negative.
2009-03-10 06:44:05 +00:00
moodler
7982426d1b Fiexed order of time elements for RTL MDL-10768 2007-08-09 08:44:29 +00:00
tjhunt
5aed30094d Fix whitespace, and round times to the previous multiple of the 'step' option, if necessary. 2007-07-23 14:55:35 +00:00
poltawski
a044c05ddb MDL-9742 - changed tabs to spaces in a few places where there are one
or two
2007-05-08 15:07:25 +00:00
martinlanghoff
76ab1c33d9 Bug fix: 'off by one'month bug in mupltiple locations.
When the system/user time zone was set to GMT-13 months would lag behind by
one month.


Author: Matt Clarkson <mattc@catalyst.net.nz>
2007-04-13 05:04:57 +00:00
jamiesensei
44875d7898 added code to include hidden labels in groups in forms 2006-12-09 14:06:15 +00:00
jamiesensei
4dd564ddb2 small fix to disabledIf initiation 2006-12-09 11:45:24 +00:00
jamiesensei
11f260f4ee some changes to date_selector and date_time_selector. Now automatically disabledIf disable checkbox is checked. 'optional' option includes a disable checkbox. 2006-12-09 11:42:57 +00:00
jamiesensei
46e648b610 added Sam's 'enabled' checkbox functionality 2006-12-07 10:39:28 +00:00
jamiesensei
dbc6607baa added some strings for labels for dateselector and datetimeselector day, month etc. elements. These are not used yet. 2006-12-07 05:37:41 +00:00
jamiesensei
02f8f37d5d added defaults for when there is no submitted data to datetimeselector and small fix for forum\mod_form.php 2006-11-23 09:38:33 +00:00
jamiesensei
4a2d352a88 oops, removed print_object that was left in from debugging 2006-11-21 10:16:01 +00:00
jamiesensei
0e6303103b fixed a couple of bugs in custom elements 2006-11-21 10:14:38 +00:00
jamiesensei
e2294b9822 fixes for small bugs in datetimeselector and dateselector and added custom elements to formslib library for standard module forms 2006-11-09 18:08:34 +00:00
skodak
7f40a229a4 New version of formslib.php (see MDL-6914 for more details), course/edit2.php is disabled for now - working on edit3.php ;-)
More inline comments/docs today.
2006-10-12 07:33:57 +00:00
jamiesensei
e9d39a3215 added new form element datetimeselector 2006-10-11 06:30:03 +00:00