Changeset:
        ccbec44d3779
        
https://sourceforge.net/p/mrbs/hg-code/ci/ccbec44d3779b0ca60f8971f96f962c050f369ad
Author:
        Campbell Morrison <[email protected]>
Date:
        Thu Jul 07 15:57:02 2016 +0100
Log message:

Removed the type field from the booking form if there are fewer than two types. 
 (The default type is used for the booking when writing to the database).

diffstat:

 web/edit_entry.php         |  6 ++++++
 web/edit_entry_handler.php |  4 ++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diffs (30 lines):

diff -r 90b350b0b3b9 -r ccbec44d3779 web/edit_entry.php
--- a/web/edit_entry.php        Wed Jul 06 18:38:22 2016 +0100
+++ b/web/edit_entry.php        Thu Jul 07 15:57:02 2016 +0100
@@ -466,6 +466,12 @@
 {
   global $booking_types, $type, $is_mandatory_field;
   
+  // Don't bother with types if there's only one of them (or even none)
+  if (count($booking_types) < 2)
+  {
+    return;
+  }
+  
   echo "<div id=\"div_type\">\n";
   
   $params = array('label'       => get_vocab("type") . ":",
diff -r 90b350b0b3b9 -r ccbec44d3779 web/edit_entry_handler.php
--- a/web/edit_entry_handler.php        Wed Jul 06 18:38:22 2016 +0100
+++ b/web/edit_entry_handler.php        Thu Jul 07 15:57:02 2016 +0100
@@ -195,6 +195,10 @@
   }        
 }
 
+if (!isset($type))
+{
+  $type = $default_type;
+}
 
 if (isset($month_relative_ord) && isset($month_relative_day))
 {

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to