mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:04:53 +01:00
Feature request #230126.
This commit is contained in:
parent
1f8ae0362f
commit
d5a8089d16
@ -36,6 +36,7 @@
|
||||
'mini_calendar' => True,
|
||||
'index' => True,
|
||||
'month' => True,
|
||||
'get_month' => True,
|
||||
'week' => True,
|
||||
'year' => True,
|
||||
'view' => True,
|
||||
@ -246,6 +247,19 @@
|
||||
}
|
||||
|
||||
function month()
|
||||
{
|
||||
if (!$this->bo->printer_friendly)
|
||||
{
|
||||
unset($GLOBALS['phpgw_info']['flags']['noheader']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['noappheader']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['noappfooter']);
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
}
|
||||
echo $this->get_month();
|
||||
}
|
||||
|
||||
function get_month()
|
||||
{
|
||||
$this->bo->read_holidays();
|
||||
|
||||
@ -300,15 +314,6 @@
|
||||
'print' => $print
|
||||
);
|
||||
|
||||
if (!$this->bo->printer_friendly)
|
||||
{
|
||||
unset($GLOBALS['phpgw_info']['flags']['noheader']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['noappheader']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['noappfooter']);
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
}
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
||||
$p->set_unknowns('remove');
|
||||
$p->set_file(
|
||||
@ -317,10 +322,21 @@
|
||||
)
|
||||
);
|
||||
$p->set_var($var);
|
||||
$p->pparse('out','index_t');
|
||||
return $p->fp('out','index_t');
|
||||
}
|
||||
|
||||
function week()
|
||||
{
|
||||
if (!$this->bo->printer_friendly)
|
||||
{
|
||||
unset($GLOBALS['phpgw_info']['flags']['noheader']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
}
|
||||
echo $this->get_week();
|
||||
}
|
||||
|
||||
function get_week()
|
||||
{
|
||||
$this->bo->read_holidays();
|
||||
|
||||
@ -403,13 +419,6 @@
|
||||
'print' => $print
|
||||
);
|
||||
|
||||
if (!$this->bo->printer_friendly)
|
||||
{
|
||||
unset($GLOBALS['phpgw_info']['flags']['noheader']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
}
|
||||
|
||||
$p = CreateObject('phpgwapi.Template',$this->template_dir);
|
||||
$p->set_file(
|
||||
Array(
|
||||
@ -417,7 +426,7 @@
|
||||
)
|
||||
);
|
||||
$p->set_var($var);
|
||||
$p->pparse('out','week_t');
|
||||
return $p->fp('out','week_t');
|
||||
}
|
||||
|
||||
function year()
|
||||
@ -427,6 +436,19 @@
|
||||
unset($GLOBALS['phpgw_info']['flags']['noheader']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
}
|
||||
else
|
||||
{
|
||||
$GLOBALS['phpgw_info']['flags']['nofooter'] = True;
|
||||
}
|
||||
echo $this->get_year();
|
||||
}
|
||||
|
||||
|
||||
functiong get_year()
|
||||
{
|
||||
if(!$this->bo->printer_friendly)
|
||||
{
|
||||
$print = '';
|
||||
$left_link = '<a href="'.$this->page('year','&year='.($this->bo->year - 1)).'"><<</a>';
|
||||
$right_link = '<a href="'.$this->page('year','&year='.($this->bo->year + 1)).'">>></a>';
|
||||
@ -440,7 +462,6 @@
|
||||
$right_link = '';
|
||||
$link = '';
|
||||
$printer = '';
|
||||
$GLOBALS['phpgw_info']['flags']['nofooter'] = True;
|
||||
}
|
||||
|
||||
$var = Array(
|
||||
@ -483,7 +504,7 @@
|
||||
$p->parse('row','month_sep',True);
|
||||
}
|
||||
}
|
||||
$p->pparse('out','year_t');
|
||||
return $p->fp('out','year_t');
|
||||
}
|
||||
|
||||
function view($vcal_id=0,$cal_date=0)
|
||||
@ -998,7 +1019,7 @@
|
||||
|
||||
$var = Array(
|
||||
'printer_friendly' => $printer,
|
||||
'bg_text' => $GLOBALS['phpgw_info']['theme']['bg_text'],
|
||||
'bg_text' => $this->theme['bg_text'],
|
||||
'daily_events' => $this->print_day(
|
||||
Array(
|
||||
'year' => $this->bo->year,
|
||||
|
@ -26,26 +26,28 @@
|
||||
{
|
||||
$time = time() - ((60*60) * intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']));
|
||||
$GLOBALS['date'] = $GLOBALS['phpgw']->common->show_date($time,'Ymd');
|
||||
$GLOBALS['g_year'] = substr($GLOBALS['date'],0,4);
|
||||
$GLOBALS['g_month'] = substr($GLOBALS['date'],4,2);
|
||||
$GLOBALS['g_day'] = substr($GLOBALS['date'],6,2);
|
||||
$GLOBALS['owner'] = $GLOBALS['phpgw_info']['user']['account_id'];
|
||||
$cal = CreateObject('calendar.uicalendar');
|
||||
$extra_data = "\n".'<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="35%" valign="top">'
|
||||
. $cal->mini_calendar(
|
||||
Array(
|
||||
'day' => $cal->bo->day,
|
||||
'month' => $cal->bo->month,
|
||||
'year' => $cal->bo->year,
|
||||
'link' => 'day'
|
||||
)
|
||||
).'</td><td align="center"><table border="0" width="100%" cellspacing="0" cellpadding="0">'
|
||||
. '<tr><td align="center">'.lang($GLOBALS['phpgw']->common->show_date($time,'F')).' '.$cal->bo->day.', '
|
||||
.$cal->bo->year.'</td></tr><tr><td bgcolor="'.$GLOBALS['phpgw_info']['theme']['bg_text']
|
||||
.'" valign="top">'.$cal->print_day(
|
||||
Array(
|
||||
'year' => $cal->bo->year,
|
||||
'month' => $cal->bo->month,
|
||||
'day' => $cal->bo->day
|
||||
)
|
||||
).'</td></tr></table>'."\n".'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n";
|
||||
$GLOBALS['css'] = "\n".'<STYLE type="text/css">'."\n".'<!--'."\n"
|
||||
. ExecMethod('calendar.uicalendar.css').'-->'."\n".'</style>';
|
||||
|
||||
$page_ = explode('.',$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']);
|
||||
$_page = $page_[0];
|
||||
if ($_page=='index' || ($_page != 'day' && $_page != 'week' && $_page != 'month' && $_page != 'year'))
|
||||
{
|
||||
$_page = 'month';
|
||||
// $GLOBALS['phpgw']->preferences->add('calendar','defaultcalendar','month');
|
||||
// $GLOBALS['phpgw']->preferences->save_repository();
|
||||
}
|
||||
|
||||
if(!@file_exists(PHPGW_INCLUDE_ROOT.'/calendar/inc/hook_home_'.$_page.'.inc.php'))
|
||||
{
|
||||
$_page = 'day';
|
||||
}
|
||||
include(PHPGW_INCLUDE_ROOT.'/calendar/inc/hook_home_'.$_page.'.inc.php');
|
||||
|
||||
|
||||
$title = '<font color="#FFFFFF">'.lang('Calendar').'</font>';
|
||||
|
||||
@ -78,7 +80,7 @@
|
||||
|
||||
$portalbox->data = Array();
|
||||
|
||||
echo "\n".'<!-- BEGIN Calendar info -->'."\n".$portalbox->draw($extra_data)."\n".'<!-- END Calendar info -->'."\n";
|
||||
echo "\n".'<!-- BEGIN Calendar info -->'."\n".$portalbox->draw($GLOBALS['extra_data'])."\n".'<!-- END Calendar info -->'."\n";
|
||||
unset($cal);
|
||||
}
|
||||
flush();
|
||||
|
43
calendar/inc/hook_home_day.inc.php
Executable file
43
calendar/inc/hook_home_day.inc.php
Executable file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Calendar *
|
||||
* http://www.phpgroupware.org *
|
||||
* Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> *
|
||||
* http://www.radix.net/~cknudsen *
|
||||
* Written by Mark Peters <skeeter@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$d1 = strtolower(substr(PHPGW_APP_INC,0,3));
|
||||
if($d1 == 'htt' || $d1 == 'ftp' )
|
||||
{
|
||||
echo 'Failed attempt to break in via an old Security Hole!<br>'."\n";
|
||||
$GLOBALS['phpgw']->common->phpgw_exit();
|
||||
}
|
||||
unset($d1);
|
||||
|
||||
$GLOBALS['extra_data'] = $GLOBALS['css']."\n".'<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="35%" valign="top">'
|
||||
. ExecMethod('calendar.uicalendar.mini_calendar',
|
||||
Array(
|
||||
'day' => $GLOBALS['g_day'],
|
||||
'month' => $GLOBALS['g_month'],
|
||||
'year' => $GLOBALS['g_year'],
|
||||
'link' => 'day'
|
||||
)
|
||||
).'</td><td align="center"><table border="0" width="100%" cellspacing="0" cellpadding="0">'
|
||||
. '<tr><td align="center">'.lang($GLOBALS['phpgw']->common->show_date($time,'F')).' '.$GLOBALS['g_day'].', '
|
||||
.$GLOBALS['g_year'].'</td></tr><tr><td bgcolor="'.$GLOBALS['phpgw_info']['theme']['bg_text']
|
||||
.'" valign="top">'.ExecMethod('calendar.uicalendar.print_day',
|
||||
Array(
|
||||
'year' => $GLOBALS['g_year'],
|
||||
'month' => $GLOBALS['g_month'],
|
||||
'day' => $GLOBALS['g_day']
|
||||
)
|
||||
).'</td></tr></table>'."\n".'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n";
|
||||
?>
|
28
calendar/inc/hook_home_month.inc.php
Executable file
28
calendar/inc/hook_home_month.inc.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Calendar *
|
||||
* http://www.phpgroupware.org *
|
||||
* Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> *
|
||||
* http://www.radix.net/~cknudsen *
|
||||
* Written by Mark Peters <skeeter@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$d1 = strtolower(substr(PHPGW_APP_INC,0,3));
|
||||
if($d1 == 'htt' || $d1 == 'ftp' )
|
||||
{
|
||||
echo 'Failed attempt to break in via an old Security Hole!<br>'."\n";
|
||||
$GLOBALS['phpgw']->common->phpgw_exit();
|
||||
}
|
||||
unset($d1);
|
||||
|
||||
$GLOBALS['extra_data'] = $GLOBALS['css']."\n".'<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="100%" valign="top">'
|
||||
. ExecMethod('calendar.uicalendar.get_month')
|
||||
.'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n";
|
||||
?>
|
28
calendar/inc/hook_home_week.inc.php
Executable file
28
calendar/inc/hook_home_week.inc.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Calendar *
|
||||
* http://www.phpgroupware.org *
|
||||
* Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> *
|
||||
* http://www.radix.net/~cknudsen *
|
||||
* Written by Mark Peters <skeeter@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$d1 = strtolower(substr(PHPGW_APP_INC,0,3));
|
||||
if($d1 == 'htt' || $d1 == 'ftp' )
|
||||
{
|
||||
echo 'Failed attempt to break in via an old Security Hole!<br>'."\n";
|
||||
$GLOBALS['phpgw']->common->phpgw_exit();
|
||||
}
|
||||
unset($d1);
|
||||
|
||||
$GLOBALS['extra_data'] = $GLOBALS['css']."\n".'<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="100%" valign="top">'
|
||||
. ExecMethod('calendar.uicalendar.get_week')
|
||||
.'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n";
|
||||
?>
|
28
calendar/inc/hook_home_year.inc.php
Executable file
28
calendar/inc/hook_home_year.inc.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Calendar *
|
||||
* http://www.phpgroupware.org *
|
||||
* Based on Webcalendar by Craig Knudsen <cknudsen@radix.net> *
|
||||
* http://www.radix.net/~cknudsen *
|
||||
* Written by Mark Peters <skeeter@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$d1 = strtolower(substr(PHPGW_APP_INC,0,3));
|
||||
if($d1 == 'htt' || $d1 == 'ftp' )
|
||||
{
|
||||
echo 'Failed attempt to break in via an old Security Hole!<br>'."\n";
|
||||
$GLOBALS['phpgw']->common->phpgw_exit();
|
||||
}
|
||||
unset($d1);
|
||||
|
||||
$GLOBALS['extra_data'] = $GLOBALS['css']."\n".'<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="100%" valign="top">'
|
||||
. ExecMethod('calendar.uicalendar.get_year')
|
||||
.'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n";
|
||||
?>
|
Loading…
Reference in New Issue
Block a user