public function load() { parent::load(); $model = new SupportCenters(); $scs = $model->getindex(); $this->view->scs = array(); foreach ($this->sc_ids as $sc_id) { $this->view->scs[$sc_id] = $scs[$sc_id][0]; } if (isset($_REQUEST["summary_attrs_showcontact"])) { $this->view->contacts = array(); $cmodel = new SupportCenterContact(); $contacts = $cmodel->getindex(); //group by contact_type_id foreach ($this->sc_ids as $sc_id) { $types = array(); if (isset($contacts[$sc_id])) { foreach ($contacts[$sc_id] as $contact) { if (!isset($types[$contact->contact_type])) { $types[$contact->contact_type] = array(); } $types[$contact->contact_type][] = $contact; } $this->view->contacts[$sc_id] = $types; } } } if (isset($_REQUEST["summary_attrs_showsites"])) { $model = new Site(); $this->view->sites = $model->getgroupby("sc_id"); } }
public function legacyosgwebsiteviewAction() { $vo_ids = $this->process_volist(); header("Content-type: text/html"); echo "<html>\n<head></head>\n<body>\n\n<h3>Virtual Organizations</h3>\n\n<table width=\\'100%\\'>\n <tr><th align=left>VO Name</th><th align=left>Primary URL</th></tr>\n"; $model = new VirtualOrganization(); $vos = $model->getindex(); $scmodel = new SupportCenters(); $scs = $scmodel->getindex(); foreach ($vo_ids as $vo_id) { $vo = $vos[$vo_id][0]; $long_name = $vo->long_name; $name = $vo->name; $primary_url = $vo->primary_url; echo " <tr><td>{$long_name} ({$name})</td><td><a href=\"{$primary_url}\">{$primary_url}</a></td></tr>\n"; } echo "</table>\n\n</body>"; $this->render("none", null, true); }
private function apply_sort(&$ids) { global $sort_info, $sort_reverse; //pull user query $sort_key = "name"; if (isset($_REQUEST["sort_key"])) { $sort_key = $_REQUEST["sort_key"]; } $sort_reverse = false; if (isset($_REQUEST["sort_reverse"])) { $sort_reverse = true; } $sort_info = array(); switch ($sort_key) { case "name": $model = new VirtualOrganization(); foreach ($model->getindex() as $id => $vo) { $vo[0]->header = $vo[0]->name; $sort_info[$id] = strtoupper($vo[0]->name); } break; case "long_name": $model = new VirtualOrganization(); foreach ($model->getindex() as $id => $vo) { $vo[0]->header = $vo[0]->long_name; $sort_info[$id] = strtoupper($vo[0]->long_name); } break; case "sc": $scmodel = new SupportCenters(); $scs = $scmodel->getindex(); $model = new VirtualOrganization(); foreach ($model->getindex() as $id => $vo) { $vo[0]->header = $scs[$vo[0]->sc_id][0]->name; $sort_info[$id] = strtoupper($scs[$vo[0]->sc_id][0]->name); } break; default: elog("Unknown sort_key given for mysort: VoController: " . $sort_key); } usort($ids, "mysort"); }