Have different 'resolution' for different areas
Brought to you by:
jberanek
MRBS currently has one global 'resolution' value which
is the minimum amount of booking slot time and also
controls how the day and week views are shown (i.e. the
duration the table elements represent).
In our usage of MRBS we need to vary the resolution
value and the easiest way to do this is by area.
(Varying the resolution by room would require changing
the day and week views as multiple rooms are displayed
in one table on these pages).
Logged In: YES
user_id=718847
I've made the following changes (to my test system) and they
seem to work:
the
existing records. The default should match the current
resolution value:
ALTER TABLE mrbs_area ADD COLUMN resolution INT NOT NULL
DEFAULT 1800;
the
mrbs_area table:
if( $enable_periods ) {
:
:
} else {
$sql = "SELECT resolution FROM $tbl_area WHERE id =
$area";
$res = sql_query($sql);
$row = sql_row($res, 0);
$resolution = $row[0];
}
if( $enable_periods ) {
:
:
} else {
$sql = "SELECT resolution FROM $tbl_area WHERE id =
$area";
$res = sql_query($sql);
$row = sql_row($res, 0);
$resolution = $row[0];
}
$vocab["resolution"] = "Booking Length (mins)";
(admin.php):
(add.php):
$sql = "insert into $tbl_area (area_name, resolution) values
('$area_name_q', $area_resolution * 60)";
for new
entries in rooms for the area (edit_entry.php):
$duration = ($enable_periods ? 60 : 60 * 60);
WHERE
$tbl_room.area_id = $tbl_area.id AND $tbl_room.id =
$room_id";
$res = sql_query($sql);
$row = sql_row($res, 0);
$duration = ($enable_periods ? 60 : $row[0]);
this from the
database (edit_entry_handler.php):
if( $enable_periods ) {
:
:
} else {
$sql = "SELECT resolution FROM $tbl_area WHERE id =
$areas";
$res = sql_query($sql);
$row = sql_row($res, 0);
$resolution = $row[0];
}
This has now been implemented in MRBS