From 743cae611eeb4436d3d8dc865c010b2b3fd0102a Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 30 Jun 2003 22:46:12 +0000 Subject: Multiple Calendar support added. --- config.inc.php | 10 +++++----- day.php | 18 +++++++++++++----- month.php | 2 +- preferences.php | 13 ++++++++++--- week.php | 16 ++++++++++++---- 5 files changed, 41 insertions(+), 18 deletions(-) diff --git a/config.inc.php b/config.inc.php index 19d53a5..939212a 100644 --- a/config.inc.php +++ b/config.inc.php @@ -8,10 +8,10 @@ $style_sheet = 'silver'; // Themes support - silver, red, green, orange, grey, tan $default_view = 'day'; // Default view for calendars = 'day', 'week', 'month', 'year' $minical_view = 'current'; // Where do the mini-calendars go when clicked? = 'day', 'week', 'month', 'current' -$default_cal = 'Home'; // Exact filename of calendar without .ics -$language = 'English'; // Language support - 'English', 'Polish', 'German', 'French', 'Dutch', 'Danish', 'Italian', 'Japanese', 'Norwegian', 'Spanish', 'Swedish', 'Portuguese', 'Catalan', 'Traditional_Chinese' -$week_start_day = 'Sunday'; // Day of the week your week starts on -$day_start = '0700'; // Start time for day grid +$default_cal = 'all_calenders_combined971'; // Exact filename of calendar without .ics. Or set to 'all_calenders_combined971' to open all calenders combined into one. +$language = 'Esperanto'; // Language support - 'English', 'Polish', 'German', 'French', 'Dutch', 'Danish', 'Italian', 'Japanese', 'Norwegian', 'Spanish', 'Swedish', 'Portuguese', 'Catalan', 'Traditional_Chinese', 'Esperanto' +$week_start_day = 'Saturday'; // Day of the week your week starts on +$day_start = '0800'; // Start time for day grid $gridLength = '15'; // Grid distance in minutes for day view, multiples of 15 preferred $num_years = '3'; // Number of years to display in 'Jump to' $month_event_lines = '1'; // Number of lines to wrap each event title in month view, 0 means display all lines. @@ -47,7 +47,7 @@ $show_todos = 'yes'; // Show your todo list on the side of day and week vie $show_completed = 'yes'; // Show completed todos on your todo list. // Administration settings -$allow_admin = 'yes'; // Set to yes to allow the admin page - remember to change the default password if using 'internal' as the $auth_method +$allow_admin = 'no'; // Set to yes to allow the admin page - remember to change the default password if using 'internal' as the $auth_method $auth_method = 'ftp'; // Valid values are: 'ftp', 'internal', or 'none'. 'ftp' uses the ftp server's username and password as well as ftp commands to delete and copy files. 'internal' uses $auth_internal_username and $auth_internal_password defined below - CHANGE the password. 'none' uses NO authentication - meant to be used with another form of authentication such as http basic. $auth_internal_username = 'admin'; // Only used if $auth_method='internal'. The username for the administrator. $auth_internal_password = 'default'; // Only used if $auth_method='internal'. The password for the administrator. diff --git a/day.php b/day.php index cb44d8d..8b16898 100644 --- a/day.php +++ b/day.php @@ -15,7 +15,7 @@ if ($minical_view == 'current') $minical_view = 'day'; $starttime = '0500'; $weekstart = 1; $unix_time = strtotime($getdate); -$today_today = date('Ymd', strtotime("now + $second_offset seconds")); +$today_today = date('Ymd', strtotime("now + $second_offset seconds")); $tomorrows_date = date( 'Ymd', strtotime('+1 day', $unix_time)); $yesterdays_date = date( 'Ymd', strtotime('-1 day', $unix_time)); $display_date = localizeDate($dateFormat_day, $unix_time); @@ -107,7 +107,10 @@ if (isset($master_array[($getdate)])) { echo ''."\n"; foreach($master_array[($getdate)]['-1'] as $allday) { echo "\n"; - echo '
'; + $event_calno = $allday['calnumber']; + if ($event_calno < 1) $event_calno=1; + if ($event_calno > 7) $event_calno=7; + echo ''; openevent("$calendar_name", "", "", @@ -245,8 +248,11 @@ if (isset($master_array[($getdate)])) { $event_end = strtotime ($this_time_arr[($event_length[$i]['key'])]['event_end']); $event_start = date ($timeFormat, $event_start); $event_end = date ($timeFormat, $event_end); + $event_calno = $this_time_arr[($event_length[$i]['key'])]['calnumber']; + if ($event_calno < 1) $event_calno=1; + if ($event_calno > 7) $event_calno=7; - echo ''."\n"; + echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; @@ -255,8 +261,10 @@ if (isset($master_array[($getdate)])) { echo '
'.$event_start.' - '.$event_end.''."\n"; echo ''."\n"; echo ''."\n"; - echo '
'; - openevent("$calendar_name", + echo ''; + // Todo: keep track of where the event comes from, and indicate that to openevent instead of "all_calenders_combined971" + if ($cal == 'all_calenders_combined971') $calendar_name2=$cal; else $calendar_name2=$calendar_name; + openevent("$calendar_name2", "$event_start", "$event_end", $this_time_arr[($event_length[$i]['key'])], diff --git a/month.php b/month.php index 1b8431d..bb592b4 100644 --- a/month.php +++ b/month.php @@ -11,7 +11,7 @@ $this_month = $day_array2[2]; $this_year = $day_array2[1]; $unix_time = strtotime($getdate); -$today_today = date('Ymd', strtotime("now + $second_offset seconds")); +$today_today = date('Ymd', strtotime("now + $second_offset seconds")); $tomorrows_date = date( "Ymd", strtotime("+1 day", $unix_time)); $yesterdays_date = date( "Ymd", strtotime("-1 day", $unix_time)); $date = mktime(0,0,0,"$this_month","$this_day","$this_year"); diff --git a/preferences.php b/preferences.php index d42f8a7..d83bf4a 100644 --- a/preferences.php +++ b/preferences.php @@ -64,14 +64,13 @@ if ((!isset($HTTP_COOKIE_VARS['phpicalendar'])) || ($cookie_unset)) { $cookie_time = $day_start; } - ?> - <?php echo "$cal $calendar_lang - $preferences_lang"; ?> + <?php echo "$calendar_lang - $preferences_lang"; ?> "> @@ -184,7 +183,15 @@ if ((!isset($HTTP_COOKIE_VARS['phpicalendar'])) || ($cookie_unset)) { print "\n"; } } - } + } + // add option to open all (non-web) calenders together + // Todo: add $all_calenders_combined_lang (plural) in the language-specific files and use it here + if ($cookie_calendar == 'all_calenders_combined971') { + print "\n"; + } else { + print "\n"; + } + foreach($list_webcals as $cal_tmp) { if ($cal_tmp != '') { $cal_displayname_tmp = basename($cal_tmp); diff --git a/week.php b/week.php index 51a7673..d155235 100644 --- a/week.php +++ b/week.php @@ -9,7 +9,7 @@ $starttime = "0500"; $weekstart = 1; $unix_time = strtotime($getdate); $thisday2 = localizeDate($dateFormat_week_list, $unix_time); -$today_today = date('Ymd', strtotime("now + $second_offset seconds")); +$today_today = date('Ymd', strtotime("now + $second_offset seconds")); $next_week = date("Ymd", strtotime("+1 week", $unix_time)); $prev_week = date("Ymd", strtotime("-1 week", $unix_time)); $tomorrows_date = date( "Ymd", strtotime("+1 day", $unix_time)); @@ -178,7 +178,10 @@ for ($i=0;$i<7;$i++) { echo "\n"; foreach($master_array[($thisday)]["-1"] as $allday) { echo "\n"; - echo "
"; + $event_calno = $allday['calnumber']; + if ($event_calno < 1) $event_calno=1; + if ($event_calno > 7) $event_calno=7; + echo ''; openevent("$calendar_name", "", "", @@ -296,7 +299,10 @@ for ($i=0;$i<7;$i++) { $event_length[$thisday][$i]["state"] = "started"; $event_start = $this_time_arr[($event_length[$thisday][$i]["key"])]["start_unixtime"]; $event_start = date ($timeFormat, $event_start); - echo "\n"; + $event_calno = $this_time_arr[($event_length[$thisday][$i]['key'])]['calnumber']; + if ($event_calno < 1) $event_calno=1; + if ($event_calno > 7) $event_calno=7; + echo ''."\n"; echo "\n"; echo "\n"; echo "\n"; @@ -305,9 +311,11 @@ for ($i=0;$i<7;$i++) { echo "
$event_start\n"; echo "\n"; echo "\n"; - echo "
"; + echo ''; $event_end = $this_time_arr[($event_length[$thisday][$i]["key"])]["end_unixtime"]; $event_end = date ($timeFormat, $event_end); + // Todo: keep track of where the event comes from, and indicate that to openevent instead of "all_calenders_combined971" + if ($cal == 'all_calenders_combined971') $calendar_name2=$cal; else $calendar_name2=$calendar_name; openevent("$calendar_name2", "$event_start", "$event_end", -- cgit v1.2.3