Revision: 1712
http://mrbs.svn.sourceforge.net/mrbs/?rev=1712&view=rev
Author: cimorrison
Date: 2010-12-17 13:17:32 +0000 (Fri, 17 Dec 2010)
Log Message:
-----------
Merged in latest changes from the trunk
Modified Paths:
--------------
mrbs/branches/ics_attachments/web/edit_entry_handler.php
Property Changed:
----------------
mrbs/branches/ics_attachments/
mrbs/branches/ics_attachments/web/upgrade/5/pgsql.sql
Property changes on: mrbs/branches/ics_attachments
___________________________________________________________________
Modified: svn:mergeinfo
- /mrbs/branches/custom_entry_fields:1374-1396
/mrbs/branches/datepicker:1409-1416
/mrbs/branches/disabled_rooms:1601-1634
/mrbs/branches/from_to_bookings:1491-1587
/mrbs/branches/improve_css_2008_06:804-872
/mrbs/branches/provisional_bookings:1242-1280
/mrbs/branches/provisional_bookings_new_style:1407-1570
/mrbs/trunk:1652-1691
+ /mrbs/branches/custom_entry_fields:1374-1396
/mrbs/branches/datepicker:1409-1416
/mrbs/branches/disabled_rooms:1601-1634
/mrbs/branches/from_to_bookings:1491-1587
/mrbs/branches/improve_css_2008_06:804-872
/mrbs/branches/provisional_bookings:1242-1280
/mrbs/branches/provisional_bookings_new_style:1407-1570
/mrbs/trunk:1652-1711
Modified: mrbs/branches/ics_attachments/web/edit_entry_handler.php
===================================================================
--- mrbs/branches/ics_attachments/web/edit_entry_handler.php 2010-12-17
12:38:26 UTC (rev 1711)
+++ mrbs/branches/ics_attachments/web/edit_entry_handler.php 2010-12-17
13:17:32 UTC (rev 1712)
@@ -272,85 +272,73 @@
$resolution = 60;
}
+// When All Day is checked, $start_seconds and $end_seconds are disabled and
so won't
+// get passed through by the form. We therefore need to set them.
if (isset($all_day) && ($all_day == "yes"))
{
if ($enable_periods)
{
- $max_periods = count($periods);
- $starttime = mktime(12, 0, 0, $month, $day, $year);
- $endtime = mktime(12, $max_periods, 0, $end_month, $end_day, $end_year);
- // We need to set the duration and units because they are needed for email
notifications
- $duration = $max_periods;
- $dur_units = "periods";
- // No need to convert into something sensible, because they already are
+ $start_seconds = 12 * 60 * 60;
+ // This is actually the start of the last period, which is what the form
would
+ // have returned. It will get corrected in a moment.
+ $end_seconds = $start_seconds + ((count($periods) - 1) * 60);
}
else
{
- $starttime = mktime($morningstarts, $morningstarts_minutes, 0,
- $month, $day, $year,
- is_dst($month, $day, $year, $morningstarts));
- $endtime = mktime($eveningends, $eveningends_minutes, 0,
- $end_month, $end_day, $end_year,
- is_dst($month, $day, $year, $eveningends));
- $endtime += $resolution; // add on the duration (in
seconds) of the last slot as
- // $eveningends and
$eveningends_minutes specify the
- // beginning of the last slot
- // We need to set the duration and units because they are needed for email
notifications
- $duration = $endtime - $starttime;
- $dur_units = "seconds";
- // Convert them into something sensible (but don't translate because
- // that's done later)
- toTimeString($duration, $dur_units, FALSE);
+ $start_seconds = (($morningstarts * 60) + $morningstarts_minutes) * 60;
+ $end_seconds = (($eveningends * 60) + $eveningends_minutes) *60;
+ $end_seconds += $resolution; // We want the end of the last slot, not the
beginning
}
}
-else
+
+// Now work out the start and times
+$starttime = mktime(0, 0, 0,
+ $month, $day, $year,
+ is_dst($month, $day, $year, intval($start_seconds/3600)))
+ $start_seconds;
+$endtime = mktime(0, 0, 0,
+ $end_month, $end_day, $end_year,
+ is_dst($end_month, $end_day, $end_year,
intval($end_seconds/3600))) + $end_seconds;
+// If we're using periods then the endtime we've been returned by the form is
actually
+// the beginning of the last period in the booking (it's more intuitive for
users this way)
+// so we need to add on 60 seconds (1 period)
+if ($enable_periods)
{
- $starttime = mktime(0, 0, 0,
- $month, $day, $year,
- is_dst($month, $day, $year,
intval($start_seconds/3600))) + $start_seconds;
- $endtime = mktime(0, 0, 0,
- $end_month, $end_day, $end_year,
- is_dst($end_month, $end_day, $end_year,
intval($end_seconds/3600))) + $end_seconds;
- // If we're using periods then the endtime we've been returned by the form
is actually
- // the beginning of the last period in the booking (it's more intuitive for
users this way)
- // so we need to add on 60 seconds (1 period)
- if ($enable_periods)
- {
- $endtime = $endtime + 60;
- }
+ $endtime = $endtime + 60;
+}
- // Round down the starttime and round up the endtime to the nearest slot
boundaries
- $am7=mktime($morningstarts,$morningstarts_minutes,0,
- $month,$day,$year,is_dst($month,$day,$year,$morningstarts));
- $starttime = round_t_down($starttime, $resolution, $am7);
- $endtime = round_t_up($endtime, $resolution, $am7);
+// Round down the starttime and round up the endtime to the nearest slot
boundaries
+// (This step is probably unnecesary now that MRBS always returns times aligned
+// on slot boundaries, but is left in for good measure).
+$am7 = mktime($morningstarts, $morningstarts_minutes, 0,
+ $month, $day, $year, is_dst($month, $day, $year,
$morningstarts));
+$starttime = round_t_down($starttime, $resolution, $am7);
+$endtime = round_t_up($endtime, $resolution, $am7);
- // If they asked for 0 minutes, and even after the rounding the slot length
is still
- // 0 minutes, push that up to 1 resolution unit.
- if ($endtime == $starttime)
- {
- $endtime += $resolution;
- }
+// If they asked for 0 minutes, and even after the rounding the slot length is
still
+// 0 minutes, push that up to 1 resolution unit.
+if ($endtime == $starttime)
+{
+ $endtime += $resolution;
+}
- // Now adjust the duration in line with the adjustments to start and end time
- // so that the email notifications report the adjusted duration
- // (We do this before we adjust for DST so that the user sees what they
expect to see)
- $duration = $endtime - $starttime;
- $date = getdate($starttime);
- if ($enable_periods)
- {
- $period = (($date['hours'] - 12) * 60) + $date['minutes'];
- toPeriodString($period, $duration, $dur_units, FALSE);
- }
- else
- {
- toTimeString($duration, $dur_units, FALSE);
- }
-
- // Adjust the endtime for DST
- $endtime += cross_dst( $starttime, $endtime );
+// Now get the duration, which will be needed for email notifications
+// (We do this before we adjust for DST so that the user sees what they expect
to see)
+$duration = $endtime - $starttime;
+$date = getdate($starttime);
+if ($enable_periods)
+{
+ $period = (($date['hours'] - 12) * 60) + $date['minutes'];
+ toPeriodString($period, $duration, $dur_units, FALSE);
}
+else
+{
+ toTimeString($duration, $dur_units, FALSE);
+}
+
+// Adjust the endtime for DST
+$endtime += cross_dst( $starttime, $endtime );
+
if (isset($rep_type) && ($rep_type != REP_NONE) &&
isset($rep_end_month) && isset($rep_end_day) && isset($rep_end_year))
{
Property changes on: mrbs/branches/ics_attachments/web/upgrade/5/pgsql.sql
___________________________________________________________________
Modified: svn:mergeinfo
- /mrbs/branches/custom_entry_fields/web/upgrade/5/pgsql.sql:1374-1396
/mrbs/branches/datepicker/web/upgrade/5/pgsql.sql:1409-1416
/mrbs/branches/disabled_rooms/web/upgrade/5/pgsql.sql:1601-1634
/mrbs/branches/from_to_bookings/web/upgrade/5/pgsql.sql:1491-1587
/mrbs/branches/provisional_bookings/web/upgrade/5/pgsql.sql:1242-1280
/mrbs/branches/provisional_bookings_new_style/web/upgrade/5/pgsql.sql:1407-1570
/mrbs/trunk/web/upgrade/5/pgsql.sql:1652-1691
+ /mrbs/branches/custom_entry_fields/web/upgrade/5/pgsql.sql:1374-1396
/mrbs/branches/datepicker/web/upgrade/5/pgsql.sql:1409-1416
/mrbs/branches/disabled_rooms/web/upgrade/5/pgsql.sql:1601-1634
/mrbs/branches/from_to_bookings/web/upgrade/5/pgsql.sql:1491-1587
/mrbs/branches/provisional_bookings/web/upgrade/5/pgsql.sql:1242-1280
/mrbs/branches/provisional_bookings_new_style/web/upgrade/5/pgsql.sql:1407-1570
/mrbs/trunk/web/upgrade/5/pgsql.sql:1652-1711
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