Revision: 2674
https://sourceforge.net/p/mrbs/code/2674/
Author: cimorrison
Date: 2013-02-01 21:12:36 +0000 (Fri, 01 Feb 2013)
Log Message:
-----------
Merged in latest changes from the trunk
Modified Paths:
--------------
mrbs/branches/linked_bookings/web/edit_entry.php
mrbs/branches/linked_bookings/web/edit_entry_handler.php
mrbs/branches/linked_bookings/web/lang/lang.en
Property Changed:
----------------
mrbs/branches/linked_bookings/
Index: mrbs/branches/linked_bookings
===================================================================
--- mrbs/branches/linked_bookings 2013-02-01 21:05:42 UTC (rev 2673)
+++ mrbs/branches/linked_bookings 2013-02-01 21:12:36 UTC (rev 2674)
Property changes on: mrbs/branches/linked_bookings
___________________________________________________________________
Modified: svn:mergeinfo
## -12,4 +12,4 ##
/mrbs/branches/only_unicode:1747-1749
/mrbs/branches/provisional_bookings:1242-1280
/mrbs/branches/provisional_bookings_new_style:1407-1570
-/mrbs/trunk:2599-2671
+/mrbs/trunk:2599-2673
\ No newline at end of property
Modified: mrbs/branches/linked_bookings/web/edit_entry.php
===================================================================
--- mrbs/branches/linked_bookings/web/edit_entry.php 2013-02-01 21:05:42 UTC
(rev 2673)
+++ mrbs/branches/linked_bookings/web/edit_entry.php 2013-02-01 21:12:36 UTC
(rev 2674)
@@ -460,6 +460,7 @@
'force_assoc' => TRUE,
'value' => $selected_rooms,
'multiple' => $multiroom_allowed,
+ 'mandatory' => TRUE,
'disabled' => $disabled,
'attributes' => array('size="5"'));
generate_select($params);
Modified: mrbs/branches/linked_bookings/web/edit_entry_handler.php
===================================================================
--- mrbs/branches/linked_bookings/web/edit_entry_handler.php 2013-02-01
21:05:42 UTC (rev 2673)
+++ mrbs/branches/linked_bookings/web/edit_entry_handler.php 2013-02-01
21:12:36 UTC (rev 2674)
@@ -6,6 +6,18 @@
require_once "functions_ical.inc";
+function invalid_booking($message)
+{
+ global $day, $month, $year, $area, $room;
+
+ print_header($day, $month, $year, $area, isset($room) ? $room : "");
+ echo "<h1>" . get_vocab('invalid_booking') . "</h1>\n";
+ echo "<p>$message</p>\n";
+ // Print footer and exit
+ print_footer(TRUE);
+}
+
+
// (1) Check the user is authorised for this page
// ---------------------------------------------
checkAuthorised();
@@ -136,27 +148,17 @@
{
if ($name == '')
{
- print_header($day, $month, $year, $area, isset($room) ? $room : "");
- ?>
- <h1><?php echo get_vocab('invalid_booking'); ?></h1>
- <p>
- <?php echo get_vocab('must_set_description'); ?>
- </p>
- <?php
- // Print footer and exit
- print_footer(TRUE);
+ invalid_booking(get_vocab('must_set_description'));
}
+ if (empty($rooms))
+ {
+ invalid_booking(get_vocab('no_rooms_selected'));
+ }
if (($rep_type == REP_WEEKLY) && ($rep_num_weeks < 1))
{
- print_header($day, $month, $year, $area, isset($room) ? $room : "");
- echo "<h1>" . get_vocab('invalid_booking') . "</h1>\n";
- echo "<p>\n";
- echo get_vocab('you_have_not_entered') . " " .
get_vocab("useful_n-weekly_value");
- echo "</p>\n";
- // Print footer and exit
- print_footer(TRUE);
+ invalid_booking(get_vocab('you_have_not_entered') . " " .
get_vocab("useful_n-weekly_value"));
}
@@ -167,16 +169,8 @@
$field = preg_replace('/^entry\./', '', $field);
if ($value && array_key_exists($field, $custom_fields) &&
($custom_fields[$field] === ''))
{
- print_header($day, $month, $year, $area, isset($room) ? $room : "");
- ?>
- <h1><?php echo get_vocab('invalid_booking'); ?></h1>
- <p>
- <?php echo get_vocab('missing_mandatory_field')." \"".
- get_loc_field_name($tbl_entry, $field)."\""; ?>
- </p>
- <?php
- // Print footer and exit
- print_footer(TRUE);
+ invalid_booking(get_vocab('missing_mandatory_field') . ' "' .
+ get_loc_field_name($tbl_entry, $field) . '"');
}
}
}
Modified: mrbs/branches/linked_bookings/web/lang/lang.en
===================================================================
--- mrbs/branches/linked_bookings/web/lang/lang.en 2013-02-01 21:05:42 UTC
(rev 2673)
+++ mrbs/branches/linked_bookings/web/lang/lang.en 2013-02-01 21:12:36 UTC
(rev 2674)
@@ -163,6 +163,7 @@
$vocab["failed_to_acquire"] = "Failed to acquire exclusive database access";
$vocab["invalid_booking"] = "Invalid booking";
$vocab["must_set_description"] = "You must set a brief description for the
booking. Please go back and enter one.";
+$vocab["no_rooms_selected"] = "You must select a room.";
$vocab["mail_subject_approved"] = "Entry approved for $mrbs_company MRBS";
$vocab["mail_subject_rejected"] = "Entry rejected for $mrbs_company MRBS";
$vocab["mail_subject_more_info"] = "$mrbs_company MRBS: more information
requested";
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits