Revision: 1995
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1995&view=rev
Author:   cimorrison
Date:     2011-09-22 09:56:45 +0000 (Thu, 22 Sep 2011)
Log Message:
-----------
Merged in latest changes from the trunk

Modified Paths:
--------------
    mrbs/branches/datatables/web/Themes/default/header.inc
    mrbs/branches/datatables/web/functions.inc
    mrbs/branches/datatables/web/systemdefaults.inc.php

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-1990
   + /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-1994

Modified: mrbs/branches/datatables/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/datatables/web/Themes/default/header.inc      2011-09-22 
09:28:37 UTC (rev 1994)
+++ mrbs/branches/datatables/web/Themes/default/header.inc      2011-09-22 
09:56:45 UTC (rev 1995)
@@ -77,6 +77,7 @@
   global $lang_map_windows, $langs, $server_os;
   global $default_duration_all_day;
   global $select_options;
+  global $ajax_refresh_rate;
   
   $page = basename($PHP_SELF, ".php");
   $user = getUserName();
@@ -541,12 +542,12 @@
           if (result.conflicts.length == 0)
           {
             conflictDiv.text(checkMark).attr('class', 'good').attr;
-            titleText = '<?php echo get_vocab("no_conflicts") ?>';
+            titleText = '<?php echo 
mrbs_entity_decode(get_vocab("no_conflicts")) ?>';
           }
           else
           {
             conflictDiv.text(cross).attr('class', 'bad');
-            titleText = '<?php echo get_vocab("conflict") ?>' + ":  \n\n";
+            titleText = '<?php echo mrbs_entity_decode(get_vocab("conflict")) 
?>' + ":  \n\n";
             for (var i=0; i<result.conflicts.length; i++)
             {
               titleText += '(' + (i+1).toString() + ') ';
@@ -559,12 +560,12 @@
           if (result.rules_broken.length == 0)
           {
             policyDiv.text(checkMark).attr('class', 'good');
-            titleText = '<?php echo get_vocab("no_rules_broken") ?>';
+            titleText = '<?php echo 
mrbs_entity_decode(get_vocab("no_rules_broken")) ?>';
           }
           else
           {
             policyDiv.text(cross).attr('class', 'bad');
-            titleText = '<?php echo get_vocab("rules_broken") ?>' + ":  \n\n";
+            titleText = '<?php echo 
mrbs_entity_decode(get_vocab("rules_broken")) ?>' + ":  \n\n";
             for (var i=0; i<result.rules_broken.length; i++)
             {
               titleText += '(' + (i+1).toString() + ') ' + 
result.rules_broken[i] + "  \n";
@@ -1182,12 +1183,27 @@
           });
       }  
       <?php
-    }
+    }  // foreach
     ?>
 
     checkValidBooking();
+    
     <?php
-  }
+    // Finally set a timer so that the validity of the booking is periodically
+    // checked, in case someone else books that slot before you press Save
+    // (Note the config variable is in seconds, but the setInterval() function
+    // uses milliseconds)
+    if (!empty($ajax_refresh_rate))
+    {
+      ?>
+      window.setInterval(function() {
+        checkValidBooking();
+      }, <?php echo $ajax_refresh_rate * 1000 ?>);
+      <?php
+    }
+
+
+  } // if (function_exists('json_encode'))
   ?>
 
   <?php

Modified: mrbs/branches/datatables/web/functions.inc
===================================================================
--- mrbs/branches/datatables/web/functions.inc  2011-09-22 09:28:37 UTC (rev 
1994)
+++ mrbs/branches/datatables/web/functions.inc  2011-09-22 09:56:45 UTC (rev 
1995)
@@ -885,32 +885,15 @@
 // should be sufficient in most MRBS circumstances.   This could
 // always be extended later to do something more sophisticated if
 // necessary.
-function mrbs_entity_decode($string)
+//
+// Note: the charset defaults to UTF-8.  This is slightly different from the
+// behaviour in the PHP html_entity_decode() function where the default charset
+// was only changed from ISO-8859-1 to UTF-8 in PHP 5.4.0
+function mrbs_entity_decode($string, $quote_style=ENT_COMPAT, $charset = 
'UTF-8')
 {
-  $n_args = func_num_args();
-  if ($n_args > 1)
-  {
-    $quote_style = func_get_arg(1);
-  }
-  if ($n_args > 2)
-  {
-    $charset = func_get_arg(2);
-  }
-  
   if (function_exists('version_compare') && version_compare(PHP_VERSION, 
'5.0.0', 'ge'))
   {
-    switch ($n_args)
-    {
-      case 3:
-        $string = html_entity_decode($string, $quote_style, $charset);
-        break;
-      case 2:
-        $string = html_entity_decode($string, $quote_style);
-        break;
-      default:
-        $string = html_entity_decode($string);
-        break;
-    }  
+    $string = html_entity_decode($string, $quote_style, $charset);
   }
   else
   {

Modified: mrbs/branches/datatables/web/systemdefaults.inc.php
===================================================================
--- mrbs/branches/datatables/web/systemdefaults.inc.php 2011-09-22 09:28:37 UTC 
(rev 1994)
+++ mrbs/branches/datatables/web/systemdefaults.inc.php 2011-09-22 09:56:45 UTC 
(rev 1995)
@@ -294,6 +294,10 @@
 // Page refresh time (in seconds). Set to 0 to disable
 $refresh_rate = 0;
 
+// Refresh rate (in seconds) for Ajax checking of valid bookings on the 
edit_entry page
+// Set to 0 to disable
+$ajax_refresh_rate = 10;
+
 // Trailer type.   FALSE gives a trailer complete with links to days, weeks 
and months before
 // and after the current date.    TRUE gives a simpler trailer that just has 
links to the
 // current day, week and month.


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-1990
   + /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-1994

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


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to