Revision: 1060
http://mrbs.svn.sourceforge.net/mrbs/?rev=1060&view=rev
Author: cimorrison
Date: 2009-03-22 15:22:19 +0000 (Sun, 22 Mar 2009)
Log Message:
-----------
Fixed bug which caused the wrong area settings ($resolution etc) to be used by
edit_entry_handler when there was more than one area.
Modified Paths:
--------------
mrbs/trunk/web/edit_entry.php
mrbs/trunk/web/edit_entry_handler.php
mrbs/trunk/web/functions.inc
Modified: mrbs/trunk/web/edit_entry.php
===================================================================
--- mrbs/trunk/web/edit_entry.php 2009-03-22 11:58:14 UTC (rev 1059)
+++ mrbs/trunk/web/edit_entry.php 2009-03-22 15:22:19 UTC (rev 1060)
@@ -573,7 +573,7 @@
function changeRooms( formObj )
{
- areasObj = eval( "formObj.areas" );
+ areasObj = eval( "formObj.area" );
area = areasObj[areasObj.selectedIndex].value;
roomsObj = eval( "formObj.elements['rooms']" );
@@ -618,8 +618,8 @@
// Create area selector, only if we have Javascript
this.document.writeln("<div id=\"div_areas\">");
- this.document.writeln("<label for=\"areas\"><?php echo
get_vocab("areas") ?>:<\/label>");
- this.document.writeln(" <select id=\"areas\" name=\"areas\"
onchange=\"changeRooms(this.form)\">");
+ this.document.writeln("<label for=\"area\"><?php echo get_vocab("areas")
?>:<\/label>");
+ this.document.writeln(" <select id=\"area\" name=\"area\"
onchange=\"changeRooms(this.form)\">");
<?php
// get list of areas
Modified: mrbs/trunk/web/edit_entry_handler.php
===================================================================
--- mrbs/trunk/web/edit_entry_handler.php 2009-03-22 11:58:14 UTC (rev
1059)
+++ mrbs/trunk/web/edit_entry_handler.php 2009-03-22 15:22:19 UTC (rev
1060)
@@ -41,7 +41,14 @@
if (empty($area))
{
- $area = get_default_area();
+ if (empty($rooms[0]))
+ {
+ $area = get_default_area();
+ }
+ else
+ {
+ $area = get_area($rooms[0]);
+ }
}
// Get the timeslot settings (resolution, etc.) for this area
Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc 2009-03-22 11:58:14 UTC (rev 1059)
+++ mrbs/trunk/web/functions.inc 2009-03-22 15:22:19 UTC (rev 1060)
@@ -539,6 +539,14 @@
return ($room < 0 ? 0 : $room);
}
+// Return an area id for a given room
+function get_area($room)
+{
+ global $tbl_room;
+ $area = sql_query1("SELECT area_id FROM $tbl_room WHERE id=$room LIMIT 1");
+ return ($area < 0 ? 0 : $area);
+}
+
// Update the default timeslot settings with the ones specific to this area
function get_area_settings($area)
{
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits