forked from iCalcreator/iCalcreator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummary.html
More file actions
executable file
·323 lines (300 loc) · 20.4 KB
/
summary.html
File metadata and controls
executable file
·323 lines (300 loc) · 20.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>iCalcreator 2.10.23 summary</title>
<meta name="author" content="Kjell-Inge Gustafsson - kigkonsult" />
<meta name="copyright" content="2007-2011 Kjell-Inge Gustafsson - kigkonsult" />
<meta name="keywords" content="ical, calendar, calender, xcal, xml, icalender, rfc2445, rfc5545, vcalender, php, create" />
<meta name="description" content="iCalcreator summary" />
<style type="text/css">
body {
FONT-FAMILY : "Lucida Grande","Lucida Sans Unicode", "Bitstream Vera Sans", Lucida, Arial, Geneva, Helvetica, sans-serif;
FONT-SIZE : small;
MARGIN : 10px;
WIDTH : 800px;
}
h1 {
FONT-FAMILY : "Lucida Grande","Lucida Sans Unicode", "Bitstream Vera Sans", Lucida, Arial, Geneva, Helvetica, sans-serif;
FONT-SIZE : large;
}
h2 {
FONT-FAMILY : "Lucida Grande","Lucida Sans Unicode", "Bitstream Vera Sans", Lucida, Arial, Geneva, Helvetica, sans-serif;
FONT-SIZE : large;
}
h4 {
FONT-FAMILY : "Lucida Grande","Lucida Sans Unicode", "Bitstream Vera Sans", Lucida, Arial, Geneva, Helvetica, sans-serif;
FONT-SIZE : small;
FONT-WEIGHT : bold;
}
.code {
FONT-FAMILY : monospace;
FONT-SIZE : medium;
WHITE-SPACE : pre;
}
.comment {
FONT-FAMILY : arial;
FONT-SIZE : small;
FONT-STYLE : italic;
}
</style>
</head>
<body>
<h1>iCalcreator v2.10.23</h1>
iCalcreator class v2.10.23<br />
copyright (c) 2007-2011 Kjell-Inge Gustafsson, kigkonsult<br />
<a href="http://kigkonsult.se/iCalcreator/index.php" title="kigkonsult.se/iCalcreator" target="_blank">kigkonsult.se/iCalcreator</a><br />
ical@kigkonsult.se<br />
<br />
iCalcreator is a PHP class managing iCal formatted files for non-calendar
systems like CMS, project management systems and other applications able
to process calendar information like agendas, tasks, reports, totos,
journaling data and for communication with calendar systems and applications.
<br /><br />
This is a <b>short summary</b> how to use iCalcreator; create, parse, edit, select and output functionality.
<br /><br />
iCalcreator is built of a class file with support of a function class file and are calendar component property oriented.
Development environment is PHP version 5.x but coding is done to meet 4.x backward compatibility and may work.
<h4>iCal</h4>
A short iCal description is found at <a href="http://en.wikipedia.org/wiki/ICalendar#Core_object" title="iCalendar From Wikipedia, the free encyclopedia" target="_blank">Wikipedia</a>. If You are not familiar with iCal, read this first!<br />
Knowledge of calendar protocol rfc5545/rfc5546 is to recommend;<br />
<a href="http://kigkonsult.se/downloads/dl.php?f=rfc5545" title="RFC5545" target="_blank">rfc5545</a>
- Internet Calendaring and Scheduling Core Object Specification (iCalendar)<br />
<a href="http://kigkonsult.se/downloads/dl.php?f=rfc5546" title="RFC5546" target="_blank">rfc5546</a>
- iCalendar Transport-Independent Interoperability Protocol (iTIP) Scheduling Events, BusyTime, To-dos and Journal Entries <br />
<a href="http://kigkonsult.se/downloads/dl.php?f=rfc5545" title="Download RFC5545 in text format">rfc5545</a> and
<a href="http://kigkonsult.se/downloads/dl.php?f=rfc5546" title="Download RFC5546 in text format">rfc5546</a>
obsoletes, respectively,
<a href="http://kigkonsult.se/downloads/dl.php?f=rfc2445" title="Download RFC2445 in text format">rfc2445</a> and
<a href="http://kigkonsult.se/downloads/dl.php?f=rfc2446" title="Download RFC2446 in text format">rfc2446</a>.<br />
All functions calls are made as simple as possible BUT (, !!!,) read these rfc's properly!<br />
<h4>SUPPORT</h4>
The main support channel is using iCalcreator
<a title="Sourceforge" href="http://sourceforge.net/projects/icalcreator/forums/" target="_blank">Sourceforge</a> forum.
<br />
<br />
Our services are available for support and designing and developing customizations,
adaptations and other <i>PHP</i>/MySQL solutions with a special focus on software utility and reliability,
supported through our iterative acquire/design/transition process modell.
<h4>DONATE</h4>
You can show your appreciation for our free software,
and can support future development by making a donation to the kigkonsult GPL/LGPL projects.
<br />
<br />
Make a donation of any size by clicking <a href="http://kigkonsult.se/contact/index.php#Donate" title="Donate" target="_blank">here</a>.
Thanks in advance!
<h4>Contact</h4>
Use the contact <a href="http://kigkonsult.se/contact/index.php" title="kigkonsult.se/contact" target="_blank">page</a>
for queries, improvement/development issues or professional support and development.
Please note that paid support or consulting service has the highest priority.
<h4>Downloads</h4>
Download
<a href="http://kigkonsult.se/downloads/index.php#iCalcreator" title="iCalcreator complete manual" target="_blank"><b>complete manual</b></a>
and
<a href="http://kigkonsult.se/downloads/index.php#iCalcreator" title="iCalcreator coding samples" target="_blank"><b>coding samples</b></a>.
from <a href="http://kigkonsult.se/index.php" title="kigkonsult" target="_blank">kigkonsult.se</a>.
<h4>INSTALL</h4>
Unpack to any folder<br />
- add this folder to your include-path<br />
- or unpack to your application-(include)-folder<br />
Add "require_once '[folder/]iCalcreator.class.php';" to your php-script.
<br />
<br />
If using php version 5.1 or higher, the default timezone need to be set/altered, now "Europe/Stockholm",
line 50 in the iCalcreator.class.php file.
<br />
When creating a new calendar/component instance, review config settings.
<br />
<br />
To really boost performance, visit kigkonsult.se contact <a href="http://kigkonsult.se/contact/index.php"><u>page</u></a> for information.
<br />
<h2>CREATE</h2>
<p class="code">require_once( "iCalcreator.class.php" );
$config = array( "unique_id" => "kigkonsult.se" ); // <span class="comment">set Your unique id</span>
$v = new vcalendar( $config ); // <span class="comment">create a new calendar instance</span>
$v->setProperty( "method", "PUBLISH" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "x-wr-calname", "Calendar Sample" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "X-WR-CALDESC", "Calendar Description" ); // <span class="comment">required of some calendar software</span>
$tz = "Europe/Stockholm";
$v->setProperty( "X-WR-TIMEZONE", $tz ); // <span class="comment">required of some calendar software</span>
.. .
iCalUtilityFunctions::createTimezone( $v, $tz ) // <span class="comment">creates (very simple) timezone component(-s)</span>
.. .
$vevent = & $v->newComponent( "vevent" ); // <span class="comment">create an event calendar component</span>
$vevent->setProperty( "dtstart", array( "year"=>2007, "month"=>4, "day"=>1, "hour"=>19, "min"=>0, "sec"=>0 ));
$vevent->setProperty( "dtend", array( "year"=>2007, "month"=>4, "day"=>1, "hour"=>22, "min"=>30, "sec"=>0 ));
$vevent->setProperty( "LOCATION", "Central Placa" ); // <span class="comment">property name - case independent</span>
$vevent->setProperty( "summary", "PHP summit" );
$vevent->setProperty( "description", "This is a description" );
$vevent->setProperty( "comment", "This is a comment" );
$vevent->setProperty( "attendee", "attendee1@icaldomain.net" );
.. .
$vevent = & $v->newComponent( "vevent" ); // <span class="comment">create next event calendar component</span>
$vevent->setProperty( "dtstart", "20070401", array("VALUE" => "DATE"));// <span class="comment">alt. date format, now for an all-day event</span>
$vevent->setProperty( "organizer" , "boss@icaldomain.com" );
$vevent->setProperty( "summary", "ALL-DAY event" );
$vevent->setProperty( "description", "This is a description for an all-day event" );
$vevent->setProperty( "resources", "COMPUTER PROJECTOR" );
$vevent->setProperty( "rrule", array( "FREQ" => "WEEKLY", "count" => 4));// <span class="comment">weekly, four occasions</span>
$vevent->parse( "LOCATION:1CP Conference Room 4350" ); // <span class="comment">supporting parse of strict rfc5545 formatted text</span>
.. .
.. .// <span class="comment">all calendar components are described in <a href="http://kigkonsult.se/downloads/dl.php?f=rfc5545" title="RFC5545" target="_blank">rfc5545</a></span>
.. .// <span class="comment">a complete iCalcreator function list (ex. setProperty) in <a href="http://kigkonsult.se/downloads/index.php#iCalcreator" title="iCalcreator complete manual" target="_blank">iCalcreator manual</a></span>
.. .
$v->returnCalendar(); // <span class="comment">redirect calendar file to browser</span>
</p>
<h2>PARSE</h2>
<p class="code">require_once( "iCalcreator.class.php" );
$config = array( "unique_id" => "kigkonsult.se" ); // <span class="comment">set Your unique id, required if any component UID is missing</span>
$v = new vcalendar( $config ); // <span class="comment">create a new calendar instance</span>
/* start parse of local file */
$config = array( "directory" => "calendar", "filename" => "file.ics" );
$v->setConfig( $config ); // <span class="comment">set directory and file name</span>
$v->parse();
/* start parse of remote file */
$v->setConfig( "url", "http://www.aDomain.net/file.ics" ); // <span class="comment">iCalcreator also support parse from or write to remote files</span>
$v->parse();
$v->setProperty( "method", "PUBLISH" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "x-wr-calname", "Calendar Sample" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "X-WR-CALDESC", "Calendar Description" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); // <span class="comment">required of some calendar software</span>
.. .
$v->sort(); // <span class="comment">ensure start date order</span>
.. .
</p>
<h2>EDIT</h2>
<p class="code">require_once( "iCalcreator.class.php" );
$config = array( "unique_id" => "kigkonsult.se", "directory" => "calendar", "filename" => "file.ics" );
// <span class="comment">set Your unique id, import directory and file name</span>
$v = new vcalendar( $config ); // <span class="comment">create a new calendar instance</span>
$v->parse();
$v->setProperty( "method", "PUBLISH" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "x-wr-calname", "Calendar Sample" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "X-WR-CALDESC", "Calendar Description" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); // <span class="comment">required of some calendar software</span>
while( $vevent = $v->getComponent( "vevent" )) { // <span class="comment">read events, one by one</span>
$uid = $vevent->getProperty( "uid" ); // <span class="comment">uid required, one occurence (unique id/key for component)</span>
.. .
$dtstart = $vevent->getProperty( "dtstart" ); // <span class="comment">dtstart required, one occurence</span>
.. .
if( $description = $vevent->getProperty( "description", 1 )) { // <span class="comment">description optional, first occurence</span>
.. . // <span class="comment">edit the description</span>
$vevent->setProperty( "description", $description, FALSE, 1 ); // <span class="comment">update/replace the description</span>
}
while( $comment = $vevent->getProperty( "comment" )) { // <span class="comment">comment optional, may occur more than once </span>
.. . // <span class="comment">manage comments</span>
}
.. .
while( $vevent->deleteProperty( "attendee" ))
continue; // <span class="comment">remove all ATTENDEE properties .. .</span>
.. .
$v->setComponent ( $vevent, $uid ); // <span class="comment">update/replace event in calendar with <b>uid</b> as key </span>
}
.. .
.. .// <span class="comment">a complete iCalcreator function list (ex. getProperty, deleteProperty) in <a href="http://kigkonsult.se/downloads/index.php#iCalcreator" title="iCalcreator complete manual" target="_blank">iCalcreator manual</a></span>
.. .
</p>
<h2>SELECT</h2>
<p class="code">require_once( "iCalcreator.class.php" );
$config = array( "unique_id" => "kigkonsult.se" ); // <span class="comment">set Your unique id</span>
$v = new vcalendar( $config ); // <span class="comment">create a new calendar instance</span>
$v->setConfig( "url", "http://www.aDomain.net/file.ics" ); // <span class="comment">iCalcreator also support remote files</span>
$v->parse();
$v->sort(); // <span class="comment">ensure start date order</span>
$v->setProperty( "method", "PUBLISH" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "x-wr-calname", "Calendar Sample" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "X-WR-CALDESC", "Calendar Description" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); // <span class="comment">required of some calendar software</span>
</p>
<h4>Date based select</h4>
<p class="code">$eventArray = $v->selectComponents(); // <span class="comment">select components occuring <b>today</b></span>
// <span class="comment">(including components with recurrence pattern)</span>
foreach( $eventArray as $year => $yearArray) {
foreach( $yearArray as $month => $monthArray ) {
foreach( $monthArray as $day => $dailyEventsArray ) {
foreach( $dailyEventsArray as $vevent ) {
$currddate = $event->getProperty( "x-current-dtstart" );
// <span class="comment">if member of a recurrence set (2nd occurence etc)</span>
// <span class="comment">returns array( "x-current-dtstart"</span>
// <span class="comment"> , <(string) date("Y-m-d [H:i:s][timezone/UTC offset]")>)</span>
$dtstart = $vevent->getProperty( "dtstart" ); // <span class="comment">dtstart required, one occurence, (orig. start date)</span>
$summary = $vevent->getProperty( "summary" );
$description = $vevent->getProperty( "description" );
.. .
.. .
}
}
}
}
</p>
<h4>Select specific property values</h4>
<p class="code">$valueOccurr = $v->getProperty( "CATEGORIES" ); // <span class="comment">fetch specific property (unique) values and ocurrences</span>
// <span class="comment">ATTENDEE, CATEGORIES, DTSTART, LOCATION,</span>
// <span class="comment">ORGANIZER, PRIORITY, RESOURCES, STATUS,</span>
// <span class="comment">SUMMARY, UID</span>
foreach( $valueOccurr as $uniqueValue => $occurr ) {
.. .
}
</p>
<h4>Specific property value select</h4>
<p class="code">$selectSpec = array( "CATEGORIES" => "course1" );
$specComps = $v->selectComponents( $selectSpec ); // <span class="comment">selects components based on specific property value(-s)</span>
// <span class="comment">ATTENDEE, CATEGORIES, LOCATION, ORGANIZER,</span>
// <span class="comment">PRIORITY, RESOURCES, STATUS, SUMMARY, UID</span>
foreach( $specComps as $comp ) {
.. .
}
</p>
<h2>OUTPUT</h2>
<p class="code">require_once( "iCalcreator.class.php" );
$config = array( "unique_id" => "kigkonsult.se" ); // <span class="comment">set Your unique id</span>
$v = new vcalendar( $config ); // <span class="comment">create a new calendar instance</span>
$v->setProperty( "method", "PUBLISH" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "x-wr-calname", "Calendar Sample" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "X-WR-CALDESC", "Calendar Description" ); // <span class="comment">required of some calendar software</span>
$v->setProperty( "X-WR-TIMEZONE", "Europe/Stockholm" ); // <span class="comment">required of some calendar software</span>
.. .
.. .// <span class="comment">parse calendar file(s) and/or edit/create calendar components.. .</span>
.. .
</p>
<h4> // opt 1</h4>
<p class="code">.. .
$v->returnCalendar(); // <span class="comment">redirect calendar file to browser</span>
</p>
<h4> // opt 2</h4>
<p class="code">.. .
$config = array( "directory" => "depot", "filename" => "calendar.ics" );
$v->setConfig( $config ); // <span class="comment">set output directory and file name</span>
$v->saveCalendar(); // <span class="comment">save calendar to (local) file</span>
</p>
<h4> // opt 3</h4>
<p class="code">.. .
$config = array( "url" => "http://www.aDomain.net/file.ics" );
$v->setConfig( $config ); // <span class="comment">set output url</span>
$v->saveCalendar(); // <span class="comment">save calendar to remote url</span>
</p>
<h2>COPYRIGHT AND LICENSE</h2>
<h4>Copyright</h4>
iCalcreator v2.10.23<br />
copyright (c) 2007-2011 Kjell-Inge Gustafsson, kigkonsult<br />
<a href="http://kigkonsult.se/iCalcreator/index.php" title="kigkonsult.se/iCalcreator" target="_blank">kigkonsult.se/iCalcreator</a><br />
ical@kigkonsult.se<br />
<h4>License</h4>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
<br /><br />
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
<br /><br />
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or download it <a href="http://kigkonsult.se/downloads/dl.php?f=LGPL" target="_blank">here</a>.
<br />
<br />
</body>
</html>