Revision: 1914
http://mrbs.svn.sourceforge.net/mrbs/?rev=1914&view=rev
Author: cimorrison
Date: 2011-08-31 22:05:09 +0000 (Wed, 31 Aug 2011)
Log Message:
-----------
Fixed bug in skipping bookings when making weekly repeat bookings (bookings
were made for the wrong day of the week). Thanks to John O'Donnell for
spotting the problem.
Modified Paths:
--------------
mrbs/trunk/web/edit_entry.php
mrbs/trunk/web/edit_entry_handler.php
Modified: mrbs/trunk/web/edit_entry.php
===================================================================
--- mrbs/trunk/web/edit_entry.php 2011-08-31 14:25:47 UTC (rev 1913)
+++ mrbs/trunk/web/edit_entry.php 2011-08-31 22:05:09 UTC (rev 1914)
@@ -1123,7 +1123,7 @@
for ($i = 0; $i < 7; $i++)
{
$wday = ($i + $weekstarts) % 7;
- echo " <label><input class=\"checkbox\"
name=\"rep_day[$wday]\" type=\"checkbox\"";
+ echo " <label><input class=\"checkbox\" name=\"rep_day[]\"
value=\"$wday\" type=\"checkbox\"";
if ($rep_day[$wday])
{
echo " checked=\"checked\"";
Modified: mrbs/trunk/web/edit_entry_handler.php
===================================================================
--- mrbs/trunk/web/edit_entry_handler.php 2011-08-31 14:25:47 UTC (rev
1913)
+++ mrbs/trunk/web/edit_entry_handler.php 2011-08-31 22:05:09 UTC (rev
1914)
@@ -43,7 +43,6 @@
{
$$var = get_form_var($var, $var_type);
}
-
// Get custom form variables
$custom_fields = array();
@@ -385,14 +384,13 @@
// as the day of the week of the start of the period
if (count($rep_day) == 0)
{
- $start_day = date('w', $starttime);
- $rep_day[$start_day] = TRUE;
+ $rep_day[] = date('w', $starttime);
}
// Build string of weekdays to repeat on:
for ($i = 0; $i < 7; $i++)
{
- $rep_opt .= empty($rep_day[$i]) ? "0" : "1"; // $rep_opt is a string
+ $rep_opt .= in_array($i, $rep_day) ? "1" : "0"; // $rep_opt is a string
}
// Make sure that the starttime and endtime coincide with a repeat day. In
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits