source: trunk/gm_system/icalendar/icalendar_all.php@ 638

Last change on this file since 638 was 638, checked in by barny, 16 years ago
File size: 1.7 KB
Line 
1<?php
2/*
3 $Id: icalendar_all.php 2299 2009-08-24 09:46:33Z andrewsimpson $
4
5 (c) 2005 - 2009 Andrew Simpson <andrew.simpson at paradise.net.nz>
6
7 WebCollab
8 ---------------------------------------
9
10 This program is free software; you can redistribute it and/or modify it under the
11 terms of the GNU General Public License as published by the Free Software Foundation;
12 either version 2 of the License, or (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
16 PARTICULAR PURPOSE. See the GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License along with this
19 program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
20 Cambridge, MA 02139, USA.
21
22 Function:
23 ---------
24
25 Creates an iCalendar file for all projects & tasks
26
27*/
28
29//security check
30if(! defined('UID' ) ) {
31 die('Direct file access not permitted' );
32}
33
34include_once(BASE.'icalendar/icalendar_download.php' );
35include_once(BASE.'icalendar/icalendar_common.php' );
36
37//set variables
38$content = '';
39$icalendar_id = md5(MANAGER_NAME.BASE_URL);
40
41//set database character set to UTF-8
42db_user_locale('UTF-8');
43
44//main query
45$q = db_query(icalendar_query(). icalendar_usergroup_tail() );
46
47for($i=0 ; $row = @db_fetch_array($q, $i) ; ++$i ) {
48
49 //add vtodo
50 $content .= icalendar_body($row);
51}
52
53//no rows ==> return
54if($i == 0 ) {
55 header('Location: '.BASE_URL.'main.php?x='.X );
56 die;
57}
58
59//we have content, send it!
60
61//send headers to browser
62icalendar_header('ALL');
63
64//send content
65echo $content;
66
67//end of file
68icalendar_end();
69
70?>
Note: See TracBrowser for help on using the repository browser.