Revision: 1722
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1722&view=rev
Author:   cimorrison
Date:     2010-12-21 00:08:28 +0000 (Tue, 21 Dec 2010)

Log Message:
-----------
Fixed bug whereby, on exporting as an iCalendar, the report end date was being 
used as the series end date, even when the series finished before the report 
end date.

Modified Paths:
--------------
    mrbs/branches/ics_attachments/web/report.php

Modified: mrbs/branches/ics_attachments/web/report.php
===================================================================
--- mrbs/branches/ics_attachments/web/report.php        2010-12-20 23:24:06 UTC 
(rev 1721)
+++ mrbs/branches/ics_attachments/web/report.php        2010-12-21 00:08:28 UTC 
(rev 1722)
@@ -1304,12 +1304,12 @@
             {
               $last_repeat_id = $row['repeat_id'];
               // We need to set the repeat start and end dates because we've 
only been
-              // asked to export dates in the report range.  The end date will 
be the
-              // report end date.  The start date of the series will be the 
recurrence-id
-              // of the first entry in the series, which is this one thanks to 
the
-              // SQL query which ordered the entries by recurrence-id.
+              // asked to export dates in the report range.  The end date will 
be the earlier
+              // of the series end date and the report end date.  The start 
date of the series
+              // will be the recurrence-id of the first entry in the series, 
which is this one
+              // thanks to the SQL query which ordered the entries by 
recurrence-id.
               $start_row = $row;  // Make a copy of the data because we are 
going to tweak it.
-              $start_row['end_date'] = $report_end;
+              $start_row['end_date'] = min($report_end, 
$start_row['end_date']);
               $duration = $start_row['end_time'] - $start_row['start_time'];
               $start_row['start_time'] = strtotime($row['ical_recur_id']);
               $start_row['end_time'] = $start_row['start_time'] + $duration;
@@ -1348,7 +1348,7 @@
               $duration = $row['end_time'] - $row['start_time'];
               $row['start_time'] = $start_row['start_time'];
               $row['end_time'] = $row['start_time'] + $duration;
-              $row['end_date'] = $report_end;
+              $row['end_date'] = min($report_end, $row['end_date']);
               $text_body['content'] = create_details_body($row, FALSE);
               $html_body['content'] = create_details_body($row, TRUE);
               $ical_events[$replace_index] = create_ical_event("REQUEST", 
$row, $text_body, $html_body, NULL, TRUE);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to