/[drupal]/contributions/modules/event/event.install
ViewVC logotype

Diff of /contributions/modules/event/event.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.36, Tue Dec 30 21:44:03 2008 UTC revision 1.37, Sun Jul 5 00:34:15 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: event.install,v 1.35 2008/12/25 16:21:23 killes Exp $  // $Id: event.install,v 1.36 2008/12/30 21:44:03 killes Exp $
3    
4  /**  /**
5   * We need mysql >= 4.1.1   * We need mysql >= 4.1.1
# Line 462  function event_update_6003() { Line 462  function event_update_6003() {
462  }  }
463    
464  /**  /**
465     * Update DST in timezones, might be screwed up.
466     */
467    function event_update_6004() {
468      include_once(drupal_get_path('module', 'event') .'/event.module');
469      $timezones = event_install_timezones();
470      foreach ($timezones as $id => $timezone) {
471        $timezone = event_zonelist_by_id($id);
472        $status = event_is_dst($timezone['dst_region'], gmdate('Y-m-d H:i', time()));
473        db_query('UPDATE {event_timezones} SET is_dst = %d WHERE timezone = %d', $status, $id);
474      }
475      return array();
476    }
477    
478    /**
479     * Update DST in events, might be screwed up.
480     */
481    function event_update_6005() {
482      include_once(drupal_get_path('module', 'event') .'/event.module');
483      // get all events
484      $result = db_query('SELECT e.* FROM {event} e');
485      while ($event = db_fetch_object($result)) {
486        $timezone = event_zonelist_by_id($event->timezone);
487        $status_start = event_is_dst($timezone['dst_region'], $event->event_start);
488        $status_end = event_is_dst($timezone['dst_region'], $event->event_end);
489        if ($event->start_in_dst != $status_start || $event->end_in_dst != $status_end) {
490          db_query('UPDATE {event} SET start_in_dst = %d, end_in_dst = %d WHERE nid = %d', $status_start, $status_end, $event->nid);
491        }
492      }
493      return array();
494    }
495    
496    /**
497   * Timezones table used only during installation.   * Timezones table used only during installation.
498   */   */
499  function event_install_timezones() {  function event_install_timezones() {

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

  ViewVC Help
Powered by ViewVC 1.1.2