daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Sep 21st, 2011 327 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. //Implementation of hook_date_views_fields().
  2. function civicrm_date_views_fields($field) {
  3.     $values = array(
  4.                     // The type of date: DATE_UNIX, DATE_ISO, DATE_DATETIME.
  5.                     'sql_type' => DATE_DATETIME,
  6.                     // Timezone handling options: 'none', 'site', 'date', 'utc'.
  7.                     'tz_handling' => 'site',
  8.                     // Needed only for dates that use 'date' tz_handling.
  9.                     'timezone_field' => '',
  10.                     // Needed only for dates that use 'date' tz_handling.
  11.                     'offset_field' => '',
  12.                     // Array of "table.field" values for related fields that should be
  13.                     // loaded automatically in the Views SQL.
  14.                     'related_fields' => array(),
  15.                     // Granularity of this date field's db data.
  16.                     'granularity' => array('year', 'month', 'day', 'hour', 'minute', 'second'),
  17.                     );
  18.  
  19.     switch ($field) {
  20.     case 'civicrm_event.start_date':
  21.     case 'civicrm_event.end_date':
  22.     case 'civicrm_event.registration_start_date':
  23.     case 'civicrm_event.registration_end_date':
  24.     case 'civicrm_mailing_job.scheduled_date':
  25.     case 'civicrm_mailing_job.start_date':
  26.     case 'civicrm_mailing_job.end_date':
  27.     case 'civicrm_activity.activity_date_time':
  28.     case 'civicrm_campaign.start_date':
  29.     case 'civicrm_campaign.end_date':
  30.         return $values;
  31.     }
  32. }
  33.  
  34.  
  35. /**
  36.  * Implement hook_date_api_tables().
  37.  */
  38. function civicrm_date_views_tables() {
  39.     return array('civicrm_mailing_job',
  40.                  'civicrm_event',
  41.                  'civicrm_activity',
  42.                  'civicrm_campaign',);
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top