warning if slice does not allow reservations
smbaker [Tue, 27 Nov 2012 03:17:23 +0000 (19:17 -0800)]
apps/gacksadmin/user_add_reservation.php

index f20bc97..71b3fd0 100644 (file)
@@ -58,9 +58,20 @@ if ($account_name != NULL) {
 }\r
 
 if ($account == NULL) {
+    $details->end();
+    $details->form_end();
     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"])) {
+    $details->end();
+    $details->form_end();
+    $link = href(l_gacks_service_level($account_name), "upgrade");
+    print <<< EOF
+<br><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);
 
@@ -159,13 +170,10 @@ if ($account == NULL) {
 
         $table->end();
     }
-    //$details->tr_submit("submit1","Submit Reservation");
-    //$details->space();
+    $details->end();
+    $details->form_end();
 }
 
-$details->end();
-$details->form_end();
-
 print "Current server time is " . date("Y-m-d h:i:s", time() + $timezone_seconds) . ", timezone offset seconds " . $timezone_seconds;
 
 include 'plc_footer.php';