Revision: 2333
http://mrbs.svn.sourceforge.net/mrbs/?rev=2333&view=rev
Author: cimorrison
Date: 2012-07-13 14:08:22 +0000 (Fri, 13 Jul 2012)
Log Message:
-----------
Fixed bug preventing resizable bookings from working when there's only one time
slot or period in the day.
Modified Paths:
--------------
mrbs/trunk/web/day.php
mrbs/trunk/web/functions.inc
mrbs/trunk/web/js/resizable.js.php
mrbs/trunk/web/week.php
Modified: mrbs/trunk/web/day.php
===================================================================
--- mrbs/trunk/web/day.php 2012-07-12 20:07:58 UTC (rev 2332)
+++ mrbs/trunk/web/day.php 2012-07-13 14:08:22 UTC (rev 2333)
@@ -113,7 +113,7 @@
// and output them
echo $before_after_links_html;
- echo "<table class=\"dwm_main\" id=\"day_main\">\n";
+ echo "<table class=\"dwm_main\" id=\"day_main\"
data-resolution=\"$resolution\">\n";
echo day_table_innerhtml($day, $month, $year, $room, $area,
$timetohighlight);
echo "</table>\n";
Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc 2012-07-12 20:07:58 UTC (rev 2332)
+++ mrbs/trunk/web/functions.inc 2012-07-13 14:08:22 UTC (rev 2333)
@@ -888,6 +888,12 @@
$max_per_interval_area[$interval_type] = $$var;
}
+ // If we're using periods then set the rsolution to 60 seconds
+ if ($enable_periods)
+ {
+ $resolution = 60;
+ }
+
}
Modified: mrbs/trunk/web/js/resizable.js.php
===================================================================
--- mrbs/trunk/web/js/resizable.js.php 2012-07-12 20:07:58 UTC (rev 2332)
+++ mrbs/trunk/web/js/resizable.js.php 2012-07-13 14:08:22 UTC (rev 2333)
@@ -170,6 +170,7 @@
?>
var rtl = ((table.css('direction') !== undefined) &&
table.css('direction').toLowerCase() == 'rtl');
+ var resolution = table.data('resolution');
tableData.x = {};
tableData.x.data = [];
<?php // We need :visible because there might be hidden days // ?>
@@ -202,8 +203,7 @@
var value = null;
if (tableData.x.key == 'seconds')
{
- value = tableData.x.data[0].value;
- value += tableData.x.data[0].value - tableData.x.data[1].value;
+ value = tableData.x.data[0].value + resolution;
}
var edge = $(this).offset().left;
tableData.x.data.unshift({coord: edge, value: value});
@@ -214,8 +214,7 @@
var value = null;
if (tableData.x.key == 'seconds')
{
- value = tableData.x.data[tableData.x.data.length - 1].value;
- value += tableData.x.data[1].value - tableData.x.data[0].value;
+ value = tableData.x.data[tableData.x.data.length - 1].value +
resolution;
}
var edge = $(this).offset().left + $(this).outerWidth();
tableData.x.data.push({coord: edge, value: value});
@@ -238,8 +237,7 @@
var value = null;
if (tableData.y.key == 'seconds')
{
- value = tableData.y.data[tableData.y.data.length - 1].value +
- tableData.y.data[1].value - tableData.y.data[0].value;
+ value = tableData.y.data[tableData.y.data.length - 1].value +
resolution;
}
tableData.y.data.push({coord: $(this).offset().top +
$(this).outerHeight(),
value: value});
Modified: mrbs/trunk/web/week.php
===================================================================
--- mrbs/trunk/web/week.php 2012-07-12 20:07:58 UTC (rev 2332)
+++ mrbs/trunk/web/week.php 2012-07-13 14:08:22 UTC (rev 2333)
@@ -94,7 +94,7 @@
print $before_after_links_html;
-echo "<table class=\"dwm_main\" id=\"week_main\">";
+echo "<table class=\"dwm_main\" id=\"week_main\"
data-resolution=\"$resolution\">";
echo week_table_innerhtml($day, $month, $year, $room, $area, $timetohighlight);
echo "</table>\n";
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits