Revision: 1732
http://mrbs.svn.sourceforge.net/mrbs/?rev=1732&view=rev
Author: cimorrison
Date: 2010-12-23 09:07:13 +0000 (Thu, 23 Dec 2010)
Log Message:
-----------
Added comments
Modified Paths:
--------------
mrbs/branches/ics_attachments/web/functions_ical.inc
Modified: mrbs/branches/ics_attachments/web/functions_ical.inc
===================================================================
--- mrbs/branches/ics_attachments/web/functions_ical.inc 2010-12-22
09:32:11 UTC (rev 1731)
+++ mrbs/branches/ics_attachments/web/functions_ical.inc 2010-12-23
09:07:13 UTC (rev 1732)
@@ -286,13 +286,35 @@
// outputs an iCalendar based on the data in $res, the result of an SQL query.
//
-// &$res resource the result of an SQL query on the entry table
+// &$res resource the result of an SQL query on the entry table,
which
+// has been sorted by repeat_id, ical_recur_id (both
ascending).
+// As well as all the fields in the entry table, the
rows will
+// also contain the area name, the room name and the
repeat
+// details (rep_type, end_date, rep_opt,
rep_num_weeks)
// $export_end int a Unix timestamp giving the end limit for the
export
function export_icalendar(&$res, $keep_private, $export_end=PHP_INT_MAX)
{
require_once "functions_view.inc";
require_once "mrbs_sql.inc";
+ // We construct an iCalendar by going through the rows from the SQL query.
Because
+ // it was sorted by repeat_id and then by ical_recur_id we will
+ // - get all the individual entries (which will have repeat_id 0)
+ // - then get the series. For each series we have to:
+ // - identify the series information. This is the original series
information
+ // so we can only get it from an entry that has not been changed,
ie has
+ // entry_type == ENTRY_RPT_ORIGINAL. If there isn't one of these
then it
+ // does not matter, because every entry will have been changed and
so there
+ // is no need for the original data. [Note: another way of getting
the
+ // series information would have been to get it as part of the
query]
+ // - identify any events that have been changed from the standard, ie
events
+ // with entry_type == ENTRY_RPT_CHANGED
+ // - identify any events from the original series that have been
cancelled. We
+ // can do this because we know from the repeat information the
events that
+ // should be there and we can tell from the recurrence-id the
events that
+ // are actually there. We can then issue cancellations for the
missing
+ // events.
+
// Initialize an array to hold the events and a variable to keep track
// of the last repeat id we've seen
$ical_events = array();
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits