diff --git a/calendar/setup/setup.inc.php b/calendar/setup/setup.inc.php index aecb8ce4a4..537c29f3b9 100755 --- a/calendar/setup/setup.inc.php +++ b/calendar/setup/setup.inc.php @@ -10,7 +10,7 @@ */ $setup_info['calendar']['name'] = 'calendar'; -$setup_info['calendar']['version'] = '1.7.006'; +$setup_info['calendar']['version'] = '1.7.007'; $setup_info['calendar']['app_order'] = 3; $setup_info['calendar']['enable'] = 1; $setup_info['calendar']['index'] = 'calendar.calendar_uiviews.index'; diff --git a/calendar/setup/tables_update.inc.php b/calendar/setup/tables_update.inc.php index b76095f7e5..efa54a7af7 100644 --- a/calendar/setup/tables_update.inc.php +++ b/calendar/setup/tables_update.inc.php @@ -1941,4 +1941,32 @@ function calendar_upgrade1_7_005() } } return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.006'; -} \ No newline at end of file +} + +/** + * // Fix whole day event cal_end times which are set to 23:59:00 or 00:00 instead of 23:59:59 + * // Fix recur_interval from 0 to 1 for event series + * + * @return string + */ +function calendar_upgrade1_7_006() +{ + foreach($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates + WHERE (cal_end-cal_start)%86400=86340',__LINE__,__FILE__) as $row) + { + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_dates SET cal_end=cal_end+59 + WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'],__LINE__,__FILE__); + } + + foreach($GLOBALS['egw_setup']->db->query('SELECT * FROM egw_cal_dates + WHERE cal_end-cal_start>0 AND (cal_end-cal_start)%86400=0',__LINE__,__FILE__) as $row) + { + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_dates SET cal_end=cal_end-1 + WHERE cal_id='.(int)$row['cal_id'].' AND cal_start='.(int)$row['cal_start'],__LINE__,__FILE__); + } + + $GLOBALS['egw_setup']->db->query('UPDATE egw_cal_repeats SET recur_interval=1 + WHERE recur_interval=0',__LINE__,__FILE__); + + return $GLOBALS['setup_info']['calendar']['currentver'] = '1.7.007'; +}