aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2009-01-02 07:12:12 +0000
committerJim Hu <jimhu@users.sourceforge.net>2009-01-02 07:12:12 +0000
commitc60246816752a18ba37b8f3508799acd17686b30 (patch)
treeb010ee90fb0b568bd3a84f4f4c52b18b80d0645a
parent281d63eedb805ec330a5572b85f48896981fca16 (diff)
downloadphpicalendar-c60246816752a18ba37b8f3508799acd17686b30.tar.gz
phpicalendar-c60246816752a18ba37b8f3508799acd17686b30.tar.bz2
phpicalendar-c60246816752a18ba37b8f3508799acd17686b30.zip
add download event to event popup
-rw-r--r--config.inc.php15
-rw-r--r--default_config.php3
-rw-r--r--functions/ical_parser.php4
-rw-r--r--functions/init.inc.php6
-rw-r--r--functions/parse/end_vevent.php3
-rw-r--r--functions/parse/parse_tzs.php5
-rw-r--r--includes/event.php31
-rw-r--r--languages/english.inc.php2
-rw-r--r--templates/default/event.tpl3
9 files changed, 65 insertions, 7 deletions
diff --git a/config.inc.php b/config.inc.php
index b940a92..f99799c 100644
--- a/config.inc.php
+++ b/config.inc.php
@@ -65,6 +65,21 @@ phpicalendar currently supports about 30 language variants. For a list of suppo
# 'week_length' => '5', // Number of days to display in the week view
# 'day_start' => '0600', // Start time for day grid
# 'day_end' => '2000', // End time for day grid
+# 'event_download' => 'yes',
+
+
+/* ========= CALENDAR PUBLISHING =========
+
+ This section is not needed if your calendars directory is accessible via WebDAV or CalDAV. These settings
+ control the publish.php script provided in the calendars directory. For more information, please see that
+ file.
+*/
+
+ 'phpicalendar_publishing'=> 1,
+
+
+
+
);
/* ========= SPECIAL CALENDARS =========
diff --git a/default_config.php b/default_config.php
index 18c44bd..7c69307 100644
--- a/default_config.php
+++ b/default_config.php
@@ -2,7 +2,7 @@
class Configs{
private static $instance;
private function __construct(){
- $this->phpicalendar_version = '2.31rc2';
+ $this->phpicalendar_version = '2.31rc3';
// Configuration file for PHP iCalendar 2.25rc1
//
// To set values, change the text between the single quotes
@@ -47,6 +47,7 @@ class Configs{
$this->printview_default = 'no'; // Set print view as the default view. day, week, and month only supported views for $this->default_view (listed well above).
$this->show_todos = 'yes'; // Show your todo list on the side of day and week view.
$this->show_completed = 'yes'; // Show completed todos on your todo list.
+ $this->event_download = 'no'; // Show completed todos on your todo list.
$this->allow_login = 'no'; // Set to yes to prompt for login to unlock calendars.
$this->login_cookies = 'no'; // Set to yes to store authentication information via (unencrypted) cookies. Set to no to use sessions.
$this->support_ical = 'no'; // Set to yes to support the Apple iCal calendar database structure.
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 5e1afc6..aaaba93 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -126,7 +126,6 @@ foreach ($cal_filelist as $cal_key=>$filename) {
$nextline = ereg_replace("[\r\n]", "", $nextline);
}
$line = trim(stripslashes($line));
-
switch ($line) {
case 'BEGIN:VFREEBUSY':
case 'BEGIN:VEVENT':
@@ -150,6 +149,7 @@ foreach ($cal_filelist as $cal_key=>$filename) {
$url = '';
$geo = '';
$type = '';
+ $other = '';
$wkst = 'MO';
$except_dates = array();
@@ -440,6 +440,8 @@ foreach ($cal_filelist as $cal_key=>$filename) {
case 'URL':
$url = $data;
break;
+ default:
+ if(strpos(':',$data) > 1) $other .= $data;
}
}
}
diff --git a/functions/init.inc.php b/functions/init.inc.php
index 1b227cc..8ca11f6 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -1,7 +1,11 @@
<?php
+# require php 5
$php_started = getmicrotime();
# define BASE
if (!defined('BASE')) define('BASE', './');
+if (phpversion() < '5.1'){
+ die (phpversion()." detected. php 5.1 or higher required for this version.\n\n" );
+}
include_once(BASE.'functions/init/sanitize.php');
include_once(BASE.'functions/init/set_error_reporting.php');
include_once(BASE.'functions/init/configs.php');
@@ -11,8 +15,6 @@ include_once(BASE.'error.php');
include_once(BASE.'functions/calendar_functions.php');
include_once(BASE.'functions/userauth_functions.php');
-# require php 5
-if (phpversion() < '5.1') die (error(sprintf($lang['l_php_version_required'],phpversion()) ) );
// Grab the action (login or logout).
$action = '';
if (isset($_GET['action'])) $action = $_GET['action'];
diff --git a/functions/parse/end_vevent.php b/functions/parse/end_vevent.php
index 9f2e603..addca3a 100644
--- a/functions/parse/end_vevent.php
+++ b/functions/parse/end_vevent.php
@@ -334,10 +334,13 @@ foreach($recur_data as $recur_data_unixtime) {
'class' => $class,
'spans_day' => $spans_day,
'location' => $location,
+ 'categories' => $vtodo_categories,
'organizer' => serialize($organizer),
'attendee' => serialize($attendee),
'calnumber' => $calnumber,
'calname' => $actual_calname,
+ 'timezone' => $start_tz,
+ 'other' => trim($other),
'geo' => $geo,
'url' => $url,
'recur' => $recur
diff --git a/functions/parse/parse_tzs.php b/functions/parse/parse_tzs.php
index 8b02cb5..fb250b2 100644
--- a/functions/parse/parse_tzs.php
+++ b/functions/parse/parse_tzs.php
@@ -43,9 +43,10 @@ while (!feof($ifile)) {
$is_daylight = false;
break;
case 'END:VTIMEZONE':
+ if (!isset($offset_d) && isset($offset_s)) $offset_d = $offset_s;
$tz_array[$tz_id] = array(
- 0 => $offset_s,
- 1 => $offset_d,
+ 0 => @$offset_s,
+ 1 => @$offset_d,
'dt_start' => @$begin_daylight,
'st_start' => @$begin_std,
'st_name' => @$st_name,
diff --git a/includes/event.php b/includes/event.php
index c15f3d2..7cafa8a 100644
--- a/includes/event.php
+++ b/includes/event.php
@@ -11,6 +11,7 @@ require_once(BASE.'functions/template.php');
$event = unserialize(stripslashes($_POST['event_data']));
$organizer = unserialize($event['organizer']);
$attendee = unserialize($event['attendee']);
+$uid = stripslashes($_POST['uid']);
// Format event time
// All day
@@ -71,6 +72,35 @@ switch ($event['status']){
$event['status'] = '' ;
}
+$event_download = '';
+if($phpiCal_config->event_download == 'yes') $event_download = "
+<form action='' method='post'>
+<input type=hidden name='event_data' value = '".$_POST['event_data']."' />
+<input type=hidden name='uid' value = '".$_POST['uid']."' />
+<input type='submit' name='submit' value='".$lang['l_download_event']."' />
+<form>";
+
+if (isset($_POST['submit'])){
+header("Content-Type: text/calendar; charset=utf-8; name=$uid");
+header("Content-Disposition: attachment; filename=$uid");
+echo
+"BEGIN:VCALENDAR
+VERSION:2.0
+X-WR-CALNAME:".$event['calname']."
+BEGIN:VEVENT
+UID:$uid
+SUMMARY:".$event['event_text']."
+CATEGORIES:".$event['calname']."
+DTSTART;TZID=".$event['timezone'].":".date("Ymd\THis",$event['start_unixtime'])."
+DTEND;TZID=".$event['timezone'].":".date("Ymd\THis",$event['start_unixtime'])."
+CLASS:".$event['class']."
+".$event['other']."
+SEQUENCE:1
+CREATED:20081128T075152
+END:VEVENT
+END:VCALENDAR
+";exit;
+}
$page = new Page(BASE.'templates/'.$phpiCal_config->template.'/event.tpl');
$page->replace_tags(array(
@@ -83,6 +113,7 @@ $page->replace_tags(array(
'attendee' => $attendee,
'status' => $event['status'],
'location' => $event['location'],
+ 'event_download' => $event_download,
'url' => $event['url'],
'cal_title_full' => $event['calname'].' '.$lang['l_calendar'],
'template' => $phpiCal_config->template,
diff --git a/languages/english.inc.php b/languages/english.inc.php
index b85f6a5..075babf 100644
--- a/languages/english.inc.php
+++ b/languages/english.inc.php
@@ -98,6 +98,7 @@ $lang['l_unset_prefs'] = 'Unset preferences';
$lang['l_organizer'] = 'Organizer';
$lang['l_attendee'] = 'Attendee';
$lang['l_location'] = 'Location';
+$lang['l_download_event'] = 'Download event';
$lang['l_url'] = 'URL';
$lang['l_admin_header'] = 'PHP iCalendar Administration';
$lang['l_username'] = 'Username';
@@ -206,7 +207,6 @@ Notes about dateFormat_*
$lang['l_error_title'] = 'Error!';
$lang['l_error_window'] = 'There was an error!';
$lang['l_error_calendar'] = 'The calendar "%s" was being processed when this error occurred.';
-$lang['l_php_version_required'] = 'PHP version "%s" detected. PHP 5.1 or greater is required to run this version of phpicalendar.';
$lang['l_error_path'] = 'Unable to open the path: "%s"';
$lang['l_error_back'] = 'Please use the "Back" button to return.';
$lang['l_error_remotecal'] = 'This server blocks remote calendars which have not been approved.';
diff --git a/templates/default/event.tpl b/templates/default/event.tpl
index b0a9a7f..fbd5e44 100644
--- a/templates/default/event.tpl
+++ b/templates/default/event.tpl
@@ -35,6 +35,9 @@
<!-- switch url on -->
<b>{L_URL}</b>: {URL}<br />
<!-- switch url off -->
+ <!-- switch event download on -->
+ {EVENT_DOWNLOAD}<br />
+ <!-- switch event download off -->
</p>
</div>
</td>

© 2014-2024 Faster IT GmbH | imprint | privacy policy