early warning on reservation page if user lacks reservation capability
smbaker [Thu, 22 Nov 2012 03:19:32 +0000 (19:19 -0800)]
apps/gacksadmin/user_reservations.php

index 9d07c8f..55b478c 100644 (file)
@@ -27,7 +27,7 @@ $timezone_seconds = $timezone_offset_minutes * 60;
 
 // Print header
 require_once 'plc_drupal.php';
-drupal_set_title('Gacks Reservations');
+drupal_set_title('Reservations');
 include 'plc_header.php';
 
 $gacksapi = new GACKSAPI();
@@ -52,6 +52,14 @@ if ($account == NULL) {
     if ($account_name != NULL) {\r
         print "Oops. We had an error retrieving the account details for $account_name.";\r
     }
+} else if (!array_key_exists("calendar", $account["reservable"])) {
+    $link = href(l_gacks_service_level($account_name), "upgrade");
+    print <<< EOF
+<P>The service level of $account_name does not permit reservations.
+To add reservation capabality, please $link the account to a higher service level.
+</P>
+EOF;
+
 } else {
     $account_hrn = slice_to_hrn($account_name);