Revision: 1305
http://mrbs.svn.sourceforge.net/mrbs/?rev=1305&view=rev
Author: cimorrison
Date: 2010-03-17 09:27:24 +0000 (Wed, 17 Mar 2010)
Log Message:
-----------
- Redesigned (and hopefully improved) the layout of the admin page with a view
to being able to add extra fields to the room table in the future
- Opened up the admin and edit_area_room pages to users at level 1, who can
view room details but not change them
- Renamed ?\226?\128?\156Admin?\226?\128?\157 in the header to
?\226?\128?\156Rooms?\226?\128?\157
- Removed the browser language details from the Rooms page as
they?\226?\128?\153re available on the Help page
- Created an images directory for holding icons
Modified Paths:
--------------
mrbs/trunk/web/Themes/classic126/styling.inc
mrbs/trunk/web/Themes/default/header.inc
mrbs/trunk/web/Themes/default/styling.inc
mrbs/trunk/web/admin.php
mrbs/trunk/web/edit_area_room.php
mrbs/trunk/web/functions.inc
mrbs/trunk/web/lang.en
mrbs/trunk/web/month.php
mrbs/trunk/web/mrbs-ie8.css
mrbs/trunk/web/mrbs-ielte7.css.php
mrbs/trunk/web/mrbs.css.php
Added Paths:
-----------
mrbs/trunk/web/images/
mrbs/trunk/web/images/delete.png
mrbs/trunk/web/images/edit.png
mrbs/trunk/web/images/new.gif
Removed Paths:
-------------
mrbs/trunk/web/new.gif
Modified: mrbs/trunk/web/Themes/classic126/styling.inc
===================================================================
--- mrbs/trunk/web/Themes/classic126/styling.inc 2010-03-16 21:00:08 UTC
(rev 1304)
+++ mrbs/trunk/web/Themes/classic126/styling.inc 2010-03-17 09:27:24 UTC
(rev 1305)
@@ -22,6 +22,7 @@
$admin_table_header_back_color = $header_back_color; // background colour
for header and also border colour for table cells
$admin_table_header_sep_color = $body_background_color; // vertical
separator colour in header
$admin_table_header_font_color = $header_font_color; // font colour for
header
+$admin_table_border_color = "#C3CCD3";
$main_table_border_color = "#777777"; // border
colour for day/week/month tables - outside
$main_table_header_border_color = $main_table_border_color; // border
colour for day/week/month tables - header
Modified: mrbs/trunk/web/Themes/default/header.inc
===================================================================
--- mrbs/trunk/web/Themes/default/header.inc 2010-03-16 21:00:08 UTC (rev
1304)
+++ mrbs/trunk/web/Themes/default/header.inc 2010-03-17 09:27:24 UTC (rev
1305)
@@ -422,7 +422,7 @@
echo "</td>\n";
echo "<td>\n";
- echo "<a href=\"admin.php?$query_str\">" . get_vocab("admin") . "</a>\n";
+ echo "<a href=\"admin.php?$query_str\">" . get_vocab("rooms") . "</a>\n";
echo "</td>\n";
echo "<td>\n";
Modified: mrbs/trunk/web/Themes/default/styling.inc
===================================================================
--- mrbs/trunk/web/Themes/default/styling.inc 2010-03-16 21:00:08 UTC (rev
1304)
+++ mrbs/trunk/web/Themes/default/styling.inc 2010-03-17 09:27:24 UTC (rev
1305)
@@ -22,6 +22,7 @@
$admin_table_header_back_color = $header_back_color; // background colour
for header and also border colour for table cells
$admin_table_header_sep_color = $body_background_color; // vertical
separator colour in header
$admin_table_header_font_color = $header_font_color; // font colour for
header
+$admin_table_border_color = "#C3CCD3";
$main_table_border_color = $body_background_color; // border colour for
day/week/month tables - outside
$main_table_header_border_color = $body_background_color; // border colour for
day/week/month tables - header
Modified: mrbs/trunk/web/admin.php
===================================================================
--- mrbs/trunk/web/admin.php 2010-03-16 21:00:08 UTC (rev 1304)
+++ mrbs/trunk/web/admin.php 2010-03-17 09:27:24 UTC (rev 1305)
@@ -12,6 +12,7 @@
$room = get_form_var('room', 'int');
$area_name = get_form_var('area_name', 'string');
$error = get_form_var('error', 'string');
+$action = get_form_var('action', 'string');
// If we dont know the right date then make it up
if (!isset($day) or !isset($month) or !isset($year))
@@ -26,12 +27,39 @@
$area = get_default_area();
}
-$required_level = (isset($max_level) ? $max_level : 2);
-if (!getAuthorised($required_level))
+// Check to see whether the Edit or Delete buttons have been pressed and
redirect
+// as appropriate
+if (isset($action))
{
+ $std_query_string = "area=$area&day=$day&month=$month&year=$year";
+ switch($action) {
+ case 'edit':
+ $location = "edit_area_room.php?$std_query_string";
+ break;
+ case 'delete':
+ $location = "del.php?type=area&$std_query_string";
+ break;
+ default:
+ unset($location);
+ break;
+ }
+ if (isset($location))
+ {
+ header("Location: $location");
+ exit;
+ }
+}
+
+// Users must be at least Level 1 for this page as we will be displaying
+// information such as email addresses
+if (!getAuthorised(1))
+{
showAccessDenied($day, $month, $year, $area, "");
exit();
}
+$user = getUserName();
+$required_level = (isset($max_level) ? $max_level : 2);
+$is_admin = (authGetUserLevel($user) >= $required_level);
print_header($day, $month, $year, isset($area) ? $area : "", isset($room) ?
$room : "");
@@ -40,7 +68,7 @@
{
if (empty($area_name))
{
- $res = sql_query("select area_name from $tbl_area where id=$area");
+ $res = sql_query("SELECT area_name FROM $tbl_area WHERE id=$area");
if (! $res) fatal_error(0, sql_error());
if (sql_count($res) == 1)
{
@@ -58,71 +86,188 @@
echo "<p class=\"error\">" . get_vocab($error) . "</p>\n";
}
-?>
-<table id="admin" class="admin_table">
- <thead>
- <tr>
- <th><?php echo get_vocab("areas") ?></th>
- <th>
- <?php
- echo get_vocab("rooms");
- if(isset($area_name))
- {
- echo " " . get_vocab("in") . " " . htmlspecialchars($area_name);
- }
- ?>
- </th>
- </tr>
- </thead>
-
- <tbody>
- <tr>
- <td>
-<?php
-// This cell has the areas
-$res = sql_query("select id, area_name from $tbl_area order by area_name");
-if (! $res) fatal_error(0, sql_error());
-
-if (sql_count($res) == 0)
+// TOP SECTION: THE FORM FOR SELECTING AN AREA
+echo "<div id=\"area_form\">\n";
+$sql = "select id, area_name from $tbl_area order by area_name";
+$res = sql_query($sql);
+$areas_defined = $res && (sql_count($res) > 0);
+if ($areas_defined)
{
- echo get_vocab("noareas");
-}
-else
-{
- echo " <ul>\n";
+ // If there are some areas defined, then show the area form
+ echo "<form id=\"areaChangeForm\" method=\"get\" action=\"$PHP_SELF\">\n";
+ echo "<fieldset>\n";
+ echo "<legend></legend>\n";
+
+ // The area selector
+ echo "<label id=\"area_label\" for=\"area_select\">" . get_vocab("area") .
":</label>\n";
+ echo "<select class=\"room_area_select\" id=\"area_select\" name=\"area\"
onchange=\"this.form.submit()\">";
for ($i = 0; ($row = sql_row_keyed($res, $i)); $i++)
{
- $area_name_q = urlencode($row['area_name']);
- echo " <li><a
href=\"admin.php?area=".$row['id']."&area_name=$area_name_q\">"
- . htmlspecialchars($row['area_name']) . "</a> (<a
href=\"edit_area_room.php?area=".$row['id']."\">" . get_vocab("edit") . "</a>)
(<a href=\"del.php?type=area&area=".$row['id']."\">" . get_vocab("delete")
. "</a>)</li>\n";
+ $selected = ($row['id'] == $area) ? "selected=\"selected\"" : "";
+ echo "<option $selected value=\"". $row['id']. "\">" .
htmlspecialchars($row['area_name']) . "</option>";
}
- echo " </ul>\n";
+ echo "</select>\n";
+
+ // Some hidden inputs for current day, month, year
+ echo "<input type=\"hidden\" name=\"day\" value=\"$day\">\n";
+ echo "<input type=\"hidden\" name=\"month\" value=\"$month\">\n";
+ echo "<input type=\"hidden\" name=\"year\" value=\"$year\">\n";
+
+ // The change area button (won't be needed or displayed if JavaScript is
enabled)
+ echo "<input type=\"submit\" name=\"change\" class=\"js_none\" value=\"" .
get_vocab("change") . "\">\n";
+
+ // If they're an admin then give them edit and delete buttons for the area
+ // and also a form for adding a new area
+ if ($is_admin)
+ {
+ // The edit button
+ echo "<button type=\"submit\" name=\"action\" value=\"edit\" title=\"" .
get_vocab("edit") . "\">\n";
+ echo "<img src=\"images/edit.png\" width=\"16\" height=\"16\" alt=\"" .
get_vocab("edit") . "\">\n";
+ echo "</button>\n";
+
+ // The delete button
+ echo "<button type=\"submit\" name=\"action\" value=\"delete\" title=\"" .
get_vocab("delete") . "\">\n";
+ echo "<img src=\"images/delete.png\" width=\"16\" height=\"16\" alt=\"" .
get_vocab("delete") . "\">\n";
+ echo "</button>\n";
+ }
+
+ echo "</fieldset>\n";
+ echo "</form>\n";
}
-?>
- </td>
- <td>
-<?php
-// This one has the rooms
-if(isset($area))
+else
{
- $res = sql_query("select id, room_name, description, capacity from $tbl_room
where area_id=$area order by sort_key");
+ echo "<p>" . get_vocab("noareas") . "</p>\n";
+}
+if ($is_admin)
+{
+ // New area form
+ ?>
+ <form id="add_area" class="form_admin" action="add.php" method="post">
+ <fieldset>
+ <legend><?php echo get_vocab("addarea") ?></legend>
+
+ <input type="hidden" name="type" value="area">
+
+ <div>
+ <label for="area_name"><?php echo get_vocab("name") ?>:</label>
+ <input type="text" id="area_name" name="name" maxlength="<?php echo
$maxlength['area.area_name'] ?>">
+ </div>
+
+ <div>
+ <input type="submit" class="submit" value="<?php echo
get_vocab("addarea") ?>">
+ </div>
+
+ </fieldset>
+ </form>
+ <?php
+}
+echo "</div>";
+
+// BOTTOM SECTION: ROOMS IN THE SELECTED AREA
+echo "<h2>\n";
+echo get_vocab("rooms");
+if(isset($area_name))
+{
+ echo " " . get_vocab("in") . " " . htmlspecialchars($area_name);
+}
+echo "</h2>\n";
+
+echo "<div id=\"room_form\">\n";
+if (isset($area))
+{
+ $res = sql_query("SELECT * FROM $tbl_room WHERE area_id=$area ORDER BY
sort_key");
if (! $res)
{
fatal_error(0, sql_error());
}
if (sql_count($res) == 0)
{
- echo get_vocab("norooms");
+ echo "<p>" . get_vocab("norooms") . "</p>\n";
}
else
{
- echo " <ul>";
+ // Build an array with the room info
+ $rooms = array();
for ($i = 0; ($row = sql_row_keyed($res, $i)); $i++)
{
- echo " <li>" . htmlspecialchars($row['room_name']) . "(" .
htmlspecialchars($row['description'])
- . ", ".$row['capacity'].") (<a
href=\"edit_area_room.php?room=".$row['id']."\">" . get_vocab("edit") . "</a>)
(<a href=\"del.php?type=room&room=".$row['id']."\">" . get_vocab("delete")
. "</a>)</li>\n";
+ $rooms[] = $row;
}
- echo " </ul>";
+ // Display it in a table [Actually two tables side by side so that we can
+ // achieve a "Freeze Panes" effect: there doesn't seem to be a good way of
+ // getting a colgroup to scroll, so we have to distort the mark-up a
little]
+
+ echo "<div id=\"room_info\">\n";
+ // (a) the "header" column containing the room names
+ echo "<div id=\"header_column\">\n";
+ echo "<table>\n";
+ echo "<thead>\n";
+ echo "<tr>\n";
+ if ($is_admin)
+ {
+ echo "<th><div> </div></th>\n";
+ echo "<th><div> </div></th>\n";
+ }
+ echo "<th><div>" . get_vocab("name") . "</div></th>\n";
+ echo "</tr>\n";
+ echo "</thead>\n";
+ echo "<tbody>\n";
+ $row_class = "odd_row";
+ foreach ($rooms as $r)
+ {
+ $row_class = ($row_class == "even_row") ? "odd_row" : "even_row";
+ echo "<tr class=\"$row_class\">\n";
+ // Give admins delete and edit links
+ if ($is_admin)
+ {
+ // Delete link
+ echo "<td><div>\n";
+ echo "<a href=\"del.php?type=room&room=" . $r['id'] . "\">\n";
+ echo "<img src=\"images/delete.png\" width=\"16\" height=\"16\"
+ alt=\"" . get_vocab("delete") . "\"
+ title=\"" . get_vocab("delete") . "\">\n";
+ echo "</a>\n";
+ echo "</div></td>\n";
+ // Delete link
+ echo "<td><div>\n";
+ echo "<a href=\"edit_area_room.php?room=" . $r['id'] . "\">\n";
+ echo "<img src=\"images/edit.png\" width=\"16\" height=\"16\"
+ alt=\"" . get_vocab("edit") . "\"
+ title=\"" . get_vocab("edit") . "\">\n";
+ echo "</a>\n";
+ echo "</div></td>\n";
+ }
+ echo "<td><div><a href=\"edit_area_room.php?room=" . $r['id'] . "\">" .
htmlspecialchars($r['room_name']) . "</a></div></td>\n";
+ echo "</tr>\n";
+ }
+ echo "</tbody>\n";
+ echo "</table>\n";
+ echo "</div>\n";
+
+ // (b) the "body" columns containing the room info
+ echo "<div id=\"body_columns\">\n";
+ echo "<table>\n";
+ echo "<thead>\n";
+ echo "<tr>\n";
+ echo "<th><div>" . get_vocab("description") . "</div></th>\n";
+ echo "<th><div>" . get_vocab("capacity") . "</div></th>\n";
+ echo "<th><div>" . get_vocab("room_admin_email") . "</div></th>\n";
+ echo "</tr>\n";
+ echo "</thead>\n";
+ echo "<tbody>\n";
+ $row_class = "odd_row";
+ foreach ($rooms as $r)
+ {
+ $row_class = ($row_class == "even_row") ? "odd_row" : "even_row";
+ echo "<tr class=\"$row_class\">\n";
+ echo "<td><div>" . htmlspecialchars($r['description']) . "</div></td>\n";
+ echo "<td class=\"int\"><div>" . $r['capacity'] . "</div></td>\n";
+ echo "<td><div>" . htmlspecialchars($r['room_admin_email']) .
"</div></td>\n";
+ echo "</tr>\n";
+ }
+ echo "</tbody>\n";
+ echo "</table>\n";
+ echo "</div>\n";
+ echo "</div>\n";
}
}
else
@@ -130,82 +275,43 @@
echo get_vocab("noarea");
}
-?>
- </td>
- </tr>
- <tr>
- <td>
- <form class="form_admin" action="add.php" method="post">
- <fieldset>
- <legend><?php echo get_vocab("addarea") ?></legend>
-
- <input type="hidden" name="type" value="area">
-
- <div>
- <label for="area_name"><?php echo get_vocab("name") ?>:</label>
- <input type="text" id="area_name" name="name" maxlength="<?php
echo $maxlength['area.area_name'] ?>">
- </div>
-
- <div>
- <input type="submit" class="submit" value="<?php echo
get_vocab("addarea") ?>">
- </div>
-
- </fieldset>
- </form>
- </td>
-
- <td>
-<?php
-if (0 != $area)
+// Give admins a form for adding rooms to the area - provided
+// there's an area selected
+if ($is_admin && $areas_defined && !empty($area))
{
?>
- <form class="form_admin" action="add.php" method="post">
- <fieldset>
- <legend><?php echo get_vocab("addroom") ?></legend>
+ <form id="add_room" class="form_admin" action="add.php" method="post">
+ <fieldset>
+ <legend><?php echo get_vocab("addroom") ?></legend>
- <input type="hidden" name="type" value="room">
- <input type="hidden" name="area" value="<?php echo $area; ?>">
+ <input type="hidden" name="type" value="room">
+ <input type="hidden" name="area" value="<?php echo $area; ?>">
- <div>
- <label for="room_name"><?php echo get_vocab("name") ?>:</label>
- <input type="text" id="room_name" name="name" maxlength="<?php echo
$maxlength['room.room_name'] ?>">
- </div>
+ <div>
+ <label for="room_name"><?php echo get_vocab("name") ?>:</label>
+ <input type="text" id="room_name" name="name" maxlength="<?php echo
$maxlength['room.room_name'] ?>">
+ </div>
- <div>
- <label for="room_description"><?php echo get_vocab("description")
?>:</label>
- <input type="text" id="room_description" name="description"
maxlength="<?php echo $maxlength['room.description'] ?>">
- </div>
+ <div>
+ <label for="room_description"><?php echo get_vocab("description")
?>:</label>
+ <input type="text" id="room_description" name="description"
maxlength="<?php echo $maxlength['room.description'] ?>">
+ </div>
- <div>
- <label for="room_capacity"><?php echo get_vocab("capacity")
?>:</label>
- <input type="text" id="room_capacity" name="capacity">
- </div>
+ <div>
+ <label for="room_capacity"><?php echo get_vocab("capacity") ?>:</label>
+ <input type="text" id="room_capacity" name="capacity">
+ </div>
- <div>
- <input type="submit" class="submit" value="<?php echo
get_vocab("addroom") ?>">
- </div>
+ <div>
+ <input type="submit" class="submit" value="<?php echo
get_vocab("addroom") ?>">
+ </div>
- </fieldset>
- </form>
+ </fieldset>
+ </form>
<?php
}
-else
-{
- echo " ";
-}
-?>
- </td>
- </tr>
- </tbody>
-</table>
+echo "</div>\n";
-<?php
-echo "<p>\n" . get_vocab("browserlang") .":\n";
-
-echo implode(", ", array_keys($langs));
-
-echo "\n</p>\n";
-
require_once "trailer.inc"
?>
Modified: mrbs/trunk/web/edit_area_room.php
===================================================================
--- mrbs/trunk/web/edit_area_room.php 2010-03-16 21:00:08 UTC (rev 1304)
+++ mrbs/trunk/web/edit_area_room.php 2010-03-17 09:27:24 UTC (rev 1305)
@@ -52,12 +52,16 @@
$year = date("Y");
}
-$required_level = (isset($max_level) ? $max_level : 2);
-if (!getAuthorised($required_level))
+// Users must be at least Level 1 for this page as we will be displaying
+// information such as email addresses
+if (!getAuthorised(1))
{
showAccessDenied($day, $month, $year, $area, "");
exit();
}
+$user = getUserName();
+$required_level = (isset($max_level) ? $max_level : 2);
+$is_admin = (authGetUserLevel($user) >= $required_level);
// Done changing area or room information?
if (isset($change_done))
@@ -78,6 +82,19 @@
$valid_room_name = TRUE;
+// PHASE 2
+// -------
+// Unauthorised users shouldn't normally be able to reach Phase 2, but just in
case
+// they have, check again that they are allowed to be here
+if (isset($change_room) || isset($change_area))
+{
+ if (!$is_admin)
+ {
+ showAccessDenied($day, $month, $year, $area, "");
+ exit();
+ }
+}
+
// PHASE 2 (ROOM) - UPDATE THE DATABASE
// ------------------------------------
if (isset($change_room) && !empty($room))
@@ -256,12 +273,17 @@
print_header($day, $month, $year, isset($area) ? $area : "", isset($room) ?
$room : "");
-?>
+if ($is_admin)
+{
+ // Heading is confusing for non-admins
+ echo "<h2>" . get_vocab("editroomarea") . "</h2>\n";
+}
-<h2><?php echo get_vocab("editroomarea") ?></h2>
+// Non-admins will only be allowed to view room details, not change them
+// (We would use readonly instead of disabled, but it is not valid for some
+// elements, eg <select>)
+$disabled = ($is_admin) ? "" : " disabled=\"disabled\"";
-<?php
-
// THE ROOM FORM
if (!empty($room))
{
@@ -276,7 +298,9 @@
?>
<form class="form_general" id="edit_room" action="edit_area_room.php"
method="post">
<fieldset class="admin">
- <legend><?php echo get_vocab("editroom") ?></legend>
+ <legend>
+ <?php echo ($is_admin) ? get_vocab("editroom") : get_vocab("viewroom")?>
+ </legend>
<fieldset>
<legend></legend>
@@ -303,11 +327,11 @@
{
fatal_error(FALSE, get_vocab('noareas')); // should not happen
}
- ?>
- <div>
- <label for="new_area"><?php echo get_vocab("area") ?>:</label>
- <select id="new_area" name="new_area">
- <?php
+
+ // The area select box
+ echo "<div>\n";
+ echo "<label for=\"new_area\">" . get_vocab("area") . ":</label>\n";
+ echo "<select id=\"new_area\" name=\"new_area\"$disabled>\n";
for ($i = 0; ($row_area = sql_row_keyed($res, $i)); $i++)
{
echo "<option value=\"" . $row_area['id'] . "\"";
@@ -317,49 +341,56 @@
}
echo ">" . $row_area['area_name'] . "</option>\n";
}
- ?>
- </select>
- <input type="hidden" name="old_area" value="<?php echo $row['area_id']
?>">
- </div>
+ echo "</select>\n";
+ echo "<input type=\"hidden\" name=\"old_area\" value=\"" .
$row['area_id'] . "\">\n";
+ echo "</div>\n";
- <div>
- <label for="room_name"><?php echo get_vocab("name") ?>:</label>
- <input type="text" id="room_name" name="room_name" value="<?php echo
htmlspecialchars($row["room_name"]); ?>">
- <input type="hidden" name="old_room_name" value="<?php echo
htmlspecialchars($row["room_name"]); ?>">
- </div>
+ // Room name
+ echo "<div>\n";
+ echo "<label for=\"room_name\">" . get_vocab("name") . ":</label>\n";
+ echo "<input type=\"text\" id=\"room_name\" name=\"room_name\" value=\""
. htmlspecialchars($row["room_name"]) . "\"$disabled>\n";
+ echo "<input type=\"hidden\" name=\"old_room_name\" value=\"" .
htmlspecialchars($row["room_name"]) . "\">\n";
+ echo "</div>\n";
- <div>
- <?php
+ // Sort key
+ echo "<div>\n";
echo "<label for=\"sort_key\" title=\"" . get_vocab("sort_key_note") .
"\">" . get_vocab("sort_key") . ":</label>\n";
- ?>
- <input type="text" id="sort_key" name="sort_key" value="<?php echo
htmlspecialchars($row["sort_key"]); ?>">
- </div>
+ echo "<input type=\"text\" id=\"sort_key\" name=\"sort_key\" value=\"" .
htmlspecialchars($row["sort_key"]) . "\"$disabled>\n";
+ echo "</div>\n";
- <div>
- <label for="description"><?php echo get_vocab("description") ?>:</label>
- <input type="text" id="description" name="description" value="<?php echo
htmlspecialchars($row["description"]); ?>">
- </div>
+ // Description
+ echo "<div>\n";
+ echo "<label for=\"description\">" . get_vocab("description") .
":</label>\n";
+ echo "<input type=\"text\" id=\"description\" name=\"description\"
value=\"" . htmlspecialchars($row["description"]) . "\"$disabled>\n";
+ echo "</div>\n";
- <div>
- <label for="capacity"><?php echo get_vocab("capacity") ?>:</label>
- <input type="text" id="capacity" name="capacity" value="<?php echo
$row["capacity"]; ?>">
- </div>
+ // Capacity
+ echo "<div>\n";
+ echo "<label for=\"capacity\">" . get_vocab("capacity") . ":</label>\n";
+ echo "<input type=\"text\" id=\"capacity\" name=\"capacity\" value=\"" .
$row["capacity"] . "\"$disabled>\n";
+ echo "</div>\n";
- <div>
- <label for="room_admin_email"><?php echo get_vocab("room_admin_email")
?>:</label>
- <input type="text" id="room_admin_email" name="room_admin_email"
maxlength="75" value="<?php echo htmlspecialchars($row["room_admin_email"]);
?>">
- </div>
+ // Room admin email
+ echo "<div>\n";
+ echo "<label for=\"room_admin_email\">" . get_vocab("room_admin_email")
. ":</label>\n";
+ echo "<input type=\"text\" id=\"room_admin_email\"
name=\"room_admin_email\" maxlength=\"75\" value=\"" .
htmlspecialchars($row["room_admin_email"]) . "\"$disabled>\n";
+ echo "</div>\n";
- <fieldset class="submit_buttons">
- <legend></legend>
- <div id="edit_area_room_submit_back">
- <input class="submit" type="submit" name="change_done" value="<?php
echo get_vocab("backadmin") ?>">
- </div>
- <div id="edit_area_room_submit_save">
- <input class="submit" type="submit" name="change_room" value="<?php
echo get_vocab("change") ?>">
- </div>
- </fieldset>
-
+ // Submit and Back buttons (Submit only if they're an admin)
+ echo "<fieldset class=\"submit_buttons\">\n";
+ echo "<legend></legend>\n";
+ echo "<div id=\"edit_area_room_submit_back\">\n";
+ echo "<input class=\"submit\" type=\"submit\" name=\"change_done\"
value=\"" . get_vocab("backadmin") . "\">\n";
+ echo "</div>\n";
+ if ($is_admin)
+ {
+ echo "<div id=\"edit_area_room_submit_save\">\n";
+ echo "<input class=\"submit\" type=\"submit\" name=\"change_room\"
value=\"" . get_vocab("change") . "\">\n";
+ echo "</div>\n";
+ }
+ echo "</fieldset>\n";
+
+ ?>
</fieldset>
</form>
@@ -369,6 +400,13 @@
// THE AREA FORM
if (!empty($area))
{
+ // Only admins can see this form
+ if (!$is_admin)
+ {
+ showAccessDenied($day, $month, $year, $area, "");
+ exit();
+ }
+ // Get the details for this area
$res = sql_query("SELECT * FROM $tbl_area WHERE id=$area LIMIT 1");
if (! $res)
{
Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc 2010-03-16 21:00:08 UTC (rev 1304)
+++ mrbs/trunk/web/functions.inc 2010-03-17 09:27:24 UTC (rev 1305)
@@ -665,7 +665,7 @@
$out_html = "
<form id=\"areaChangeForm\" method=\"get\" action=\"$link\">
<div>
- <select name=\"area\" onchange=\"this.form.submit()\">";
+ <select class=\"room_area_select\" id=\"area_select\" name=\"area\"
onchange=\"this.form.submit()\">";
$sql = "select id, area_name from $tbl_area order by area_name";
$res = sql_query($sql);
@@ -698,7 +698,7 @@
$out_html = "
<form id=\"roomChangeForm\" method=\"get\" action=\"$link\">
<div>
- <select name=\"room\" onchange=\"this.form.submit()\">";
+ <select class=\"room_area_select\" name=\"room\"
onchange=\"this.form.submit()\">";
$sql = "select id, room_name from $tbl_room where area_id=$area order by
sort_key";
$res = sql_query($sql);
@@ -1346,13 +1346,13 @@
if( $enable_periods )
{
echo "<a class=\"new_booking\" href=\"edit_entry.php?" .
$query_strings['new_periods'] . "\">\n";
- echo "<img src=\"new.gif\" alt=\"New\" width=\"10\"
height=\"10\">\n";
+ echo "<img src=\"images/new.gif\" alt=\"New\" width=\"10\"
height=\"10\">\n";
echo "</a>\n";
}
else
{
echo "<a class=\"new_booking\" href=\"edit_entry.php?" .
$query_strings['new_times'] . "\">\n";
- echo "<img src=\"new.gif\" alt=\"New\" width=\"10\"
height=\"10\">\n";
+ echo "<img src=\"images/new.gif\" alt=\"New\" width=\"10\"
height=\"10\">\n";
echo "</a>\n";
}
Added: mrbs/trunk/web/images/delete.png
===================================================================
(Binary files differ)
Property changes on: mrbs/trunk/web/images/delete.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: mrbs/trunk/web/images/edit.png
===================================================================
(Binary files differ)
Property changes on: mrbs/trunk/web/images/edit.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: mrbs/trunk/web/images/new.gif
===================================================================
(Binary files differ)
Property changes on: mrbs/trunk/web/images/new.gif
___________________________________________________________________
Added: svn:mime-type
+ image/gif
Modified: mrbs/trunk/web/lang.en
===================================================================
--- mrbs/trunk/web/lang.en 2010-03-16 21:00:08 UTC (rev 1304)
+++ mrbs/trunk/web/lang.en 2010-03-17 09:27:24 UTC (rev 1305)
@@ -280,15 +280,16 @@
$vocab["addroom"] = "Add Room";
$vocab["capacity"] = "Capacity";
$vocab["norooms"] = "No rooms have been defined.";
-$vocab["administration"] = "Administration";
+$vocab["administration"] = "Room Details";
$vocab["invalid_area_name"] = "This area name has already been used!";
// Used in edit_area_room.php
$vocab["editarea"] = "Edit Area";
$vocab["change"] = "Change";
-$vocab["backadmin"] = "Back to Admin";
+$vocab["backadmin"] = "Back to Rooms";
$vocab["editroomarea"] = "Edit Area or Room Description";
$vocab["editroom"] = "Edit Room";
+$vocab["viewroom"] = "View Room";
$vocab["update_room_failed"] = "Update room failed: ";
$vocab["error_room"] = "Error: room ";
$vocab["not_found"] = " not found";
Modified: mrbs/trunk/web/month.php
===================================================================
--- mrbs/trunk/web/month.php 2010-03-16 21:00:08 UTC (rev 1304)
+++ mrbs/trunk/web/month.php 2010-03-17 09:27:24 UTC (rev 1305)
@@ -550,13 +550,13 @@
if ($enable_periods)
{
echo "<a class=\"new_booking\"
href=\"edit_entry.php?room=$room&area=$area&period=0&year=$year&month=$month&day=$cday\">\n";
- echo "<img src=\"new.gif\" alt=\"New\" width=\"10\" height=\"10\">\n";
+ echo "<img src=\"images/new.gif\" alt=\"New\" width=\"10\"
height=\"10\">\n";
echo "</a>\n";
}
else
{
echo "<a class=\"new_booking\"
href=\"edit_entry.php?room=$room&area=$area&hour=$morningstarts&minute=0&year=$year&month=$month&day=$cday\">\n";
- echo "<img src=\"new.gif\" alt=\"New\" width=\"10\" height=\"10\">\n";
+ echo "<img src=\"images/new.gif\" alt=\"New\" width=\"10\"
height=\"10\">\n";
echo "</a>\n";
}
if ($javascript_cursor)
Modified: mrbs/trunk/web/mrbs-ie8.css
===================================================================
--- mrbs/trunk/web/mrbs-ie8.css 2010-03-16 21:00:08 UTC (rev 1304)
+++ mrbs/trunk/web/mrbs-ie8.css 2010-03-17 09:27:24 UTC (rev 1305)
@@ -2,8 +2,6 @@
/* Fixes for Internet Explorer 8 */
-/* ------------ ADMIN.PHP ---------------------------*/
-.form_admin fieldset {padding-top: 0}
/* ------------ FORM_GENERAL ------------------------*/
/* Even though no max-height is set, IE8 will clip content */
Modified: mrbs/trunk/web/mrbs-ielte7.css.php
===================================================================
--- mrbs/trunk/web/mrbs-ielte7.css.php 2010-03-16 21:00:08 UTC (rev 1304)
+++ mrbs/trunk/web/mrbs-ielte7.css.php 2010-03-17 09:27:24 UTC (rev 1305)
@@ -12,6 +12,13 @@
/* Fixes for Internet Explorer 7 and less */
+/* ------------ ADMIN.PHP ---------------------------*/
+<?php
+// Alignment slightly different in IE7 and below
+?>
+#areaChangeForm button {margin-top: -0.1em}
+
+
/* ------------ DAY/WEEK/MONTH.PHP ------------------*/
<?php
Modified: mrbs/trunk/web/mrbs.css.php
===================================================================
--- mrbs/trunk/web/mrbs.css.php 2010-03-16 21:00:08 UTC (rev 1304)
+++ mrbs/trunk/web/mrbs.css.php 2010-03-17 09:27:24 UTC (rev 1305)
@@ -31,6 +31,8 @@
h1 {font-size: x-large}
h2 {font-size: large}
+img {border: 0}
+
a:link {color: <?php echo $anchor_link_color ?>; text-decoration: none;
font-weight: bold}
a:visited {color: <?php echo $anchor_visited_color ?>; text-decoration: none;
font-weight: bold}
a:hover {color: <?php echo $anchor_hover_color ?>; text-decoration:
underline; font-weight: bold}
@@ -43,32 +45,32 @@
legend {font-weight: bold; font-size: large;
font-family: <?php echo $standard_font_family ?>;
color: <?php echo $standard_font_color ?>}
-fieldset {margin: 0; padding: 0; border: 0}
+fieldset {margin: 0; padding: 0; border: 0;
+ border-radius: 8px;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px}
fieldset.admin {width: 100%; padding: 0 1.0em 1.0em 1.0em;
- border: 1px solid <?php echo $admin_table_header_back_color ?>}
+ border: 1px solid <?php echo $admin_table_border_color ?>}
fieldset fieldset {position: relative; clear: left; width: 100%; padding: 0;
border: 0; margin: 0} /* inner fieldsets are invisible */
fieldset fieldset legend {font-size: 0} /* for IE: even if there is no
legend text, IE allocates space */
-
table.admin_table {border-spacing: 0px; border-collapse: collapse;
border-color: <?php echo $admin_table_header_back_color ?>; border-style: solid;
border-top-width: 0; border-right-width: 1px; border-bottom-width: 1px;
border-left-width: 0}
+.admin_table th, .admin_table td {padding: 0.1em 0.5em 0.1em 0.5em;
vertical-align: middle; text-align: left;
+ border-top-width: 1px; border-right-width: 0; border-bottom-width: 0;
border-left-width: 1px; border-style: solid;
+ border-top-color: <?php echo $admin_table_header_back_color ?>}
.admin_table th {color: <?php echo $admin_table_header_font_color ?>;
font-size: small;
background-color: <?php echo $admin_table_header_back_color ?>;
- padding: 0.1em 0.5em 0.1em 0.5em;
- border-top-width: 1px; border-right-width: 0; border-bottom-width: 0;
border-left-width: 1px; border-style: solid;
- border-top-color: <?php echo $admin_table_header_back_color ?>;
border-left-color: <?php echo $admin_table_header_sep_color ?>;
- vertical-align: middle; text-align: left}
+ border-left-color: <?php echo $admin_table_header_sep_color ?>}
.admin_table th:first-child {border-left-color: <?php echo
$admin_table_header_back_color ?>}
-.admin_table td {padding: 0.1em 0.5em 0.1em 0.5em;
- border-top-width: 1px; border-right-width: 0; border-bottom-width: 0;
border-left-width: 1px; border-style: solid;
- border-top-color: <?php echo $admin_table_header_back_color ?>;
border-left-color: <?php echo $admin_table_header_back_color ?>;
- vertical-align: middle}
+.admin_table td {border-left-color: <?php echo $admin_table_header_back_color
?>;}
.naked {margin: 0; padding: 0; border-width: 0} /* Invisible tables used for
internal needs */
table.naked {width: 100%; height: 100%}
table:hover.naked {cursor: pointer} /* set cursor to pointer; if you don't
it doesn't show up when show_plus_link is false */
+select.room_area_select {margin-right: 0.5em}
/* ------------ ADMIN.PHP ---------------------------*/
<?php
@@ -77,14 +79,11 @@
$admin_form_label_width = '7.0'; // em
$admin_form_gap = '1.0'; // em
$admin_form_input_width = '10.5'; // em (Also used in
edit_area_room.php)
-$admin_form_overheads = '1.0'; // em (fudge factor)
-$admin_form_width = $admin_form_label_width + $admin_form_gap +
$admin_form_input_width + $admin_form_overheads;
-$admin_form_width = number_format($admin_form_width, 1, '.', '');
// get rid of any commas
+
?>
-table#admin {margin-bottom: 1.0em}
-#admin th {text-align: center}
-#admin td {padding: 0.5em; vertical-align: top}
-.form_admin fieldset {border: 0; padding-top: 1.0em; width: <?php echo
$admin_form_width ?>em} /* width necessary for Safari */
+form.form_admin {float: left; clear: left; margin: 2em 0 0 0}
+.form_admin fieldset {float: left; width: auto; border: 1px solid <?php echo
$admin_table_border_color ?>; padding: 1em}
+.form_admin legend {font-size: small}
.form_admin div {float: left; clear: left}
.form_admin label {
display: block; float: left; clear: left;
@@ -99,8 +98,38 @@
.form_admin input.submit {
width: auto; margin-top: 1.2em; margin-left: <?php echo
number_format(($admin_form_gap + $admin_form_label_width), 1, '.', '')?>em
}
+.admin h2 {clear: left}
+div#area_form, div#room_form {float: left; margin: 0 0 2em 1em}
+#area_form form {float: left; margin-right: 1em}
+#area_form label#area_label {display: block; float: left; font-weight: bold;
margin-right: <?php echo $admin_form_gap ?>em}
+#areaChangeForm select {display: block; float: left; margin: -0.1em 1.5em 0 0}
+#areaChangeForm input {float: left; margin: -0.2em 0.5em 0 0}
+#areaChangeForm button {display: block; float: left; margin: -0.2em 0.5em 0
0.5em;
+ background-color: transparent; border: 0; padding: 0}
+#areaChangeForm button img {vertical-align: middle}
+div#header_column, div#body_columns {float: left}
+#room_info table {border-spacing: 0px; border-collapse: collapse;
border-color: <?php echo $admin_table_border_color ?>; border-style: solid;
+ border-top-width: 0; border-right-width: 1px; border-bottom-width: 1px;
border-left-width: 0}
+#room_info th div, #room_info td div {display: table-cell; vertical-align:
middle; white-space: nowrap; overflow: hidden}
+#room_info th div {height: 1.5em; max-height: 1.5em; min-height: 1.5em}
+#room_info td div {height: 2em; max-height: 2em; min-height: 2em}
+#room_info td.int div {width: 6em; text-align: right; padding-right: 0.5em}
+
+tr.even_row {background-color: <?php echo $row_even_color ?>}
+tr.odd_row {background-color: <?php echo $row_odd_color ?>}
+#room_info th, #room_info td {vertical-align: middle; text-align: left;
+ padding: 0.1em 0.5em 0.1em 0.5em;
+ border-top-width: 0; border-right-width: 0; border-bottom-width: 0;
border-left-width: 1px; border-style: solid;}
+#room_info th {color: <?php echo $admin_table_header_font_color ?>;
+ background-color: <?php echo $admin_table_header_back_color ?>;
+ }
+#room_info td, #room_info th {border-color: <?php echo
$admin_table_border_color ?>}
+#room_info #header_column th:first-child {border-left-color: <?php echo
$admin_table_header_back_color ?>}
+
+
+
/* ------------ DAY/WEEK/MONTH.PHP ------------------*/
<?php
@@ -179,7 +208,7 @@
.dwm_main#month_main a {height: 100%; width: 100%; padding: 0 2px 0 2px}
a.new_booking {display: block; font-size: medium; text-align: center}
-.new_booking img {margin: auto; border: 0; padding: 4px 0 2px 0}
+.new_booking img {margin: auto; padding: 4px 0 2px 0}
<?php
if (!$show_plus_link)
{
@@ -625,7 +654,6 @@
#banner td:first-child {border-left-width: 0}
#banner td#company {font-size: large}
#banner #company div {width: 100%}
-#banner #company img {border: 0}
#banner a:link {color: <?php echo $anchor_link_color_banner ?>;
text-decoration: none; font-weight: normal}
#banner a:visited {color: <?php echo $anchor_visited_color_banner ?>;
text-decoration: none; font-weight: normal}
#banner a:hover {color: <?php echo $anchor_hover_color_banner ?>;
text-decoration:underline; font-weight: normal}
Deleted: mrbs/trunk/web/new.gif
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits