Revision: 2267
http://mrbs.svn.sourceforge.net/mrbs/?rev=2267&view=rev
Author: cimorrison
Date: 2012-01-28 12:49:09 +0000 (Sat, 28 Jan 2012)
Log Message:
-----------
Improved error handling for LOCATION property
Modified Paths:
--------------
mrbs/trunk/web/import.php
mrbs/trunk/web/lang.en
Modified: mrbs/trunk/web/import.php
===================================================================
--- mrbs/trunk/web/import.php 2012-01-27 21:48:05 UTC (rev 2266)
+++ mrbs/trunk/web/import.php 2012-01-28 12:49:09 UTC (rev 2267)
@@ -5,6 +5,7 @@
require_once "functions_ical.inc";
require_once "mrbs_sql.inc";
+
function get_room_id($location)
{
global $area_room_order, $area_room_delimiter, $area_room_create;
@@ -195,7 +196,7 @@
break;
case 'LOCATION':
$booking['room_id'] = get_room_id($details['value']);
- if (empty($booking['room_id']))
+ if ($booking['room_id'] === FALSE)
{
$problems[] = get_vocab("could_not_find_room") . "
'${details['value']}'";
}
@@ -239,6 +240,12 @@
case 'SEQUENCE':
$booking['ical_sequence'] = $details['value'];
break;
+ case 'LAST-MODIFIED':
+ // We probably ought to do something with LAST-MODIFIED and use it
+ // for the timestamp field
+ break;
+ default:
+ break;
}
}
@@ -264,6 +271,13 @@
$booking['sequence'] = 0; // and we'll start the sequence from 0
}
+ if (!isset($booking['room_id']))
+ {
+ // LOCATION is optional in RFC 5545 but is obviously mandatory in MRBS.
+ // We could maybe have a default room pon the form and use that
+ $problems[] = get_vocab("no_LOCATION");
+ }
+
if (empty($problems))
{
// Get the area settings for this room, if we haven't got them already
Modified: mrbs/trunk/web/lang.en
===================================================================
--- mrbs/trunk/web/lang.en 2012-01-27 21:48:05 UTC (rev 2266)
+++ mrbs/trunk/web/lang.en 2012-01-28 12:49:09 UTC (rev 2267)
@@ -448,6 +448,7 @@
$vocab["could_not_create_room"] = "Could not create room";
$vocab["could_not_find_room"] = "Could not find room";
$vocab["could_not_import"] = "Could not import";
+$vocab["no_LOCATION"] = "The VEVENT did not include a LOCATION
property";
$vocab["invalid_RRULE"] = "Invalid RRULE: missing FREQ part";
$vocab["more_than_one_BYDAY"] = "MRBS does not support more than one
BYDAY value when FREQ=";
$vocab["negative_BYDAY"] = "MRBS does not support negative BYDAY
values";
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits