Commit Graph

190 Commits

Author SHA1 Message Date
Sean Harvey
60d09a6c5b BUGFIX Incorrect call to weekday function in Date class (thanks webbower!) (from r115443)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@115444 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-01-11 23:11:43 +00:00
Sam Minnee
8d5b417619 MINOR Fixed documentation in Datetime (fixes #6062, thanks nicolaas) (from r111787)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112921 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 04:53:11 +00:00
Sam Minnee
adfab98adb BUGFIX StringField::setNullifyEmpty() should assign the given value boolean, not evaluate whether it's true or not (from r109081)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112774 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 00:53:46 +00:00
Ingo Schommer
bd6e51c87f BUGFIX: Only highlight strings more than 2 characters long. #4949 (from r107423)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112590 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-15 03:44:24 +00:00
Ingo Schommer
e36247c1ed ENHANCEMENT: added prefix and suffix support to ContextSummary (from r106200)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112526 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-15 02:59:46 +00:00
Ingo Schommer
aa4fc0a3db ENHANCEMENT: added Month function for consistency (from r104935)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112409 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-15 01:17:45 +00:00
Ingo Schommer
32afc2923e MINOR Migrated various API-style documentation from doc.ss.org (from r104157)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112337 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-14 23:58:09 +00:00
Sam Minnee
1379f133ea MINOR Enum DBField class should default to ExactMatchFilter to avoid wrong results with overlapping Enum values in LIKE queries (see #5434) (from r103322)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112132 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-13 03:40:36 +00:00
Sam Minnee
322a2da0dc BUGFIX Float should always be not null and default 0 in the database (from r102686)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112068 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-13 01:45:24 +00:00
Sam Minnee
268800dec6 BUGFIX #5316 Float and Double should never try to save NULL as the "null" value (from r102460)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112067 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-13 01:43:58 +00:00
Ingo Schommer
3f2cc791ac MINOR More common language in Date->TimeDiff() ("in 2 hours" instead of "2 hours away") (fixes #5402)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111840 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-10 05:06:50 +00:00
Ingo Schommer
a0d1c7d2b1 BUGFIX: Date::now() supplies wrong string - it misses leading zeroes on hours (from r100767)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105644 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-05-25 04:57:43 +00:00
Ingo Schommer
f661501019 BUG FIX: the default value for decimals are now cast as (doubles) (from r100686)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105619 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-05-25 04:22:21 +00:00
Ingo Schommer
3bd114256b MINOR added Rfc2822 method to SS_Datetime. Fixed bug where dates in DataObject would not set times. (from r100032)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105546 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-05-25 03:40:37 +00:00
Ingo Schommer
271584e43b MINOR Fixed phpdoc documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@103390 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-23 01:04:16 +00:00
Ingo Schommer
6460d09570 MINOR Fixed phpdoc documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@103385 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-23 00:11:41 +00:00
Ingo Schommer
6227478f82 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  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  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. (from r99360)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102859 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-14 04:38:40 +00:00
Ingo Schommer
feabab3808 BUGFIX: modified float to have the same database table schema as int. Now defaults to zero and 'not null' (from r98847)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102805 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-14 03:45:20 +00:00
Ingo Schommer
9f4413421d MINOR: use DB doubles only in MySQL, fall back to float (from r98178)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102623 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-13 02:27:46 +00:00
Ingo Schommer
2ae6f896e3 Add some nice date formats (from r95772) (from r98093)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102585 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-13 02:05:26 +00:00
Ingo Schommer
a5dde231b6 API CHANGE Decimal now allows setting a default value properly
MINOR Unit tests for Decimal field type default value through new test class DecimalTest (from r98056)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102571 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-13 01:53:13 +00:00
Ingo Schommer
529ed1dd1d MINOR: niced the way MultiEnums call requireField to give alternative adapter access (from r98043)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102570 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-13 01:50:15 +00:00
Ingo Schommer
1997485ba3 BUGFIX #5009: Removed inappropriate field-detection change on multienums with no default (from r97980)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102561 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-13 01:46:27 +00:00
Ingo Schommer
9e9dcb1b96 MINOR: Better error message on bad Enum default (from r97979)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102560 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-13 01:45:53 +00:00
Ingo Schommer
eba3409c20 ENHANCEMENT Added Date::Rfc3339() for returning an RFC 3339 valid date format (from r96010) (from r96049)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102324 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 01:34:42 +00:00
Sean Harvey
eb25344862 BUGFIX #4566 Time::Nice() and Time::Nice24() return bad results if there is no value (from r94353)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@95600 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-12-16 05:39:23 +00:00
Ingo Schommer
43dd296076 ENHANCEMENT Added parameter to DBLocale->Nice()
ENHANCEMENT Added DBLocale->getNativeName() (from r93771)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@93941 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-30 00:44:46 +00:00
Ingo Schommer
3878730edf API CHANGE: Added Lower and Upper methods to Varchar, Text, and Enum (from r91048)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92452 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-21 01:41:24 +00:00
Andrew O'Neil
70e730efc4 BUGFIX: Fix Date::FormatI18N() to work with accents (dospuntocero)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@91268 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-11 02:47:36 +00:00
Andreas Piening
edf7d4a134 BUGFIX: MSSQL does not support double, using float instead
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90928 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-05 21:44:40 +00:00
Sam Minnee
c4581f741a BUGFIX: Allow null default on MultiEnum fields
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90850 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-05 01:14:17 +00:00
Sean Harvey
adf9bc89fe BUGFIX Fixed Text::scaffoldFormField() showing a "Is Null" checkbox, even if nullifyEmpty is true
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90747 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-03 22:27:56 +00:00
Andrew Short
79773042be API CHANGE: Renamed conflicting classes to have an "SS_" namespace, and renamed existing "SS" namespace to "SS_". The affected classes are: HTTPRequest, HTTPResponse, Query, Database, SSBacktrace, SSCli, SSDatetime, SSDatetimeTest, SSLog, SSLogTest, SSLogEmailWriter, SSLogErrorEmailFormatter, SSLogErrorFileFormatter, SSLogFileWriter and SSZendLog.
MINOR: Replaced usage of renamed classes with the new namespaced name.

From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90075 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-26 03:06:31 +00: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
Sean Harvey
87a8af00c5 BUGFIX Fixed array to string conversion error in Date::setValue() (from r82749)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89718 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-21 02:30:07 +00:00
Andrew Short
55408946a6 MINOR: Parse HTMLText and HTMLVarchar values with ShortcodeParser before inserting into a template.
From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88475 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-11 00:06:59 +00:00
Andrew Short
365b4784a9 FEATURE: Refactored ViewableData. The main changes are:
* Values are not always casted before being rendered into a template.
	* Casting information can by dynamically provided by $casting_properties, rather than being hardcoded to $casting and $db.
	* Removed unneeded ViewableData_Iterator - ArrayIterator is instead used.
	* Removed ViewableData_ObjectCustomised - now just uses ViewableData_Customised.
ENHANCEMENT: Added template and value methods to database fields.
MINOR: Added ViewableDataTest and extended DataObjectTest.

From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88474 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-11 00:06:58 +00:00
Geoff Munn
ddfc0613ad MINOR CHANGE: numeric datatypes changed to support array types
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87895 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-01 21:03:52 +00:00
Geoff Munn
acba65eaaa API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87568 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:02:35 +00:00
Geoff Munn
c2cb8dd4b9 API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87567 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:02:28 +00:00
Geoff Munn
05014765e6 API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87566 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:01:59 +00:00
Geoff Munn
dd31eb1754 API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87565 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:01:51 +00:00
Geoff Munn
e0334112f9 API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87564 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:01:41 +00:00
Geoff Munn
fa4be08785 API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87563 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:01:30 +00:00
Geoff Munn
d07871c372 API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87562 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:01:15 +00:00
Geoff Munn
c1e32fb3db API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87561 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:01:06 +00:00
Geoff Munn
9cb252d976 API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87560 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:00:56 +00:00
Geoff Munn
acbff3b95a API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87559 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:00:45 +00:00
Geoff Munn
8cd96982c9 API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87558 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:00:36 +00:00
Geoff Munn
772c1136d4 API CHANGE: array data type now supported
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87557 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 22:00:27 +00:00