Changeset:
        80052eb62baa
        
https://sourceforge.net/p/mrbs/hg-code/ci/80052eb62baaa8f3f1c08658eeeb7a9dc797fea8
Author:
        Campbell Morrison <[email protected]>
Date:
        Mon Jan 30 17:24:45 2017 +0000
Log message:

Added the ability to recocgnise type information in imported .ics files using 
the X-MRBS-TYPE property.

diffstat:

 web/import.php |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (36 lines):

diff -r 7f9da2c50e55 -r 80052eb62baa web/import.php
--- a/web/import.php    Mon Jan 30 17:04:40 2017 +0000
+++ b/web/import.php    Mon Jan 30 17:24:45 2017 +0000
@@ -239,6 +239,7 @@
 {
   global $import_default_type, $skip;
   global $morningstarts, $morningstarts_minutes, $resolution;
+  global $booking_types;
   
   // We are going to cache the settings ($resolution etc.) for the rooms
   // in order to avoid lots of database lookups
@@ -249,6 +250,7 @@
   $booking['status'] = 0;
   $booking['rep_type'] = REP_NONE;
   $booking['type'] = $import_default_type;
+  
   // Parse all the lines first because we'll need to get the start date
   // for calculating some of the other settings
   $properties = array();
@@ -344,6 +346,16 @@
           $booking['status'] |= STATUS_TENTATIVE;
         }
         break;
+      case 'X-MRBS-TYPE':
+        foreach($booking_types as $type)
+        {
+          if ($details['value'] == get_type_vocab($type))
+          {
+            $booking['type'] = $type;
+            break;
+          }
+        }
+        break;
       case 'UID':
         $booking['ical_uid'] = $details['value'];
         break;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to