Revision: 1928
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1928&view=rev
Author:   cimorrison
Date:     2011-09-06 13:07:42 +0000 (Tue, 06 Sep 2011)
Log Message:
-----------
Merged in latest changes from trunk

Modified Paths:
--------------
    mrbs/branches/datatables/web/functions.inc

Property Changed:
----------------
    mrbs/branches/datatables/
    mrbs/branches/datatables/web/upgrade/5/pgsql.sql


Property changes on: mrbs/branches/datatables
___________________________________________________________________
Modified: svn:mergeinfo
   - /mrbs/branches/custom_entry_fields:1374-1396
/mrbs/branches/datepicker:1409-1416
/mrbs/branches/disabled_rooms:1601-1634
/mrbs/branches/from_to_bookings:1491-1587
/mrbs/branches/ics_attachments:1652-1741
/mrbs/branches/improve_css_2008_06:804-872
/mrbs/branches/only_unicode:1747-1749
/mrbs/branches/provisional_bookings:1242-1280
/mrbs/branches/provisional_bookings_new_style:1407-1570
/mrbs/trunk:1863-1925
   + /mrbs/branches/custom_entry_fields:1374-1396
/mrbs/branches/datepicker:1409-1416
/mrbs/branches/disabled_rooms:1601-1634
/mrbs/branches/from_to_bookings:1491-1587
/mrbs/branches/ics_attachments:1652-1741
/mrbs/branches/improve_css_2008_06:804-872
/mrbs/branches/only_unicode:1747-1749
/mrbs/branches/provisional_bookings:1242-1280
/mrbs/branches/provisional_bookings_new_style:1407-1570
/mrbs/trunk:1863-1927

Modified: mrbs/branches/datatables/web/functions.inc
===================================================================
--- mrbs/branches/datatables/web/functions.inc  2011-09-06 13:04:55 UTC (rev 
1927)
+++ mrbs/branches/datatables/web/functions.inc  2011-09-06 13:07:42 UTC (rev 
1928)
@@ -429,13 +429,16 @@
 // $form_id is an optional fifth parameter.   If set it specifies the id of
 // a form to submit when the datepicker is closed.
 //
+// $disabled:  TRUE if the SELECT is to be disabled (Note: hidden inputs will 
be
+// created if the SELECT is disabled)
+//
 // Whether or not JavaScript is enabled the date is passed back in three 
separate
 // variables:  ${prefix}day, ${prefix}month and ${prefix}year
 //
 // The function passes back three separate variables, rather than a single 
date 
 // variable, partly for compatibility with previous implementations of 
genDateSelector()
 // and partly because it's easier to do this for the non-JavaScript version.
-function genDateSelector($prefix, $day, $month, $year, $form_id='')
+function genDateSelector($prefix, $day, $month, $year, $form_id='', 
$disabled=FALSE)
 {
   global $strftime_format, $year_range;
   
@@ -468,14 +471,18 @@
   // datepicker calendar.
   echo "<span id=\"${prefix}dateselector\">\n";
   // the day selector
-  echo "<select name=\"${prefix}day\">\n";
+  echo "<select name=\"${prefix}day\"" . 
+       ($disabled ? " disabled=\"disabled\"" : "") .
+       ">\n"; 
   for ($i = 1; $i <= 31; $i++)
   {
     echo "<option" . ($i == $day ? " selected=\"selected\"" : "") . 
">$i</option>\n";
   }
   echo "</select>\n";
   // the month selector
-  echo "<select name=\"${prefix}month\">\n";
+  echo "<select name=\"${prefix}month\"" . 
+       ($disabled ? " disabled=\"disabled\"" : "") .
+       ">\n"; 
   for ($i = 1; $i <= 12; $i++)
   {
     $m = utf8_strftime($strftime_format['mon'], mktime(0, 0, 0, $i, 1, 
$year));  
@@ -483,12 +490,21 @@
   }
   echo "</select>\n";
   // the year selector
-  echo "<select name=\"${prefix}year\">\n";
+  echo "<select name=\"${prefix}year\"" . 
+       ($disabled ? " disabled=\"disabled\"" : "") .
+       ">\n";
   for ($i = $min; $i <= $max; $i++)
   {
     echo "<option value=\"$i\"" . ($i == $year ? " selected=\"selected\"" : 
"") . ">$i</option>\n";
   }
   echo "</select>\n";
+  // If the select is disabled we'll still pass through the values as hidden 
inputs
+  if ($disabled)
+  {
+    echo "<input type=\"hidden\" name=\"${prefix}day\" value=\"$day\">\n";
+    echo "<input type=\"hidden\" name=\"${prefix}month\" value=\"$month\">\n";
+    echo "<input type=\"hidden\" name=\"${prefix}year\" value=\"$year\">\n";
+  }
   echo "</span>\n";
   
   // Now use JavaScript to overwrite the contents of this span with a 
datepicker calendar
@@ -503,6 +519,10 @@
                                                        {
                                                          echo ", onClose: 
function(dateText, inst) {datepicker_close(dateText, inst, '$form_id');}";
                                                        }
+                                                       if ($disabled)
+                                                       {
+                                                         echo ", disabled: 
true";
+                                                       }
                                                        ?>
                                                       });
     <?php
@@ -522,7 +542,7 @@
   var datepicker_html = '<input class="date" type="text" id="<?php echo 
$datepicker_baseid ?>">\n';
   <?php
   // The next input is disabled because we don't need to pass the value 
through to
-  // the form and we don't want the value cluttering up the URL (it's a GET).
+  // the form and we don't want the value cluttering up the URL (if it's a 
GET).
   // It's just used as a holder for the date in a known format so that it can
   // then be used by datepicker_close() to populate the following three inputs.
   ?>


Property changes on: mrbs/branches/datatables/web/upgrade/5/pgsql.sql
___________________________________________________________________
Modified: svn:mergeinfo
   - /mrbs/branches/custom_entry_fields/web/upgrade/5/pgsql.sql:1374-1396
/mrbs/branches/datepicker/web/upgrade/5/pgsql.sql:1409-1416
/mrbs/branches/disabled_rooms/web/upgrade/5/pgsql.sql:1601-1634
/mrbs/branches/from_to_bookings/web/upgrade/5/pgsql.sql:1491-1587
/mrbs/branches/ics_attachments/web/upgrade/5/pgsql.sql:1652-1741
/mrbs/branches/only_unicode/web/upgrade/5/pgsql.sql:1747-1749
/mrbs/branches/provisional_bookings/web/upgrade/5/pgsql.sql:1242-1280
/mrbs/branches/provisional_bookings_new_style/web/upgrade/5/pgsql.sql:1407-1570
/mrbs/trunk/web/upgrade/5/pgsql.sql:1863-1925
   + /mrbs/branches/custom_entry_fields/web/upgrade/5/pgsql.sql:1374-1396
/mrbs/branches/datepicker/web/upgrade/5/pgsql.sql:1409-1416
/mrbs/branches/disabled_rooms/web/upgrade/5/pgsql.sql:1601-1634
/mrbs/branches/from_to_bookings/web/upgrade/5/pgsql.sql:1491-1587
/mrbs/branches/ics_attachments/web/upgrade/5/pgsql.sql:1652-1741
/mrbs/branches/only_unicode/web/upgrade/5/pgsql.sql:1747-1749
/mrbs/branches/provisional_bookings/web/upgrade/5/pgsql.sql:1242-1280
/mrbs/branches/provisional_bookings_new_style/web/upgrade/5/pgsql.sql:1407-1570
/mrbs/trunk/web/upgrade/5/pgsql.sql:1863-1927

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