mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 23:29:20 +01:00
Restructured the calendar database, added the categories, and fixed problem with repeating entries.
This commit is contained in:
parent
fad64be85d
commit
a078f7f58f
@ -17,6 +17,7 @@
|
|||||||
$phpgw_flags = Array(
|
$phpgw_flags = Array(
|
||||||
'currentapp' => 'calendar',
|
'currentapp' => 'calendar',
|
||||||
'enable_nextmatchs_class' => True,
|
'enable_nextmatchs_class' => True,
|
||||||
|
'enable_categories_class' => True,
|
||||||
'noheader' => True,
|
'noheader' => True,
|
||||||
'nonavbar' => True,
|
'nonavbar' => True,
|
||||||
'noappheader' => True,
|
'noappheader' => True,
|
||||||
@ -191,6 +192,9 @@
|
|||||||
// Full Description
|
// Full Description
|
||||||
display_item(lang('Full Description'),'<textarea name="description" rows="5" cols="40" wrap="virtual" maxlength="2048">'.$event->description.'</textarea>');
|
display_item(lang('Full Description'),'<textarea name="description" rows="5" cols="40" wrap="virtual" maxlength="2048">'.$event->description.'</textarea>');
|
||||||
|
|
||||||
|
// Display Categories
|
||||||
|
display_item(lang('Category'),'<select name="category"><option value="">'.lang('Choose the category').'</option>'.$phpgw->categories->formated_list('select','all',$event->category,'True').'</select>');
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
$day_html = $sb->getDays('start[mday]',intval($phpgw->common->show_date($start,'d')));
|
$day_html = $sb->getDays('start[mday]',intval($phpgw->common->show_date($start,'d')));
|
||||||
$month_html = $sb->getMonthText('start[month]',intval($phpgw->common->show_date($start,'n')));
|
$month_html = $sb->getMonthText('start[month]',intval($phpgw->common->show_date($start,'n')));
|
||||||
|
@ -15,12 +15,13 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
$phpgw_flags = Array(
|
$phpgw_flags = Array(
|
||||||
'currentapp' => 'calendar',
|
'currentapp' => 'calendar',
|
||||||
'noheader' => True,
|
'noheader' => True,
|
||||||
'nonavbar' => True,
|
'nonavbar' => True,
|
||||||
'enable_nextmatchs_class' => True,
|
'enable_nextmatchs_class' => True,
|
||||||
'noappheader' => True,
|
'enable_categories_class' => True,
|
||||||
'noappfooter' => True
|
'noappheader' => True,
|
||||||
|
'noappfooter' => True
|
||||||
);
|
);
|
||||||
|
|
||||||
$phpgw_info['flags'] = $phpgw_flags;
|
$phpgw_info['flags'] = $phpgw_flags;
|
||||||
@ -109,6 +110,7 @@
|
|||||||
|
|
||||||
$cal_stream = $phpgw->calendar->open('INBOX',intval($owner),'');
|
$cal_stream = $phpgw->calendar->open('INBOX',intval($owner),'');
|
||||||
$phpgw->calendar->event_init($cal_stream);
|
$phpgw->calendar->event_init($cal_stream);
|
||||||
|
// $cat = $phpgw->categories->return_single($category);
|
||||||
$phpgw->calendar->event_set_category($cal_stream,$category);
|
$phpgw->calendar->event_set_category($cal_stream,$category);
|
||||||
$phpgw->calendar->event_set_title($cal_stream,$title);
|
$phpgw->calendar->event_set_title($cal_stream,$title);
|
||||||
$phpgw->calendar->event_set_description($cal_stream,$description);
|
$phpgw->calendar->event_set_description($cal_stream,$description);
|
||||||
|
@ -281,15 +281,15 @@ class calendar extends calendar_
|
|||||||
global $phpgw, $phpgw_info, $grants;
|
global $phpgw, $phpgw_info, $grants;
|
||||||
|
|
||||||
if($owner == 0) { $owner = $phpgw_info['user']['account_id']; }
|
if($owner == 0) { $owner = $phpgw_info['user']['account_id']; }
|
||||||
$is_private = False;
|
if ($owner == $phpgw_info['user']['account_id'] || (!!($grants[$owner] & PHPGW_ACL_PRIVATE) == True) || ($event->public == 1))
|
||||||
if ($owner == $phpgw_info['user']['account_id'] || (!!($grants[$owner] & PHPGW_ACL_PRIVATE) == True))
|
|
||||||
{
|
{
|
||||||
|
$is_private = False;
|
||||||
}
|
}
|
||||||
elseif ($event->public == False)
|
elseif($event->public == 0)
|
||||||
{
|
{
|
||||||
$is_private = True;
|
$is_private = True;
|
||||||
}
|
}
|
||||||
elseif($event->access == 'group')
|
elseif($event->public == 2)
|
||||||
{
|
{
|
||||||
$is_private = True;
|
$is_private = True;
|
||||||
$groups = $phpgw->accounts->memberships($owner);
|
$groups = $phpgw->accounts->memberships($owner);
|
||||||
@ -301,6 +301,10 @@ class calendar extends calendar_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$is_private = False;
|
||||||
|
}
|
||||||
|
|
||||||
if ($is_private)
|
if ($is_private)
|
||||||
{
|
{
|
||||||
@ -322,8 +326,8 @@ class calendar extends calendar_
|
|||||||
{
|
{
|
||||||
if($phpgw_info['server']['calendar_type'] == 'sql')
|
if($phpgw_info['server']['calendar_type'] == 'sql')
|
||||||
{
|
{
|
||||||
$this->stream->query('UPDATE calendar_entry SET cal_owner='.$new_owner.' WHERE cal_owner='.$account_id,__LINE__,__FILE__);
|
$this->stream->query('UPDATE phpgw_cal SET owner='.$new_owner.' WHERE owner='.$account_id,__LINE__,__FILE__);
|
||||||
$this->stream->query('UPDATE calendar_entry_user SET cal_login='.$new_owner.' WHERE cal_login='.$account_id);
|
$this->stream->query('UPDATE phpgw_cal_user SET login='.$new_owner.' WHERE login='.$account_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,17 +337,17 @@ class calendar extends calendar_
|
|||||||
|
|
||||||
$this->set_filter();
|
$this->set_filter();
|
||||||
$owner = $owner == 0?$phpgw_info['user']['account_id']:$owner;
|
$owner = $owner == 0?$phpgw_info['user']['account_id']:$owner;
|
||||||
$sql = "AND (calendar_entry.cal_type='M') "
|
$sql = "AND (phpgw_cal.type='M') "
|
||||||
. 'AND (calendar_entry_user.cal_login='.$owner.' '
|
. 'AND (phpgw_cal_user.login='.$owner.' '
|
||||||
. 'AND ((calendar_entry_repeats.cal_end >= '.$this->end_repeat_day.') OR (calendar_entry_repeats.cal_end=0))';
|
. 'AND ((phpgw_cal_repeats.recur_enddate >= '.$this->end_repeat_day.') OR (phpgw_cal_repeats.recur_enddate=0))';
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
if(strpos($this->filter,'private'))
|
if(strpos($this->filter,'private'))
|
||||||
{
|
{
|
||||||
$sql .= " AND calendar_entry.cal_access='private'";
|
$sql .= " AND phpgw_cal.public=0";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= ') ORDER BY calendar_entry.cal_datetime ASC, calendar_entry.cal_edatetime ASC, calendar_entry.cal_priority ASC';
|
$sql .= ') ORDER BY phpgw_cal.datetime ASC, phpgw_cal.edatetime ASC, phpgw_cal.priority ASC';
|
||||||
|
|
||||||
$events = $this->get_event_ids(True,$sql);
|
$events = $this->get_event_ids(True,$sql);
|
||||||
|
|
||||||
@ -399,7 +403,7 @@ class calendar extends calendar_
|
|||||||
$full_event_date = date('Ymd',$event_beg_day);
|
$full_event_date = date('Ymd',$event_beg_day);
|
||||||
|
|
||||||
// only repeat after the beginning, and if there is an rpt_end before the end date
|
// only repeat after the beginning, and if there is an rpt_end before the end date
|
||||||
if (($rep_events->rpt_use_end && ($search_date_full > $end_recur_date)) ||
|
if (($rep_events->rpt_end_use && ($search_date_full > $end_recur_date)) ||
|
||||||
($search_date_full < $full_event_date))
|
($search_date_full < $full_event_date))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@ -424,6 +428,11 @@ class calendar extends calendar_
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RECUR_WEEKLY:
|
case RECUR_WEEKLY:
|
||||||
|
if (floor(($search_beg_day - $event_beg_day)/604800) % $rep_events->recur_interval)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$check = 0;
|
$check = 0;
|
||||||
switch($search_date_dow)
|
switch($search_date_dow)
|
||||||
{
|
{
|
||||||
@ -449,11 +458,6 @@ class calendar extends calendar_
|
|||||||
$check = M_SATURDAY;
|
$check = M_SATURDAY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (floor(($search_beg_day - $event_beg_day)/604800) % $rep_events->recur_interval)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($rep_events->recur_data & $check)
|
if ($rep_events->recur_data & $check)
|
||||||
{
|
{
|
||||||
$link[$this->repeating_event_matches++] = $id;
|
$link[$this->repeating_event_matches++] = $id;
|
||||||
@ -515,21 +519,19 @@ class calendar extends calendar_
|
|||||||
$this->set_filter();
|
$this->set_filter();
|
||||||
$owner = !$owner?$phpgw_info['user']['account_id']:$owner;
|
$owner = !$owner?$phpgw_info['user']['account_id']:$owner;
|
||||||
$repeating_events_matched = $this->check_repeating_entries($datetime - $this->tz_offset);
|
$repeating_events_matched = $this->check_repeating_entries($datetime - $this->tz_offset);
|
||||||
$sql = "AND (calendar_entry.cal_type != 'M') "
|
$sql = "AND (phpgw_cal.type != 'M') "
|
||||||
. 'AND ((calendar_entry.cal_datetime >= '.$datetime.' AND calendar_entry.cal_datetime <= '.($datetime + 86399).') '
|
. 'AND ((phpgw_cal.datetime >= '.$datetime.' AND phpgw_cal.datetime <= '.($datetime + 86399).') '
|
||||||
. 'OR (calendar_entry.cal_datetime <= '.$datetime.' AND calendar_entry.cal_edatetime >= '.($datetime + 86399).') '
|
. 'OR (phpgw_cal.datetime <= '.$datetime.' AND phpgw_cal.edatetime >= '.($datetime + 86399).') '
|
||||||
// . 'AND ((calendar_entry.cal_datetime > '.$datetime.' AND calendar_entry.cal_datetime < '.($datetime + 86399).') '
|
. 'OR (phpgw_cal.edatetime >= '.$datetime.' AND phpgw_cal.edatetime <= '.($datetime + 86399).')) '
|
||||||
// . 'OR (calendar_entry.cal_datetime < '.$datetime.' AND calendar_entry.cal_edatetime >= '.($datetime + 86399).') '
|
. 'AND (phpgw_cal_user.login='.$owner;
|
||||||
. 'OR (calendar_entry.cal_edatetime >= '.$datetime.' AND calendar_entry.cal_edatetime <= '.($datetime + 86399).')) '
|
|
||||||
. 'AND (calendar_entry_user.cal_login='.$owner;
|
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
if(strpos($this->filter,'private'))
|
if(strpos($this->filter,'private'))
|
||||||
{
|
{
|
||||||
$sql .= " AND calendar_entry.cal_access='private'";
|
$sql .= " AND endar_entry.cal.public=0";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= ') ORDER BY calendar_entry.cal_datetime ASC, calendar_entry.cal_edatetime ASC, calendar_entry.cal_priority ASC';
|
$sql .= ') ORDER BY phpgw_cal.datetime ASC, phpgw_cal.edatetime ASC, phpgw_cal.priority ASC';
|
||||||
|
|
||||||
$event = $this->get_event_ids(False,$sql);
|
$event = $this->get_event_ids(False,$sql);
|
||||||
|
|
||||||
@ -770,14 +772,13 @@ class calendar extends calendar_
|
|||||||
|
|
||||||
if($starttime == $endtime)
|
if($starttime == $endtime)
|
||||||
{
|
{
|
||||||
// $endtime = mktime($phpgw->common->show_date($starttime,'H'),$phpgw->common->show_date($starttime,'i'),0,$phpgw->common->show_date($starttime,'m'),$phpgw->common->show_date($starttime,'d') + 1,$phpgw->common->show_date($starttime,'Y')) - $this->tz_offset - 1;
|
|
||||||
$endtime = mktime(0,0,0,$phpgw->common->show_date($starttime,'m'),$phpgw->common->show_date($starttime,'d') + 1,$phpgw->common->show_date($starttime,'Y')) - $this->tz_offset - 1;
|
$endtime = mktime(0,0,0,$phpgw->common->show_date($starttime,'m'),$phpgw->common->show_date($starttime,'d') + 1,$phpgw->common->show_date($starttime,'Y')) - $this->tz_offset - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'AND ((('.$starttime.' <= calendar_entry.cal_datetime) AND ('.$endtime.' >= calendar_entry.cal_datetime) AND ('.$endtime.' <= calendar_entry.cal_edatetime)) '
|
$sql = 'AND ((('.$starttime.' <= phpgw_cal.datetime) AND ('.$endtime.' >= phpgw_cal.datetime) AND ('.$endtime.' <= phpgw_cal.edatetime)) '
|
||||||
. 'OR (('.$starttime.' >= calendar_entry.cal_datetime) AND ('.$starttime.' < calendar_entry.cal_edatetime) AND ('.$endtime.' >= calendar_entry.cal_edatetime)) '
|
. 'OR (('.$starttime.' >= phpgw_cal.datetime) AND ('.$starttime.' < phpgw_cal.edatetime) AND ('.$endtime.' >= phpgw_cal.edatetime)) '
|
||||||
. 'OR (('.$starttime.' <= calendar_entry.cal_datetime) AND ('.$endtime.' >= calendar_entry.cal_edatetime)) '
|
. 'OR (('.$starttime.' <= phpgw_cal.datetime) AND ('.$endtime.' >= phpgw_cal.edatetime)) '
|
||||||
. 'OR (('.$starttime.' >= calendar_entry.cal_datetime) AND ('.$endtime.' <= calendar_entry.cal_edatetime))) ';
|
. 'OR (('.$starttime.' >= phpgw_cal.datetime) AND ('.$endtime.' <= phpgw_cal.edatetime))) ';
|
||||||
|
|
||||||
if(count($participants) > 0)
|
if(count($participants) > 0)
|
||||||
{
|
{
|
||||||
@ -790,7 +791,7 @@ class calendar extends calendar_
|
|||||||
{
|
{
|
||||||
$p_g .= ' OR ';
|
$p_g .= ' OR ';
|
||||||
}
|
}
|
||||||
$p_g .= 'calendar_entry_user.cal_login='.$participants[$i];
|
$p_g .= 'phpgw_cal_user.login='.$participants[$i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($p_g)
|
if($p_g)
|
||||||
@ -801,7 +802,7 @@ class calendar extends calendar_
|
|||||||
|
|
||||||
if($id)
|
if($id)
|
||||||
{
|
{
|
||||||
$sql .= ' AND calendar_entry.cal_id <> '.$id;
|
$sql .= ' AND phpgw_cal.id <> '.$id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db2 = $phpgw->db;
|
$db2 = $phpgw->db;
|
||||||
@ -813,7 +814,7 @@ class calendar extends calendar_
|
|||||||
}
|
}
|
||||||
for($i=0;$i<count($events);$i++)
|
for($i=0;$i<count($events);$i++)
|
||||||
{
|
{
|
||||||
$db2->query('SELECT cal_type FROM calendar_entry_repeats WHERE cal_id='.$events[$i],__LINE__,__FILE__);
|
$db2->query('SELECT recur_type FROM phpgw_cal_repeats WHERE id='.$events[$i],__LINE__,__FILE__);
|
||||||
if($db2->num_rows() == 0)
|
if($db2->num_rows() == 0)
|
||||||
{
|
{
|
||||||
$retval[] = $events[$i];
|
$retval[] = $events[$i];
|
||||||
@ -822,7 +823,7 @@ class calendar extends calendar_
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db2->next_record();
|
$db2->next_record();
|
||||||
if($db2->f('cal_type') <> 'monthlyByDay')
|
if($db2->f('recur_type') <> RECUR_MONTHLY_MDAY)
|
||||||
{
|
{
|
||||||
$retval[] = $events[$i];
|
$retval[] = $events[$i];
|
||||||
$ok = True;
|
$ok = True;
|
||||||
@ -859,10 +860,12 @@ class calendar extends calendar_
|
|||||||
);
|
);
|
||||||
$p->set_var($var);
|
$p->set_var($var);
|
||||||
|
|
||||||
|
$p->set_var('col_width','14');
|
||||||
if($display_name == True)
|
if($display_name == True)
|
||||||
{
|
{
|
||||||
$p->set_var('col_title',lang('name'));
|
$p->set_var('col_title',lang('name'));
|
||||||
$p->parse('column_header','column_title',True);
|
$p->parse('column_header','column_title',True);
|
||||||
|
$p->set_var('col_width','12');
|
||||||
}
|
}
|
||||||
|
|
||||||
for($i=0;$i<7;$i++)
|
for($i=0;$i<7;$i++)
|
||||||
@ -898,11 +901,13 @@ class calendar extends calendar_
|
|||||||
$p->set_file($templates);
|
$p->set_file($templates);
|
||||||
|
|
||||||
$p->set_var('extra','');
|
$p->set_var('extra','');
|
||||||
|
|
||||||
|
$p->set_var('col_width','14');
|
||||||
if($display_name)
|
if($display_name)
|
||||||
{
|
{
|
||||||
$p->set_var('column_data',$phpgw->common->grab_owner_name($owner));
|
$p->set_var('column_data',$phpgw->common->grab_owner_name($owner));
|
||||||
$p->parse('column_header','month_column',True);
|
$p->parse('column_header','month_column',True);
|
||||||
|
$p->set_var('col_width','12');
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($j=0;$j<7;$j++)
|
for ($j=0;$j<7;$j++)
|
||||||
@ -940,7 +945,7 @@ class calendar extends calendar_
|
|||||||
if((!!($grants[$owner] & PHPGW_ACL_ADD) == True))
|
if((!!($grants[$owner] & PHPGW_ACL_ADD) == True))
|
||||||
{
|
{
|
||||||
$new_event_link .= '<a href="'.$phpgw->link('/calendar/edit_entry.php','year='.$date_year.'&month='.$date['month'].'&day='.$date['day'].'&owner='.$owner).'">';
|
$new_event_link .= '<a href="'.$phpgw->link('/calendar/edit_entry.php','year='.$date_year.'&month='.$date['month'].'&day='.$date['day'].'&owner='.$owner).'">';
|
||||||
$new_event_link .= '<img src="'.$this->image_dir.'/new.gif" width="10" height="10" alt="'.lang('New Entry').'" border="0" align="right">';
|
$new_event_link .= '<img src="'.$this->image_dir.'/new.gif" width="10" height="10" alt="'.lang('New Entry').'" border="0" align="center">';
|
||||||
$new_event_link .= '</a>';
|
$new_event_link .= '</a>';
|
||||||
}
|
}
|
||||||
$day_number = '<a href="'.$phpgw->link('/calendar/day.php','month='.$month.'&day='.$day.'&year='.$year.'&owner='.$owner).'">'.$day.'</a>';
|
$day_number = '<a href="'.$phpgw->link('/calendar/day.php','month='.$month.'&day='.$day.'&year='.$year.'&owner='.$owner).'">'.$day.'</a>';
|
||||||
@ -1044,7 +1049,7 @@ class calendar extends calendar_
|
|||||||
'start_time' => $start_time,
|
'start_time' => $start_time,
|
||||||
'end_time' => $end_time,
|
'end_time' => $end_time,
|
||||||
'close_view_link' => $close_link,
|
'close_view_link' => $close_link,
|
||||||
'name' => $this->is_private($lr_events,$owner,'name').$this->display_status($lr_events->users_status)
|
'name' => $this->is_private($lr_events,$owner,'title').$this->display_status($lr_events->users_status)
|
||||||
);
|
);
|
||||||
$p->set_var($var);
|
$p->set_var($var);
|
||||||
$p->parse('events','week_day_event',True);
|
$p->parse('events','week_day_event',True);
|
||||||
@ -1104,12 +1109,14 @@ class calendar extends calendar_
|
|||||||
$display_name = True;
|
$display_name = True;
|
||||||
$counter = count($owners);
|
$counter = count($owners);
|
||||||
$owners_array = $owners;
|
$owners_array = $owners;
|
||||||
|
$p->set_var('cols','8');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$display_name = False;
|
$display_name = False;
|
||||||
$counter = 1;
|
$counter = 1;
|
||||||
$owners_array[0] = $owners;
|
$owners_array[0] = $owners;
|
||||||
|
$p->set_var('cols','7');
|
||||||
}
|
}
|
||||||
$p->set_var('month_filler_text',$this->large_month_header($month,$year,$display_name));
|
$p->set_var('month_filler_text',$this->large_month_header($month,$year,$display_name));
|
||||||
$p->parse('row','month_filler',True);
|
$p->parse('row','month_filler',True);
|
||||||
@ -1156,7 +1163,8 @@ class calendar extends calendar_
|
|||||||
'month_header' => 'month_header.tpl'
|
'month_header' => 'month_header.tpl'
|
||||||
);
|
);
|
||||||
$p->set_file($templates);
|
$p->set_file($templates);
|
||||||
|
|
||||||
|
$p->set_var('cols','7');
|
||||||
$p->set_var('month_filler_text',$this->large_month_header($month,$year,False));
|
$p->set_var('month_filler_text',$this->large_month_header($month,$year,False));
|
||||||
$p->parse('row','month_filler',True);
|
$p->parse('row','month_filler',True);
|
||||||
|
|
||||||
@ -1543,7 +1551,7 @@ class calendar extends calendar_
|
|||||||
|
|
||||||
$var = Array(
|
$var = Array(
|
||||||
'bg_text' => $phpgw_info['theme']['bg_text'],
|
'bg_text' => $phpgw_info['theme']['bg_text'],
|
||||||
'name' => $event->name
|
'name' => $event->title
|
||||||
);
|
);
|
||||||
$p->set_var($var);
|
$p->set_var($var);
|
||||||
$p->parse('out','view_begin');
|
$p->parse('out','view_begin');
|
||||||
@ -1560,6 +1568,16 @@ class calendar extends calendar_
|
|||||||
$p->parse('output','list',True);
|
$p->parse('output','list',True);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($event->category)
|
||||||
|
{
|
||||||
|
$var = Array(
|
||||||
|
'field' => lang('Category'),
|
||||||
|
'data' => $event->category
|
||||||
|
);
|
||||||
|
$p->set_var($var);
|
||||||
|
$p->parse('output','list',True);
|
||||||
|
}
|
||||||
|
|
||||||
$start = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $this->tz_offset;
|
$start = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $this->tz_offset;
|
||||||
$var = Array(
|
$var = Array(
|
||||||
'field' => lang('Start Date/Time'),
|
'field' => lang('Start Date/Time'),
|
||||||
@ -1663,7 +1681,15 @@ class calendar extends calendar_
|
|||||||
$p->parse('output','list',True);
|
$p->parse('output','list',True);
|
||||||
|
|
||||||
// Repeated Events
|
// Repeated Events
|
||||||
$str = lang($event->rpt_type);
|
$rpt_type = Array(
|
||||||
|
'none',
|
||||||
|
'daily',
|
||||||
|
'weekly',
|
||||||
|
'monthlybyday',
|
||||||
|
'monthlybydate',
|
||||||
|
'yearly'
|
||||||
|
);
|
||||||
|
$str = lang($rpt_type[$event->recur_type]);
|
||||||
if($event->recur_type <> RECUR_NONE)
|
if($event->recur_type <> RECUR_NONE)
|
||||||
{
|
{
|
||||||
$str .= ' (';
|
$str .= ' (';
|
||||||
|
@ -252,34 +252,6 @@ class calendar__
|
|||||||
|
|
||||||
function set_common_recur($year,$month,$day,$interval)
|
function set_common_recur($year,$month,$day,$interval)
|
||||||
{
|
{
|
||||||
if(intval($day) == 0 && intval($month) == 0 && intval($year) == 0)
|
|
||||||
{
|
|
||||||
$this->event->rpt_end_use = 0;
|
|
||||||
$this->event->rpt_end = 0;
|
|
||||||
$this->event->rpt_end_day = 0;
|
|
||||||
$this->event->rpt_end_month = 0;
|
|
||||||
$this->event->rpt_end_year = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->event->rpt_end_use = 1;
|
|
||||||
$this->event->rpt_end = mktime(0,0,0,intval($month),intval($day),intval($year));
|
|
||||||
$this->event->rpt_end -= ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset']));
|
|
||||||
$this->event->rpt_end_day = intval($day);
|
|
||||||
$this->event->rpt_end_month = intval($month);
|
|
||||||
$this->event->rpt_end_year = intval($year);
|
|
||||||
}
|
|
||||||
$this->event->rpt_sun = 0;
|
|
||||||
$this->event->rpt_mon = 0;
|
|
||||||
$this->event->rpt_tue = 0;
|
|
||||||
$this->event->rpt_wed = 0;
|
|
||||||
$this->event->rpt_thu = 0;
|
|
||||||
$this->event->rpt_fri = 0;
|
|
||||||
$this->event->rpt_sat = 0;
|
|
||||||
$this->event->rpt_days = 'nnnnnnn';
|
|
||||||
$this->event->rpt_freq = intval($interval);
|
|
||||||
|
|
||||||
// Legacy Support (New)
|
|
||||||
$this->event->recur_interval = intval($interval);
|
$this->event->recur_interval = intval($interval);
|
||||||
if(intval($day) == 0 && intval($month) == 0 && intval($year) == 0)
|
if(intval($day) == 0 && intval($month) == 0 && intval($year) == 0)
|
||||||
{
|
{
|
||||||
|
@ -14,82 +14,48 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
class calendar_time {
|
class calendar_time
|
||||||
var $year;
|
{
|
||||||
var $month;
|
var $year;
|
||||||
var $mday;
|
var $month;
|
||||||
var $hour;
|
var $mday;
|
||||||
var $min;
|
var $hour;
|
||||||
var $sec;
|
var $min;
|
||||||
var $alarm = 0;
|
var $sec;
|
||||||
}
|
var $alarm = 0;
|
||||||
|
}
|
||||||
|
|
||||||
class calendar_item {
|
class calendar_item
|
||||||
|
{
|
||||||
//New ICal Support
|
//New ICal Support
|
||||||
var $id = 0;
|
var $id = 0;
|
||||||
var $public = 0;
|
var $category = 0;
|
||||||
var $category = "none";
|
var $title = "Unnamed Event";
|
||||||
var $title = "Unnamed Event";
|
var $description = "Unnamed Event";
|
||||||
var $description = "Unnamed Event";
|
var $public = 0;
|
||||||
var $alarm = 0;
|
var $alarm = 0;
|
||||||
var $start;
|
var $start;
|
||||||
var $end;
|
var $end;
|
||||||
var $recur_type = 0;
|
var $mod;
|
||||||
var $recur_interval = 0;
|
var $recur_type = 0;
|
||||||
var $recur_enddate;
|
var $recur_interval = 0;
|
||||||
var $recur_data = 0;
|
var $recur_enddate;
|
||||||
|
var $recur_data = 0;
|
||||||
|
|
||||||
var $users_status = 'U';
|
var $users_status = 'U';
|
||||||
// Legacy Support
|
var $owner;
|
||||||
var $owner;
|
var $datetime = 0;
|
||||||
var $name = "Unnamed Event";
|
var $mdatetime = 0;
|
||||||
var $datetime = 0;
|
var $edatetime = 0;
|
||||||
var $day = 0;
|
var $priority = 0;
|
||||||
var $month = 0;
|
var $groups = array();
|
||||||
var $year = 0;
|
var $participants = array();
|
||||||
var $hour = 0;
|
var $status = array();
|
||||||
var $minute = 0;
|
|
||||||
var $ampm = "";
|
|
||||||
var $mdatetime = 0;
|
|
||||||
var $mod_day = 0;
|
|
||||||
var $mod_month = 0;
|
|
||||||
var $mod_year = 0;
|
|
||||||
var $mod_hour = 0;
|
|
||||||
var $mod_minute = 0;
|
|
||||||
var $mod_second = 0;
|
|
||||||
var $mod_ampm = "";
|
|
||||||
var $edatetime = 0;
|
|
||||||
var $end_day = 0;
|
|
||||||
var $end_month = 0;
|
|
||||||
var $end_year = 0;
|
|
||||||
var $end_hour = 0;
|
|
||||||
var $end_minute = 0;
|
|
||||||
var $end_second = 0;
|
|
||||||
var $end_ampm = "";
|
|
||||||
var $priority = 0;
|
|
||||||
var $access = "private";
|
|
||||||
var $groups = array();
|
|
||||||
var $participants = array();
|
|
||||||
var $status = array();
|
|
||||||
var $rpt_type = "none";
|
|
||||||
var $rpt_end_use = 0;
|
|
||||||
var $rpt_end = 0;
|
|
||||||
var $rpt_end_day = 0;
|
|
||||||
var $rpt_end_month = 0;
|
|
||||||
var $rpt_end_year = 0;
|
|
||||||
var $rpt_days = "nnnnnnn";
|
|
||||||
var $rpt_sun = 0;
|
|
||||||
var $rpt_mon = 0;
|
|
||||||
var $rpt_tue = 0;
|
|
||||||
var $rpt_wed = 0;
|
|
||||||
var $rpt_thu = 0;
|
|
||||||
var $rpt_fri = 0;
|
|
||||||
var $rpt_sat = 0;
|
|
||||||
var $rpt_freq = 0;
|
|
||||||
|
|
||||||
function set($var,$val="") {
|
function set($var,$val="")
|
||||||
$this->$var = $val;
|
{
|
||||||
}
|
$this->$var = $val;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -36,11 +36,11 @@
|
|||||||
echo '<a href="' . $phpgw->link('/calendar/preferences.php') . '">' . lang('Calendar preferences')
|
echo '<a href="' . $phpgw->link('/calendar/preferences.php') . '">' . lang('Calendar preferences')
|
||||||
. '</a><br>';
|
. '</a><br>';
|
||||||
|
|
||||||
// echo '<a href="' . $phpgw->link('/calendar/categories.php') . '">'
|
echo '<a href="' . $phpgw->link('/preferences/acl_preferences.php','acl_app='.$appname) . '">'
|
||||||
// . lang('Edit Categories') . '</a><br>';
|
. lang('Grant Calendar Access') . '</a><br>';
|
||||||
|
|
||||||
echo '<a href="' . $phpgw->link('/preferences/acl_preferences.php','acl_app=calendar') . '">'
|
echo '<a href="' . $phpgw->link('/preferences/categories.php','cats_app='.$appname) . '">'
|
||||||
. lang('Grant Calendar Access') . '</a>';
|
. lang('Edit Categories') . '</a>';
|
||||||
|
|
||||||
section_end();
|
section_end();
|
||||||
}
|
}
|
||||||
|
@ -16,20 +16,18 @@
|
|||||||
-->
|
-->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<table border="0" cellspacing="0" cellpadding="0" valign="top" width="46%">
|
<table border="0" cellspacing="0" cellpadding="0" valign="top" width=80 cols=7>
|
||||||
<tr valign="center">
|
<tr valign="center">
|
||||||
<td align="left" colspan="5"><font size="-2"> <b>{month}</b></font></td>
|
<td align="left" colspan=4><font size="-2"> <b>{month}</b></font></td>
|
||||||
<td align="right" colspan="2">{prevmonth} {nextmonth}</td>
|
<td align="right" colspan=3>{prevmonth} {nextmonth}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" colspan="7"><img src="{cal_img_root}/mini-calendar-bar.gif" width="90%" height="5"></td>
|
<td align="center" colspan=7><img src="{cal_img_root}/mini-calendar-bar.gif" width="90%" height="5"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<td colspan="7">
|
<td colspan=7>
|
||||||
<table border="0" width="100%" cellspacing="7" cellpadding="0" valign="top" cols="7">
|
<table border="0" width="100%" cellspacing="7" cellpadding="0" valign="top" cols=7>
|
||||||
<tr>{daynames}
|
<tr>{daynames} </tr>{display_monthweek} </table>
|
||||||
</tr>{display_monthweek}
|
|
||||||
</table>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
<table width="100%" border="0" bordercolor="#FFFFFF" cellspacing="2" cellpadding="2">
|
<table width="100%" border="0" bordercolor="#FFFFFF" cellspacing="2" cellpadding="2" cols={cols}>
|
||||||
{row}
|
{row}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!-- $Id$ month_column -->
|
<!-- $Id$ month_column -->
|
||||||
<td valign="top" width="75" height="75"{extra}>
|
<td valign="top" height="75" colspan=1 width="{col_width}%"{extra}>
|
||||||
{column_data}
|
{column_data}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
<!-- $Id$ month_day -->
|
<!-- $Id$ month_day -->
|
||||||
{new_event_link}
|
<font size="-1">[ {day_number} ]</font>{new_event_link}<br>
|
||||||
[ {day_number} ]<br>
|
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
<tr>
|
<tr colspan={cols} width="{col_width}%">
|
||||||
{column_header}</tr>
|
{column_header}</tr>
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
{printer_friendly}
|
{printer_friendly}
|
||||||
<head>
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.tablecell {
|
.tablecell {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
<table border="0" width="100%" cols=5>
|
||||||
<table border=0 width=100%>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" valign="top">
|
<td align="left" valign="top" width="20%">
|
||||||
{small_calendar_prev}
|
{small_calendar_prev}
|
||||||
</td>
|
</td>
|
||||||
<td align="left">
|
<td align="left">
|
||||||
@ -18,8 +16,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td align="center" valign="top">
|
<td align="center" valign="top">
|
||||||
{small_calendar_this}
|
{small_calendar_this}
|
||||||
<font size="+2" color="#000000"><b>{week_identifier}</b></font>
|
<font size="+2" color="#000000"><b>{week_identifier}</b><br>{username}</font>
|
||||||
<font size="+2" color="#000000"><br>{username}</font>
|
|
||||||
</td>
|
</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
{next_week_link}
|
{next_week_link}
|
||||||
|
@ -16,20 +16,18 @@
|
|||||||
-->
|
-->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<table border="0" cellspacing="0" cellpadding="0" valign="top" width="46%">
|
<table border="0" cellspacing="0" cellpadding="0" valign="top" width=80 cols=7>
|
||||||
<tr valign="center">
|
<tr valign="center">
|
||||||
<td align="left" colspan="5"><font size="-2"> <b>{month}</b></font></td>
|
<td align="left" colspan=4><font size="-2"> <b>{month}</b></font></td>
|
||||||
<td align="right" colspan="2">{prevmonth} {nextmonth}</td>
|
<td align="right" colspan=3>{prevmonth} {nextmonth}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" colspan="7"><img src="{cal_img_root}/mini-calendar-bar.gif" width="90%" height="5"></td>
|
<td align="center" colspan=7><img src="{cal_img_root}/mini-calendar-bar.gif" width="90%" height="5"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<td colspan="7">
|
<td colspan=7>
|
||||||
<table border="0" width="100%" cellspacing="7" cellpadding="0" valign="top" cols="7">
|
<table border="0" width="100%" cellspacing="7" cellpadding="0" valign="top" cols=7>
|
||||||
<tr>{daynames}
|
<tr>{daynames} </tr>{display_monthweek} </table>
|
||||||
</tr>{display_monthweek}
|
|
||||||
</table>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
<!-- BEGIN mini_week -->
|
<!-- BEGIN mini_week -->
|
||||||
<tr>
|
<tr>
|
||||||
{monthweek_day}
|
{monthweek_day} </tr>
|
||||||
</tr>
|
|
||||||
<!-- END mini_week -->
|
<!-- END mini_week -->
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
<table width="100%" border="0" bordercolor="#FFFFFF" cellspacing="2" cellpadding="2">
|
<table width="100%" border="0" bordercolor="#FFFFFF" cellspacing="2" cellpadding="2" cols={cols}>
|
||||||
{row}
|
{row}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!-- $Id$ month_column -->
|
<!-- $Id$ month_column -->
|
||||||
<td valign="top" width="75" height="75"{extra}>
|
<td valign="top" height="75" colspan=1 width="{col_width}%"{extra}>
|
||||||
{column_data}
|
{column_data}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
<!-- $Id$ month_day -->
|
<!-- $Id$ month_day -->
|
||||||
{new_event_link}
|
<font size="-1">[ {day_number} ]</font>{new_event_link}<br>
|
||||||
[ {day_number} ]<br>
|
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
<tr>
|
<tr colspan={cols} width="{col_width}%">
|
||||||
{column_header}</tr>
|
{column_header}</tr>
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
<!-- $Id$ -->
|
<!-- $Id$ -->
|
||||||
{printer_friendly}
|
{printer_friendly}
|
||||||
<head>
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.tablecell {
|
.tablecell {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
<table border="0" width="100%" cols=5>
|
||||||
<table border=0 width=100%>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" valign="top">
|
<td align="left" valign="top" width="20%">
|
||||||
{small_calendar_prev}
|
{small_calendar_prev}
|
||||||
</td>
|
</td>
|
||||||
<td align="left">
|
<td align="left">
|
||||||
@ -18,8 +16,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td align="center" valign="top">
|
<td align="center" valign="top">
|
||||||
{small_calendar_this}
|
{small_calendar_this}
|
||||||
<font size="+2" color="#000000"><b>{week_identifier}</b></font>
|
<font size="+2" color="#000000"><b>{week_identifier}</b><br>{username}</font>
|
||||||
<font size="+2" color="#000000"><br>{username}</font>
|
|
||||||
</td>
|
</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
{next_week_link}
|
{next_week_link}
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<center>
|
<center>
|
||||||
<table border="0" cellspacing="3" cellpadding="4">
|
<table border="0" cellspacing="3" cellpadding="4" cols=4>
|
||||||
<tr>
|
<tr>
|
||||||
<?php
|
<?php
|
||||||
if (!$friendly)
|
if (!$friendly)
|
||||||
@ -53,7 +53,7 @@
|
|||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</td>
|
</td>
|
||||||
<td colspan="<?php echo ($friendly?'6':'4'); ?>" align="center">
|
<td align="center">
|
||||||
<font face=\"".$phpgw_info["theme"][font]."\" size="+1"><?php echo $year; ?></font>
|
<font face=\"".$phpgw_info["theme"][font]."\" size="+1"><?php echo $year; ?></font>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
@ -72,7 +72,7 @@
|
|||||||
else
|
else
|
||||||
echo $phpgw->calendar->mini_calendar($i,$i,$year,'','none',False);
|
echo $phpgw->calendar->mini_calendar($i,$i,$year,'','none',False);
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
if($i==6) echo '</tr><tr valign="top">';
|
if($i % 3 == 0) echo '</tr><tr valign="top">';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('mail_login_type', 'standard')");
|
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('mail_login_type', 'standard')");
|
||||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('smtp_server', 'localhost')");
|
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('smtp_server', 'localhost')");
|
||||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('smtp_port', '25')");
|
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('smtp_port', '25')");
|
||||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')");
|
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_server', 'news.freshmeat.net')");
|
||||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_port', '119')");
|
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_port', '119')");
|
||||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')");
|
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')");
|
||||||
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')");
|
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')");
|
||||||
|
@ -210,36 +210,37 @@
|
|||||||
)";
|
)";
|
||||||
$phpgw_setup->db->query($sql);
|
$phpgw_setup->db->query($sql);
|
||||||
|
|
||||||
$sql = "CREATE TABLE calendar_entry (
|
$sql = "CREATE TABLE phpgw_cal (
|
||||||
cal_id int(11) DEFAULT '0' NOT NULL auto_increment,
|
id int(11) DEFAULT '0' NOT NULL auto_increment,
|
||||||
cal_owner int(11) DEFAULT '0' NOT NULL,
|
owner int(11) DEFAULT '0' NOT NULL,
|
||||||
cal_group varchar(255),
|
category int(11) DEFAULT '0' NOT NULL ,
|
||||||
cal_datetime int(11),
|
groups varchar(255),
|
||||||
cal_mdatetime int(11),
|
datetime int(11),
|
||||||
cal_edatetime int(11),
|
mdatetime int(11),
|
||||||
cal_priority int(11) DEFAULT '2' NOT NULL,
|
edatetime int(11),
|
||||||
cal_type varchar(10),
|
priority int(11) DEFAULT '2' NOT NULL,
|
||||||
cal_access varchar(10),
|
type varchar(10),
|
||||||
cal_name varchar(80) NOT NULL,
|
public int DEFAULT '1' NOT NULL,
|
||||||
cal_description text,
|
title varchar(80) NOT NULL,
|
||||||
PRIMARY KEY (cal_id)
|
description text,
|
||||||
|
PRIMARY KEY (id)
|
||||||
)";
|
)";
|
||||||
$phpgw_setup->db->query($sql);
|
$phpgw_setup->db->query($sql);
|
||||||
|
|
||||||
$sql = "CREATE TABLE calendar_entry_repeats (
|
$sql = "CREATE TABLE phpgw_cal_repeats (
|
||||||
cal_id int(11) DEFAULT '0' NOT NULL,
|
id int(11) DEFAULT '0' NOT NULL,
|
||||||
cal_type enum('daily','weekly','monthlyByDay','monthlyByDate','yearly') DEFAULT 'daily' NOT NULL,
|
recur_type int DEFAULT '0' NOT NULL,
|
||||||
cal_use_end int DEFAULT '0',
|
recur_use_end int DEFAULT '0',
|
||||||
cal_end int(11),
|
recur_enddate int(11) DEFAULT '0',
|
||||||
cal_frequency int(11) DEFAULT '1',
|
recur_interval int(11) DEFAULT '1',
|
||||||
cal_days char(7)
|
recur_data int
|
||||||
)";
|
)";
|
||||||
$phpgw_setup->db->query($sql);
|
$phpgw_setup->db->query($sql);
|
||||||
|
|
||||||
$sql = "CREATE TABLE calendar_entry_user (
|
$sql = "CREATE TABLE phpgw_cal_user (
|
||||||
cal_id int(11) DEFAULT '0' NOT NULL,
|
id int(11) DEFAULT '0' NOT NULL,
|
||||||
cal_login int(11) DEFAULT '0' NOT NULL,
|
login int(11) DEFAULT '0' NOT NULL,
|
||||||
cal_status char(1) DEFAULT 'A',
|
status char(1) DEFAULT 'A',
|
||||||
PRIMARY KEY (cal_id, cal_login)
|
PRIMARY KEY (cal_id, cal_login)
|
||||||
)";
|
)";
|
||||||
$phpgw_setup->db->query($sql);
|
$phpgw_setup->db->query($sql);
|
||||||
@ -353,4 +354,4 @@
|
|||||||
$phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi'];
|
$phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi'];
|
||||||
update_version_table();
|
update_version_table();
|
||||||
// $phpgw_setup->update_version_table();
|
// $phpgw_setup->update_version_table();
|
||||||
?>
|
?>
|
||||||
|
@ -1474,11 +1474,93 @@
|
|||||||
{
|
{
|
||||||
global $phpgw_info,$phpgw_setup;
|
global $phpgw_info,$phpgw_setup;
|
||||||
|
|
||||||
$phpgw_setup->db->query("alter table phpgw_notes add column note_access char(7) after note_owner");
|
$phpgw_setup->db->query("alter table phpgw_notes add column note_access char(7) after note_owner");
|
||||||
|
|
||||||
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.001';
|
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.001';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$test[] = '0.9.11.001';
|
||||||
|
function upgrade0_9_11_001()
|
||||||
|
{
|
||||||
|
global $phpgw_info,$phpgw_setup;
|
||||||
|
|
||||||
|
if(extension_loaded('mcal') == False)
|
||||||
|
{
|
||||||
|
define(RECUR_NONE,0);
|
||||||
|
define(RECUR_DAILY,1);
|
||||||
|
define(RECUR_WEEKLY,2);
|
||||||
|
define(RECUR_MONTHLY_MDAY,3);
|
||||||
|
define(RECUR_MONTHLY_WDAY,4);
|
||||||
|
define(RECUR_YEARLY,5);
|
||||||
|
|
||||||
|
define(M_SUNDAY,1);
|
||||||
|
define(M_MONDAY,2);
|
||||||
|
define(M_TUESDAY,4);
|
||||||
|
define(M_WEDNESDAY,8);
|
||||||
|
define(M_THURSDAY,16);
|
||||||
|
define(M_FRIDAY,32);
|
||||||
|
define(M_SATURDAY,64);
|
||||||
|
}
|
||||||
|
|
||||||
|
$temp_db = $phpgw_setup->db;
|
||||||
|
|
||||||
|
$phpgw_setup->db->query("UPDATE calendar_entry SET cal_access='0' WHERE cal_access='private'",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("UPDATE calendar_entry SET cal_access='1' WHERE cal_access='public'",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("UPDATE calendar_entry SET cal_access='2' WHERE cal_access='group'",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_id id int(11) DEFAULT '0' NOT NULL auto_increment",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_owner owner int(11) DEFAULT '0' NOT NULL",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry add column category int(11) DEFAULT '0' NOT NULL after owner",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_group groups varchar(255)",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_datetime datetime int(11) DEFAULT '0' NOT NULL",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_mdatetime mdatetime int(11) DEFAULT '0' NOT NULL",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_edatetime edatetime int(11) DEFAULT '0' NOT NULL",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_priority priority int(11) DEFAULT '2' NOT NULL",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_type type varchar(10)",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_access public int DEFAULT '1' NOT NULL",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_name title varchar(80) NOT NULL",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry change cal_description description text",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry rename phpgw_cal",__LINE__,__FILE__);
|
||||||
|
|
||||||
|
// Prepare the calendar with the field data before washing it.....
|
||||||
|
$phpgw_setup->db->query("SELECT cal_id,cal_days,cal_type+0 AS rpt_type FROM calendar_entry_repeats",__LINE__,__FILE__);
|
||||||
|
while($phpgw_setup->db->next_record())
|
||||||
|
{
|
||||||
|
$id = $phpgw_setup->db->f('cal_id');
|
||||||
|
$days = strtoupper($phpgw_setup->db->f('cal_days'));
|
||||||
|
$rpt_type[$id] = $phpgw_setup->db->f('rpt_type');
|
||||||
|
$new_days = 0;
|
||||||
|
$new_days += (substr($days,0,1)=='Y'?M_SUNDAY:0);
|
||||||
|
$new_days += (substr($days,1,1)=='Y'?M_MONDAY:0);
|
||||||
|
$new_days += (substr($days,2,1)=='Y'?M_TUESDAY:0);
|
||||||
|
$new_days += (substr($days,3,1)=='Y'?M_WEDNESDAY:0);
|
||||||
|
$new_days += (substr($days,4,1)=='Y'?M_THURSDAY:0);
|
||||||
|
$new_days += (substr($days,5,1)=='Y'?M_FRIDAY:0);
|
||||||
|
$new_days += (substr($days,6,1)=='Y'?M_SATURDAY:0);
|
||||||
|
$temp_db->query("UPDATE calendar_entry_repeats SET cal_days = '".$new_days."' WHERE cal_id=".$id,__LINE__,__FILE__);
|
||||||
|
}
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_repeats change cal_id id int(11) DEFAULT '0' NOT NULL",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_repeats change cal_type recur_type int(11) DEFAULT '0' NOT NULL",__LINE__,__FILE__);
|
||||||
|
// I'm thinking I can delete the use_end field and just check to see if the end is != 0....
|
||||||
|
// $phpgw_setup->db->query("alter table calendar_entry_repeats drop recur_use_end",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_repeats change cal_use_end recur_use_end int DEFAULT '0'",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_repeats change cal_end recur_enddate int(11) DEFAULT '0'",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_repeats change cal_frequency recur_interval int(11) DEFAULT '1'",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_repeats change cal_days recur_data int(11) DEFAULT '0'",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_repeats rename phpgw_cal_repeats",__LINE__,__FILE__);
|
||||||
|
|
||||||
|
while(list($key,$value) = each($rpt_type))
|
||||||
|
{
|
||||||
|
$phpgw_setup->db->query("UPDATE phpgw_cal_repeats SET recur_type=".$value." WHERE id=".$key,__LINE__,__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_user change cal_id id int(11) DEFAULT '0' NOT NULL",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_user change cal_login login int(11) DEFAULT '0' NOT NULL",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_user change cal_status status char(1) DEFAULT 'A'",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("alter table calendar_entry_user rename phpgw_cal_user",__LINE__,__FILE__);
|
||||||
|
|
||||||
|
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.002';
|
||||||
|
}
|
||||||
|
|
||||||
reset ($test);
|
reset ($test);
|
||||||
while (list ($key, $value) = each ($test)){
|
while (list ($key, $value) = each ($test)){
|
||||||
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {
|
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {
|
||||||
|
@ -185,35 +185,36 @@
|
|||||||
)";
|
)";
|
||||||
$phpgw_setup->db->query($sql);
|
$phpgw_setup->db->query($sql);
|
||||||
|
|
||||||
$sql = "CREATE TABLE calendar_entry (
|
$sql = "CREATE TABLE phpgw_cal (
|
||||||
cal_id serial,
|
id serial,
|
||||||
cal_owner int DEFAULT 0 NOT NULL,
|
owner int DFAULT 0 NOT NULL,
|
||||||
cal_group varchar(255),
|
category int DFAULT 0 NOT NULL,
|
||||||
cal_datetime int4,
|
groups varchar(255),
|
||||||
cal_mdatetime int4,
|
datetime int4,
|
||||||
cal_edatetime int4,
|
mdatetime int4,
|
||||||
cal_priority int DEFAULT 2,
|
edatetime int4,
|
||||||
cal_type varchar(10),
|
priority int DEFAULT 2 NOT NULL,
|
||||||
cal_access varchar(10),
|
type varchar(10),
|
||||||
cal_name varchar(80) NOT NULL,
|
public int DEFAULT 1 NOT NULL,
|
||||||
cal_description text
|
title varchar(80) NOT NULL,
|
||||||
)";
|
desription text
|
||||||
|
)";
|
||||||
$phpgw_setup->db->query($sql);
|
$phpgw_setup->db->query($sql);
|
||||||
|
|
||||||
$sql = "CREATE TABLE calendar_entry_user (
|
$sql = "CREATE TABLE phpgw_cal_user (
|
||||||
cal_id int DEFAULT 0 NOT NULL,
|
id int DEFAULT 0 NOT NULL,
|
||||||
cal_login int DEFAULT 0 NOT NULL,
|
login int DEFAULT 0 NOT NULL,
|
||||||
cal_status char(1) DEFAULT 'A'
|
status char(1) DEFAULT 'A'
|
||||||
)";
|
)";
|
||||||
$phpgw_setup->db->query($sql);
|
$phpgw_setup->db->query($sql);
|
||||||
|
|
||||||
$sql = "create table calendar_entry_repeats (
|
$sql = "CREATE TABLE phpgw_cal_repeats (
|
||||||
cal_id int DEFAULT 0 NOT NULL,
|
id int DEFAULT 0 NOT NULL,
|
||||||
cal_type varchar(20),
|
recur_type int DEFAULT 0 NOT NULL,
|
||||||
cal_use_end int default 0,
|
recur_use_end int DEFAULT 0,
|
||||||
cal_end int4,
|
recur_enddate int4 DEFAULT 0,
|
||||||
cal_frequency int default 1,
|
recur_interval int DEFAULT 1,
|
||||||
cal_days char(7)
|
recur_data int
|
||||||
)";
|
)";
|
||||||
$phpgw_setup->db->query($sql);
|
$phpgw_setup->db->query($sql);
|
||||||
|
|
||||||
|
@ -1889,6 +1889,106 @@
|
|||||||
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.001';
|
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.001';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$test[] = '0.9.11.001';
|
||||||
|
function upgrade0_9_11_001()
|
||||||
|
{
|
||||||
|
global $phpgw_info,$phpgw_setup;
|
||||||
|
|
||||||
|
$temp_db = $phpgw_setup->db;
|
||||||
|
|
||||||
|
$sql = "CREATE TABLE phpgw_cal (
|
||||||
|
id serial,
|
||||||
|
owner int DFAULT 0 NOT NULL,
|
||||||
|
category int DFAULT 0 NOT NULL,
|
||||||
|
groups varchar(255),
|
||||||
|
datetime int4,
|
||||||
|
mdatetime int4,
|
||||||
|
edatetime int4,
|
||||||
|
priority int DEFAULT 2 NOT NULL,
|
||||||
|
type varchar(10),
|
||||||
|
public int DEFAULT 1 NOT NULL,
|
||||||
|
title varchar(80) NOT NULL,
|
||||||
|
desription text
|
||||||
|
)";
|
||||||
|
$phpgw_setup->db->query($sql);
|
||||||
|
|
||||||
|
$phpgw_setup->db->query("UPDATE calendar_entry SET cal_access='1' WHERE cal_access='public'",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("UPDATE calendar_entry SET cal_access='0' WHERE cal_access='private'",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("UPDATE calendar_entry SET cal_access='2' WHERE cal_access='group'",__LINE__,__FILE__);
|
||||||
|
|
||||||
|
$phpgw_setup->db->query("SELECT * FROM calendar_entry",__LINE__,__FILE__);
|
||||||
|
while($phpgw_setup->db->next_record())
|
||||||
|
{
|
||||||
|
$id = $phpgw_setup->db->f('cal_id');
|
||||||
|
$owner = $phpgw_setup->db->f('cal_owner');
|
||||||
|
$groups = $phpgw_setup->db->f('cal_group');
|
||||||
|
$datetime = $phpgw_setup->db->f('cal_datetime');
|
||||||
|
$mdatetime = $phpgw_setup->db->f('cal_mdatetime');
|
||||||
|
$edatetime = $phpgw_setup->db->f('cal_edatetime');
|
||||||
|
$priority = $phpgw_setup->db->f('cal_priority');
|
||||||
|
$type = $phpgw_setup->db->f('cal_type');
|
||||||
|
$public = $phpgw_setup->db->f('cal_access');
|
||||||
|
$title = $phpgw_setup->db->f('cal_name');
|
||||||
|
$description = $phpgw_setup->db->f('cal_description');
|
||||||
|
$temp_db->query("INSERT INTO phpgw_cal(id,owner,category,groups,datetime,mdatetime,edatetime,priority,type,public,title,description)
|
||||||
|
values($id,$owner,0,'$groups',$datetime,$mdatetime,$edatetime,$priority,'$type',$public,'$title','$description')",__LINE__,__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
$phpgw_setup->db->query("drop table calendar_entry",__LINE__,__FILE__);
|
||||||
|
$phpgw_setup->db->query("drop sequence calender_entry_cal_id_seq",__LINE__,__FILE__);
|
||||||
|
|
||||||
|
$sql = "CREATE TABLE phpgw_cal_repeats (
|
||||||
|
id int DEFAULT 0 NOT NULL,
|
||||||
|
recur_type int DEFAULT 0 NOT NULL,
|
||||||
|
recur_use_end int DEFAULT 0,
|
||||||
|
recur_enddate int4 DEFAULT 0,
|
||||||
|
recur_interval int DEFAULT 1,
|
||||||
|
recur_data int
|
||||||
|
)";
|
||||||
|
$phpgw_setup->db->query($sql);
|
||||||
|
|
||||||
|
$phpgw_setup->db->query("SELECT * FROM calendar_entry_repeats",__LINE__,__FILE__);
|
||||||
|
while($phpgw_setup->db->next_record())
|
||||||
|
{
|
||||||
|
$id = $phpgw_setup->db->f('cal_id');
|
||||||
|
$recur_type = $phpgw_setup->db->f('cal_type');
|
||||||
|
$recur_end_use = $phpgw_setup->db->f('cal_use_end');
|
||||||
|
$recur_end = $phpgw_setup->db->f('cal_end');
|
||||||
|
$recur_interval = $phpgw_setup->db->f('cal_frequency');
|
||||||
|
$days = strtoupper($phpgw_setup->db->f('cal_days'));
|
||||||
|
$recur_data = 0;
|
||||||
|
$recur_data += (substr($days,0,1)=='Y'?M_SUNDAY:0);
|
||||||
|
$recur_data += (substr($days,1,1)=='Y'?M_MONDAY:0);
|
||||||
|
$recur_data += (substr($days,2,1)=='Y'?M_TUESDAY:0);
|
||||||
|
$recur_data += (substr($days,3,1)=='Y'?M_WEDNESDAY:0);
|
||||||
|
$recur_data += (substr($days,4,1)=='Y'?M_THURSDAY:0);
|
||||||
|
$recur_data += (substr($days,5,1)=='Y'?M_FRIDAY:0);
|
||||||
|
$recur_data += (substr($days,6,1)=='Y'?M_SATURDAY:0);
|
||||||
|
$temp_db->query("INSERT INTO phpgw_cal_repeats(id,recur_type,recur_use_end,recur_enddate,recur_interval,recur_data)
|
||||||
|
VALUES($id,$recur_type,$recur_use_end,$recur_end,$recur_interval,$recur_data)",__LINE__,__FILE__);
|
||||||
|
}
|
||||||
|
$phpgw_setup->db->query("drop table calendar_entry_repeats",__LINE__,__FILE__);
|
||||||
|
|
||||||
|
$sql = "CREATE TABLE phpgw_cal_user (
|
||||||
|
id int DEFAULT 0 NOT NULL,
|
||||||
|
login int DEFAULT 0 NOT NULL,
|
||||||
|
status char(1) DEFAULT 'A'
|
||||||
|
)";
|
||||||
|
$phpgw_setup->db->query($sql);
|
||||||
|
|
||||||
|
$phpgw_setup->db->query("SELECT * FROM calendar_entry_user",__LINE__,__FILE__);
|
||||||
|
while($phpgw_setup->db->next_record())
|
||||||
|
{
|
||||||
|
$id = $phpgw_setup->db->f('cal_id');
|
||||||
|
$login = $phpgw_setup->db->f('cal_login');
|
||||||
|
$status = $phpgw_setup->db->f('cal_status');
|
||||||
|
$temp_db->query("INSERT INTO phpgw_cal_user(id,login,status) VALUES($id,$login,'$status')",__LINE__,__FILE__);
|
||||||
|
}
|
||||||
|
$phpgw_setup->db->query("drop table calendar_entry_user",__LINE__,__FILE__);
|
||||||
|
|
||||||
|
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.002';
|
||||||
|
}
|
||||||
|
|
||||||
reset ($test);
|
reset ($test);
|
||||||
while (list ($key, $value) = each ($test)){
|
while (list ($key, $value) = each ($test)){
|
||||||
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {
|
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {
|
||||||
|
@ -11,5 +11,5 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
$phpgw_info['server']['versions']['phpgwapi'] = '0.9.11.001';
|
$phpgw_info['server']['versions']['phpgwapi'] = '0.9.11.002';
|
||||||
$phpgw_info['server']['versions']['current_header'] = '1.11';
|
$phpgw_info['server']['versions']['current_header'] = '1.11';
|
||||||
|
Loading…
Reference in New Issue
Block a user