Revision: 1923
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1923&view=rev
Author:   cimorrison
Date:     2011-09-05 15:57:24 +0000 (Mon, 05 Sep 2011)
Log Message:
-----------
Added a Back button to the edit_entry page

Modified Paths:
--------------
    mrbs/trunk/web/edit_entry.php
    mrbs/trunk/web/edit_entry_handler.php
    mrbs/trunk/web/mrbs-ielte6.css
    mrbs/trunk/web/mrbs.css.php

Modified: mrbs/trunk/web/edit_entry.php
===================================================================
--- mrbs/trunk/web/edit_entry.php       2011-09-02 13:32:48 UTC (rev 1922)
+++ mrbs/trunk/web/edit_entry.php       2011-09-05 15:57:24 UTC (rev 1923)
@@ -515,7 +515,7 @@
 ?>
 
 // do a little form verifying
-function validate(form)
+function validate(form_id)
 {
   <?php
   // First of all check that a name (brief description) has been entered.
@@ -523,6 +523,7 @@
   // being entered via a SELECT box there's no need to do this because there's
   // bound to be a value and the test below will fail on some browsers (eg IE)
   ?>
+  var form = document.getElementById(form_id);
   if (form.name.tagName.toLowerCase() == 'input')
   {
     // null strings and spaces only strings not allowed
@@ -727,7 +728,7 @@
 ?>
 
 
-<form class="form_general" id="main" action="edit_entry_handler.php" 
method="post" onsubmit="return validate(this)">
+<form class="form_general" id="main" action="edit_entry_handler.php" 
method="post">
   <fieldset>
   <legend><?php echo get_vocab($token); ?></legend>
 
@@ -1231,11 +1232,20 @@
       echo "<input type=\"hidden\" name=\"id\" value=\"$id\">\n";
     }
 
+    // Buttons
+    echo "<fieldset class=\"submit_buttons\">\n";
+    echo "<legend></legend>\n";
+    // The Back button
+    echo "<div id=\"edit_entry_submit_back\">\n";
+    echo "<input class=\"submit\" type=\"submit\" name=\"back_button\" 
value=\"" . get_vocab("back") . "\">\n";
+    echo "</div>\n";
+    
     // The Submit button
-    echo "<div id=\"edit_entry_submit\">\n";
-    echo "<input class=\"submit\" type=\"submit\" name=\"save_button\" 
value=\"".
-      get_vocab("save") . "\">\n";
+    echo "<div id=\"edit_entry_submit_save\">\n";
+    echo "<input class=\"submit\" type=\"submit\" name=\"save_button\" 
value=\"" .
+      get_vocab("save") . "\" onclick=\"return validate('main')\">\n";
     echo "</div>\n";
+    echo "</fieldset>";
     ?>
   </fieldset>
 </form>

Modified: mrbs/trunk/web/edit_entry_handler.php
===================================================================
--- mrbs/trunk/web/edit_entry_handler.php       2011-09-02 13:32:48 UTC (rev 
1922)
+++ mrbs/trunk/web/edit_entry_handler.php       2011-09-05 15:57:24 UTC (rev 
1923)
@@ -50,7 +50,8 @@
                   'start_year'        => 'int',
                   'end_day'           => 'int',
                   'end_month'         => 'int',
-                  'end_year'          => 'int');
+                  'end_year'          => 'int',
+                  'back_button'       => 'string');
                   
 foreach($formvars as $var => $var_type)
 {
@@ -155,6 +156,13 @@
   $returl = $returl_base[0];
 }
 
+// BACK:  we didn't really want to be here - send them to the returl
+if (isset($back_button))
+{
+  header("Location: $returl");
+  exit();
+}
+
 // If we haven't been given a sensible date then get out of here and don't 
trey and make a booking
 if (!isset($day) || !isset($month) || !isset($year) || !checkdate($month, 
$day, $year))
 {

Modified: mrbs/trunk/web/mrbs-ielte6.css
===================================================================
--- mrbs/trunk/web/mrbs-ielte6.css      2011-09-02 13:32:48 UTC (rev 1922)
+++ mrbs/trunk/web/mrbs-ielte6.css      2011-09-05 15:57:24 UTC (rev 1923)
@@ -31,6 +31,7 @@
 /* ------------ FORM_GENERAL ------------------------*/
 .form_general input {display: inline}        /* stops IE6 "double margin float 
bug" appearing */
 .form_general input.submit {display: inline} /* stops IE6 "double margin float 
bug" appearing */
+#edit_room fieldset.submit_buttons, #main fieldset.submit_buttons {width: auto}
 
 /* ------------ TRAILER.INC ---------------------*/
 #trailer div.trailer_label {text-align: right}   /* max-width does not work in 
IE6, so this keeps it looking OK */

Modified: mrbs/trunk/web/mrbs.css.php
===================================================================
--- mrbs/trunk/web/mrbs.css.php 2011-09-02 13:32:48 UTC (rev 1922)
+++ mrbs/trunk/web/mrbs.css.php 2011-09-05 15:57:24 UTC (rev 1923)
@@ -585,16 +585,18 @@
 .edit_area_room .form_general #booking_policies input.text {width: 2.0em}
 .form_general input.submit {display: block; width: auto; float: left; clear: 
left; margin-top: 1.0em}
 
-div#edit_entry_submit {width: <?php echo $general_left_col_width ?>%; 
max-width: <?php echo $edit_entry_left_col_max_width ?>em}
 div#report_submit     {width: <?php echo $general_left_col_width ?>%; 
max-width: <?php echo $report_left_col_max_width ?>em}
 div#search_submit     {width: <?php echo $general_left_col_width ?>%; 
max-width: <?php echo $search_left_col_max_width ?>em}
 div#logon_submit      {width: <?php echo $general_left_col_width ?>%; 
max-width: <?php echo $logon_left_col_max_width ?>em}
 div#db_logon_submit   {width: <?php echo $general_left_col_width ?>%; 
max-width: <?php echo $db_logon_left_col_max_width ?>em}
-#edit_entry_submit input, #report_submit input, #search_submit input, 
#logon_submit input, #db_logon_submit input
+#report_submit input, #search_submit input, #logon_submit input, 
#db_logon_submit input
     {position: relative; left: 100%; width: auto}
 div#edit_area_room_submit_back {float: left; width: <?php echo 
$edit_area_room_left_col_width ?>em; max-width: <?php echo 
$edit_area_room_left_col_max_width ?>em}
 div#edit_area_room_submit_save {float: left; clear: none; width: auto}
 #edit_area_room_submit_back input {float: right}
+div#edit_entry_submit_back {float: left; width: <?php echo 
$general_left_col_width ?>em; max-width: <?php echo 
$edit_entry_left_col_max_width ?>em}
+div#edit_entry_submit_save {float: left; clear: none; width: auto}
+#edit_entry_submit_back input {float: right}
 
 .form_general .div_dur_mins input{width: 4.0em}
 .form_general .div_time input {width: 2.0em}

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to