Mini calendars are now a configurable option for printer friendly pages.

This commit is contained in:
skeeter 2001-05-18 11:31:44 +00:00
parent dc2b2bfc05
commit 168fa729e8
5 changed files with 76 additions and 19 deletions

View File

@ -54,11 +54,20 @@
$printer = '';
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
$print = '<a href="'.$phpgw->link('/calendar/day.php',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
$minical = $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php');
}
else
{
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
$print = '';
if($phpgw_info['user']['preferences']['calendar']['display_minicals'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_minicals'])
{
$minical = $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php');
}
else
{
$minical = '';
}
}
$now = $phpgw->calendar->makegmttime(0, 0, 0, $thismonth, $thisday, $thisyear);
@ -69,7 +78,7 @@
'printer_friendly' => $printer,
'bg_text' => $phpgw_info['themem']['bg_text'],
'daily_events' => $phpgw->calendar->print_day_at_a_glance($now),
'small_calendar' => $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'),
'small_calendar' => $minical,
'date' => lang(date('F',$m)).' '.$thisday.', '.$thisyear,
'username' => $phpgw->common->grab_owner_name($owner),
'print' => $print

View File

@ -800,7 +800,7 @@ class calendar extends calendar_
$p->set_block('mini_calendar','mini_week','mini_week');
$p->set_block('mini_calendar','mini_day','mini_day');
if($this->printer_firendly == False)
if($this->printer_friendly == False)
{
$month = '<a href="' . $phpgw->link('/calendar/month.php','month='.date('m',$date['raw']).'&year='.date('Y',$date['raw']).'&owner='.$this->owner) . '" class="minicalendar">' . lang($phpgw->common->show_date($date['raw'],'F')).' '.$year . '</a>';
}
@ -908,6 +908,7 @@ class calendar extends calendar_
}
else
{
$dayname = '';
$holiday_found = $this->holidays->find_date($cal['raw']);
if($outside_month == True)
{
@ -919,15 +920,23 @@ class calendar extends calendar_
{
$class = 'minicalgreyhol';
}
$p->set_var('day_image','');
$p->set_var('dayname','<a href="'.$phpgw->link('/calendar/'.$link,'year='.$cal['year'].'&month='.$cal['month'].'&day='.$cal['day']).'" class="'.$class.'">'.$cal['day'].'</a>');
if(!$this->printer_friendly)
{
$dayname .= '<a href="'.$phpgw->link('/calendar/'.$link,'year='.$cal['year'].'&month='.$cal['month'].'&day='.$cal['day']).'" class="'.$class.'">';
}
$dayname .= $cal['day'];
if(!$this->printer_friendly)
{
$dayname .= '</a>';
}
}
else
{
$p->set_var('day_image','');
// $p->set_var('bgcolor2','#FEFEFE');
$p->set_var('dayname','');
}
$var = Array(
'day_image' => '',
'dayname' => $dayname
);
$p->set_var($var);
}
$p->parse('monthweek_day','mini_day',True);
}

View File

@ -57,20 +57,32 @@
$printer = '';
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner;
$print = '<a href="'.$phpgw->link('/calendar/month.php',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
$minical_prev = $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php');
$minical_next = $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php');
}
else
{
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
$print = '';
if($phpgw_info['user']['preferences']['calendar']['display_minicals'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_minicals'])
{
$minical_prev = $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php');
$minical_next = $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php');
}
else
{
$minical_prev = '';
$minical_next = '';
}
}
$var = Array(
'printer_friendly' => $printer,
'bg_text' => $phpgw_info['themem']['bg_text'],
'small_calendar_prev' => $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php'),
'small_calendar_prev' => $minical_prev,
'month_identifier' => lang(strftime("%B",$m)) . ' ' . $thisyear,
'username' => $phpgw->common->grab_owner_name($owner),
'small_calendar_next' => $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php'),
'small_calendar_next' => $minical_next,
'large_month' => $phpgw->calendar->display_large_month($thismonth,$thisyear,True,$owner),
'print' => $print
);

View File

@ -66,6 +66,15 @@
{
$phpgw->preferences->delete('calendar','default_private');
}
if ($display_minicals == True)
{
$phpgw->preferences->add('calendar','display_minicals');
}
else
{
$phpgw->preferences->delete('calendar','display_minicals');
}
$phpgw->preferences->save_repository(True);
Header('Location: '.$phpgw->link('/preferences/index.php'));
@ -174,16 +183,19 @@
// . '<option value="private+group"'.$selected['private+group'].'>'.lang('private and group public').'</option>'
// . '<option value="public+group"'.$selected['public+group'].'>'.lang('global public and group public').'</option>'
. '</select>';
display_item(lang('default calendar filter'),$str);
display_item(lang('Default calendar filter'),$str);
$str = '<input type="checkbox" name="send_updates" value="True"'.($phpgw_info['user']['preferences']['calendar']['send_updates'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['send_updates'] == True?' checked':'').'>';
display_item(lang('send/receive updates via email'),$str);
display_item(lang('Send/receive updates via email'),$str);
$str = '<input type="checkbox" name="display_status" value="True"'.($phpgw_info['user']['preferences']['calendar']['display_status'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_status'] == True?' checked':'').'>';
display_item(lang('display status of events'),$str);
display_item(lang('Display status of events'),$str);
$str = '<input type="checkbox" name="default_private" value="True"'.($phpgw_info['user']['preferences']['calendar']['default_private'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['default_private'] == True?' checked':'').'>';
display_item(lang('when creating new events default set to private'),$str);
display_item(lang('When creating new events default set to private'),$str);
$str = '<input type="checkbox" name="display_minicals" value="True"'.($phpgw_info['user']['preferences']['calendar']['display_minicals'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_minicals'] == True?' checked':'').'>';
display_item(lang('Display mini calendars when printing'),$str);
$country = CreateObject('phpgwapi.country');
display_item(lang('Select country for including holidays'),$country->form_select($phpgw_info['user']['preferences']['calendar']['locale'],'locale'));

View File

@ -75,6 +75,9 @@
$next_week_link = '<a href="'.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/week.php','year='.$next['year'].'&month='.$next['month'].'&day='.$next['day']).'">&gt;&gt;</a>';
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
$print = '<a href="'.$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/week.php',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
$minical_this = $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php');
$minical_prev = $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php');
$minical_next = $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php');
}
else
{
@ -82,18 +85,30 @@
$prev_week_link = '&lt;&lt;';
$next_week_link = '&gt;&gt;';
$print = '';
if($phpgw_info['user']['preferences']['calendar']['display_minicals'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_minicals'])
{
$minical_this = $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php');
$minical_prev = $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php');
$minical_next = $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php');
}
else
{
$minical_this = '';
$minical_prev = '';
$minical_next = '';
}
}
$var = Array(
'printer_friendly' => $printer,
'bg_text' => $phpgw_info['themem']['bg_text'],
'small_calendar_prev' => $phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php'),
'small_calendar_prev' => $minical_prev,
'prev_week_link' => $prev_week_link,
'small_calendar_this' => $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'),
'small_calendar_this' => $minical_this,
'week_identifier' => $week_id,
'next_week_link' => $next_week_link,
'username' => $phpgw->common->grab_owner_name($owner),
'small_calendar_next' => $phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php'),
'small_calendar_next' => $minical_next,
'week_display' => $phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true,$owner),
'print' => $print
);