Revision: 1477
http://mrbs.svn.sourceforge.net/mrbs/?rev=1477&view=rev
Author: cimorrison
Date: 2010-09-24 17:44:14 +0000 (Fri, 24 Sep 2010)
Log Message:
-----------
Added a repeat symbol to the display of series on the day, week and month views.
Modified Paths:
--------------
mrbs/trunk/web/day.php
mrbs/trunk/web/functions.inc
mrbs/trunk/web/month.php
mrbs/trunk/web/mrbs.css.php
mrbs/trunk/web/week.php
Added Paths:
-----------
mrbs/trunk/web/images/repeat.png
Modified: mrbs/trunk/web/day.php
===================================================================
--- mrbs/trunk/web/day.php 2010-09-24 10:55:42 UTC (rev 1476)
+++ mrbs/trunk/web/day.php 2010-09-24 17:44:14 UTC (rev 1477)
@@ -139,14 +139,15 @@
//Note: The predicate clause 'start_time <= ...' is an equivalent but simpler
//form of the original which had 3 BETWEEN parts. It selects all entries which
//occur on or cross the current day.
-$sql = "SELECT $tbl_room.id AS room_id, start_time, end_time, name,
$tbl_entry.id AS entry_id, type,
- $tbl_entry.description AS entry_description, status,
- $tbl_entry.private AS entry_private, $tbl_entry.create_by AS
entry_create_by
- FROM $tbl_entry, $tbl_room
- WHERE $tbl_entry.room_id = $tbl_room.id
- AND area_id = $area
- AND start_time <= $pm7 AND end_time > $am7
- ORDER BY start_time"; // necessary so that multiple bookings appear in
the right order
+$sql = "SELECT R.id AS room_id, start_time, end_time, name, repeat_id,
+ E.id AS entry_id, type,
+ E.description AS entry_description, status,
+ E.private AS entry_private, E.create_by AS entry_create_by
+ FROM $tbl_entry E, $tbl_room R
+ WHERE E.room_id = R.id
+ AND area_id = $area
+ AND start_time <= $pm7 AND end_time > $am7
+ ORDER BY start_time"; // necessary so that multiple bookings appear in
the right order
$res = sql_query($sql);
if (! $res)
@@ -163,6 +164,7 @@
// row['start_time'] = start time
// row['end_time'] = end time
// row['name'] = short description
+ // row['repeat_id'] = repeat type
// row['entry_id'] = id of this booking
// row['type'] = type (internal/external)
// row['entry_description'] = description
Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc 2010-09-24 10:55:42 UTC (rev 1476)
+++ mrbs/trunk/web/functions.inc 2010-09-24 17:44:14 UTC (rev 1477)
@@ -1033,6 +1033,7 @@
// start_time
// end_time
// name
+ // repeat_id
// entry_id
// type
// entry_description
@@ -1044,6 +1045,7 @@
// It looks like:
// $column[Time][n][id]
// [is_private]
+ // [is_repeat]
// [color]
// [data]
// [long_descr]
@@ -1115,6 +1117,7 @@
// fill in the id, type and start time
$column[$time_t][$n]["id"] = $row['entry_id'];
$column[$time_t][$n]["is_private"] = $is_private;
+ $column[$time_t][$n]["is_repeat"] = !empty($row['repeat_id']);
$column[$time_t][$n]["status"] = $row['status'];
$column[$time_t][$n]["color"] = $row['type'];
$column[$time_t][$n]["start_time"] = utf8_strftime(hour_min_format(),
$row['start_time']);
@@ -1246,6 +1249,7 @@
//
// $cell[n][id]
// [is_private]
+ // [is_repeat]
// [color]
// [data]
// [long_descr]
@@ -1315,6 +1319,7 @@
{
$id = $cell[$n]["id"];
$is_private = $cell[$n]["is_private"];
+ $is_repeat = $cell[$n]["is_repeat"];
$status = $cell[$n]["status"];
$color = $cell[$n]["color"];
$descr = htmlspecialchars($cell[$n]["data"]);
@@ -1361,6 +1366,7 @@
{
$id = $cell[$n]["id"];
$is_private = $cell[$n]["is_private"];
+ $is_repeat = $cell[$n]["is_repeat"];
$status = $cell[$n]["status"];
$color = $cell[$n]["color"];
$descr = htmlspecialchars($cell[$n]["start_time"] . " " .
$cell[$n]["data"]);
@@ -1379,7 +1385,9 @@
(($n==0) ? " style=\"border-top-width: 0\"" : "") . // no border
for first row
">\n";
echo "<div class=\"celldiv slots1\">\n"; // we want clipping of
overflow
- echo " <a href=\"view_entry.php?id=$id&". $query_strings['booking']
. "\" title=\"$long_descr\">$descr</a>\n";
+ echo "<a href=\"view_entry.php?id=$id&". $query_strings['booking'] .
"\" title=\"$long_descr\">";
+ echo ($is_repeat) ? "<img class=\"repeat_symbol\"
src=\"images/repeat.png\" alt=\"" . get_vocab("series") . "\" title=\"" .
get_vocab("series") . "\" width=\"10\" height=\"10\">" : '';
+ echo "$descr</a>\n";
echo "</div>\n";
echo "</td>\n";
@@ -1399,6 +1407,7 @@
{
$id = $cell[0]["id"];
$is_private = $cell[0]["is_private"];
+ $is_repeat = $cell[0]["is_repeat"];
$status = $cell[0]["status"];
$color = $cell[0]["color"];
$descr = htmlspecialchars($cell[0]["data"]);
@@ -1487,8 +1496,10 @@
else
{
echo "<div class=\"celldiv slots" . $slots . "\">\n"; // we want
clipping of overflow
- }
- echo " <a href=\"view_entry.php?id=$id&".
$query_strings['booking'] . "\" title=\"$long_descr\">$descr</a>\n";
+ }
+ echo "<a href=\"view_entry.php?id=$id&". $query_strings['booking']
. "\" title=\"$long_descr\">";
+ echo ($is_repeat) ? "<img class=\"repeat_symbol $c\"
src=\"images/repeat.png\" alt=\"" . get_vocab("series") . "\" title=\"" .
get_vocab("series") . "\" width=\"10\" height=\"10\">" : '';
+ echo "$descr</a>\n";
echo "</div>\n";
}
echo "</td>\n";
Added: mrbs/trunk/web/images/repeat.png
===================================================================
(Binary files differ)
Property changes on: mrbs/trunk/web/images/repeat.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Modified: mrbs/trunk/web/month.php
===================================================================
--- mrbs/trunk/web/month.php 2010-09-24 10:55:42 UTC (rev 1476)
+++ mrbs/trunk/web/month.php 2010-09-24 17:44:14 UTC (rev 1477)
@@ -257,11 +257,11 @@
for ($day_num = 1; $day_num<=$days_in_month; $day_num++)
{
$sql = "SELECT start_time, end_time, id, name, type,
- status, private, create_by
- FROM $tbl_entry
- WHERE room_id=$room
- AND start_time <= $midnight_tonight[$day_num] AND end_time >
$midnight[$day_num]
- ORDER by start_time";
+ repeat_id, status, private, create_by
+ FROM $tbl_entry
+ WHERE room_id=$room
+ AND start_time <= $midnight_tonight[$day_num] AND end_time >
$midnight[$day_num]
+ ORDER BY start_time";
// Build an array of information about each day in the month.
// The information is stored as:
@@ -315,6 +315,7 @@
}
$d[$day_num]["is_private"][] = $private;
+ $d[$day_num]["is_repeat"][] = !empty($row['repeat_id']);
$d[$day_num]["status"][] = $row['status'];
$d[$day_num]["color"][] = $row['type'];
@@ -558,20 +559,17 @@
{
case "description":
{
- echo "<a href=\"$booking_link\" title=\"$full_text\">"
- . $description_text . "</a>\n";
+ $display_text = $description_text;
break;
}
case "slot":
{
- echo "<a href=\"$booking_link\" title=\"$full_text\">"
- . $slot_text . "</a>\n";
+ $display_text = $slot_text;
break;
}
case "both":
{
- echo "<a href=\"$booking_link\" title=\"$full_text\">"
- . $full_text . "</a>\n";
+ $display_text = $full_text;
break;
}
default:
@@ -579,6 +577,9 @@
echo "error: unknown parameter";
}
}
+ echo "<a href=\"$booking_link\" title=\"$full_text\">";
+ echo ($d[$cday]['is_repeat'][$i]) ? "<img class=\"repeat_symbol\"
src=\"images/repeat.png\" alt=\"" . get_vocab("series") . "\" title=\"" .
get_vocab("series") . "\" width=\"10\" height=\"10\">" : '';
+ echo "$display_text</a>\n";
echo "</div>\n";
}
echo "</div>\n";
Modified: mrbs/trunk/web/mrbs.css.php
===================================================================
--- mrbs/trunk/web/mrbs.css.php 2010-09-24 10:55:42 UTC (rev 1476)
+++ mrbs/trunk/web/mrbs.css.php 2010-09-24 17:44:14 UTC (rev 1477)
@@ -208,6 +208,9 @@
a.new_booking {display: block; font-size: medium; text-align: center}
.new_booking img {margin: auto; padding: 4px 0 2px 0}
+img.repeat_symbol {float: right; padding: 3px}
+.dwm_main#month_main img.repeat_symbol {padding: 2px}
+
<?php
if (!$show_plus_link)
{
Modified: mrbs/trunk/web/week.php
===================================================================
--- mrbs/trunk/web/week.php 2010-09-24 10:55:42 UTC (rev 1476)
+++ mrbs/trunk/web/week.php 2010-09-24 17:44:14 UTC (rev 1477)
@@ -217,13 +217,13 @@
for ($j = 0; $j<=($num_of_days-1) ; $j++)
{
- $sql = "SELECT room_id, start_time, end_time, type, name, status,
- id AS entry_id, description AS entry_description,
- private AS entry_private, create_by AS entry_create_by
- FROM $tbl_entry
- WHERE room_id = $room
- AND start_time <= $pm7[$j] AND end_time > $am7[$j]
- ORDER BY start_time"; // necessary so that multiple bookings
appear in the right order
+ $sql = "SELECT room_id, start_time, end_time, type, name, status, repeat_id,
+ id AS entry_id, description AS entry_description,
+ private AS entry_private, create_by AS entry_create_by
+ FROM $tbl_entry
+ WHERE room_id = $room
+ AND start_time <= $pm7[$j] AND end_time > $am7[$j]
+ ORDER BY start_time"; // necessary so that multiple bookings appear
in the right order
// Each row returned from the query is a meeting. Build an array of the
// form: $week_map[room][weekday][slot][x], where x = id, color, data,
long_desc.
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits