summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.18/sites/all/modules/date
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.18/sites/all/modules/date')
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/CHANGELOG.txt64
-rwxr-xr-x[-rw-r--r--]kolab.org/www/drupal-7.18/sites/all/modules/date/LICENSE.txt0
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date.api.php3
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date.diff.inc79
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date.field.inc8
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date.info8
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date.migrate.inc (renamed from kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date.migrate.inc)91
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date.module19
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date.theme66
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_admin.inc9
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_all_day/date_all_day.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api.module73
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api_elements.inc23
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api_sql.inc32
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_context/date_context.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_context/plugins/date_context_date_condition.inc2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_elements.inc13
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.info14
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.module12
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.info7
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc59
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.module3
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/README.txt6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/date_popup.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/date_popup.module8
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat/date_repeat.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat/date_repeat_form.inc6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat_field/date_repeat_field.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat_field/date_repeat_field.module25
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_tools/date_tools.info6
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/date_views.info7
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc2
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_filter_handler.inc4
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc48
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/date/tests/date_migrate.test (renamed from kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.test)18
36 files changed, 518 insertions, 233 deletions
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/CHANGELOG.txt b/kolab.org/www/drupal-7.18/sites/all/modules/date/CHANGELOG.txt
index 99e8fb0..8c00161 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/CHANGELOG.txt
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/CHANGELOG.txt
@@ -1,9 +1,45 @@
Date Module 7.x
=================
-===================
-Version 7.x-2.x-dev
-===================
+
+======================
+Version 7.x-2.7
+======================
+- Issue #1691342 by Cyberwolf: Field description is displayed multiple times.
+- Issue #1668240 by ianthomas_uk: /themes/jquery.timeentry.css is not aggregated with other CSS files.
+- Issue #1974056 by pjcdawkins: Add a CSS class to the date repeat rule.
+- Issue #2065749 by vijaycs85, blackdog: $class in theme_date_repeat_rrule is not used.
+- Issue #1840008 by cr0ss, Alan D.: Unlock "Date attributes" (granularity) field setting.
+- Issue #1580032 by jmuzz | 30equals: Date values are not being saved when field is used in a nested field collection.
+- Issue #2071629 by blackdog: #after_build wrongly added, overwrites other modules.
+- Issue #1869962 by kaidjohnson: Date Context breaks context edit form.
+- Issue #1571258 by David_Rothstein | ddalvi: Date and time form elements do not have accessible labels when the label position is set to 'Within' or 'None'.
+- Issue #2130575 by kostajh: Unset() should be used with more caution in views_filter_handler_simple().inc.
+- Issue #1826598 by eromba, jyee: 'c' and 'r' formatter causes date to be printed twice in views.
+- Issue #1933472 by minorOffense: Added Optimize date_now() function.
+- Issue #1248786 by kenneth.venken | dboulet: Fixed appearance of marker for required date fields.
+- Issue #1810734 by ParisLiakos: Fixed Repeat checkboxes working reversed with updated jQuery.
+- Issue #1844092 by dboulet, kardave, Spleshka: Fixed Untranslated strings: month, day, ...
+- Issue #1202248 by james.williams, dawehner, mikehues | DamienMcKenna: Fixed Exported view doesn't include 'default_argument_options()' attribute.
+- Issue #1409120 by anrikun, akamustang | marsbidon: Added Date format in views exposed filter does not respect configured format.
+- Issue #1858112 by tomdearden: Fixed DateObject->difference not calculating correctly for future dates > 1 year away.
+- Issue #1659466 by artkon: Fixed Date filter does not remember value in views if the identifier is something other than date_filter().
+- Issue #1905096 by gielfeldt: Fixed Wrong usage of database API.
+- Issue #1791804 by 5n00py: Errors on form validation if date field placed in sub-form.
+- Issue [#636208] Date range: Expose a single filter to select events that start before the chosen date and end after the chosen date by anrikun.
+- Issue [#2024269] Date popup documentation fix by RoySegall.
+- Issue [#1835184] by Steven Jones, das-peter, jwhat: Fixed date_limit_format() can have poor performance.
+- Issue [#991830] by milesw | restyler: Fixed validation errors when date_popup() date is localized.
+- Issue [#2098715] by jhodgdon: Fixed Date field not obeying widget alters for #required.
+- Issue [#1266688] by linclark, rbayliss, fago, colette: Support microdata in date fields.
+- Issue [#1863610] by maximpodorov: Fixed Invalid date formatting.
+- META [#2034231] [#1832544] Class registration for Migrate 2.5 or later - mikeryan, [#1835214] Automated tests failing - Exception thrown in Date2 migration - PatchRanger, [#
+- Issue [#1350604] by Alan D., johaziel: Added Diff support for Date fields.
+- Issue [#2086313] by dooug: Fixed Wrong path in date_popup() README.txt
+- Issue [#1455558] by BTMash | mediameriquat: Fixed Missing file in date_views().info causes error 500.
+- Issue [#1697322] by Alan D., ianmthomasuk | pandikamal: Fixed Call to a member function getName() on a non-object in date api.
+- Code cleanup, remove #prev values that were never used in repeat functionality.
+- Small fix needed to ensure cardinality gets set correctly if repeat option is changed in the UI.
======================
Version 7.x-2.6
@@ -110,7 +146,7 @@ Version 7.x-2.1
- Issue #1437242 by zerbash, Remove extraneous leading slashes in module_load_include().
- Issue #1436722 by hefox: Fixed Undefined variable $form_set_error() used as function.
-- Issue #1250626 by Gábor Hojtsy, B-Prod, hefox: Added start date and end date labels.
+- Issue #1250626 by G�bor Hojtsy, B-Prod, hefox: Added start date and end date labels.
- Issue #1253482, Make sure $argument->is_default gets reset by the Date pager when altering results.
- Adjust Date Tools to work with changes to use Views templates to create calendars.
- Issue #1398584 by dhalbert and , Make sure groupby times is initialized.
@@ -194,7 +230,7 @@ The Date Browser has been removed. Please use the Date Pager instead. If you hav
Browser the navigation will just disappear from them. If you add a Date Pager to the view you should get it back.
Then delete the Date Browser attachment from the view, since it doesn't do anything any more.
-The UNTIL date was not getting included in repeating results and that is now fixed. This is an API change of sorts
+The UNTIL date was not getting included in repeating results and that is now fixed. This is an API change of sorts
for anyone who worked around the issue by setting it ahead.
The All Day checkbox and All Day themes were moved into a separate module, using new hooks added to the date
@@ -219,7 +255,7 @@ New Features/Major Changes
Bugfixes
- Fix to new default date handling, the default date has to set a date in the database timezone, not the display timezone.
-- Issue #1245106 by Gábor Hojtsy, Hide the option to add the delta into the view for single value fields.
+- Issue #1245106 by G�bor Hojtsy, Hide the option to add the delta into the view for single value fields.
- Issue #1370876, Make sure new Date All Day code does not try to set the popup values if Date Popup is disabled.
- Issue #874322, Add back the date_field_all_day() function to avoid breaking other modules that are using it.
- Fix Date text placeholder to display a formatted date instead of a format. Follow up to Date repeat UI changes.
@@ -316,7 +352,7 @@ Bugfixes
- Issue #1179715, Default value callback for the timezone widget was not returning an array.
- Issue #1179716, Remove value_callback for date_repeat and date_combo forms, the default behavior works fine.
- Issue #1178716 by das-peter, Use drupal_array_get_nested_value() in Date Repeat instead of trying to find it manually.
-- Issue #1178716 by das-peter and KarenS, Tweak the date repeat widget to identify empty input when used on nodes with translation.
+- Issue #1178716 by das-peter and KarenS, Tweak the date repeat widget to identify empty input when used on nodes with translation.
- Issue #1178716 by das-peter and KarenS, Fix date repeat form values that are not arrays when hidden on a node that has translation.
- Issue #1178176 by das-peter, Fix date_combo_value_callback to return NULL to avoid data lost on untranslatable dates used with Entity Translation.
- Date Context module was making incorrect assumptions about the $language of the field.
@@ -350,7 +386,7 @@ field settings. Previous versions did not always honor those settings, this one
New Features/UX Improvements
-- Issue #1249724 by KarenS, Gábor Hojtsy, David_Rothstein, Improve usability of date and time input configuration.
+- Issue #1249724 by KarenS, G�bor Hojtsy, David_Rothstein, Improve usability of date and time input configuration.
- Issue #1250784 by David_Rothstein, Add user-friendly labels for start and end date values in Views.
- Issue #742146, Add option to remove X-WR-CALNAME if VEVENT is not a feed.
- Add option to change method from PUBLISH to REQUEST in VCALENDAR.
@@ -360,8 +396,8 @@ New Features/UX Improvements
- Issue #1249724 by David_Rothstein: Improve usability of date and time input configuration
- Issue #1177198 by tim.plunkett: Allow CTools to process #dependency for date elements.
- Issue #1245562 by David_Rothstein, Rename the default date display format to something friendlier
-- Issue #1239934 by David_Rothstein and Gábor Hojtsy, Reuse the "years back and forward" dropdown widget on the Views filter settings page.
-- Issue #1239228 by Gábor Hojtsy, Date Views filter form UI improvements, clarify the way absolute and relative dates work.
+- Issue #1239934 by David_Rothstein and G�bor Hojtsy, Reuse the "years back and forward" dropdown widget on the Views filter settings page.
+- Issue #1239228 by G�bor Hojtsy, Date Views filter form UI improvements, clarify the way absolute and relative dates work.
- Issue #233047 by ksenzee and David_Rothstein, Add the Vegas jQuery timepicker as a new time selector option.
- Issue #1145976 by tim.plunkett and KarenS, Add 'is date' identifier to all date handlers.
- Issue #1234140 by arlinsundbulte, Change terminology in user-facing text from 'From/To Date' to 'Start/End Date'.
@@ -408,10 +444,10 @@ Bugfixes
- Issue #1254582 Repeat additions need to be adjusted to use the same time as the original date.
- Move vcalendar and vevent templates from Date Views to Date API modules.
- Follow up to Issue #1250344, We don't need extra space when there is a description, only when there is not.
-- Issue #1239228 by Gábor Hojtsy, More tweaks to filter css.
-- Issue #1244924 by Gábor Hojtsy, Minor text improvements in date filter configuration
+- Issue #1239228 by G�bor Hojtsy, More tweaks to filter css.
+- Issue #1244924 by G�bor Hojtsy, Minor text improvements in date filter configuration
- Issue #1245556 by David_Rothstein, Date granularity description incorrectly implies that it affects the date attributes that are displayed
-- Issue #1247444 by Gábor Hojtsy, Give a little breathing space to the date year range "other" field
+- Issue #1247444 by G�bor Hojtsy, Give a little breathing space to the date year range "other" field
- Issue #1250344 by jessebeach, Fix padding around date fields by adding clearfix class.
- Issue #1249116 by yched, Fix various glitches with D6 migration code.
- Issue #1243022 by fmosca and KarenS, Make sure all_day #states visibility is only set when there is a value for all_day.
@@ -419,7 +455,7 @@ Bugfixes
- Issue #1246416, Test whether libraries_get_path() returns a valid path before using it.
- Issue #1235994, Don't display 'All Day' when using a format that has no time.
- Issue #1245690 by mikeryan, Migration plugin missing seconds from date formats
-- Issue #1229406 by David Rothstein, Gábor Hojtsy, and tim.plunkett Fix broken timepicker in Chrome and Safari.
+- Issue #1229406 by David Rothstein, G�bor Hojtsy, and tim.plunkett Fix broken timepicker in Chrome and Safari.
- Issue #1239412 by keithm, Fix validation error when #access is false.
- Issue #1232522, Don't alter field_ui_field_edit form except on date fields.
- Issue #1243842, Make sure the All Day and Show End Date flags work correctly in unlimited value fields that use ajax.
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/LICENSE.txt b/kolab.org/www/drupal-7.18/sites/all/modules/date/LICENSE.txt
index d159169..d159169 100644..100755
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/LICENSE.txt
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/LICENSE.txt
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.api.php b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.api.php
index 17f7514..268ae86 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.api.php
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.api.php
@@ -344,9 +344,6 @@ function hook_date_combo_process_alter(&$element, &$form_state, $context) {
'#date_increment' => $instance['widget']['settings']['increment'],
'#date_year_range' => $instance['widget']['settings']['year_range'],
'#date_label_position' => $instance['widget']['settings']['label_position'],
- '#prev_value' => isset($item['value']) ? $item['value'] : '',
- '#prev_value2' => isset($item['value2']) ? $item['value2'] : '',
- '#prev_rrule' => isset($item['rrule']) ? $item['rrule'] : '',
'#date_repeat_widget' => str_replace('_repeat', '', $instance['widget']['type']),
'#date_repeat_collapsed' => $instance['widget']['settings']['repeat_collapsed'],
'#date_flexible' => 0,
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.diff.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.diff.inc
new file mode 100644
index 0000000..e46d3a1
--- /dev/null
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.diff.inc
@@ -0,0 +1,79 @@
+<?php
+
+/**
+ * @file
+ * Provide diff field functions for the Date module.
+ */
+
+/**
+ * Diff field callback for parsing date fields comparative values.
+ */
+function date_field_diff_view($items, $context) {
+ $diff_items = array();
+ $display = $context['display'];
+ $display['settings']['format_type'] = $context['settings']['format_type'];
+ $display['settings']['fromto'] = $context['settings']['fromto'];
+ foreach ($items as $delta => $item) {
+ $date = date_formatter_process('date_default', $context['entity_type'], $context['entity'], $context['field'], $context['instance'], $context['language'], $item, $display);
+ switch ($display['settings']['fromto']) {
+ case 'both':
+ if ($date['value']['formatted'] != $date['value2']['formatted']) {
+ $diff_items[$delta] = t('@from to @to', array(
+ '@from' => $date['value']['formatted'],
+ '@to' => $date['value2']['formatted'],
+ ));
+ }
+ else {
+ $diff_items[$delta] = $date['value']['formatted'];
+ }
+ break;
+
+ case 'value':
+ case 'value2':
+ $diff_items[$delta] = $date[$display['settings']['fromto']]['formatted'];
+ break;
+
+ }
+ }
+ return $diff_items;
+}
+
+/**
+ * Provide default field comparison options.
+ */
+function date_field_diff_default_options($field_type) {
+ return array(
+ 'format_type' => 'long',
+ 'fromto' => 'both',
+ );
+}
+
+/**
+ * Provide a form for setting the field comparison options.
+ */
+function date_field_diff_options_form($field_type, $settings) {
+ $options_form = array();
+
+ $form['format_type'] = array(
+ '#title' => t('Choose how render dates and times'),
+ '#type' => 'select',
+ '#options' => date_format_type_options(),
+ '#default_value' => $settings['format_type'],
+ '#description' => t('To add or edit options, visit <a href="@date-time-page">Date and time settings</a>.', array('@date-time-page' => url('admin/config/regional/date-time'))),
+ '#weight' => 0,
+ );
+
+ $form['fromto'] = array(
+ '#title' => t('Display'),
+ '#type' => 'select',
+ '#options' => array(
+ 'both' => t('Both Start and End dates'),
+ 'value' => t('Start date only'),
+ 'value2' => t('End date only'),
+ ),
+ '#default_value' => $settings['fromto'],
+ '#weight' => 1,
+ );
+
+ return $options_form;
+}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.field.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.field.inc
index b104702..46ea317 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.field.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.field.inc
@@ -125,8 +125,16 @@ function date_field_formatter_view($entity_type, $entity, $field, $instance, $la
'attributes' => array(),
'rdf_mapping' => array(),
'add_rdf' => module_exists('rdf'),
+ 'microdata' => array(),
+ 'add_microdata' => module_exists('microdata'),
);
+ // If the microdata module is enabled, the microdata mapping will have been
+ // passed in via the entity.
+ if ($variables['add_microdata'] && isset($entity->microdata[$field['field_name']])) {
+ $variables['microdata'] = $entity->microdata[$field['field_name']];
+ }
+
// If there is an RDf mapping for this date field, pass it down to the theme.
$rdf_mapping = array();
if (!empty($entity->rdf_mapping) && function_exists('rdf_rdfa_attributes')) {
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.info
index e5b00c2..242937c 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.info
@@ -4,15 +4,17 @@ dependencies[] = date_api
package = Date/Time
core = 7.x
php = 5.2
+files[] = date.migrate.inc
files[] = tests/date_api.test
files[] = tests/date.test
files[] = tests/date_field.test
+files[] = tests/date_migrate.test
files[] = tests/date_validation.test
files[] = tests/date_timezone.test
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date.migrate.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.migrate.inc
index 637a626..095c789 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date.migrate.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.migrate.inc
@@ -5,6 +5,17 @@
* Support for migration into Date fields.
*/
+/**
+ * Implements hook_migrate_api().
+ */
+function date_migrate_api() {
+ $api = array(
+ 'api' => 2,
+ 'field handlers' => array('DateMigrateFieldHandler'),
+ );
+ return $api;
+}
+
class DateMigrateFieldHandler extends MigrateFieldHandler {
/**
@@ -57,37 +68,47 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
$arguments = array();
}
- if (isset($arguments['timezone'])) {
- $default_timezone = $arguments['timezone'];
- }
- else {
- $default_timezone = 'UTC';
- }
- if (isset($arguments['timezone_db'])) {
- $default_timezone_db = $arguments['timezone_db'];
- }
- else {
- $default_timezone_db = NULL;
- }
- if (isset($arguments['rrule'])) {
- $default_rrule = $arguments['rrule'];
- }
- else {
- $default_rrule = NULL;
- }
$language = $this->getFieldLanguage($entity, $field_info, $arguments);
- // Setup the standard Field API array for saving.
- $delta = 0;
- foreach ($values as $from) {
- // Set defaults.
- $to = NULL;
- $timezone = $default_timezone;
- $timezone_db = $default_timezone_db;
- $rrule = $default_rrule;
-
- // Is the value a straight datetime value, or JSON containing a set of
- // properties?
+ foreach ($values as $delta => $from) {
+ if (!empty($arguments['timezone'])) {
+ if (is_array($arguments['timezone'])) {
+ $timezone = $arguments['timezone'][$delta];
+ }
+ else {
+ $timezone = $arguments['timezone'];
+ }
+ }
+ else {
+ $timezone = 'UTC';
+ }
+
+ if (!empty($arguments['rrule'])) {
+ if (is_array($arguments['rrule'])) {
+ $rrule = $arguments['rrule'][$delta];
+ }
+ else {
+ $rrule = $arguments['rrule'];
+ }
+ }
+ else {
+ $rrule = NULL;
+ }
+
+ if (!empty($arguments['to'])) {
+ if (is_array($arguments['to'])) {
+ $to = $arguments['to'][$delta];
+ }
+ else {
+ $to = $arguments['to'];
+ }
+ }
+ else {
+ $to = NULL;
+ }
+
+ // Legacy support for JSON containing a set of properties - deprecated
+ // now that we have subfields.
if (!empty($from) && $from{0} == '{') {
$properties = drupal_json_decode($from);
$from = $properties['from'];
@@ -98,9 +119,6 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
if (!empty($properties['timezone'])) {
$timezone = $properties['timezone'];
}
- if (!empty($properties['timezone_db'])) {
- $timezone_db = $properties['timezone_db'];
- }
if (!empty($properties['rrule'])) {
$rrule = $properties['rrule'];
}
@@ -165,11 +183,18 @@ class DateMigrateFieldHandler extends MigrateFieldHandler {
$return[$language][$delta]['value2'] = $to;
}
}
- $delta++;
}
if (!isset($return)) {
$return = NULL;
}
return $return;
}
+
+ public function fields($migration = NULL) {
+ return array(
+ 'timezone' => t('Timezone'),
+ 'rrule' => t('Recurring event rule'),
+ 'to' => t('End date date'),
+ );
+ }
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.module b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.module
index 4f6a013..6f4560b 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.module
@@ -1,10 +1,8 @@
<?php
-
/**
* @file
* Defines date/time field types.
*/
-
module_load_include('theme', 'date', 'date');
module_load_include('inc', 'date', 'date.field');
module_load_include('inc', 'date', 'date_elements');
@@ -78,6 +76,8 @@ function date_theme() {
'attributes' => array(),
'rdf_mapping' => NULL,
'add_rdf' => NULL,
+ 'microdata' => NULL,
+ 'add_microdata' => NULL,
),
),
'date_display_range' => $base + array(
@@ -95,6 +95,8 @@ function date_theme() {
'attributes_end' => array(),
'rdf_mapping' => NULL,
'add_rdf' => NULL,
+ 'microdata' => NULL,
+ 'add_microdata' => NULL,
)),
'date_display_combination' => $base + array(
'variables' => array(
@@ -110,6 +112,8 @@ function date_theme() {
'attributes' => array(),
'rdf_mapping' => NULL,
'add_rdf' => NULL,
+ 'microdata' => NULL,
+ 'add_microdata' => NULL,
),
),
'date_display_interval' => $base + array(
@@ -247,7 +251,7 @@ function date_formatter_process($formatter, $entity_type, $entity, $field, $inst
elseif ($format == 'format_calendar_day') {
$dates[$processed]['calendar_day'] = date_format_calendar_day($date);
}
- elseif ($format == 'U') {
+ elseif ($format == 'U' || $format == 'r' || $format == 'c') {
$dates[$processed]['formatted'] = date_format_date($date, 'custom', $format);
$dates[$processed]['formatted_date'] = date_format_date($date, 'custom', $format);
$dates[$processed]['formatted_time'] = '';
@@ -543,6 +547,8 @@ function date_entity_metadata_property_info_alter(&$info, $entity_type, $field,
// The getter and setter callbacks for 'value' and 'value2'
// will not provide the field name as $name, we'll add it to $info.
'field_name' => $field['field_name'],
+ // Alert Microdata module that this value can be exposed in microdata.
+ 'microdata' => TRUE,
),
'value2' => array(
'type' => 'date',
@@ -552,6 +558,8 @@ function date_entity_metadata_property_info_alter(&$info, $entity_type, $field,
// The getter and setter callbacks for 'value' and 'value2'
// will not provide the field name as $name, we'll add it to $info.
'field_name' => $field['field_name'],
+ // Alert Microdata module that this value can be exposed in microdata.
+ 'microdata' => TRUE,
),
'duration' => array(
'type' => 'duration',
@@ -566,6 +574,11 @@ function date_entity_metadata_property_info_alter(&$info, $entity_type, $field,
);
unset($property['query callback']);
}
+ else {
+ // If this doesn't have a todate, it is handled as a date rather than a
+ // struct. Enable microdata on the field itself rather than the properties.
+ $property['microdata'] = TRUE;
+ }
}
/**
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.theme b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.theme
index 70c6be4..cc88e87 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date.theme
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date.theme
@@ -74,6 +74,8 @@ function theme_date_display_combination($variables) {
$attributes = $variables['attributes'];
$rdf_mapping = $variables['rdf_mapping'];
$add_rdf = $variables['add_rdf'];
+ $microdata = $variables['microdata'];
+ $add_microdata = $variables['add_microdata'];
$precision = date_granularity_precision($field['settings']['granularity']);
$output = '';
@@ -162,6 +164,8 @@ function theme_date_display_combination($variables) {
'attributes' => $attributes,
'rdf_mapping' => $rdf_mapping,
'add_rdf' => $add_rdf,
+ 'microdata' => $microdata,
+ 'add_microdata' => $add_microdata,
'dates' => $dates,
));
}
@@ -179,6 +183,8 @@ function theme_date_display_combination($variables) {
'attributes' => $attributes,
'rdf_mapping' => $rdf_mapping,
'add_rdf' => $add_rdf,
+ 'microdata' => $microdata,
+ 'add_microdata' => $add_microdata,
'dates' => $dates,
));
$replaced = str_replace($time1, $time, $date1);
@@ -200,6 +206,8 @@ function theme_date_display_combination($variables) {
'attributes' => $attributes,
'rdf_mapping' => $rdf_mapping,
'add_rdf' => $add_rdf,
+ 'microdata' => $microdata,
+ 'add_microdata' => $add_microdata,
'dates' => $dates,
));
}
@@ -211,7 +219,7 @@ function theme_date_display_combination($variables) {
* Template preprocess function for displaying a single date.
*/
function template_preprocess_date_display_single(&$variables) {
- if ($variables['add_rdf']) {
+ if ($variables['add_rdf'] || $variables['add_microdata']) {
// Pass along the rdf mapping for this field, if any. Add some default rdf
// attributes that will be used if not overridden by attributes passed in.
$rdf_mapping = $variables['rdf_mapping'];
@@ -222,6 +230,24 @@ function template_preprocess_date_display_single(&$variables) {
);
$variables['attributes'] = $variables['attributes'] + $base_attributes;
}
+
+ // Pass along microdata attributes, or set display to false if none are set.
+ if (!empty($variables['add_microdata'])) {
+ // Because the Entity API integration for Date has a variable data
+ // structure depending on whether there is an end value, the attributes
+ // could be attached to the field or to the value property.
+ if(!empty($variables['microdata']['#attributes']['itemprop'])) {
+ $variables['microdata']['value']['#attributes'] = $variables['microdata']['#attributes'];
+ }
+
+ // Add the machine readable time using the content attribute.
+ if(!empty($variables['microdata']['value']['#attributes'])) {
+ $variables['microdata']['value']['#attributes']['content'] = $variables['dates']['value']['formatted_iso'];
+ }
+ else {
+ $variables['add_microdata'] = FALSE;
+ }
+ }
}
/**
@@ -233,7 +259,13 @@ function theme_date_display_single($variables) {
$attributes = $variables['attributes'];
// Wrap the result with the attributes.
- return '<span class="date-display-single"' . drupal_attributes($attributes) . '>' . $date . $timezone . '</span>';
+ $output = '<span class="date-display-single"' . drupal_attributes($attributes) . '>' . $date . $timezone . '</span>';
+
+ if ($variables['add_microdata']) {
+ $output .= '<meta' . drupal_attributes($variables['microdata']['value']['#attributes']) . '/>';
+ }
+
+ return $output;
}
/**
@@ -247,7 +279,6 @@ function template_preprocess_date_display_range(&$variables) {
if ($variables['add_rdf']) {
// Pass along the rdf mapping for this field, if any. Add some default rdf
// attributes that will be used if not overridden by attributes passed in.
- $rdf_mapping = $variables['rdf_mapping'];
$dates = $variables['dates'];
$base_attributes = array(
'property' => array('dc:date'),
@@ -261,6 +292,17 @@ function template_preprocess_date_display_range(&$variables) {
$variables['attributes_end']['property'][$delta] = str_replace('start', 'end', $property);
}
}
+
+ // Pass along microdata attributes, or set display to false if none are set.
+ if ($variables['add_microdata']) {
+ if (!empty($variables['microdata']['value']['#attributes'])) {
+ $variables['microdata']['value']['#attributes']['content'] = $variables['dates']['value']['formatted_iso'];
+ $variables['microdata']['value2']['#attributes']['content'] = $variables['dates']['value2']['formatted_iso'];
+ }
+ else {
+ $variables['add_microdata'] = FALSE;
+ }
+ }
}
/**
@@ -273,10 +315,20 @@ function theme_date_display_range($variables) {
$attributes_start = $variables['attributes_start'];
$attributes_end = $variables['attributes_end'];
+ $start_date = '<span class="date-display-start"' . drupal_attributes($attributes_start) . '>' . $date1 . '</span>';
+ $end_date = '<span class="date-display-end"' . drupal_attributes($attributes_end) . '>' . $date2 . $timezone . '</span>';
+
+ // If microdata attributes for the start date property have been passed in,
+ // add the microdata in meta tags.
+ if (!empty($variables['add_microdata'])) {
+ $start_date .= '<meta' . drupal_attributes($variables['microdata']['value']['#attributes']) . '/>';
+ $end_date .= '<meta' . drupal_attributes($variables['microdata']['value2']['#attributes']) . '/>';
+ }
+
// Wrap the result with the attributes.
return t('!start-date to !end-date', array(
- '!start-date' => '<span class="date-display-start"' . drupal_attributes($attributes_start) . '>' . $date1 . '</span>',
- '!end-date' => '<span class="date-display-end"' . drupal_attributes($attributes_end) . '>' . $date2 . $timezone . '</span>',
+ '!start-date' => $start_date,
+ '!end-date' => $end_date,
));
}
@@ -326,6 +378,10 @@ function theme_date_combo($variables) {
'#attributes' => array(),
'#children' => $element['#children'],
);
+ // Add marker to required date fields.
+ if ($element['#required']) {
+ $fieldset['#title'] .= " " . theme('form_required_marker');
+ }
return theme('fieldset', array('element' => $fieldset));
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_admin.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_admin.inc
index 993aa09..0e32fc5 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_admin.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_admin.inc
@@ -370,11 +370,11 @@ function _date_field_widget_settings_form($field, $instance) {
);
if (in_array($widget['type'], array('date_select'))) {
$options = array('above' => t('Above'), 'within' => t('Within'), 'none' => t('None'));
- $description = t("The location of date part labels, like 'Year', 'Month', or 'Day' . 'Above' displays the label as titles above each date part. 'Within' inserts the label as the first option in the select list and in blank textfields. 'None' doesn't label any of the date parts. Theme functions like 'date_part_label_year' and 'date_part_label_month' control label text.");
+ $description = t("The location of date part labels, like 'Year', 'Month', or 'Day' . 'Above' displays the label as titles above each date part. 'Within' inserts the label as the first option in the select list and in blank textfields. 'None' doesn't visually label any of the date parts. Theme functions like 'date_part_label_year' and 'date_part_label_month' control label text.");
}
else {
$options = array('above' => t('Above'), 'none' => t('None'));
- $description = t("The location of date part labels, like 'Year', 'Month', or 'Day' . 'Above' displays the label as titles above each date part. 'None' doesn't label any of the date parts. Theme functions like 'date_part_label_year' and 'date_part_label_month' control label text.");
+ $description = t("The location of date part labels, like 'Year', 'Month', or 'Day' . 'Above' displays the label as titles above each date part. 'None' doesn't visually label any of the date parts. Theme functions like 'date_part_label_year' and 'date_part_label_month' control label text.");
}
$form['advanced']['label_position'] = array(
'#type' => 'radios',
@@ -453,6 +453,9 @@ function _date_field_settings_form($field, $instance, $has_data) {
$tz_handling = $settings['tz_handling'];
$description = t('Select the date attributes to collect and store.');
+ if ($has_data) {
+ $description .= ' ' . t('Changes to date attributes only effects new or updated content.');
+ }
$options = date_granularity_names();
$checkbox_year = array(
'#type' => 'checkbox',
@@ -469,7 +472,6 @@ function _date_field_settings_form($field, $instance, $has_data) {
'#options' => $options,
'#attributes' => array('class' => array('container-inline')),
'#description' => $description,
- '#disabled' => $has_data,
'year' => $checkbox_year,
);
@@ -499,7 +501,6 @@ function _date_field_settings_form($field, $instance, $has_data) {
'#default_value' => $tz_handling,
'#options' => date_timezone_handling_options(),
'#description' => $description,
- '#disabled' => $has_data,
'#attached' => array(
'js' => array(drupal_get_path('module', 'date') . '/date_admin.js'),
),
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_all_day/date_all_day.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_all_day/date_all_day.info
index 8f8bf48..14e1d86 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_all_day/date_all_day.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_all_day/date_all_day.info
@@ -5,9 +5,9 @@ dependencies[] = date
package = Date/Time
core = 7.x
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api.info
index ee1a384..19ac12c 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api.info
@@ -9,9 +9,9 @@ stylesheets[all][] = date.css
files[] = date_api.module
files[] = date_api_sql.inc
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api.module b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api.module
index d85a8a5..2ca0a33 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api.module
@@ -276,18 +276,17 @@ class DateObject extends DateTime {
$this->setGranularityFromTime($time, $tz);
}
}
- // If this tz was given as just an offset or the timezone
- // was invalid, we need to do some tweaking.
+
+ // If we haven't got a valid timezone name yet, we need to set one or
+ // we will get undefined index errors.
+ // This can happen if $time had an offset or no timezone.
if (!$this->getTimezone() || !preg_match('/[a-zA-Z]/', $this->getTimezone()->getName())) {
- // If the timezone name is an offset and the original
- // $tz has a name, use it. This happens if you pass in
- // a date string with an offset along with a specific timezone name.
- if (!preg_match('/[a-zA-Z]/', $this->getTimezone()->getName()) && preg_match('/[a-zA-Z]/', $tz->getName())) {
+ // If the original $tz has a name, use it.
+ if (preg_match('/[a-zA-Z]/', $tz->getName())) {
$this->setTimezone($tz);
}
- // If we get this far, we have no information about the timezone name,
- // but we will get undefined index errors without any name.
+ // We have no information about the timezone so must fallback to a default.
else {
$this->setTimezone(new DateTimeZone("UTC"));
$this->errors['timezone'] = t('No valid timezone name was provided.');
@@ -459,8 +458,8 @@ class DateObject extends DateTime {
$true = $this->hasGranularity() && (!$granularity || $flexible || $this->hasGranularity($granularity));
if (!$true && $granularity) {
foreach ((array) $granularity as $part) {
- if (!$this->hasGranularity($part)) {
- $this->errors[$part] = t("The @part is missing.", array('@part' => $part));
+ if (!$this->hasGranularity($part) && in_array($part, array('second', 'minute', 'hour', 'day', 'month', 'year'))) {
+ $this->errors[$part] = t("The $part is missing.");
}
}
}
@@ -574,7 +573,7 @@ class DateObject extends DateTime {
$regex2 = preg_replace($patterns, $repl2, $format_regexp, 1);
$regex2 = str_replace('A', '(AM|PM)', $regex2);
$regex2 = str_replace('a', '(am|pm)', $regex2);
- preg_match('`^' . $regex2 . '$`', $date, $values);
+ preg_match('`^' . $regex2 . '$`u', $date, $values);
array_shift($values);
// If we did not find all the values for the patterns in the format, abort.
if (count($letters) != count($values)) {
@@ -951,6 +950,11 @@ class DateObject extends DateTime {
if ($year_diff == 0) {
return intval($item2 - $item1);
}
+ elseif ($year_diff < 0) {
+ $item_diff = 0 - $item1;
+ $item_diff -= intval((abs($year_diff) - 1) * 12);
+ return $item_diff - (12 - $item2);
+ }
else {
$item_diff = 12 - $item1;
$item_diff += intval(($year_diff - 1) * 12);
@@ -965,6 +969,14 @@ class DateObject extends DateTime {
if ($year_diff == 0) {
return intval($item2 - $item1);
}
+ elseif ($year_diff < 0) {
+ $item_diff = 0 - $item1;
+ for ($i = 1; $i < abs($year_diff); $i++) {
+ date_modify($date1, '-1 year');
+ $item_diff -= date_days_in_year($date1);
+ }
+ return $item_diff - (date_days_in_year($date2) - $item2);
+ }
else {
$item_diff = date_days_in_year($date1) - $item1;
for ($i = 1; $i < $year_diff; $i++) {
@@ -978,9 +990,12 @@ class DateObject extends DateTime {
case 'weeks':
$week_diff = date_format($date2, 'W') - date_format($date1, 'W');
$year_diff = date_format($date2, 'o') - date_format($date1, 'o');
- for ($i = 1; $i <= $year_diff; $i++) {
- date_modify($date1, '+1 year');
- $week_diff += date_iso_weeks_in_year($date1);
+
+ $sign = ($year_diff < 0) ? -1 : 1;
+
+ for ($i = 1; $i <= abs($year_diff); $i++) {
+ date_modify($date1, (($sign > 0) ? '+': '-').'1 year');
+ $week_diff += (date_iso_weeks_in_year($date1) * $sign);
}
return $week_diff;
}
@@ -1705,13 +1720,21 @@ function date_format_interval($date, $granularity = 2, $display_ago = TRUE) {
* (optional) Optionally force time to a specific timezone, defaults to user
* timezone, if set, otherwise site timezone. Defaults to NULL.
*
+ * @param boolean $reset [optional]
+ * Static cache reset
+ *
* @return object
* The current time as a date object.
*/
-function date_now($timezone = NULL) {
- return new DateObject('now', $timezone);
-}
+function date_now($timezone = NULL, $reset = FALSE) {
+ $now = &drupal_static(__FUNCTION__);
+ if (!isset($now) || $reset) {
+ $now = new DateObject('now', $timezone);
+ }
+
+ return $now;
+}
/**
* Determines if a timezone string is valid.
*
@@ -2100,6 +2123,17 @@ function date_part_format($part, $format) {
* The format string with all other elements removed.
*/
function date_limit_format($format, $granularity) {
+ // Use the advanced drupal_static() pattern to improve performance.
+ static $drupal_static_fast;
+ if (!isset($drupal_static_fast)) {
+ $drupal_static_fast['formats'] = &drupal_static(__FUNCTION__);
+ }
+ $formats = &$drupal_static_fast['formats'];
+ $format_granularity_cid = $format .'|'. implode(',', $granularity);
+ if (isset($formats[$format_granularity_cid])) {
+ return $formats[$format_granularity_cid];
+ }
+
// If punctuation has been escaped, remove the escaping. Done using strtr()
// because it is easier than getting the escape character extracted using
// preg_replace().
@@ -2169,11 +2203,14 @@ function date_limit_format($format, $granularity) {
// After removing the non-desired parts of the format, test if the only things
// left are escaped, non-date, characters. If so, return nothing.
// Using S instead of w to pick up non-ASCII characters.
- $test = trim(preg_replace('(\\\\\S{1,3})', '', $format));
+ $test = trim(preg_replace('(\\\\\S{1,3})u', '', $format));
if (empty($test)) {
$format = '';
}
+ // Store the return value in the static array for performance.
+ $formats[$format_granularity_cid] = $format;
+
return $format;
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api_elements.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api_elements.inc
index 7da4e58..57e4161 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api_elements.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api_elements.inc
@@ -239,7 +239,8 @@ function date_timezone_element_process($element, &$form_state, $form) {
$label = theme('date_part_label_timezone', array('part_type' => 'select', 'element' => $element));
$element['timezone'] = array(
'#type' => 'select',
- '#title' => $element['#date_label_position'] == 'above' ? $label : '',
+ '#title' => $label,
+ '#title_display' => $element['#date_label_position'] == 'above' ? 'before' : 'invisible',
'#options' => date_timezone_names($element['#required']),
'#value' => $element['#value'],
'#weight' => $element['#weight'],
@@ -320,6 +321,8 @@ function date_text_element_process($element, &$form_state, $form) {
$element['date']['#weight'] = !empty($element['date']['#weight']) ? $element['date']['#weight'] : $element['#weight'];
$element['date']['#attributes'] = array('class' => isset($element['#attributes']['class']) ? $element['#attributes']['class'] += array('date-date') : array('date-date'));
$now = date_example_date();
+ $element['date']['#title'] = t('Date');
+ $element['date']['#title_display'] = 'invisible';
$element['date']['#description'] = ' ' . t('Format: @date', array('@date' => date_format_date(date_example_date(), 'custom', $element['#date_format'])));
$element['date']['#ajax'] = !empty($element['#ajax']) ? $element['#ajax'] : FALSE;
@@ -585,6 +588,8 @@ function date_parts_element($element, $date, $format) {
$sub_element[$field]['#type'] = 'textfield';
$sub_element[$field]['#theme'] = 'date_textfield_element';
$sub_element[$field]['#size'] = 7;
+ $sub_element[$field]['#title'] = $label;
+ $sub_element[$field]['#title_display'] = in_array($element['#date_label_position'], array('within', 'none')) ? 'invisible' : 'before';
if ($element['#date_label_position'] == 'within') {
if (!empty($sub_element[$field]['#options']) && is_array($sub_element[$field]['#options'])) {
$sub_element[$field]['#options'] = array(
@@ -594,20 +599,16 @@ function date_parts_element($element, $date, $format) {
$sub_element[$field]['#default_value'] = '-' . $label;
}
}
- elseif ($element['#date_label_position'] != 'none') {
- $sub_element[$field]['#title'] = $label;
- }
}
else {
$sub_element[$field]['#type'] = 'select';
$sub_element[$field]['#theme'] = 'date_select_element';
+ $sub_element[$field]['#title'] = $label;
+ $sub_element[$field]['#title_display'] = in_array($element['#date_label_position'], array('within', 'none')) ? 'invisible' : 'before';
if ($element['#date_label_position'] == 'within') {
$sub_element[$field]['#options'] = array(
'' => '-' . $label) + $sub_element[$field]['#options'];
}
- elseif ($element['#date_label_position'] != 'none') {
- $sub_element[$field]['#title'] = $label;
- }
}
}
@@ -621,9 +622,12 @@ function date_parts_element($element, $date, $format) {
}
if (($hours_format == 'g' || $hours_format == 'h') && date_has_time($granularity)) {
+ $label = theme('date_part_label_ampm', array('part_type' => 'ampm', 'element' => $element));
$sub_element['ampm'] = array(
'#type' => 'select',
'#theme' => 'date_select_element',
+ '#title' => $label,
+ '#title_display' => in_array($element['#date_label_position'], array('within', 'none')) ? 'invisible' : 'before',
'#default_value' => is_object($date) ? (date_format($date, 'G') >= 12 ? 'pm' : 'am') : '',
'#options' => drupal_map_assoc(date_ampm($part_required)),
'#required' => $part_required,
@@ -631,10 +635,7 @@ function date_parts_element($element, $date, $format) {
'#attributes' => array('class' => array('date-ampm')),
);
if ($element['#date_label_position'] == 'within') {
- $sub_element['ampm']['#options'] = array('' => '-' . theme('date_part_label_ampm', array('part_type' => 'ampm', 'eleement' => $element))) + $sub_element['ampm']['#options'];
- }
- elseif ($element['#date_label_position'] != 'none') {
- $sub_element['ampm']['#title'] = theme('date_part_label_ampm', array('part_type' => 'ampm', 'element' => $element));
+ $sub_element['ampm']['#options'] = array('' => '-' . $label) + $sub_element['ampm']['#options'];
}
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api_sql.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api_sql.inc
index a2adc65..e02f050 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api_sql.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_api/date_api_sql.inc
@@ -20,9 +20,8 @@
* Correct sql string for database type.
*/
function date_sql_concat($array) {
- switch (db_driver()) {
+ switch (Database::getConnection()->databaseType()) {
case 'mysql':
- case 'mysqli':
return "CONCAT(" . implode(",", $array) . ")";
case 'pgsql':
return implode(" || ", $array);
@@ -39,9 +38,8 @@ function date_sql_concat($array) {
* SQL statement to return the first non-NULL value in the list.
*/
function date_sql_coalesce($array) {
- switch (db_driver()) {
+ switch (Database::getConnection()->databaseType()) {
case 'mysql':
- case 'mysqli':
case 'pgsql':
return "COALESCE(" . implode(',', $array) . ")";
}
@@ -89,7 +87,7 @@ class date_sql_handler {
* The object constuctor.
*/
function __construct($date_type = DATE_DATETIME, $local_timezone = NULL, $offset = '+00:00') {
- $this->db_type = db_driver();
+ $this->db_type = Database::getConnection()->databaseType();
$this->date_type = $date_type;
$this->db_timezone = 'UTC';
$this->local_timezone = isset($local_timezone) ? $local_timezone : date_default_timezone();
@@ -105,7 +103,6 @@ class date_sql_handler {
$has_support = FALSE;
switch ($this->db_type) {
case 'mysql':
- case 'mysqli':
$test = db_query("SELECT CONVERT_TZ('2008-02-15 12:00:00', 'UTC', 'US/Central')")->fetchField();
if ($test == '2008-02-15 06:00:00') {
$has_support = TRUE;
@@ -141,11 +138,10 @@ class date_sql_handler {
*/
function set_db_timezone($offset = '+00:00') {
static $already_set = FALSE;
- $type = db_driver();
+ $type = Database::getConnection()->databaseType();
if (!$already_set) {
switch ($type) {
case 'mysql':
- case 'mysqli':
db_query("SET @@session.time_zone = '$offset'");
break;
case 'pgsql':
@@ -199,7 +195,6 @@ class date_sql_handler {
}
switch ($this->db_type) {
case 'mysql':
- case 'mysqli':
switch ($this->date_type) {
case DATE_UNIX:
$field = "FROM_UNIXTIME($field)";
@@ -258,7 +253,6 @@ class date_sql_handler {
if (!empty($offset)) {
switch ($this->db_type) {
case 'mysql':
- case 'mysqli':
return "ADDTIME($field, SEC_TO_TIME($offset))";
case 'pgsql':
return "($field + INTERVAL '$offset SECONDS')";;
@@ -288,7 +282,6 @@ class date_sql_handler {
$granularity = strtoupper($granularity);
switch ($this->db_type) {
case 'mysql':
- case 'mysqli':
switch ($direction) {
case 'ADD':
return "DATE_ADD($field, INTERVAL $count $granularity)";
@@ -358,7 +351,6 @@ class date_sql_handler {
else {
switch ($this->db_type) {
case 'mysql':
- case 'mysqli':
return "CONVERT_TZ($field, $db_zone, $localzone)";
case 'pgsql':
// WITH TIME ZONE assumes the date is using the system
@@ -382,7 +374,6 @@ class date_sql_handler {
function sql_format($format, $field) {
switch ($this->db_type) {
case 'mysql':
- case 'mysqli':
$replace = array(
'Y' => '%Y',
'y' => '%y',
@@ -553,7 +544,6 @@ class date_sql_handler {
case 'WEEK':
switch ($this->db_type) {
case 'mysql':
- case 'mysqli':
// WEEK using arg 3 in MySQl should return the same value as
// Postgres EXTRACT.
return "WEEK($field, 3)";
@@ -563,7 +553,6 @@ class date_sql_handler {
case 'DOW':
switch ($this->db_type) {
case 'mysql':
- case 'mysqli':
// MySQL returns 1 for Sunday through 7 for Saturday, PHP date
// functions and Postgres use 0 for Sunday and 6 for Saturday.
return "INTEGER(DAYOFWEEK($field) - 1)";
@@ -573,7 +562,6 @@ class date_sql_handler {
case 'DOY':
switch ($this->db_type) {
case 'mysql':
- case 'mysqli':
return "DAYOFYEAR($field)";
case 'pgsql':
return "EXTRACT(DOY FROM($field))";
@@ -896,30 +884,30 @@ class date_sql_handler {
}
$formats = array('display', 'sql');
// Start with the site long date format and add seconds to it.
- $long = str_replace(':i', ':i:s', variable_get('date_format_long', 'l, F j, Y - H:i'));
+ $short = str_replace(':i', ':i:s', variable_get('date_format_short', 'l, F j, Y - H:i'));
switch ($granularity) {
case 'year':
$formats['display'] = 'Y';
$formats['sql'] = 'Y';
break;
case 'month':
- $formats['display'] = date_limit_format($long, array('year', 'month'));
+ $formats['display'] = date_limit_format($short, array('year', 'month'));
$formats['sql'] = 'Y-m';
break;
case 'day':
- $formats['display'] = date_limit_format($long, array('year', 'month', 'day'));
+ $formats['display'] = date_limit_format($short, array('year', 'month', 'day'));
$formats['sql'] = 'Y-m-d';
break;
case 'hour':
- $formats['display'] = date_limit_format($long, array('year', 'month', 'day', 'hour'));
+ $formats['display'] = date_limit_format($short, array('year', 'month', 'day', 'hour'));
$formats['sql'] = 'Y-m-d\TH';
break;
case 'minute':
- $formats['display'] = date_limit_format($long, array('year', 'month', 'day', 'hour', 'minute'));
+ $formats['display'] = date_limit_format($short, array('year', 'month', 'day', 'hour', 'minute'));
$formats['sql'] = 'Y-m-d\TH:i';
break;
case 'second':
- $formats['display'] = date_limit_format($long, array('year', 'month', 'day', 'hour', 'minute', 'second'));
+ $formats['display'] = date_limit_format($short, array('year', 'month', 'day', 'hour', 'minute', 'second'));
$formats['sql'] = 'Y-m-d\TH:i:s';
break;
case 'week':
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_context/date_context.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_context/date_context.info
index a69a599..5f4a042 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_context/date_context.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_context/date_context.info
@@ -8,9 +8,9 @@ dependencies[] = context
files[] = date_context.module
files[] = plugins/date_context_date_condition.inc
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_context/plugins/date_context_date_condition.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_context/plugins/date_context_date_condition.inc
index 733fb5a..573b035 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_context/plugins/date_context_date_condition.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_context/plugins/date_context_date_condition.inc
@@ -41,7 +41,7 @@ class date_context_date_condition extends context_condition_node {
'#description' => t("The value the field should contain to meet the condition. This can either be an absolute date in ISO format (YYYY-MM-DDTHH:MM:SS) or a relative string like '12AM today'. Examples: 2011-12-31T00:00:00, now, now +1 day, 12AM today, Monday next week. <a href=\"@relative_format\">More examples of relative date formats in the PHP documentation</a>.", array('@relative_format' => 'http://www.php.net/manual/en/datetime.formats.relative.php')),
'#default_value' => isset($defaults['value']) ? $defaults['value'] : '',
'#process' => array('ctools_dependent_process'),
- '#dependency' => array(':input[name="conditions[plugins][date_context_date_condition][options][operation]"]' => array('<', '<=', '>', '>=', '=', '!=')),
+ '#dependency' => array('edit-conditions-plugins-date-context-date-condition-options-operation' => array('<', '<=', '>', '>=', '=', '!=')),
);
return $form;
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_elements.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_elements.inc
index 20620ed..4303d13 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_elements.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_elements.inc
@@ -77,7 +77,7 @@ function date_field_widget_form(&$form, &$form_state, $field, $instance, $langco
// lose all but the first value by doing this, so store the original values in case we need to replace them later.
if (!empty($field['settings']['repeat'])) {
if ($delta == 0) {
- $form['#after_build'] = array('date_repeat_after_build');
+ $form['#after_build'][] = 'date_repeat_after_build';
$form_state['storage']['repeat_fields'][$field_name] = array_merge($form['#parents'], array($field_name));
$form_state['storage']['date_items'][$field_name][$langcode] = $items;
}
@@ -320,7 +320,7 @@ function date_combo_element_process($element, &$form_state, $form) {
'#field' => $field,
'#instance' => $instance,
'#weight' => $instance['widget']['weight'],
- '#required' => ($instance['required'] && $delta == 0) ? 1 : 0,
+ '#required' => ($element['#required'] && $delta == 0) ? 1 : 0,
'#default_value' => isset($element['#default_value'][$from_field]) ? $element['#default_value'][$from_field] : '',
'#delta' => $delta,
'#date_timezone' => $element['#date_timezone'],
@@ -331,7 +331,8 @@ function date_combo_element_process($element, &$form_state, $form) {
'#date_label_position' => $instance['widget']['settings']['label_position'],
);
- $description = !empty($instance['description']) ? t($instance['description']) : '';
+ $description = !empty($element['#description']) ? t($element['#description']) : '';
+ unset($element['#description']);
// Give this element the right type, using a Date API
// or a Date Popup element type.
@@ -363,8 +364,8 @@ function date_combo_element_process($element, &$form_state, $form) {
// is the 'Start' and which is the 'End' .
if (!empty($field['settings']['todate'])) {
- $element[$from_field]['#title'] = '';
$element[$to_field] = $element[$from_field];
+ $element[$from_field]['#title_display'] = 'none';
$element[$to_field]['#title'] = t('to:');
$element[$from_field]['#wrapper_attributes']['class'][] = 'start-date-wrapper';
$element[$to_field]['#wrapper_attributes']['class'][] = 'end-date-wrapper';
@@ -451,8 +452,8 @@ function date_combo_validate($element, &$form_state) {
return;
}
- $item = $form_values[$field_name][$langcode][$delta];
- $posted = $form_input[$field_name][$langcode][$delta];
+ $item = drupal_array_get_nested_value($form_state['values'], $element['#parents']);
+ $posted = drupal_array_get_nested_value($form_state['input'], $element['#parents']);
$field = field_widget_field($element, $form_state);
$instance = field_widget_instance($element, $form_state);
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.info
index c0d536f..7cd23a4 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.info
@@ -1,16 +1,12 @@
name = Date Migration
-description = Provides support for importing into date fields with the Migrate module.
+description = Obsolete data migration module. Disable if no other modules depend on it.
core = 7.x
package = Date/Time
+hidden = TRUE
-dependencies[] = migrate
-dependencies[] = date
-files[] = date.migrate.inc
-files[] = date_migrate.test
-
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.module b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.module
index accdcf8..158791a 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.module
@@ -2,15 +2,5 @@
/**
* @file
- * Migration integration for Date Migrate.
+ * Obsolete migration integration for Date - now in Date itself.
*/
-
-/**
- * Implements hook_migrate_api().
- */
-function date_migrate_migrate_api() {
- $api = array(
- 'api' => 2,
- );
- return $api;
-}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.info
index b54a3f7..e5bbc8a 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.info
@@ -2,7 +2,6 @@ core = "7.x"
dependencies[] = "date"
dependencies[] = "date_repeat"
dependencies[] = "date_repeat_field"
-dependencies[] = "date_migrate"
dependencies[] = "features"
dependencies[] = "migrate"
description = "Examples of migrating with the Date module"
@@ -21,9 +20,9 @@ package = "Features"
project = "date_migrate_example"
version = "7.x-2.0"
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
index 491c27f..fcc2a22 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.migrate.inc
@@ -13,8 +13,8 @@ class DateExampleMigration extends XMLMigration {
/**
* Sets up the migration.
*/
- public function __construct() {
- parent::__construct();
+ public function __construct($arguments = array()) {
+ parent::__construct($arguments);
$this->description = t('Example migration into date fields');
$this->map = new MigrateSQLMap($this->machineName,
@@ -66,28 +66,34 @@ class DateExampleMigration extends XMLMigration {
// For date ranges, we add the "end" value in prepareRow() below.
$this->addFieldMapping('field_date_range', 'date_range_from');
+ $this->addFieldMapping('field_date_range:to', 'date_range_to');
// RRULEs on repeat fields are also done in prepareRow().
$this->addFieldMapping('field_date_repeat', 'date_repeat');
+ $this->addFieldMapping('field_date_repeat:rrule', 'date_repeat_rrule');
$this->addFieldMapping('field_datestamp', 'datestamp')
->xpath('datestamp');
$this->addFieldMapping('field_datestamp_range', 'datestamp_range_from');
+ $this->addFieldMapping('field_datestamp_range:to', 'datestamp_range_to');
// You can specify a timezone to be applied to all values going into the
// field (Tokyo is UTC+9, no DST)
- $arguments = DateMigrateFieldHandler::arguments('Asia/Tokyo');
$this->addFieldMapping('field_datetime', 'datetime')
- ->xpath('datetime')
- ->arguments($arguments);
+ ->xpath('datetime');
+ $this->addFieldMapping('field_datetime:timezone')
+ ->defaultValue('Asia/Tokyo');
// You can also get the timezone from the source data - it can be different
// for each instance of the field. Like To and RRULE values, it is added
// in prepareRow().
$this->addFieldMapping('field_datetime_range', 'datetime_range_from');
+ $this->addFieldMapping('field_datetime_range:to', 'datetime_range_to');
+ $this->addFieldMapping('field_datetime_range:timezone', 'datetime_range_timezone');
// Unmapped destination fields.
- $this->addUnmigratedDestinations(array('is_new', 'status', 'promote', 'revision', 'language', 'sticky', 'created', 'changed', 'revision_uid'));
+ $this->addUnmigratedDestinations(array('is_new', 'status', 'promote',
+ 'revision', 'language', 'sticky', 'created', 'changed', 'revision_uid'));
}
/**
@@ -101,30 +107,25 @@ class DateExampleMigration extends XMLMigration {
// The date range field can have multiple values.
$current_row->date_range_from = array();
foreach ($current_row->xml->date_range as $range) {
- $date_data = array(
- 'from' => (string) $range->from[0],
- 'to' => (string) $range->to[0],
- );
- $current_row->date_range_from[] = drupal_json_encode($date_data);
+ $current_row->date_range_from[] = (string)$range->from[0];
+ $current_row->date_range_to[] = (string)$range->to[0];
}
- $date_data = array(
- 'from' => (string) $current_row->xml->datestamp_range->from[0],
- 'to' => (string) $current_row->xml->datestamp_range->to[0],
- );
- $current_row->datestamp_range_from = drupal_json_encode($date_data);
-
- $date_data = array(
- 'from' => (string) $current_row->xml->datetime_range->from[0],
- 'to' => (string) $current_row->xml->datetime_range->to[0],
- 'timezone' => (string) $current_row->xml->datetime_range->timezone[0],
- );
- $current_row->datetime_range_from = drupal_json_encode($date_data);
-
- $date_data = array(
- 'from' => (string) $current_row->xml->date_repeat->date[0],
- 'rrule' => (string) $current_row->xml->date_repeat->rule[0],
- );
- $current_row->date_repeat = drupal_json_encode($date_data);
+ $current_row->datestamp_range_from =
+ (string) $current_row->xml->datestamp_range->from[0];
+ $current_row->datestamp_range_to =
+ (string) $current_row->xml->datestamp_range->to[0];
+
+ $current_row->datetime_range_from =
+ (string) $current_row->xml->datetime_range->from[0];
+ $current_row->datetime_range_to =
+ (string) $current_row->xml->datetime_range->to[0];
+ $current_row->datetime_range_timezone =
+ (string) $current_row->xml->datetime_range->timezone[0];
+
+ $current_row->date_repeat =
+ (string) $current_row->xml->date_repeat->date[0];
+ $current_row->date_repeat_rrule =
+ (string) $current_row->xml->date_repeat->rule[0];
}
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.module b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.module
index 993bd11..2ed7a61 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate_example/date_migrate_example.module
@@ -13,6 +13,9 @@ include_once 'date_migrate_example.features.inc';
function date_migrate_example_migrate_api() {
$api = array(
'api' => 2,
+ 'migrations' => array(
+ 'DateExample' => array('class_name' => 'DateExampleMigration')
+ ),
);
return $api;
}
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/README.txt b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/README.txt
index 149810f..7a66628 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/README.txt
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/README.txt
@@ -18,7 +18,7 @@ Timepicker
================================================================================
There are three ways to let users select time in the Date Popup widgets.
-You can choose between them by going to admin/config/content/date_popup.
+You can choose between them by going to admin/config/date/date_popup.
The options are:
@@ -99,10 +99,10 @@ Example:
$form['date'] = array(
'#type' => 'date_popup',
- '#default_value' => '2007-01-01 10:30:00,
+ '#default_value' => '2007-01-01 10:30:00',
'#date_type' => DATE_DATETIME,
'#date_timezone' => date_default_timezone(),
- '#date_format' => 'm/d/Y - H:i',
+ '#date_format' => 'm-d-Y H:i',
'#date_increment' => 1,
'#date_year_range' => '-3:+3',
);
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/date_popup.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/date_popup.info
index 767aaca..cdaf48e 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/date_popup.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/date_popup.info
@@ -7,9 +7,9 @@ configure = admin/config/date/date_popup
stylesheets[all][] = themes/datepicker.1.7.css
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/date_popup.module b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/date_popup.module
index ca292ef..a2d0ebb 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/date_popup.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_popup/date_popup.module
@@ -87,7 +87,7 @@ function date_popup_library() {
$path . '/jquery.timeentry.pack.js' => array(),
),
'css' => array(
- $path . '/themes/jquery.timeentry.css' => array('preprocess' => FALSE),
+ $path . '/themes/jquery.timeentry.css' => array(),
),
);
return $libraries;
@@ -352,7 +352,8 @@ function date_popup_process_date_part(&$element) {
$parents = array_merge($element['#parents'], array('date'));
$sub_element = array(
'#type' => 'textfield',
- '#title' => $element['#date_label_position'] == 'above' ? theme('date_part_label_date', array('part_type' => 'date', 'element' => $element)) : '',
+ '#title' => theme('date_part_label_date', array('part_type' => 'date', 'element' => $element)),
+ '#title_display' => $element['#date_label_position'] == 'above' ? 'before' : 'invisible',
'#default_value' => $element['#value']['date'],
'#id' => $id,
'#input' => FALSE,
@@ -427,7 +428,8 @@ function date_popup_process_time_part(&$element) {
$parents = array_merge($element['#parents'], array('time'));
$sub_element = array(
'#type' => 'textfield',
- '#title' => $element['#date_label_position'] == 'above' ? theme('date_part_label_time', array('part_type' => 'time', 'element' => $element)) : '',
+ '#title' => theme('date_part_label_time', array('part_type' => 'time', 'element' => $element)),
+ '#title_display' => $element['#date_label_position'] == 'above' ? 'before' : 'invisible',
'#default_value' => $element['#value']['time'],
'#id' => $id,
'#size' => 15,
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat/date_repeat.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat/date_repeat.info
index 1d1720a..d42bec9 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat/date_repeat.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat/date_repeat.info
@@ -7,9 +7,9 @@ php = 5.2
files[] = tests/date_repeat.test
files[] = tests/date_repeat_form.test
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat/date_repeat_form.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat/date_repeat_form.inc
index 9cef000..db7a79b 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat/date_repeat_form.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat/date_repeat_form.inc
@@ -941,7 +941,6 @@ function theme_date_repeat_current_additions($rows = array()) {
*/
function theme_date_repeat_rrule($vars) {
$element = $vars['element'];
- $class = $element['#date_repeat_collapsed'] ? array('date-no-float', 'collapsible', 'collapsed') : array('date-no-float', 'collapsible');
$id = drupal_html_id('repeat-settings-fieldset');
$parents = $element['#parents'];
$selector = "{$parents[0]}[{$parents[1]}][{$parents[2]}][show_repeat_settings]";
@@ -949,11 +948,10 @@ function theme_date_repeat_rrule($vars) {
'#type' => 'item',
'#title' => t('Repeat settings'),
'#title_display' => 'invisible',
- '#attributes' => array('class' => $class),
'#markup' => $element['#children'],
'#states' => array(
- 'visible' => array(
- ":input[name=\"{$selector}\"]" => array('checked' => TRUE),
+ 'invisible' => array(
+ ":input[name=\"{$selector}\"]" => array('checked' => FALSE),
),
),
'#id' => $id,
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat_field/date_repeat_field.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat_field/date_repeat_field.info
index 803105c..90d556c 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat_field/date_repeat_field.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat_field/date_repeat_field.info
@@ -7,9 +7,9 @@ stylesheets[all][] = date_repeat_field.css
package = Date/Time
core = 7.x
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat_field/date_repeat_field.module b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat_field/date_repeat_field.module
index 675ed02..c04e13e 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat_field/date_repeat_field.module
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_repeat_field/date_repeat_field.module
@@ -55,7 +55,7 @@ function theme_date_repeat_display($vars) {
$output = '';
if (!empty($item['rrule'])) {
$output = date_repeat_rrule_description($item['rrule']);
- $output = '<div>' . $output . '</div>';
+ $output = '<div class="date-repeat-rule">' . $output . '</div>';
}
return $output;
}
@@ -346,15 +346,8 @@ function date_repeat_field_widget_validate($element, &$form_state) {
// the repeating dates, wipe out the previous values, and populate the
// field with the new values.
- // TODO
- // Is it right to not do anything unless there are changes? Will that
- // confuse anyone? Commenting that out for now...
$rrule = $item['rrule'];
- if (!empty($rrule)
- //&& ($rrule != $element['rrule']['#prev_rrule']
- //|| $item['value'] != $element['rrule']['#prev_value']
- //|| $item['value2'] != $element['rrule']['#prev_value2'])
- ) {
+ if (!empty($rrule)) {
// Avoid undefined index problems on dates that don't have all parts.
$possible_items = array('value', 'value2', 'timezone', 'offset', 'offset2');
@@ -514,9 +507,6 @@ function date_repeat_field_date_combo_process_alter(&$element, &$form_state, $co
'#date_increment' => $instance['widget']['settings']['increment'],
'#date_year_range' => $instance['widget']['settings']['year_range'],
'#date_label_position' => $instance['widget']['settings']['label_position'],
- '#prev_value' => isset($item['value']) ? $item['value'] : '',
- '#prev_value2' => isset($item['value2']) ? $item['value2'] : '',
- '#prev_rrule' => isset($item['rrule']) ? $item['rrule'] : '',
'#date_repeat_widget' => str_replace('_repeat', '', $instance['widget']['type']),
'#date_repeat_collapsed' => $instance['widget']['settings']['repeat_collapsed'],
'#date_flexible' => 0,
@@ -626,6 +616,17 @@ function date_repeat_field_form_field_ui_field_edit_form_alter(&$form, &$form_st
$form['field']['cardinality']['#disabled'] = TRUE;
$form['field']['cardinality']['#value'] = FIELD_CARDINALITY_UNLIMITED;
}
+ // Repeating dates need unlimited values, confirm that in element_validate.
+ $form['field']['#element_validate'] = array('date_repeat_field_set_cardinality');
+}
+
+/**
+ * Ensure the cardinality gets updated if the option to make a date repeating is checked.
+ */
+function date_repeat_field_set_cardinality($element, &$form_state) {
+ if (!empty($form_state['values']['field']['settings']['repeat'])) {
+ form_set_value($element['cardinality'], FIELD_CARDINALITY_UNLIMITED, $form_state);
+ }
}
/**
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_tools/date_tools.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_tools/date_tools.info
index 3f392a4..51b8691 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_tools/date_tools.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_tools/date_tools.info
@@ -6,9 +6,9 @@ core = 7.x
configure = admin/config/date/tools
files[] = tests/date_tools.test
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/date_views.info b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/date_views.info
index ef7da6c..4abeb60 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/date_views.info
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/date_views.info
@@ -9,13 +9,12 @@ files[] = includes/date_views_argument_handler.inc
files[] = includes/date_views_argument_handler_simple.inc
files[] = includes/date_views_filter_handler.inc
files[] = includes/date_views_filter_handler_simple.inc
-files[] = includes/date_views.views_default.inc
files[] = includes/date_views.views.inc
files[] = includes/date_views_plugin_pager.inc
-; Information added by drupal.org packaging script on 2012-08-13
-version = "7.x-2.6"
+; Information added by Drupal.org packaging script on 2013-12-21
+version = "7.x-2.7"
core = "7.x"
project = "date"
-datestamp = "1344850024"
+datestamp = "1387659206"
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc
index faff05a..2d3fb7c 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_argument_handler_simple.inc
@@ -85,7 +85,7 @@ class date_views_argument_handler_simple extends views_handler_argument_date {
$options = parent::option_definition();
$options['year_range'] = array('default' => '-3:+3');
$options['granularity'] = array('default' => 'month');
- $options['default_argument_type'] = array('default' => 'date');
+ $options['default_argument_type']['default'] = 'date';
$options['add_delta'] = array('default' => '');
$options['use_fromto'] = array('default' => '');
$options['title_format'] = array('default' => '');
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_filter_handler.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_filter_handler.inc
index 5eb5ebc..0cfc7fc 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_filter_handler.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_filter_handler.inc
@@ -36,6 +36,10 @@ class date_views_filter_handler extends date_views_filter_handler_simple {
$this->date_combine_conditions('op_simple');
}
+ function op_contains($field) {
+ $this->date_combine_conditions('op_contains');
+ }
+
/**
* Combines multiple date WHERE expressions into a single WHERE expression.
*
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc
index 8a46253..b84eac3 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc
@@ -42,6 +42,17 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
return $options;
}
+ function operators() {
+ $operators = parent::operators();
+ $operators['contains'] = array(
+ 'title' => t('Contains'),
+ 'method' => 'op_contains',
+ 'short' => t('contains'),
+ 'values' => 1,
+ );
+ return $operators;
+ }
+
/**
* Helper function to find a default value.
*/
@@ -53,8 +64,8 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
// If this is a remembered value, use the value from the SESSION.
if (!empty($this->options['expose']['remember'])) {
$display_id = ($this->view->display_handler->is_defaulted('filters')) ? 'default' : $this->view->current_display;
- if (!empty($_SESSION['views'][$this->view->name][$display_id]['date_filter'][$prefix])) {
- return $_SESSION['views'][$this->view->name][$display_id]['date_filter'][$prefix];
+ if (!empty($_SESSION['views'][$this->view->name][$display_id][$this->options['expose']['identifier']][$prefix])) {
+ return $_SESSION['views'][$this->view->name][$display_id][$this->options['expose']['identifier']][$prefix];
}
}
@@ -104,8 +115,12 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
$element_input['value'] = $this->get_filter_value('value', !empty($element_input['value']) ? $element_input['value'] : '');
$element_input['min'] = $this->get_filter_value('min', !empty($element_input['min']) ? $element_input['min'] : '');
$element_input['max'] = $this->get_filter_value('max', !empty($element_input['max']) ? $element_input['max'] : '');
- unset($element_input['default_date']);
- unset($element_input['default_to_date']);
+ if (is_array($element_input) && isset($element_input['default_date'])) {
+ unset($element_input['default_date']);
+ }
+ if (is_array($element_input) && isset($element_input['default_to_date'])) {
+ unset($element_input['default_to_date']);
+ }
$input[$this->options['expose']['identifier']] = $element_input;
}
@@ -163,6 +178,29 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
$this->query->add_where_expression($group, "$field $this->operator $placeholder", array($placeholder => $value));
}
+ function op_contains($field) {
+
+ // Add the delta field to the view so we can later find the value that matched our query.
+ list($table_name, $field_name) = explode('.', $field);
+ if (!empty($this->options['add_delta']) && (substr($field_name, -6) == '_value' || substr($field_name, -7) == '_value2')) {
+ $this->query->add_field($table_name, 'delta');
+ }
+
+ $value = $this->get_filter_value('value', $this->value['value']);
+ $comp_date = new DateObject($value, date_default_timezone(), $this->format);
+ $fields = date_views_fields($this->base_table);
+ $fields = $fields['name'];
+ $fromto = $fields[$field]['fromto'];
+ $field_min = $this->date_handler->sql_field($fromto[0], NULL, $comp_date);
+ $field_min = $this->date_handler->sql_format($this->format, $field_min);
+ $field_max = $this->date_handler->sql_field($fromto[1], NULL, $comp_date);
+ $field_max = $this->date_handler->sql_format($this->format, $field_max);
+ $placeholder_min = $this->placeholder();
+ $placeholder_max = $this->placeholder();
+ $group = !empty($this->options['date_group']) ? $this->options['date_group'] : $this->options['group'];
+ $this->query->add_where_expression($group, "$field_max >= $placeholder_min AND $field_min <= $placeholder_max", array($placeholder_min => $value, $placeholder_max => $value));
+ }
+
/**
* Set the granularity of the date parts to use in the filter.
*/
@@ -316,7 +354,7 @@ class date_views_filter_handler_simple extends views_handler_filter_date {
$type = 'date_text';
}
- $format = $this->date_handler->views_formats($this->options['granularity'], 'sql');
+ $format = $this->date_handler->views_formats($this->options['granularity'], 'display');
$granularity = array_keys($this->date_handler->date_parts($this->options['granularity']));
$relative_value = ($prefix == 'max' ? $this->options['default_to_date'] : $this->options['default_date']);
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.test b/kolab.org/www/drupal-7.18/sites/all/modules/date/tests/date_migrate.test
index 400b2d2..cdde115 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/date/date_migrate/date_migrate.test
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/date/tests/date_migrate.test
@@ -15,9 +15,9 @@ class DateMigrateExampleUnitTest extends DrupalWebTestCase {
*/
public static function getInfo() {
return array(
- 'name' => 'Date2 migration',
- 'description' => 'Testing migration of date fields',
- 'group' => 'Migrate',
+ 'name' => 'Date Migration',
+ 'description' => 'Test migration into date fields',
+ 'group' => 'Date',
);
}
@@ -25,7 +25,17 @@ class DateMigrateExampleUnitTest extends DrupalWebTestCase {
* Declars the module dependencies for the test.
*/
function setUp() {
- parent::setUp('migrate', 'features', 'date', 'date_repeat', 'date_repeat_field', 'date_migrate_example');
+ parent::setUp('migrate', 'features', 'date', 'date_repeat',
+ 'date_repeat_field', 'date_migrate_example');
+ // Make sure the migration is registered.
+ if (function_exists('migrate_static_registration')) {
+ // Migrate 2.6 and later
+ migrate_static_registration();
+ }
+ else {
+ // Migrate 2.5 and earlier
+ migrate_get_module_apis(TRUE);
+ }
}
/**