From 1e9f5d229f2468fdf9c51a86ffdfb13a40cb9d4d Mon Sep 17 00:00:00 2001 From: shrykedude Date: Wed, 19 Nov 2003 21:08:35 +0000 Subject: [PATCH] - Added small view of upcoming events for main screen display. - Added pref setting for selecting small home view. - English translations. --- calendar/inc/class.uicalendar.inc.php | 11 +++-- calendar/inc/hook_home.inc.php | 19 ++++++--- calendar/inc/hook_home_small.inc.php | 54 +++++++++++++++++++++++++ calendar/inc/hook_settings.inc.php | 14 ++++++- calendar/setup/phpgw_en.lang | 3 +- calendar/templates/default/day_list.tpl | 29 +++++++++++++ 6 files changed, 119 insertions(+), 11 deletions(-) create mode 100755 calendar/inc/hook_home_small.inc.php create mode 100755 calendar/templates/default/day_list.tpl diff --git a/calendar/inc/class.uicalendar.inc.php b/calendar/inc/class.uicalendar.inc.php index 41796b4903..9d0df0e19e 100755 --- a/calendar/inc/class.uicalendar.inc.php +++ b/calendar/inc/class.uicalendar.inc.php @@ -3335,9 +3335,14 @@ $p = CreateObject('phpgwapi.Template',$this->template_dir); $p->set_unknowns('keep'); - $templates = Array( - 'day_cal' => 'day_cal.tpl' - ); + $tpl = 'day_cal.tpl'; + if(intval($GLOBALS['phpgw_info']['user']['preferences']['calendar']['mainscreen_showevents'])==2) + { + $tpl = 'day_list.tpl'; + } + $templates = Array( + 'day_cal' => $tpl + ); $p->set_file($templates); $p->set_block('day_cal','day','day'); $p->set_block('day_cal','day_row','day_row'); diff --git a/calendar/inc/hook_home.inc.php b/calendar/inc/hook_home.inc.php index a7ca5c5840..4b7906c6ff 100755 --- a/calendar/inc/hook_home.inc.php +++ b/calendar/inc/hook_home.inc.php @@ -22,7 +22,8 @@ } unset($d1); - if ($GLOBALS['phpgw_info']['user']['preferences']['calendar']['mainscreen_showevents']) + $showevents = intval($GLOBALS['phpgw_info']['user']['preferences']['calendar']['mainscreen_showevents']); + if($showevents>0) { $GLOBALS['phpgw']->translation->add_app('calendar'); if(!is_object($GLOBALS['phpgw']->datetime)) @@ -38,13 +39,20 @@ $GLOBALS['css'] = "\n".''; - $page_ = explode('.',$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']); - $_page = substr($page_[0],0,7); // makes planner from planner_{user|category} - if ($_page=='index' || ($_page != 'day' && $_page != 'week' && $_page != 'month' && $_page != 'year' && $_page != 'planner')) + if($showevents==2) { - $_page = 'month'; + $_page = "small"; + } + else + { + $page_ = explode('.',$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']); + $_page = substr($page_[0],0,7); // makes planner from planner_{user|category} + if ($_page=='index' || ($_page != 'day' && $_page != 'week' && $_page != 'month' && $_page != 'year' && $_page != 'planner')) + { + $_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')) @@ -88,4 +96,5 @@ unset($cal); } flush(); + unset($showevents); ?> diff --git a/calendar/inc/hook_home_small.inc.php b/calendar/inc/hook_home_small.inc.php new file mode 100755 index 0000000000..b545b18736 --- /dev/null +++ b/calendar/inc/hook_home_small.inc.php @@ -0,0 +1,54 @@ + * + * http://www.radix.net/~cknudsen * + * Written by Mark Peters * + * -------------------------------------------- * + * 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!
'."\n"; + $GLOBALS['phpgw']->common->phpgw_exit(); + } + unset($d1); + + $today = $GLOBALS['phpgw']->datetime->users_localtime; + $dates = array($today); + if(date('w',$today)=='5') // if it's Friday, show the weekend, plus Monday + { + $dates[] = $today + 86400; // Saturday + $dates[] = $today + (2*86400); // Sunday + } + $dates[] = $dates[count($dates)-1] + 86400; + + $extra_data = $GLOBALS['css']."\n" + . '' + . '
'; + foreach($dates as $id=>$day) + { + $dayprint = ExecMethod('calendar.uicalendar.print_day', + Array( + 'year' => date('Y',$day), + 'month' => date('m',$day), + 'day' => date('d',$day) + )); + $extra_data .= ''.date('l',$day) .'
' . $dayprint; + } + $extra_data .= '
'."\n"; + + $GLOBALS['extra_data'] = $extra_data; + + unset($dates); + unset($today); + unset($extra_data); +?> diff --git a/calendar/inc/hook_settings.inc.php b/calendar/inc/hook_settings.inc.php index d660ff7b21..999afda25a 100644 --- a/calendar/inc/hook_settings.inc.php +++ b/calendar/inc/hook_settings.inc.php @@ -28,8 +28,18 @@ create_select_box('default calendar view','defaultcalendar',$default, 'Which of calendar view do you want to see, when you start calendar ?'); - create_check_box('show default view on main screen','mainscreen_showevents', - 'Displays your default calendar view on the startpage (page you get when you enter phpGroupWare or click on the homepage icon)?'); + /* Selection of list for home page is different from default calendar, + since the decision for the front page is different for the decision + for the main calendar page. But the list could be added to the + default list above, if requested. - shrykedude. */ + $mainpage = array( + '1' => lang('Yes'), + '0' => lang('No'), + '2' => lang('No').' - '.lang('show list of upcoming events'), + ); + create_select_box('show default view on main screen','mainscreen_showevents',$mainpage, + 'Displays your default calendar view on the startpage (page you get when you enter eGroupWare or click on the homepage icon)?'); + unset($mainpage); /* $summary = array( 'no' => lang('Never'), diff --git a/calendar/setup/phpgw_en.lang b/calendar/setup/phpgw_en.lang index dbeb555067..f6cea19865 100644 --- a/calendar/setup/phpgw_en.lang +++ b/calendar/setup/phpgw_en.lang @@ -73,7 +73,7 @@ disabled calendar en disabled display interval in day view calendar en Display interval in Day View display mini calendars when printing calendar en Display mini calendars when printing display status of events calendar en Display Status of Events -displays your default calendar view on the startpage (page you get when you enter phpgroupware or click on the homepage icon)? calendar en Displays your default calendar view on the startpage (page you get when you enter phpGroupWare or click on the homepage icon)? +displays your default calendar view on the startpage (page you get when you enter phpgroupware or click on the homepage icon)? calendar en Displays your default calendar view on the startpage (page you get when you enter eGroupWare or click on the homepage icon)? do you want to be notified about new or changed appointments? you be notified about changes you make yourself.
you can limit the notifications to certain changes only. each item includes all the notification listed above it. all modifications include changes of title, description, participants, but no participant responses. if the owner of an event requested any notifcations, he will always get the participant responses like acceptions and rejections too. calendar en Do you want to be notified about new or changed appointments? You be notified about changes you make yourself.
You can limit the notifications to certain changes only. Each item includes all the notification listed above it. All modifications include changes of title, description, participants, but no participant responses. If the owner of an event requested any notifcations, he will always get the participant responses like acceptions and rejections too. do you want to receive a regulary summary of your appointsments via email?
the summary is sent to your standard email-address on the morning of that day or on monday for weekly summarys.
it is only sent when you have any appointments on that day or week. calendar en Do you want to receive a regulary summary of your appointsments via email?
The summary is sent to your standard email-address on the morning of that day or on Monday for weekly summarys.
It is only sent when you have any appointments on that day or week. do you wish to autoload calendar holidays files dynamically? admin en Do you wish to autoload calendar holidays files dynamically? @@ -229,6 +229,7 @@ show day view on main screen calendar en show day view on main screen show default view on main screen calendar en Show default view on main screen show high priority events on main screen calendar en Show high priority events on main screen show invitations you rejected calendar en Show invitations you rejected +show list of upcoming events calendar en Show list of upcoming events single event calendar en single event sorry, the owner has just deleted this event calendar en Sorry, the owner has just deleted this event sorry, this event does not exist calendar en Sorry, this event does not exist diff --git a/calendar/templates/default/day_list.tpl b/calendar/templates/default/day_list.tpl new file mode 100755 index 0000000000..d4d8276120 --- /dev/null +++ b/calendar/templates/default/day_list.tpl @@ -0,0 +1,29 @@ + + +
+ + + + +
+{row} +
+
+ + + {event} + + + {event} + + + {event} + + + {event} + + + {time} + + +