| 1 |
<?php
|
| 2 |
|
| 3 |
// $Header: /cvsroot/tikiwiki/tiki/tiki-minical_export.php,v 1.4.2.1 2005/01/01 00:11:25 damosoft Exp $
|
| 4 |
|
| 5 |
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
|
| 6 |
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
|
| 7 |
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
|
| 8 |
require_once ('tiki-setup.php');
|
| 9 |
|
| 10 |
include_once ('lib/minical/minicallib.php');
|
| 11 |
|
| 12 |
if ($feature_minical != 'y') {
|
| 13 |
die;
|
| 14 |
}
|
| 15 |
|
| 16 |
if (!$user) {
|
| 17 |
die;
|
| 18 |
}
|
| 19 |
|
| 20 |
function _csv($item) {
|
| 21 |
$item = str_replace('"', '""', $item);
|
| 22 |
|
| 23 |
// if (strpos($item, ",") !== FALSE) {
|
| 24 |
$item = '"' . $item . '"';
|
| 25 |
// }
|
| 26 |
return $item;
|
| 27 |
}
|
| 28 |
|
| 29 |
$events = $minicallib->minical_list_events($user, 0, -1, 'start_desc', '');
|
| 30 |
|
| 31 |
header ("Content-type: text/plain");
|
| 32 |
//header( "Content-Disposition: attachment; filename=$file" );
|
| 33 |
header ("Content-Disposition: inline; filename=tiki-calendar");
|
| 34 |
print ('"Subject","Start Date","Start Time","End Date","End Time","All day event","Reminder on/off","Reminder Date","Reminder Time","Meeting Organizer","Required Attendees","Optional Attendees","Meeting Resources","Billing Information","Categories","Description","Location","Mileage","Priority","Private","Sensitivity","Show time as"');
|
| 35 |
|
| 36 |
print ("\r\n");
|
| 37 |
|
| 38 |
foreach ($events['data'] as $event) {
|
| 39 |
$line = array();
|
| 40 |
|
| 41 |
$line[] = _csv($event['title']);
|
| 42 |
$line[] = _csv(date("n/j/Y", $event['start']));
|
| 43 |
$line[] = _csv(date("g:i:s A", $event['start']));
|
| 44 |
$line[] = _csv(date("n/j/Y", $event['end']));
|
| 45 |
$line[] = _csv(date("g:i:s A", $event['end']));
|
| 46 |
$line[] = _csv('False');
|
| 47 |
|
| 48 |
if ($minical_reminders) {
|
| 49 |
$line[] = _csv('True');
|
| 50 |
|
| 51 |
$line[] = _csv(date("n/j/Y", $event['start'] - $minical_reminders));
|
| 52 |
$line[] = _csv(date("g:i:s A", $event['start'] - $minical_reminders));
|
| 53 |
} else {
|
| 54 |
$line[] = _csv('False');
|
| 55 |
|
| 56 |
$line[] = _csv('');
|
| 57 |
$line[] = _csv('');
|
| 58 |
}
|
| 59 |
|
| 60 |
$line[] = '';
|
| 61 |
$line[] = '';
|
| 62 |
$line[] = '';
|
| 63 |
$line[] = '';
|
| 64 |
$line[] = '';
|
| 65 |
$line[] = '';
|
| 66 |
$line[] = '';
|
| 67 |
$line[] = _csv($event['description']);
|
| 68 |
$line[] = '';
|
| 69 |
$line[] = _csv('Normal');
|
| 70 |
$line[] = _csv('False');
|
| 71 |
$line[] = _csv('Normal');
|
| 72 |
$line[] = _csv('2');
|
| 73 |
$theline = join(',', $line);
|
| 74 |
print ($theline);
|
| 75 |
print ("\r\n");
|
| 76 |
}
|
| 77 |
|
| 78 |
?>
|