hrefs in account summary screen
smbaker [Tue, 20 Nov 2012 00:52:47 +0000 (16:52 -0800)]
apps/gacksadmin/gacks_functions.php

index a8906eb..6afca78 100644 (file)
@@ -29,13 +29,13 @@ function l_gacks_all_invoices ()   { return l_gacks_invoice(NULL, NULL, STATE_IN
 function l_gacks_weekly ($y=NULL, $m=NULL, $d=NULL)         { return "/db/gacks/weekly.php?invoiceyear=$y&invoicemonth=$m&invoiceday=$d"; }
 function l_gacks_node_status ()    { return "/db/gacks/nodestatus.php"; }
 function l_gacks_wizard ()         { return "/db/gacks/wizard.php"; }
-function l_gacks_nodelist ()         { return "/db/gacks/user_nodelist.php"; }
+function l_gacks_nodelist ($account_name=NULL)         { return "/db/gacks/user_nodelist.php?account_name=$account_name"; }
 function l_gacks_nodelist_download ($acctname) { return "/db/gacks/action.php?action=download-nodelist&account_name=$acctname&format=CSV"; }
 function l_gacks_image ()         { return "/db/gacks/user_image.php"; }
 function l_gacks_user_reservations() { return "/db/gacks/user_reservations.php"; }
 function l_gacks_edit($item)       { return "/db/gacks/edit.php"; }
 function l_gacks_delete($item)     { $timeStart=$item['timeStart']; $timeStop=$item['timeStop']; $id=$item['id']; $lastAllocator=end($item['allocatorHRNs']); return "/db/gacks/action.php?action=delete-reservation&timeStart=$timeStart&timeStop=$timeStop&resource_id=$id&lastAllocator=$lastAllocator"; }
-function l_gacks_service_level()   { return "/db/gacks/user_service_level.php"; }
+function l_gacks_service_level($account_name=NULL)   { return "/db/gacks/user_service_level.php?account_name=$account_name"; }
 function l_gacks_confirm_service($acct, $level, $autoRenew, $enableBestEffort) { return "/db/gacks/user_confirm_service.php?account_name=$acct&level=$level&autoRenew=$autoRenew&enableBestEffort=$enableBestEffort"; }
 function l_gacks_add_reservation() { return "/db/gacks/user_add_reservation.php"; }
 function l_gacks_persons()         { return "/db/gacks/user_persons.php"; }
@@ -453,7 +453,14 @@ function update_gacks_session($updated_session)
 function get_account_name($api, $_person_id, $form=NULL, $url=NULL)
 {
     $session = get_gacks_session();
-    $account_name = $session['account_name'];
+
+    $account_name = $_GET['account_name'];
+    if (!$account_name) {
+        $account_name = $_POST['account_name'];
+    }
+    if (!$account_name) {
+        $account_name = $session['account_name'];
+    }
 
 // this would be if we want to do it like how plc does loging...
 //    if ($account_name == NULL) {
@@ -600,12 +607,12 @@ function account_table($plcapi, $gacksapi, $person_id)
     foreach ($accounts as $name => $account) {
         $slice = $slices[$name];
         $table->row_start();
-        $table->cell($name);
-        $table->cell($account["level"]);
-        $table->cell(bool_text(!$account["freezeUnreserved"], "enabled", "disabled"));
+        $table->cell(href(l_gacks_service_level($name), $name));
+        $table->cell(href(l_gacks_service_level($name), $account["level"]));
+        $table->cell(href(l_gacks_service_level($name), bool_text(!$account["freezeUnreserved"], "enabled", "disabled")));
         $table->cell(count($slice["person_ids"]));
-        $table->cell(count($slice["node_ids"]));
-        $table->cell($account["billingContacts"]);
+        $table->cell(href(l_gacks_nodelist($name), count($slice["node_ids"])));
+        $table->cell(href(l_gacks_service_level($name), $account["billingContacts"]));
 
         $table->row_end();
     }