Commit Graph

84 Commits

Author SHA1 Message Date
Ingo Schommer
c945e23c62 FEATURE New DatetimeField class (form field wrapper composed of DateField andTimeField)
FEATURE New DateField and TimeField form classes with more consistent API and easier localization
API CHANGE Date/time parsing in DateField, TimeField and DatetimeField defaults to i18n::get_locale() ('en_US') instead of using en_NZ/en_GB specific parsing. Use i18n::set_locale('en_NZ') in mysite/_config.php to revert to old behaviour.
API CHANGE $timeformat constructor parameter in TimeField needs to be in ISO date notation (not PHP's date())
API CHANGE TimeField, DateField and related subclasses use Zend_Date for date parsing, meaning they're stricer than the previously used strtotime()
API CHANGE Removed DMYCalendarDateField and CalendarDateField, use DateField with setConfig('showcalendar')
API CHANGE Removed CompositeDateField, DMYDateField, use DateField with setConfig('dmyfields')
API CHANGE Removed DropdownTimeField, use TimeField with setConfig('showdropdown')
API CHANGE Removed PopupDateTimeField, use DatetimeField
API CHANGE Changed 'date', 'month' and 'year' HTML field names to lowercase in DMYDateField
API CHANGE Removed support for ambiguous date formats in DateField, e.g. '06/03/03'. Use DateField->setConfig('dateformat', '<format>') to revert to this behaviour.
API CHANGE Removed $futureOnly flag from DateField, CalendarDateField etc., use DateField->setConfig('min') and DateField->setConfig('max')
ENHANCEMENT Using Zend_Date for DateField and TimeField, with more robust date handling, starting localization support. Set globally via i18n::set_locale(), or for a field instance through setLocale(). Note: Javascript validation is not localized yet.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99360 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:38 +13:00
Sean Harvey
a93d12cf31 MINOR Use 'b' mode for fopen() where possible for better portability
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98321 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:26 +13:00
Sam Minnee
cbb882be5c MINOR: Fixed TableListField test to suit changed behaviour. (from r96639)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98141 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:23 +13:00
Sam Minnee
63096cfefb API CHANGE: Don't generate TestOnly DataObjects in the database immediately; instead let test developers specify them in SapphireTest::$extraDataObjects.
API CHANGE: Added SapphireTest::resetDBSchema() (from r90054)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96734 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:04 +13:00
Andrew O'Neil
8679fd9883 FEATURE: Allow Text/Varchar fields to be configured to differentiate between NULL and empty string. (#4178, petebd)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90036 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-23 01:29:55 +00:00
Sam Minnee
448d975b9a MINOR fixed failing unit test (from r86169)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89166 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-15 21:58:15 +00:00
Andrew Short
ce2e4e7333 MINOR: Added tests for HtmlEditorField's broken link tracking and highlighting.
From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88990 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-15 00:02:05 +00:00
Andrew Short
360dd5ebd9 MINOR: Added a test case for saving links without a href attribute in HtmlEditorField.
From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88800 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-13 02:44:10 +00:00
Sam Minnee
557ec1e3b3 MINOR: Fixed ComplexTableField test to not generate 404s when redirecting to homepage.
From: Sam Minnee <sam@silverstripe.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88511 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-11 00:07:28 +00:00
Andrew Short
9b4d9993a4 FEATURE: Added SS_HTMLValue to provide a simple wrapper around DOMDocument to allow the manipulation of HTML snippets.
FEATURE: Re-instated broken link highlighting by manually checking all shortcodes in HtmlEditorField->Field(), and adding a class to broken ones.

From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88510 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-11 00:07:27 +00:00
Andrew Short
f29eceecff API CHANGE #3724: Unified the Link() method to accept an action parameter.
From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88495 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-11 00:07:16 +00:00
Andrew Short
1859ba502b FEATURE: Updated HtmlEditorField to use DOMDocument to more reliably parse image tracking and shortcode link tracking data.
From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88492 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-11 00:07:13 +00:00
Will Rossiter
af9e4f59f5 MINOR: Reverted previous commit
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88112 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-05 03:37:05 +00:00
Will Rossiter
620aa651aa FEATURE: added extend() call to enable FieldHolder() html to be customized via extensions.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88104 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-05 02:17:19 +00:00
Ingo Schommer
afcf846b90 BUGFIX Fixed ID associations in TableListFieldTest (was assuming numerically ascending IDs, which isnt necessarily true in Postgres)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87913 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-01 21:51:58 +00:00
Geoff Munn
d9b1b66c2b BUG FIX: tests which aren't supported by Postgres temporarily disabled
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87897 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-01 21:04:46 +00:00
Geoff Munn
a56db7cff1 MINOR: tests that don't work with Postgres disabled until a fix for ID requirements can be found
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87765 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-30 21:24:53 +00:00
Geoff Munn
e1763ab4f2 MINOR FIX: columns quoted properly
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86504 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-17 00:03:22 +00:00
Geoff Munn
b1ab0a5bc0 MINOR FIX: columns quoted properly
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86503 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-17 00:02:53 +00:00
Sean Harvey
df31edf8b6 MINOR Added unit test for DropdownField::performReadonlyTransformation()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84978 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-21 04:16:21 +00:00
Ingo Schommer
946025adb9 API CHANGE Removed TableField->FieldSet() and TableField->SubmittedFieldSet(), please use Items() and TableField_Item->Fields() instead (merged branches/2.3-nzct)
BUGFIX Fixed re-loading of unsaved TableField form data (e.g. after a validation error). The (now removed) method SubmittedFieldSet() was setting incremental temporary identifiers ("new1", "new2", etc), which wasn't picked up by Items() (merged from branches/2.3-nzct)
BUGFIX Using $this->value instead of $_POST to process submitted data in TableField (merged from branches/2.3-nzct)
BUGFIX TableField validation logic iterates over TableField_Item instances to get all formfields, rather than creating their own set in SubmittedFieldSet()
MINOR Removed repitition of temporary Form generation in TableField by generateTableFieldItem() method (merged from branches/2.3-nzct)


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82089 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-17 02:09:27 +00:00
Ingo Schommer
8a20d5c1ad ENHANCEMENT Added TableField?->autoRelationSetting to allow for automatic saving into relationships (similiar to ComplexTableField? implementation) (merged from branches/2.3-nzct)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82060 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-16 23:49:32 +00:00
Ingo Schommer
f512347e33 BUGFIX Making sure RequirementsTest? has combine_files activated (merged from branches/2.3-nzct)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82055 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-16 23:45:23 +00:00
Ingo Schommer
f3959b038d API CHANGE Deprecated use of SapphireTest->fixture to access YML fixtures, please use gateway methods on SapphireTest instead (e.g. $this->objFromFixture() instead of $this->fixture->objFromFixture())
ENHANCEMENT Allowing multiple fixtures to be defined in SapphireTest::$fixture_file through array notation. 
BUGFIX Disabling DataObject validation in YamlFixture->saveIntoDatabase() instead of SapphireTest->setUp()
MINOR Adapted sapphire unit tests to deprecated $this->fixture usage

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81286 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-08 00:06:16 +00:00
Ingo Schommer
4a531820cd BUGFIX Accepting dot-notation in TabSet->fieldByName()
BUGFIX Using fieldByName() instead of dataFieldByName() in Form->handleField() to allow rendering of nested tabs through a URL

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81128 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-06 21:53:50 +00:00
Rainer Spittel
ca4ec1af03 ENHANCEMENT: enabled saveInto to use the setter method when available instead of passing through the form field values directly to the money class.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80521 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-30 03:16:28 +00:00
Sam Minnee
6bcabcbe46 BUGFIX #4306 simon_w: Fixed ConfirmedPasswordField::setValue()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80192 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-27 04:00:10 +00:00
Sean Harvey
6c754d29e9 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79438 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-17 11:36:49 +00:00
Ingo Schommer
204620b99d BUGFIX Conditionally setting and getting NULL values in TimeField->setValue()/dataValue(). Previously overriding a TimeField with an empty value wasn't possible.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79357 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-16 07:03:17 +00:00
Ingo Schommer
efb6f0ceaf API CHANGE TimeField doesn't internally store value as "Y-m-d g:ia" (including date), but only as "g:ia"
BUGFIX Allowing TimeField and subclasses to be set to NULL through setValue()
BUGFIX Added TimeField->dataValue() to apply same conversion as setValue()
MINOR Added TimeFieldTest

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79355 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-16 06:39:57 +00:00
Sam Minnee
4df21d29e0 BUGFIX: Fixed date field manipulation.
MINOR: Added sorts to TableListFieldTest

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79327 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-16 04:03:47 +00:00
Sean Harvey
60c5570bf8 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77817 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-26 02:19:50 +00:00
Ingo Schommer
b478c8be34 FEATURE Added MoneyField as a form field to edit Money values
ENHANCEMENT Using MoneyField in Money->scaffoldFormField()
BUGFIX Fixed Money->setValue() to respect $value parameter over $record to avoid wrongly updated values from stale $record values instead of new $value

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77772 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-25 22:21:02 +00:00
Sean Harvey
f4eecd4d0d Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75903 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-04 01:20:12 +00:00
Sean Harvey
9b75cb1987 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75845 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-01 03:49:34 +00:00
Sean Harvey
a5e82ddff1 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75590 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-29 01:20:24 +00:00
Sean Harvey
13b358a8dd Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75582 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-29 00:07:39 +00:00
Sean Harvey
76b5adc979 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75579 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-28 23:52:15 +00:00
Ingo Schommer
023e733b16 BUGFIX Fixed wrong condition in Requirements::includeInHTML() which failed to process requirements if only customCSS() was used
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71467 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-08 19:06:15 +00:00
Andrew O'Neil
60f75c5ca4 Merged changes from 2.3 branch
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71172 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-01 23:49:53 +00:00
Ingo Schommer
085346f0e0 MINOR Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69704 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-05 06:19:48 +00:00
Ingo Schommer
d26f08b481 MINOR merged branches/2.3 into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@67465 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-04 22:38:32 +00:00
Sam Minnee
2e955b498e BUGFIX: Fixing tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66508 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-24 19:28:46 +00:00
Sam Minnee
96c5be8252 Updating queries to be more DB agnostic
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66507 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-24 09:31:14 +00:00
Sam Minnee
12e62c6329 ENHANCEMENT: Change MySQLDatabase connection to operate in ANSI SQL mode, to ease the transition to DB abstraction
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66399 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-22 03:51:04 +00:00
Ingo Schommer
5df97fba10 ENHANCEMENT Added CompositeField->fieldPosition()
ENHANCEMENT Supporting recursion into nested sets in FieldSet->insertAfter()/TabSet->insertAfter()/CompositeField->insertAfter()
API CHANGE Deprecated CompositeField->insertBeforeRecursive(), use CompositeField->insertBefore()
ENHANCEMENT Renamed CompositeField->beforeInsert() to CompositeField->onBeforeInsert() to avoid confusion with insertBefore()
ENHANCEMENT Added CompositeFieldTest
ENHANCEMENT Added unit tests for FieldSet->insertBefore()/insertAfter()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65581 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-11 02:35:54 +00:00
Sam Minnee
e6c4d32dbc ARCHITECTURE #3034 wakeless: Make Requirements mockable by pushing the meat of the functionality to Requirements_Backend
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65436 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-07 02:06:28 +00:00
Ingo Schommer
72de4163b7 ENHANCEMENT Using namespaces for filenames in RequirementsTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65029 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-01 14:04:31 +00:00
Ingo Schommer
768fc5a588 BUGFIX Adjusted HeaderField and LabelField implementation to new constructor arguments (see r64421)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64422 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-16 13:26:50 +00:00
Ingo Schommer
c8c9c2166d ENHANCEMENT Added DropdownField->setEmptyString() and DropdownField->setHasEmptyDefault() to decrease constructor arguments and allow for modification of behaviour after calling construtor. Added DropdownField->getSource() to dynamically include empty defaults at rendering-time rather than construction time. Adjusted DropdownField subclasses to new behaviour
ENHANCEMENT Added DropdownFieldTest

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64304 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-15 12:39:09 +00:00