Changeset:
739912c24d8b
https://sourceforge.net/p/mrbs/hg-code/ci/739912c24d8bd05684e3669d60a7d513cf95082f
Author:
Campbell Morrison <[email protected]>
Date:
Mon Mar 27 21:17:22 2017 +0100
Log message:
Tidied up comments
diffstat:
web/index.php | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
diffs (72 lines):
diff -r ee93ba16e3b0 -r 739912c24d8b web/index.php
--- a/web/index.php Mon Mar 27 21:02:42 2017 +0100
+++ b/web/index.php Mon Mar 27 21:17:22 2017 +0100
@@ -166,8 +166,10 @@
$html .= "<tr>\n";
$last_id = null;
+ // Cycle through the slots
while (($data = current($row)) !== false)
{
+ // No booking in this slot
if (count($data) == 0)
{
if (isset($last_id))
@@ -184,6 +186,8 @@
$html .= get_cell_html($content, 'new');
}
}
+
+ // One booking in this slot
elseif (count($data) == 1)
{
$this_id = $data[0]['id'];
@@ -209,26 +213,18 @@
prev($row);
}
}
+
+ // More than one booking in this slot. This will happen if the
resolution is changed
+ // or the slots are shifted.
else
{
- // This can happen if you get two bookings in the same slot,
- // which will happen if the resolution is changed or the slots are
shifted
trigger_error("To do");
}
$data = next($row);
- if ($data === false)
+ if (($data === false) && isset($last_id))
{
// We're at the end of the row and there's a booking to write out
- if (isset($last_id))
- {
- $html .= get_cell_html($content, $type, $n_slots);
- }
- else
- {
- // This is an empty slot
- $content = "<a href=\"\"></a>\n"; // JUST FOR NOW - TO DO
- //$html .= get_cell_html($content, 'new');
- }
+ $html .= get_cell_html($content, $type, $n_slots);
break;
}
}
@@ -237,7 +233,6 @@
}
$html .= "</tbody>\n";
-
$html .= "</table>\n";
return $html;
@@ -247,6 +242,8 @@
{
$html = '';
+ // We use nested tables so that we can get set the column width exactly for
+ // the main data.
$html .= "<table class=\"main_view\">\n";
$html .= "<tr>\n";
$html .= "<td>" . get_row_labels_table($map) . "</td>\n";
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits