forked from extern/egroupware
various code formatting changes
This commit is contained in:
parent
175cc243b1
commit
5ba2a1cdde
@ -14,69 +14,68 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
$phpgw_flags = Array (
|
if (isset($friendly) && $friendly)
|
||||||
|
{
|
||||||
|
$phpgw_flags = Array(
|
||||||
|
'currentapp' => 'calendar',
|
||||||
|
'enable_nextmatchs_class' => True,
|
||||||
|
'noheader' => True,
|
||||||
|
'nonavbar' => True,
|
||||||
|
'noappheader' => True,
|
||||||
|
'noappfooter' => True,
|
||||||
|
'nofooter' => True
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$phpgw_flags = Array(
|
||||||
'currentapp' => 'calendar',
|
'currentapp' => 'calendar',
|
||||||
'enable_nextmatchs_class' => True
|
'enable_nextmatchs_class' => True
|
||||||
);
|
);
|
||||||
|
|
||||||
$phpgw_info['flags'] = $phpgw_flags;
|
|
||||||
|
|
||||||
if (isset($friendly) && $friendly)
|
|
||||||
{
|
|
||||||
$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;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$friendly = 0;
|
$friendly = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$phpgw_info['flags'] = $phpgw_flags;
|
||||||
include('../header.inc.php');
|
include('../header.inc.php');
|
||||||
|
|
||||||
$view = 'day';
|
$view = 'day';
|
||||||
|
|
||||||
$now = $phpgw->calendar->makegmttime(0, 0, 0, $thismonth, $thisday, $thisyear);
|
|
||||||
|
|
||||||
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
||||||
|
|
||||||
$template = Array(
|
$template = Array(
|
||||||
'day_t' => 'day.tpl'
|
'day_t' => 'day.tpl'
|
||||||
);
|
);
|
||||||
|
|
||||||
$p->set_file($template);
|
$p->set_file($template);
|
||||||
|
|
||||||
// $phpgw->template->set_block('day_t');
|
|
||||||
|
|
||||||
if ($friendly)
|
|
||||||
{
|
|
||||||
$p->set_var('printer_friendly','<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$p->set_var('printer_friendly','');
|
|
||||||
}
|
|
||||||
|
|
||||||
$p->set_var('bg_text',$phpgw_info['theme']['bg_text']);
|
|
||||||
|
|
||||||
$m = mktime(0,0,0,$thismonth,1,$thisyear);
|
|
||||||
$p->set_var('date',lang(date('F',$m)).' '.$thisday.', '.$thisyear);
|
|
||||||
$p->set_var('username',$phpgw->common->grab_owner_name($owner));
|
|
||||||
$p->set_var('daily_events',$phpgw->calendar->print_day_at_a_glance($now,$owner));
|
|
||||||
$p->set_var('small_calendar',$phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'));
|
|
||||||
|
|
||||||
if ($friendly == 0)
|
if ($friendly == 0)
|
||||||
{
|
{
|
||||||
|
$printer = '';
|
||||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||||
$print = '<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
$print = '<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
|
||||||
$print = '';
|
$print = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$p->set_var('print',$print);
|
$now = $phpgw->calendar->makegmttime(0, 0, 0, $thismonth, $thisday, $thisyear);
|
||||||
|
|
||||||
|
$m = mktime(0,0,0,$thismonth,1,$thisyear);
|
||||||
|
|
||||||
|
$var = Array(
|
||||||
|
'printer_friendly' => $printer,
|
||||||
|
'bg_text' => $phpgw_info['themem']['bg_text'],
|
||||||
|
'daily_events' => $phpgw->calendar->print_day_at_a_glance($now,$owner),
|
||||||
|
'small_calendar' => $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'),
|
||||||
|
'date' => lang(date('F',$m)).' '.$thisday.', '.$thisyear,
|
||||||
|
'username' => $phpgw->common->grab_owner_name($owner),
|
||||||
|
'print' => $print
|
||||||
|
);
|
||||||
|
|
||||||
|
$p->set_var($var);
|
||||||
|
|
||||||
$p->pparse('out','day_t');
|
$p->pparse('out','day_t');
|
||||||
$phpgw->common->phpgw_footer();
|
$phpgw->common->phpgw_footer();
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
/* Load calendar class */
|
/* Load calendar class */
|
||||||
$parameters = Array(
|
$parameters = Array(
|
||||||
'printer_friendly' => ((isset($friendly) && ($friendly==1))?True:False),
|
'printer_friendly'=> ((isset($friendly) && ($friendly==1))?True:False),
|
||||||
'owner' => $owner,
|
'owner' => $owner,
|
||||||
'rights' => $rights
|
'rights' => $rights
|
||||||
);
|
);
|
||||||
@ -56,7 +56,9 @@
|
|||||||
$phpgw->calendar = CreateObject('calendar.calendar',$parameters);
|
$phpgw->calendar = CreateObject('calendar.calendar',$parameters);
|
||||||
|
|
||||||
if(!isset($phpgw_info['user']['preferences']['calendar']['weekdaystarts']))
|
if(!isset($phpgw_info['user']['preferences']['calendar']['weekdaystarts']))
|
||||||
|
{
|
||||||
$phpgw_info['user']['preferences']['calendar']['weekdaystarts'] = 'Sunday';
|
$phpgw_info['user']['preferences']['calendar']['weekdaystarts'] = 'Sunday';
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($date) && strlen($date) > 0)
|
if (isset($date) && strlen($date) > 0)
|
||||||
{
|
{
|
||||||
|
@ -14,55 +14,67 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
$phpgw_info['flags'] = array('currentapp' => 'calendar', 'enable_nextmatchs_class' => True);
|
if (isset($friendly) && $friendly)
|
||||||
|
{
|
||||||
|
$phpgw_flags = Array(
|
||||||
|
'currentapp' => 'calendar',
|
||||||
|
'enable_nextmatchs_class' => True,
|
||||||
|
'noheader' => True,
|
||||||
|
'nonavbar' => True,
|
||||||
|
'noappheader' => True,
|
||||||
|
'noappfooter' => True,
|
||||||
|
'nofooter' => True
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$phpgw_flags = Array(
|
||||||
|
'currentapp' => 'calendar',
|
||||||
|
'enable_nextmatchs_class' => True
|
||||||
|
);
|
||||||
|
|
||||||
if (isset($friendly) && $friendly){
|
|
||||||
$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;
|
|
||||||
} else {
|
|
||||||
$friendly = 0;
|
$friendly = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$phpgw_info['flags'] = $phpgw_flags;
|
||||||
include('../header.inc.php');
|
include('../header.inc.php');
|
||||||
|
|
||||||
$view = "month";
|
$view = "month";
|
||||||
|
|
||||||
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
||||||
|
|
||||||
$p->set_file(array('index_t' => 'index.tpl'));
|
$templates = Array(
|
||||||
|
'index_t' => 'index.tpl'
|
||||||
|
);
|
||||||
|
|
||||||
$p->set_block('index_t','index');
|
$p->set_file($templates);
|
||||||
|
|
||||||
if ($friendly) {
|
|
||||||
$p->set_var('printer_friendly','<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">');
|
|
||||||
} else {
|
|
||||||
$p->set_var('printer_friendly','');
|
|
||||||
}
|
|
||||||
|
|
||||||
$p->set_var('bg_text',$phpgw_info['theme']['bg_text']);
|
|
||||||
|
|
||||||
$p->set_var('small_calendar_prev',$phpgw->calendar->mini_calendar(1,$thismonth - 1,$thisyear,'day.php'));
|
|
||||||
|
|
||||||
$m = mktime(0,0,0,$thismonth,1,$thisyear);
|
$m = mktime(0,0,0,$thismonth,1,$thisyear);
|
||||||
$p->set_var('month_identifier',lang(strftime("%B",$m)) . ' ' . $thisyear);
|
|
||||||
$p->set_var('username',$phpgw->common->grab_owner_name($owner));
|
|
||||||
$p->set_var('small_calendar_next',$phpgw->calendar->mini_calendar(1,$thismonth + 1,$thisyear,'day.php'));
|
|
||||||
$p->set_var('large_month',$phpgw->calendar->display_large_month($thismonth,$thisyear,True,$owner));
|
|
||||||
|
|
||||||
if ($friendly == 0)
|
if ($friendly == 0)
|
||||||
{
|
{
|
||||||
|
$printer = '';
|
||||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||||
$print = '<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
$print = '<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
|
||||||
$print = '';
|
$print = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$p->set_var('print',$print);
|
$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'),
|
||||||
|
'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'),
|
||||||
|
'large_month' => $phpgw->calendar->display_large_month($thismonth,$thisyear,True,$owner),
|
||||||
|
'print' => $print
|
||||||
|
);
|
||||||
|
|
||||||
|
$p->set_var($var);
|
||||||
$p->pparse('out','index_t');
|
$p->pparse('out','index_t');
|
||||||
$phpgw->common->phpgw_footer();
|
$phpgw->common->phpgw_footer();
|
||||||
?>
|
?>
|
||||||
|
@ -14,26 +14,29 @@
|
|||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
|
if (isset($friendly) && $friendly)
|
||||||
|
{
|
||||||
|
$phpgw_flags = Array(
|
||||||
|
'currentapp' => 'calendar',
|
||||||
|
'enable_nextmatchs_class' => True,
|
||||||
|
'noheader' => True,
|
||||||
|
'nonavbar' => True,
|
||||||
|
'noappheader' => True,
|
||||||
|
'noappfooter' => True,
|
||||||
|
'nofooter' => True
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$phpgw_flags = Array(
|
$phpgw_flags = Array(
|
||||||
'currentapp' => 'calendar',
|
'currentapp' => 'calendar',
|
||||||
'enable_nextmatchs_class' => True
|
'enable_nextmatchs_class' => True
|
||||||
);
|
);
|
||||||
|
|
||||||
$phpgw_info['flags'] = $phpgw_flags;
|
|
||||||
|
|
||||||
if (isset($friendly) && $friendly)
|
|
||||||
{
|
|
||||||
$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;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$friendly = 0;
|
$friendly = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$phpgw_info['flags'] = $phpgw_flags;
|
||||||
include('../header.inc.php');
|
include('../header.inc.php');
|
||||||
|
|
||||||
$next = $phpgw->calendar->makegmttime(0,0,0,$thismonth,$thisday + 7,$thisyear);
|
$next = $phpgw->calendar->makegmttime(0,0,0,$thismonth,$thisday + 7,$thisyear);
|
||||||
@ -45,86 +48,57 @@
|
|||||||
$first = $phpgw->calendar->gmtdate($phpgw->calendar->get_weekday_start($thisyear, $thismonth, $thisday));
|
$first = $phpgw->calendar->gmtdate($phpgw->calendar->get_weekday_start($thisyear, $thismonth, $thisday));
|
||||||
$last = $phpgw->calendar->gmtdate($first['raw'] + 518400);
|
$last = $phpgw->calendar->gmtdate($first['raw'] + 518400);
|
||||||
|
|
||||||
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
// Week Label
|
||||||
$templates = Array(
|
|
||||||
'week_t' => 'week.tpl'
|
|
||||||
);
|
|
||||||
$p->set_file($templates);
|
|
||||||
|
|
||||||
$p->set_block('week_t','week');
|
|
||||||
|
|
||||||
if ($friendly)
|
|
||||||
{
|
|
||||||
$p->set_var('printer_friendly','<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$p->set_var('printer_friendly','');
|
|
||||||
}
|
|
||||||
|
|
||||||
$p->set_var('bg_text',$phpgw_info['theme']['bg_text']);
|
|
||||||
|
|
||||||
$p->set_var('small_calendar_prev',$phpgw->calendar->mini_calendar($thisday,$thismonth - 1,$thisyear,'day.php'));
|
|
||||||
|
|
||||||
if (!$friendly)
|
|
||||||
{
|
|
||||||
$p->set_var('prev_week_link','<a href="'.$phpgw->link('week.php','year='.$prev['year'].'&month='.$prev['month'].'&day='.$prev['day']).'"><<</a>');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$p->set_var('prev_week_link','<<');
|
|
||||||
}
|
|
||||||
|
|
||||||
$p->set_var('small_calendar_this',$phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'));
|
|
||||||
|
|
||||||
$week_id = lang(strftime("%B",$first['raw'])).' '.$first['day'];
|
$week_id = lang(strftime("%B",$first['raw'])).' '.$first['day'];
|
||||||
|
|
||||||
if($first['month'] <> $last['month'] && $first['year'] <> $last['year'])
|
if($first['month'] <> $last['month'] && $first['year'] <> $last['year'])
|
||||||
{
|
{
|
||||||
$week_id .= ', '.$first['year'];
|
$week_id .= ', '.$first['year'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$week_id .= ' - ';
|
$week_id .= ' - ';
|
||||||
|
|
||||||
if($first['month'] <> $last['month'])
|
if($first['month'] <> $last['month'])
|
||||||
{
|
{
|
||||||
$week_id .= lang(strftime("%B",$last['raw'])).' ';
|
$week_id .= lang(strftime("%B",$last['raw'])).' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$week_id .= $last['day'].', '.$last['year'];
|
$week_id .= $last['day'].', '.$last['year'];
|
||||||
|
|
||||||
$p->set_var('week_identifier',$week_id);
|
$p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar'));
|
||||||
|
$templates = Array(
|
||||||
|
'week_t' => 'week.tpl'
|
||||||
|
);
|
||||||
|
|
||||||
$p->set_var('username',$phpgw->common->grab_owner_name($owner));
|
$p->set_file($templates);
|
||||||
|
|
||||||
if (!$friendly)
|
if ($friendly == 0)
|
||||||
{
|
{
|
||||||
$p->set_var('next_week_link','<a href="'.$phpgw->link('week.php','year='.$next['year'].'&month='.$next['month'].'&day='.$next['day']).'">>></a>');
|
$printer = '';
|
||||||
|
$prev_week_link = '<a href="'.$phpgw->link('week.php','year='.$prev['year'].'&month='.$prev['month'].'&day='.$prev['day']).'"><<</a>';
|
||||||
|
$next_week_link = '<a href="'.$phpgw->link('week.php','year='.$next['year'].'&month='.$next['month'].'&day='.$next['day']).'">>></a>';
|
||||||
|
$param = 'year='.$thisyear.'&month='.$thismonth.'&day='.$thisday.'&friendly=1&filter='.$filter.'&owner='.$owner;
|
||||||
|
$print = '<a href="'.$phpgw->link('',$param)."\" TARGET=\"cal_printer_friendly\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$p->set_var('next_week_link','>>');
|
$printer = '<body bgcolor="'.$phpgw_info['theme']['bg_color'].'">';
|
||||||
|
$prev_week_link = '<<';
|
||||||
|
$next_week_link = '>>';
|
||||||
|
$print = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$p->set_var('small_calendar_next',$phpgw->calendar->mini_calendar($thisday,$$thismonth + 1,$thisyear,'day.php'));
|
$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'),
|
||||||
|
'prev_week_link' => $prev_week_link,
|
||||||
|
'small_calendar_this' => $phpgw->calendar->mini_calendar($thisday,$thismonth,$thisyear,'day.php'),
|
||||||
|
'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'),
|
||||||
|
'week_display' => $phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true,$owner),
|
||||||
|
'print' => $print
|
||||||
|
);
|
||||||
|
|
||||||
$p->set_var('week_display',$phpgw->calendar->display_large_week($thisday,$thismonth,$thisyear,true,$owner));
|
$p->set_var($var);
|
||||||
|
|
||||||
if (!$friendly)
|
|
||||||
{
|
|
||||||
$param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter;
|
|
||||||
$p->set_var('print','<a href="'.$phpgw->link('',$param)
|
|
||||||
.'" TARGET="cal_printer_friendly" onMouseOver="window.'
|
|
||||||
. "status = '" . lang('Generate printer-friendly version')
|
|
||||||
. "'\">[". lang('Printer Friendly') . ']</A>');
|
|
||||||
$p->parse('out','week_t');
|
|
||||||
$p->pparse('out','week_t');
|
$p->pparse('out','week_t');
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$p->set_var('print','');
|
|
||||||
$p->parse('out','week_t');
|
|
||||||
$p->pparse('out','week_t');
|
|
||||||
}
|
|
||||||
$phpgw->common->phpgw_footer();
|
$phpgw->common->phpgw_footer();
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user