From 4cef072493a8fd976a94ffcd02d9fcd76a491727 Mon Sep 17 00:00:00 2001 From: skeeter Date: Sat, 10 Mar 2001 04:48:19 +0000 Subject: [PATCH] updated link() and finalized email updates --- calendar/day.php | 2 +- calendar/delete.php | 3 +- calendar/edit_entry.php | 110 +++++------ calendar/edit_entry_handler.php | 250 ++++++++++-------------- calendar/inc/class.calendar_sql.inc.php | 27 ++- calendar/inc/footer.inc.php | 6 +- calendar/inc/header.inc.php | 16 +- calendar/index.php | 38 ++-- calendar/matrixselect.php | 32 +-- calendar/month.php | 6 +- calendar/preferences.php | 13 ++ calendar/search.php | 195 +++++++++--------- calendar/view.php | 82 ++++---- calendar/week.php | 8 +- calendar/year.php | 4 +- 15 files changed, 396 insertions(+), 396 deletions(-) diff --git a/calendar/day.php b/calendar/day.php index 1a1b487ab0..b5569e9a0a 100644 --- a/calendar/day.php +++ b/calendar/day.php @@ -53,7 +53,7 @@ { $printer = ''; $param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner; - $print = '[".lang('Printer Friendly').']'; + $print = '[".lang('Printer Friendly').']'; } else { diff --git a/calendar/delete.php b/calendar/delete.php index 865ea671bb..8ccf12d2d5 100755 --- a/calendar/delete.php +++ b/calendar/delete.php @@ -27,10 +27,11 @@ { $thisyear = $event->start->year; $thismonth = $event->start->month; + $thisday = $event->start->mday; $phpgw->calendar->delete_event($cal_stream,intval($id)); $phpgw->calendar->expunge($cal_stream); } - Header('Location: ' . $phpgw->link('index.php','year='.$thisyear.'&month='.$thismonth.'&owner='.$owner)); + Header('Location: '.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/index.php','year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&owner='.$owner)); ?> diff --git a/calendar/edit_entry.php b/calendar/edit_entry.php index 9fa646791d..6fc5d3744d 100755 --- a/calendar/edit_entry.php +++ b/calendar/edit_entry.php @@ -51,7 +51,7 @@ if ($id > 0) { - $cal_stream = $phpgw->calendar->open('INBOX',intval($cal_info->owner),''); + $cal_stream = $phpgw->calendar->open('INBOX',intval($owner),''); $event = $phpgw->calendar->fetch_event($cal_stream,intval($id)); $can_edit = False; @@ -75,11 +75,6 @@ { header('Location: '.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/view.php','id='.$id.'&owner='.$owner)); } - - if($event->rpt_end_use == False) - { - $event->rpt_end = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) + 86400; - } } elseif(isset($readsess)) { @@ -130,12 +125,17 @@ $phpgw->calendar->event->priority = 2; $phpgw->calendar->event_set_recur_none($cal_stream); + $event = $phpgw->calendar->event; } + $tz_offset = ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset'])); + $start = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $tz_offset; + $end = mktime($event->end->hour,$event->end->min,$event->end->sec,$event->end->month,$event->end->mday,$event->end->year) - $tz_offset; + $phpgw->common->phpgw_header(); echo parse_navbar(); - $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar')); + $p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir); $templates = Array( 'edit_entry_begin'=> 'edit.tpl', 'list' => 'list.tpl', @@ -154,8 +154,7 @@ $action = lang('Calendar - Add'); } - $common_hidden = ''."\n" - . ''."\n" + $common_hidden = ''."\n" . ''."\n"; $vars = Array( @@ -169,78 +168,73 @@ $p->parse('out','edit_entry_begin'); // Brief Description - display_item(lang('Brief Description'),''); + display_item(lang('Brief Description'),''); // Full Description - display_item(lang('Full Description'),''); + display_item(lang('Full Description'),''); // Date - $day_html = $sb->getDays('cal[day]',intval($phpgw->common->show_date($phpgw->calendar->event->datetime,'d'))); - $month_html = $sb->getMonthText('cal[month]',intval($phpgw->common->show_date($phpgw->calendar->event->datetime,'n'))); - $year_html = $sb->getYears('cal[year]',intval($phpgw->common->show_date($phpgw->calendar->event->datetime,'Y')),intval($phpgw->common->show_date($phpgw->calendar->event->datetime,'Y'))); + $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'))); + $year_html = $sb->getYears('start[year]',intval($phpgw->common->show_date($start,'Y')),intval($phpgw->common->show_date($start,'Y'))); display_item(lang('Start Date'),$phpgw->common->dateformatorder($year_html,$month_html,$day_html)); // Time $amsel = ' checked'; $pmsel = ''; if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { - if ($phpgw->calendar->event->start->hour >= 12) + if ($event->start->hour >= 12) { $amsel = ''; $pmsel = ' checked'; } } - $str = ':'; + $str = ':'; if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { - $str .= 'am'; - $str .= 'pm'; + $str .= 'am'; + $str .= 'pm'; } display_item(lang('Start Time'),$str); // End Date - $day_html = $sb->getDays('cal[end_day]',intval($phpgw->common->show_date($phpgw->calendar->event->edatetime,'d'))); - $month_html = $sb->getMonthText('cal[end_month]',intval($phpgw->common->show_date($phpgw->calendar->event->edatetime,'n'))); - $year_html = $sb->getYears('cal[end_year]',intval($phpgw->common->show_date($phpgw->calendar->event->edatetime,'Y')),intval($phpgw->common->show_date($phpgw->calendar->event->edatetime,'Y'))); + $day_html = $sb->getDays('end[mday]',intval($phpgw->common->show_date($end,'d'))); + $month_html = $sb->getMonthText('end[month]',intval($phpgw->common->show_date($end,'n'))); + $year_html = $sb->getYears('end[year]',intval($phpgw->common->show_date($end,'Y')),intval($phpgw->common->show_date($end,'Y'))); display_item(lang('End Date'),$phpgw->common->dateformatorder($year_html,$month_html,$day_html)); // End Time $amsel = ' checked'; $pmsel = ''; if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { - if ($phpgw->calendar->event->end->hour >= 12) + if ($event->end->hour >= 12) { $amsel = ''; $pmsel = ' checked'; } } - $str = ':'; + $str = ':'; if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { - $str .= 'am'; - $str .= 'pm'; + $str .= 'am'; + $str .= 'pm'; } display_item(lang("End Time"),$str); // Priority - display_item(lang('Priority'),$sb->getPriority('cal[priority]',$phpgw->calendar->event->priority)); + display_item(lang('Priority'),$sb->getPriority('priority',$event->priority)); // Access - $str = 'calendar->event->public != True) + $str = 'public != True) { $str .= ' checked'; } $str .= '>'; display_item(lang('Private'),$str); -// Groups -// $user_groups = $phpgw->accounts->memberships(intval($owner)); -// display_item(lang('Groups'),$sb->getGroups($user_groups,$cal_info->groups,'cal[groups][]')); - // Participants -// Start Here..... $accounts = $phpgw->acl->get_ids_for_location('run',1,'calendar'); $users = Array(); for($i=0;$i'."\n"; - for ($l=0;$lcalendar->event->participants);$l++) + $str = "\n".' 0) && ($participate == True)) || !isset($id)) { $str .= ' checked'; @@ -321,7 +315,7 @@ $p->parse('output','hr',True); $p->set_var('hr_text','
'.lang('Repeating Event Information').'

'); $p->parse('output','hr',True); - $str = ''; $rpt_type = Array( RECUR_NONE, RECUR_DAILY, @@ -341,7 +335,7 @@ for($l=0;$lcalendar->event->recur_type == $rpt_type[$l]) + if($event->recur_type == $rpt_type[$l]) { $str .= ' selected'; } @@ -351,36 +345,40 @@ display_item(lang('Repeat Type'),$str); $p->set_var('field',lang('Repeat End Date')); - $str = 'calendar->event->recur_enddate->year != 0 && $phpgw->calendar->event->recur_enddate->month != 0 && $phpgw->calendar->event->recur_enddate->mday != 0) + if($event->recur_enddate->year != 0 && $event->recur_enddate->month != 0 && $event->recur_enddate->mday != 0) { $str .= ' checked'; + $recur_end = mktime($event->recur_enddate->hour,$event->recur_enddate->min,$event->recur_enddate->sec,$event->recur_enddate->month,$event->recur_enddate->mday,$event->recur_enddate->year) - $tz_offset; + } + else + { + $recur_end = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->sec) + 86400 - $tz_offset; } $str .= '>'.lang('Use End Date').' '; - $recur_end = mktime($phpgw->calendar->recur_enddate->hour,$phpgw->calendar->recur_enddate->min,$phpgw->calendar->recur_enddate->sec,$phpgw->calendar->recur_enddate->month,$phpgw->calendar->recur_enddate->mday,$phpgw->calendar->recur_enddate->year); - $recur_end -= ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset'])); - $day_html = $sb->getDays('cal[rpt_day]',intval($phpgw->common->show_date($recur_end,'d'))); - $month_html = $sb->getMonthText('cal[rpt_month]',intval($phpgw->common->show_date($recur_end,'n'))); - $year_html = $sb->getYears('cal[rpt_year]',intval($phpgw->common->show_date($recur_end,'Y')),intval($phpgw->common->show_date($recur_end,'Y'))); + + $day_html = $sb->getDays('recur_enddate[mday]',intval($phpgw->common->show_date($recur_end,'d'))); + $month_html = $sb->getMonthText('recur_enddate[month]',intval($phpgw->common->show_date($recur_end,'n'))); + $year_html = $sb->getYears('recur_enddate[year]',intval($phpgw->common->show_date($recur_end,'Y')),intval($phpgw->common->show_date($recur_end,'Y'))); $str .= $phpgw->common->dateformatorder($year_html,$month_html,$day_html); display_item(lang('Repeat End Date'),$str); - $str = 'calendar->event->recur_data & M_SUNDAY) ?' checked':'').'> '.lang('Sunday').' '; - $str .= 'calendar->event->recur_data & M_MONDAY) ?' checked':'').'> '.lang('Monday').' '; - $str .= 'calendar->event->recur_data & M_TUESDAY) ?' checked':'').'> '.lang('Tuesday').' '; - $str .= 'calendar->event->recur_data & M_WEDNESDAY) ?' checked':'').'> '.lang('Wednesday').' '; - $str .= 'calendar->event->recur_data & M_THURSDAY) ?' checked':'').'> '.lang('Thursday').' '; - $str .= 'calendar->event->recur_data & M_FRIDAY) ?' checked':'').'> '.lang('Friday').' '; - $str .= 'calendar->event->recur_data & M_SATURDAY) ?' checked':'').'> '.lang('Saturday').' '; + $str = 'recur_data & M_SUNDAY) ?' checked':'').'> '.lang('Sunday').' '; + $str .= 'recur_data & M_MONDAY) ?' checked':'').'> '.lang('Monday').' '; + $str .= 'recur_data & M_TUESDAY) ?' checked':'').'> '.lang('Tuesday').' '; + $str .= 'recur_data & M_WEDNESDAY) ?' checked':'').'> '.lang('Wednesday').' '; + $str .= 'recur_data & M_THURSDAY) ?' checked':'').'> '.lang('Thursday').' '; + $str .= 'recur_data & M_FRIDAY) ?' checked':'').'> '.lang('Friday').' '; + $str .= 'recur_data & M_SATURDAY) ?' checked':'').'> '.lang('Saturday').' '; display_item(lang('Repeat Day').'
'.lang('(for weekly)'),$str); - display_item(lang('Frequency'),''); + display_item(lang('Frequency'),''); $p->set_var('submit_button',lang('Submit')); diff --git a/calendar/edit_entry_handler.php b/calendar/edit_entry_handler.php index a8cd13eda9..144db45b6b 100755 --- a/calendar/edit_entry_handler.php +++ b/calendar/edit_entry_handler.php @@ -28,27 +28,27 @@ $cal_info = CreateObject('calendar.calendar_item'); - function validate($cal_info) + function validate($event) { global $phpgw; $error = 0; // do a little form verifying - if ($cal_info->name == '') + if ($event->title == '') { $error = 40; } - elseif (($phpgw->calendar->time_valid($cal_info->hour,$cal_info->minute,0) == False) || ($phpgw->calendar->time_valid($cal_info->end_hour,$cal_info->end_minute,0) == False)) + elseif (($phpgw->calendar->time_valid($event->start->hour,$event->start->min,0) == False) || ($phpgw->calendar->time_valid($event->end->hour,$event->end->min,0) == False)) { $error = 41; } - elseif (($phpgw->calendar->date_valid($cal_info->year,$cal_info->month,$cal_info->day) == False) || ($phpgw->calendar->date_valid($cal_info->end_year,$cal_info->end_month,$cal_info->end_day) == False) || ($phpgw->calendar->date_compare($cal_info->year,$cal_info->month,$cal_info->day,$cal_info->end_year,$cal_info->end_month,$cal_info->end_day) == -1)) + elseif (($phpgw->calendar->date_valid($event->start->year,$event->start->month,$event->start->mday) == False) || ($phpgw->calendar->date_valid($event->end->year,$event->end->month,$event->end->mday) == False) || ($phpgw->calendar->date_compare($event->start->year,$event->start->month,$event->start->mday,$event->end->year,$event->end->month,$event->end->mday) == -1)) { $error = 42; } - elseif ($phpgw->calendar->date_compare($cal_info->year,$cal_info->month,$cal_info->day,$cal_info->end_year,$cal_info->end_month,$cal_info->end_day) == 0) + elseif ($phpgw->calendar->date_compare($event->start->year,$event->start->month,$event->start->mday,$event->end->year,$event->end->month,$event->end->mday) == 0) { - if ($phpgw->calendar->time_compare($cal_info->hour,$cal_info->minute,0,$cal_info->end_hour,$cal_info->end_minute,0) == 1) + if ($phpgw->calendar->time_compare($event->start->hour,$event->start->min,0,$event->end->hour,$event->end->min,0) == 1) { $error = 42; } @@ -59,15 +59,76 @@ if(!isset($readsess)) { - $cal_info->set('access',''); - for(reset($cal);$key=key($cal);next($cal)) + if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { - $data = $cal[$key]; - $cal_info->set($key,$data); + if ($start[ampm] == 'pm') + { + if ($start[hour] <> 12) + { + $start[hour] += 12; + } + } + elseif ($start[ampm] == 'am') + { + if ($start[hour] == 12) + { + $start[hour] -= 12; + } + } + + if ($end[ampm] == 'pm') + { + if ($end[hour] <> 12) + { + $end[hour] += 12; + } + } + elseif ($end[ampm] == 'am') + { + if ($end[hour] == 12) + { + $end[hour] -= 12; + } + } } + $cal_stream = $phpgw->calendar->open('INBOX',intval($owner),''); + $phpgw->calendar->event_init($cal_stream); + $phpgw->calendar->event_set_category($cal_stream,''); + $phpgw->calendar->event_set_title($cal_stream,$title); + $phpgw->calendar->event_set_description($cal_stream,$description); + $phpgw->calendar->event_set_start($cal_stream,$start[year],$start[month],$start[mday],$start[hour],$start[min],0); + $phpgw->calendar->event_set_end($cal_stream,$end[year],$end[month],$end[mday],$end[hour],$end[min],0); + $phpgw->calendar->event_set_class($cal_stream,(private != 'private')); - $parts = $cal_info->participants; + if($id != 0) + { + $phpgw->calendar->event->id = $id; + } + + switch($recur_type) + { + case RECUR_NONE: + $phpgw->calendar->event_set_recur_none($cal_stream); + break; + case RECUR_DAILY: + $phpgw->calendar->event_set_recur_daily($cal_stream,$recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval); + break; + case RECUR_WEEKLY: + $phpgw->calendar->event_set_recur_weekly($cal_stream,$recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval,$recur_data); + break; + case RECUR_MONTHLY_MDAY: + $phpgw->calendar->event_set_recur_mday($cal_stream,$recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval); + break; + case RECUR_MONTHLY_WDAY: + $phpgw->calendar->event_set_recur_wday($cal_stream,$recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval); + break; + case RECUR_YEARLY: + $phpgw->calendar->event_set_recur_yearly($cal_stream,$recur_enddate[year],$recur_enddate[month],$recur_enddate[mday],$recur_interval); + break; + } + + $parts = $participants; $part = Array(); for($i=0;$iparticipants = Array(); + $participants = Array(); while($parts = each($part)) { - $cal_info->participants[] = $parts[0]; + $participants[] = $parts[0]; } - $cal_info->owner=$owner; + $phpgw->calendar->event_set_participants($cal_stream,$participants); - if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') - { - if ($cal_info->ampm == 'pm') - { - if ($cal_info->hour <> 12) - { - $cal_info->hour += 12; - } - } - elseif ($cal_info->ampm == 'am') - { - if ($cal_info->hour == 12) - { - $cal_info->hour -= 12; - } - } - - if ($cal_info->end_ampm == 'pm') - { - if ($cal_info->end_hour <> 12) - { - $cal_info->end_hour += 12; - } - } - elseif ($cal_info->end_ampm == 'am') - { - if ($cal_info->end_hour == 12) - { - $cal_info->end_hour -= 12; - } - } - } + $event = $phpgw->calendar->event; - $datetime = $phpgw->calendar->makegmttime($cal_info->hour,$cal_info->minute,0,$cal_info->month,$cal_info->day,$cal_info->year); - $cal_info->datetime = $datetime['raw']; - $datetime = $phpgw->calendar->makegmttime($cal_info->end_hour,$cal_info->end_minute,0,$cal_info->end_month,$cal_info->end_day,$cal_info->end_year); - $cal_info->edatetime = $datetime['raw']; - $datetime = $phpgw->calendar->makegmttime(0,0,0,$cal_info->rpt_month,$cal_info->rpt_day,$cal_info->rpt_year); - $cal_info->rpt_end = $datetime['raw']; - - $phpgw->session->appsession('entry','calendar',$cal_info); - $datetime_check = validate($cal_info); - if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') - { - if ($cal_info->hour >= 12) - { - $cal_info->ampm = ''; - } - - if ($cal_info->end_hour >= 12) - { - $cal_info->end_ampm = ''; - } - } + $phpgw->session->appsession('entry','calendar',$event); - $tz_offset = intval(((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset']))); + $datetime_check = validate($event); - $cal_info->datetime += $tz_offset; - $cal_info->edatetime += $tz_offset; - $overlapping_events = $phpgw->calendar->overlap($cal_info->datetime,$cal_info->edatetime,$cal_info->participants,$cal_info->owner,$cal_info->id); + $tz_offset = ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset'])); + $start = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $tz_offset; + $end = mktime($event->end->hour,$event->end->min,$event->end->sec,$event->end->month,$event->end->mday,$event->end->year) - $tz_offset; + + $overlapping_events = $phpgw->calendar->overlap($start,$end,$event->participants,$event->owner,$event->id); } else { - $cal_info = $phpgw->session->appsession('entry','calendar'); -// $cal_info = unserialize($phpgw->session->appsession('entry','calendar')); + $event = $phpgw->session->appsession('entry','calendar'); } if($datetime_check) @@ -186,44 +197,30 @@ $p->set_var('color',$phpgw_info['theme']['bg_text']); - $calendar_overlaps = $phpgw->calendar->getevent($overlapping_events); - - $format = $phpgw_info['user']['preferences']['common']['dateformat'] . ' - '; - - if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') - { - $format .= 'h:i:s a'; - } - else - { - $format .= 'H:i:s'; - } - $overlap = ''; - for($i=0;$icalendar->fetch_event($overlapping_events[$i]); + $overlap .= '
  • '; + $private = $phpgw->calendar->is_private($over,$over->owner); + + if(strtoupper($private) == 'PRIVATE') { - $overlap .= '
  • '; - $private = $phpgw->calendar->is_private($cal_over,$cal_over->owner); - - if(strtoupper($private) == 'PRIVATE') - { - $overlap .= '(PRIVATE)'; - } - else - { - $overlap .= $phpgw->calendar->link_to_entry($cal_over->id,'circle.gif',$cal_over->description).$cal_over->name; - } - - $overlap .= ' ('.$phpgw->common->show_date($cal_over->datetime).' - '.$phpgw->common->show_date($cal_over->edatetime).')
    '; + $overlap .= '(PRIVATE)'; } + else + { + $overlap .= $phpgw->calendar->link_to_entry($over->id,'circle.gif',$over->description).$over->title; + } + + $over_start = mktime($over->start->hour,$over->start->min,$over->start->sec,$over->start->month,$over->start->mday,$over->start->year); + $over_end = mktime($over->end->hour,$over->end->min,$over->end->sec,$over->end->month,$over->end->mday,$over->end->year); + $overlap .= ' ('.$phpgw->common->show_date($over_start).' - '.$phpgw->common->show_date($over_end).')
    '; } - if(strlen($overlap)) + if(strlen($overlap) > 0) { $var = Array( - 'overlap_text' => lang('Your suggested time of x - x conflicts with the following existing calendar entries:',date($format,$cal_info->datetime),date($format,$cal_info->edatetime)), + 'overlap_text' => lang('Your suggested time of x - x conflicts with the following existing calendar entries:',$phpgw->common->show_date($start),$phpgw->common->show_date($end)), 'overlap_list' => $overlap ); } @@ -237,8 +234,10 @@ $p->set_var($var); + $phpgw->calendar->event = $event; + $var = Array( - 'action_url_button' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/edit_entry_handler.php','readsess='.$cal_info->id.'&year='.$cal_info->year.'&month='.$cal_info->month.'&day='.$cal_info->day), + 'action_url_button' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/edit_entry_handler.php','readsess='.$event->id.'&year='.$event->year.'&month='.$event->month.'&day='.$event->mday), 'action_text_button' => lang('Ignore Conflict'), 'action_confirm_button' => '' ); @@ -247,7 +246,7 @@ $p->parse('resubmit_button','form_button'); $var = Array( - 'action_url_button' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/edit_entry.php','readsess='.$cal_info->id.'&year='.$cal_info->year.'&month='.$cal_info->month.'&day='.$cal_info->day), + 'action_url_button' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/edit_entry.php','readsess='.$event->id.'&year='.$event->start->year.'&month='.$event->start->month.'&day='.$event->start->day), 'action_text_button' => lang('Re-Edit Event'), 'action_confirm_button' => '' ); @@ -260,44 +259,9 @@ } else { - $cal_stream = $phpgw->calendar->open('INBOX',intval($cal_info->owner),''); - $phpgw->calendar->event_init($cal_stream); - $phpgw->calendar->event_set_category($cal_stream,''); - $phpgw->calendar->event_set_title($cal_stream,$cal_info->name); - $phpgw->calendar->event_set_description($cal_stream,$cal_info->description); - $phpgw->calendar->event_set_start($cal_stream,$cal_info->year,$cal_info->month,$cal_info->day,$cal_info->hour,$cal_info->minute,0); - $phpgw->calendar->event_set_end($cal_stream,$cal_info->end_year,$cal_info->end_month,$cal_info->end_day,$cal_info->end_hour,$cal_info->end_minute,0); - $phpgw->calendar->event_set_class($cal_stream,($cal_info->access != 'private')); - $phpgw->calendar->event_set_participants($cal_stream,$cal_info->participants); - - if($cal_info->id != 0) - { - $phpgw->calendar->event->id = $cal_info->id; - } - - switch($cal_info->rpt_type) - { - case 'none': - $phpgw->calendar->event_set_recur_none($cal_stream); - break; - case 'daily': - $phpgw->calendar->event_set_recur_daily($cal_stream,$cal_info->rpt_year,$cal_info->rpt_month,$cal_info->rpt_day,$cal_info->rpt_freq); - break; - case 'weekly': - $phpgw->calendar->event_set_recur_weekly($cal_stream,$cal_info->rpt_year,$cal_info->rpt_month,$cal_info->rpt_day,$cal_info->rpt_freq,$cal_freq->rpt_days); - break; - case 'monthlybydate': - $phpgw->calendar->event_set_recur_mday($cal_stream,$cal_info->rpt_year,$cal_info->rpt_month,$cal_info->rpt_day,$cal_info->rpt_freq); - break; - case 'monthlybyday': - $phpgw->calendar->event_set_recur_wday($cal_stream,$cal_info->rpt_year,$cal_info->rpt_month,$cal_info->rpt_day,$cal_info->rpt_freq); - break; - case 'yearly': - $phpgw->calendar->event_set_recur_yearly($cal_stream,$cal_info->rpt_year,$cal_info->rpt_month,$cal_info->rpt_day,$cal_info->rpt_freq); - break; - } + $cal_stream = $phpgw->calendar->open('INBOX',intval($owner),''); $phpgw->calendar->store_event($cal_stream); - Header('Location: '.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/index.php','year='.$cal_info->year.'&month='.$cal_info->month.'&cd=14&owner='.$owner)); + Header('Location: '.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/index.php','year='.$event->start->year.'&month='.$event->start->month.'&day='.$event->start->mday.'&cd=14&owner='.$owner)); } $phpgw->common->phpgw_footer(); ?> diff --git a/calendar/inc/class.calendar_sql.inc.php b/calendar/inc/class.calendar_sql.inc.php index b62d5fbeca..6edddc2291 100755 --- a/calendar/inc/class.calendar_sql.inc.php +++ b/calendar/inc/class.calendar_sql.inc.php @@ -16,6 +16,8 @@ class calendar_ extends calendar__ { + var $deleted_events = Array(); + var $cal_event; var $today = Array('raw','day','month','year','full','dow','dm','bd'); @@ -406,11 +408,7 @@ class calendar_ extends calendar__ function delete_event($mcal_stream,$event_id) { - $this->stream->lock(array('calendar_entry','calendar_entry_user','calendar_entry_repeats')); - $this->stream->query('DELETE FROM calendar_entry_user WHERE cal_id='.$event_id,__LINE__,__FILE__); - $this->stream->query('DELETE FROM calendar_entry_repeats WHERE cal_id='.$event_id,__LINE__,__FILE__); - $this->stream->query('DELETE FROM calendar_entry WHERE cal_id='.$event_id,__LINE__,__FILE__); - $this->stream->unlock(); + $this->deleted_events[] = $event_id; } function snooze($mcal_stream,$event_id) @@ -723,6 +721,25 @@ class calendar_ extends calendar__ function expunge($stream) { + if(count($this->deleted_events) <= 0) + { + return 1; + } + $this_event = $this->event; + $this->stream->lock(array('calendar_entry','calendar_entry_user','calendar_entry_repeats')); + for($i=0;$ideleted_events);$i++) + { + $event_id = $this->deleted_events[$i]; + + $event = $this->fetch_event($event_id); + $this->send_update(MSG_DELETED,$event->participants,$event); + + $this->stream->query('DELETE FROM calendar_entry_user WHERE cal_id='.$event_id,__LINE__,__FILE__); + $this->stream->query('DELETE FROM calendar_entry_repeats WHERE cal_id='.$event_id,__LINE__,__FILE__); + $this->stream->query('DELETE FROM calendar_entry WHERE cal_id='.$event_id,__LINE__,__FILE__); + } + $this->stream->unlock(); + $this->event = $this_event; return 1; } diff --git a/calendar/inc/footer.inc.php b/calendar/inc/footer.inc.php index 210abaff04..d5370a5cd4 100644 --- a/calendar/inc/footer.inc.php +++ b/calendar/inc/footer.inc.php @@ -63,7 +63,7 @@ } $var = Array( - 'action_url' => $phpgw->link('month.php','owner='.$owner), + 'action_url' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/month.php','owner='.$owner), 'form_name' => 'SelectMonth', 'label' => lang('Month'), 'form_label' => 'date', @@ -117,7 +117,7 @@ } $var = Array( - 'action_url' => $phpgw->link('week.php','owner='.$owner), + 'action_url' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/week.php','owner='.$owner), 'form_name' => 'SelectWeek', 'label' => lang('Week'), 'form_label' => 'date', @@ -150,7 +150,7 @@ } $var = Array( - 'action_url' => $phpgw->link('year.php','owner='.$owner), + 'action_url' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/year.php','owner='.$owner), 'form_name' => 'SelectYear', 'label' => lang('Year'), 'form_label' => 'year', diff --git a/calendar/inc/header.inc.php b/calendar/inc/header.inc.php index 8442fb1181..6830a30071 100644 --- a/calendar/inc/header.inc.php +++ b/calendar/inc/header.inc.php @@ -26,31 +26,31 @@   - + <?php echo lang('Today'); ?> - + <?php echo lang('This week'); ?> - + <?php echo lang('This month'); ?> - + <?php echo lang('This year'); ?> - + <?php echo lang('Daily Matrix View'); ?> -
    + : @@ -89,7 +89,7 @@ if(count($grants) > 0) { ?> - + : @@ -121,7 +121,7 @@ - + diff --git a/calendar/index.php b/calendar/index.php index ef3547bfe7..987d217c93 100755 --- a/calendar/index.php +++ b/calendar/index.php @@ -12,23 +12,29 @@ * option) any later version. * \**************************************************************************/ - /* $Id$ */ + /* $Id$ */ - $phpgw_info["flags"]["currentapp"] = "calendar"; - $phpgw_info["flags"]["noheader"] = True; - $phpgw_info["flags"]["nonavbar"] = True; - $phpgw_info["flags"]["noappheader"] = True; - $phpgw_info["flags"]["noappfooter"] = True; - $phpgw_info["flags"]["nofooter"] = True; - include("../header.inc.php"); + $phpgw_flags = Array( + 'currentapp' => 'calendar', + 'noheader' => True, + 'nonavbar' => True, + 'noappheader => True, + 'noappfooter' => True, + 'nofooter' => True + ); - $newpage = $phpgw_info["user"]["preferences"]["calendar"]["defaultcalendar"]; - if ($newpage=="index.php" || ($newpage!="day.php" && $newpage!="week.php" && $newpage!="month.php" && $newpage!="year.php")) { - $newpage = "month.php"; - $phpgw->preferences->change("calendar","defaultcalendar","month.php"); - $phpgw->preferences->commit(); - } + $phpgw_info['flags'] = $phpgw_flags; + + include('../header.inc.php'); - Header("Location: ".$newpage."?".$QUERY_STRING); - $phpgw->common->phpgw_exit(); + $newpage = $phpgw_info['user']['preferences']['calendar']['defaultcalendar']; + if ($newpage=='index.php' || ($newpage != 'day.php' && $newpage != 'week.php' && $newpage != 'month.php' && $newpage != 'year.php')) + { + $newpage = 'month.php'; + $phpgw->preferences->add('calendar','defaultcalendar','month.php'); + $phpgw->preferences->save_repository(); + } + + Header('Location: '.$newpage.'?'.$QUERY_STRING); + $phpgw->common->phpgw_exit(); ?> diff --git a/calendar/matrixselect.php b/calendar/matrixselect.php index 2544509acd..c2c898f77c 100755 --- a/calendar/matrixselect.php +++ b/calendar/matrixselect.php @@ -23,7 +23,11 @@ include('../header.inc.php'); - $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar')); + $datetime = mktime(0,0,0,$thismonth,$thisday,$thisyear) - ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset'])); + + $sb = CreateObject('phpgwapi.sbox'); + + $p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir); $templates = Array( 'matrix_query_begin' => 'matrix_query.tpl', @@ -36,34 +40,16 @@ $var = Array( 'matrix_action' => lang('Daily Matrix View'), - 'action_url' => $phpgw->link('viewmatrix.php') + 'action_url' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/viewmatrix.php') ); $p->set_var($var); $p->parse('out','matrix_query_begin'); // Date - $day_html = ''; - - $month_html = ''; - - $year_html = ''; + $day_html = $sb->getDays('day',intval($phpgw->common->show_date($datetime,'d'))); + $month_html = $sb->getMonthText('month',intval($phpgw->common->show_date($datetime,'n'))); + $year_html = $sb->getYears('year',intval($phpgw->common->show_date($datetime,'Y')),intval($phpgw->common->show_date($datetime,'Y'))); $var = Array( 'field' => lang('Date'), diff --git a/calendar/month.php b/calendar/month.php index a36efe85c1..50e5464d43 100755 --- a/calendar/month.php +++ b/calendar/month.php @@ -39,9 +39,9 @@ $phpgw_info['flags'] = $phpgw_flags; include('../header.inc.php'); - $view = "month"; + $view = 'month'; - $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar')); + $p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir); $templates = Array( 'index_t' => 'index.tpl' @@ -55,7 +55,7 @@ { $printer = ''; $param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner; - $print = '[".lang('Printer Friendly').']'; + $print = '[".lang('Printer Friendly').']'; } else { diff --git a/calendar/preferences.php b/calendar/preferences.php index c8e5d80885..b69784a826 100644 --- a/calendar/preferences.php +++ b/calendar/preferences.php @@ -39,6 +39,15 @@ { $phpgw->preferences->delete('calendar','mainscreen_showevents'); } + if ($send_updates) + { + $phpgw->preferences->add('calendar','send_updates'); + } + else + { + $phpgw->preferences->delete('calendar','send_updates'); + } + $phpgw->preferences->save_repository(True); Header('Location: '.$phpgw->link('/preferences/index.php')); @@ -147,6 +156,10 @@ . ''; display_item(lang('default calendar filter'),$str); + $str = ''; + display_item(lang('send updates via email'),$str); + + $p->pparse('out','pref'); $phpgw->common->phpgw_footer(); ?> diff --git a/calendar/search.php b/calendar/search.php index b8bb2c98d3..97e157b441 100755 --- a/calendar/search.php +++ b/calendar/search.php @@ -12,114 +12,125 @@ * option) any later version. * \**************************************************************************/ - /* $Id$ */ + /* $Id$ */ - $phpgw_info["flags"] = array("currentapp" => "calendar", "enable_nextmatchs_class" => True); + $phpgw_flags = Array( + 'currentapp' => 'calendar', + 'enable_nextmatchs_class' => True + ); + + $phpgw_info['flags'] = $phpgw_flags; - if (! $keywords) { - // If we reach this, it is because they didn't search for anything, - // attempt to send them back to where they where. - Header("Location: " . $phpgw->link($from,"date=$datemonth=$month&day=$day&year=$year")); - } + if (! $keywords) + { + // If we reach this, it is because they didn't search for anything, + // attempt to send them back to where they where. + Header('Location: ' . $phpgw->link($from,'month='.$month.'&day='.$day.'&year='.$year)); + } - include("../header.inc.php"); + include('../header.inc.php'); - $error = ""; + $error = ''; - if (strlen($keywords) == 0) { - echo "".lang("Error").":"; - echo lang("You must enter one or more search keywords."); - $phpgw->common->phpgw_footer(); - $phpgw->common->phpgw_exit(); - } - $matches = 0; + if (strlen($keywords) == 0) + { + echo ''.lang('Error').':'; + echo lang('You must enter one or more search keywords.'); + $phpgw->common->phpgw_footer(); + $phpgw->common->phpgw_exit(); + } + + $matches = 0; - $phpgw->calendar->set_filter(); + $phpgw->calendar->set_filter(); - // There is currently a problem searching in with repeated events. - // It spits back out the date it was entered. I would like to to say that - // it is a repeated event. - $ids = array(); - $words = split(" ", $keywords); - for ($i = 0; $i < count($words); $i++) { - $sql = "SELECT DISTINCT calendar_entry.cal_id, calendar_entry.cal_name, " - . "calendar_entry.cal_datetime " - . "FROM calendar_entry, calendar_entry_user " - . "WHERE " - . "(UPPER(calendar_entry.cal_name) LIKE UPPER('%".$words[$i]."%') OR " - . " UPPER(calendar_entry.cal_description) LIKE UPPER('%".$words[$i]."%')) AND " - . "calendar_entry_user.cal_id=calendar_entry.cal_id AND "; + // There is currently a problem searching in with repeated events. + // It spits back out the date it was entered. I would like to to say that + // it is a repeated event. + $ids = array(); + $words = split(' ',$keywords); + for ($i=0;$icalendar->filter==" all " || strpos($phpgw->calendar->filter,"private")) { - $sqlfilter .= "(calendar_entry_user.cal_login = ".$phpgw_info["user"]["account_id"]." AND calendar_entry.cal_access='private') "; - } + if(strpos($phpgw->calendar->filter,'private')) + { + $sql .= "AND calendar_entry.cal_access='private' "; + } + + $sql .= 'ORDER BY calendar_entry.cal_datetime ASC, calendar_entry.cal_edatetime ASC, calendar_entry.cal_priority ASC'; -// Group Public - if($phpgw->calendar->filter==" all " || strpos($phpgw->calendar->filter,"group")) { - if($sqlfilter) - $sqlfilter .= "OR "; - $sqlfilter .= $phpgw->calendar->group_search($phpgw_info["user"]["account_id"])." "; - } + $events = $phpgw->calendar->get_event_ids(True,$sql); -// Global Public - if($phpgw->calendar->filter==" all " || strpos($phpgw->calendar->filter,"public")) { - if($sqlfilter) - $sqlfilter .= "OR "; - $sqlfilter .= "calendar_entry.cal_access='public' "; - } - $orderby = " ORDER BY calendar_entry.cal_datetime ASC"; + if($events == False) + { + $matches = 0; + } + else + { + $cal_stream = $phpgw->calendar->open('INBOX',intval($owner),''); + for($i=0;$icalendar->fetch_event($cal_stream,$events[$i]); + + $datetime = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset'])); + + $ids[strval($event->id)]++; + $info[strval($event->id)] = $event->name.' (' + . $phpgw->common->show_date($datetime).')'; + } + $matches = count($events); + } + } - if($sqlfilter) $sql .= "(".$sqlfilter.") "; - $sql .= $orderby; + if ($matches > 0) + { + $matches = count($ids); + } - $phpgw->db->query($sql,__LINE__,__FILE__); - while ($phpgw->db->next_record()) { - $matches++; - $ids[strval( $phpgw->db->f(0) )]++; - $info[strval( $phpgw->db->f(0) )] = $phpgw->db->f(1) . " (" - . $phpgw->common->show_date($phpgw->db->f(2)) . ")"; - } - } + if ($matches == 1) + { + $quantity = '1 match found.'; + } + elseif ($matches > 0) + { + $quantity = lang('x matches found',$matches).'.'; + } + else + { + echo ''.lang('Error').':'; + echo lang('no matches found.'); + $phpgw->common->phpgw_footer(); + $phpgw->common->phpgw_exit(); + } - if ($matches > 0) - $matches = count($ids); + $p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir); + $templates = Array( + 'search' => 'search.tpl', + 'search_list' => 'search_list.tpl', + ); + $p->set_file($templates); - if ($matches == 1) - $quantity = "1 match found."; - else if ($matches > 0) - $quantity = lang("x matches found",$matches)."."; - else - $error = lang("no matches found."); + $var = Array( + 'color' => $phpgw_info['theme']['bg_text'], + 'search_text' => lang('Search Results'), + 'quantity' => $quantity + ); - if($error) { - echo "".lang("Error").":"; - echo $error; - $phpgw->common->phpgw_footer(); - $phpgw->common->phpgw_exit(); - } + $p->set_var($var); - $phpgw->template->set_file(array("search_t" => "search.tpl", - "search_list" => "search_list.tpl")); + // now sort by number of hits + arsort($ids); + for(reset($ids);$key=key($ids);next($ids)) + { + $p->set_var('url_result',$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/view.php','id='.$key.'&owner='.$owner)); + $p->set_var('result_desc',$info[$key]); + $p->parse('output','search_list',True); + } + + $p->pparse('out','search'); - $phpgw->template->set_block("search_t","search_list"); - - $phpgw->template->set_var("color",$phpgw_info["theme"]["bg_text"]); - $phpgw->template->set_var("search_text",lang("Search Results")); - $phpgw->template->set_var("quantity",$quantity); - -// now sort by number of hits - if (! strlen($error)) { - arsort ($ids); - for (reset($ids); $key = key($ids); next($ids)) { - $phpgw->template->set_var("url_result",$phpgw->link("view.php","id=$key")); - $phpgw->template->set_var("result_desc",$info[$key]); - $phpgw->template->parse("output","search_list",True); - } - } - - $phpgw->template->pparse("out","search_t"); - - $phpgw->common->phpgw_footer(); + $phpgw->common->phpgw_footer(); ?> diff --git a/calendar/view.php b/calendar/view.php index 13f7048473..722fb37263 100755 --- a/calendar/view.php +++ b/calendar/view.php @@ -65,13 +65,13 @@ $unapproved = FALSE; $cal_stream = $phpgw->calendar->open('INBOX',$owner,''); - $cal_info = $phpgw->calendar->fetch_event($cal_stream,$id); + $event = $phpgw->calendar->fetch_event($cal_stream,$id); - reset($cal_info->participants); + reset($event->participants); $participating = False; - for($j=0;$jparticipants);$j++) + for($j=0;$jparticipants);$j++) { - if($cal_info->participants[$j] == $owner) + if($event->participants[$j] == $owner) { $participating = True; } @@ -83,7 +83,7 @@ $phpgw->common->phpgw_exit(); } - $description = nl2br($description); +// $description = nl2br($event->description); $p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir); @@ -97,72 +97,76 @@ $var = Array( 'bg_text' => $phpgw_info['theme']['bg_text'], - 'name' => $cal_info->name + 'name' => $event->name ); $p->set_var($var); $p->parse('out','view_begin'); // Some browser add a \n when its entered in the database. Not a big deal // this will be printed even though its not needed. - if (nl2br($cal_info->description)) + if (nl2br($event->description)) { - display_item(lang("Description"),nl2br($cal_info->description)); + display_item(lang('Description'),nl2br($event->description)); } - display_item(lang('Start Date/Time'),$phpgw->common->show_date($cal_info->datetime)); + $tz_offset = ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset'])); + + $start = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $tz_offset; + display_item(lang('Start Date/Time'),$phpgw->common->show_date($start)); // save date so the trailer links are for the same time period $thisyear = $cal_info->start->year; $thismonth = $cal_info->start->month; $thisday = $cal_info->start->mday; - display_item(lang('End Date/Time'),$phpgw->common->show_date($cal_info->edatetime)); + $end = mktime($event->end->hour,$event->end->min,$event->end->sec,$event->end->month,$event->end->mday,$event->end->year) - $tz_offset; + display_item(lang('End Date/Time'),$phpgw->common->show_date($end)); - display_item(lang('Priority'),$pri[$cal_info->priority]); + display_item(lang('Priority'),$pri[$event->priority]); $participate = False; - for($i=0;$iparticipants);$i++) + for($i=0;$iparticipants);$i++) { - if($cal_info->participants[$i] == $phpgw_info['user']['account_id']) + if($event->participants[$i] == $phpgw_info['user']['account_id']) { $participate = True; } } - if($cal_info->owner == $phpgw_info['user']['account_id'] && $participate) + if($event->owner == $phpgw_info['user']['account_id'] && $participate) { display_item(lang('Created by'),''.$phpgw->common->grab_owner_name($cal_info->owner).''); + .$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/viewmatrix.php','participants='.$event->owner.'&month='.$event->start->month.'&day='.$event->start->mday.'&year='.$event->start->year.'&matrixtype=free/busy&owner='.$owner) + .'">'.$phpgw->common->grab_owner_name($event->owner).''); } else { - display_item(lang('Created by'),$phpgw->common->grab_owner_name($cal_info->owner)); + display_item(lang('Created by'),$phpgw->common->grab_owner_name($event->owner)); } - display_item(lang('Updated'),$phpgw->common->show_date($cal_info->mdatetime)); + display_item(lang('Updated'),$phpgw->common->show_date($event->mdatetime)); - if($cal_info->groups[0]) + if($event->groups[0]) { $cal_grps = ''; - for($i=0;$igroups);$i++) + for($i=0;$igroups);$i++) { if($i>0) { $cal_grps .= '
    '; } - $cal_grps .= $phpgw->accounts->id2name($cal_info->groups[$i]); + $cal_grps .= $phpgw->accounts->id2name($event->groups[$i]); } display_item(lang('Groups'),$cal_grps); } $str = ''; - for($i=0;$iparticipants);$i++) + for($i=0;$iparticipants);$i++) { if($i) { $str .= '
    '; } - switch ($cal_info->status[$i]) + switch ($event->status[$i]) { case 'A': $status = 'Accepted'; @@ -177,63 +181,63 @@ $status = 'No Repsonse'; break; } - $str .= $phpgw->common->grab_owner_name($cal_info->participants[$i]).' ('.$status.')'; + $str .= $phpgw->common->grab_owner_name($event->participants[$i]).' ('.$status.')'; } display_item(lang('Participants'),$str); // Repeated Events - $str = $cal_info->rpt_type; - if($str <> 'none' || $cal_info->rpt_use_end) + $str = $event->rpt_type; + if($event->recur_type <> RECUR_NONE || ($event->recur_enddate->mday != 0 && $event->recur_enddate->month != 0 && $event->recur_enddate->year != 0)) { $str .= ' ('; - $recur_end = mktime(0,0,0,$cal_info->recur_enddate->month,$cal_info->recur_enddate->mday,$cal_info->recur_enddate->year); + $recur_end = mktime(0,0,0,$event->recur_enddate->month,$event->recur_enddate->mday,$event->recur_enddate->year); if($recur_end != 0) { $str .= lang('ends').': '.$phpgw->common->show_date($recur_end,'l, F d, Y').' '; } - if($cal_info->recur_type == RECUR_WEEKLY || $cal_info->recur_type == RECUR_DAILY) + if($event->recur_type == RECUR_WEEKLY || $event->recur_type == RECUR_DAILY) { $repeat_days = ''; - if ($cal_info->recur_data & M_SUNDAY) + if ($event->recur_data & M_SUNDAY) { add_day($repeat_days,lang('Sunday ')); } - if ($cal_info->recur_data & M_MONDAY) + if ($event->recur_data & M_MONDAY) { add_day($repeat_days,lang('Monday ')); } - if ($cal_info->recur_data & M_TUESDAY) + if ($event->recur_data & M_TUESDAY) { add_day($repeat_days,lang('Tuesay ')); } - if ($cal_info->recur_data & M_WEDNESDAY) + if ($event->recur_data & M_WEDNESDAY) { add_day($repeat_days,lang('Wednesday ')); } - if ($cal_info->recur_data & M_THURSDAY) + if ($event->recur_data & M_THURSDAY) { add_day($repeat_days,lang('Thursday ')); } - if ($cal_info->recur_data & M_FRIDAY) + if ($event->recur_data & M_FRIDAY) { add_day($repeat_days,lang('Friday ')); } - if ($cal_info->recur_data & M_SATURDAY) + if ($event->recur_data & M_SATURDAY) { add_day($repeat_days,lang('Saturday ')); } $str .= lang('days repeated').': '.$repeat_days; } - if($cal_info->recur_interval) + if($event->recur_interval) { - $str .= lang('frequency').' '.$cal_info->recur_interval; + $str .= lang('frequency').' '.$event->recur_interval; } $str .= ')'; display_item(lang('Repetition'),$str); } - if (($cal_info->owner == $owner) && ($rights & PHPGW_ACL_EDIT)) + if (($event->owner == $owner) && ($rights & PHPGW_ACL_EDIT)) { $p->set_var('action_url_button',$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/edit_entry.php','id='.$id.'&owner='.$owner)); $p->set_var('action_text_button',' '.lang('Edit').' '); @@ -245,7 +249,7 @@ $p->set_var('edit_button',''); } - if (($cal_info->owner == $owner) && ($rights & PHPGW_ACL_DELETE)) + if (($event->owner == $owner) && ($rights & PHPGW_ACL_DELETE)) { $p->set_var('action_url_button',$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/delete.php','id='.$id.'&owner='.$owner)); $p->set_var('action_text_button',lang('Delete')); diff --git a/calendar/week.php b/calendar/week.php index aa94f847d6..d6f61f308d 100755 --- a/calendar/week.php +++ b/calendar/week.php @@ -61,7 +61,7 @@ } $week_id .= $last['day'].', '.$last['year']; - $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar')); + $p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir); $templates = Array( 'week_t' => 'week.tpl' ); @@ -71,10 +71,10 @@ if ($friendly == 0) { $printer = ''; - $prev_week_link = '<<'; - $next_week_link = '>>'; + $prev_week_link = '<<'; + $next_week_link = '>>'; $param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner; - $print = '[".lang('Printer Friendly').']'; + $print = '[".lang('Printer Friendly').']'; } else { diff --git a/calendar/year.php b/calendar/year.php index 4c019da39a..1e15331fda 100755 --- a/calendar/year.php +++ b/calendar/year.php @@ -37,7 +37,7 @@ link("year.php","year=" . ($year - 1)) . "\"><<"; + echo "link('/'.$phpgw_info['flags']['currentapp'].'/year.php',"year=" . ($year - 1)) . "\"><<"; ?> @@ -46,7 +46,7 @@ link("year.php","year=" . ($year + 1)) . "\">>>"; + echo "link('/'.$phpgw_info['flags']['currentapp'].'/year.php',"year=" . ($year + 1)) . "\">>>"; ?>