* * -------------------------------------------- * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ /* $Id$ */ if ($submit || ! $ab_id) { $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); } $phpgw_info["flags"] = array("currentapp" => "addressbook", "enable_contacts_class" => True, "enable_nextmatchs_class" => True); include("../header.inc.php"); #$t = new Template($phpgw_info["server"]["app_tpl"]); $t = new Template($phpgw->common->get_tpl_dir("addressbook")); $t->set_file(array( "view" => "view.tpl")); $this = CreateObject("phpgwapi.contacts"); if (! $ab_id) { Header("Location: " . $phpgw->link("index.php")); } while ($column = each($this->stock_contact_fields)) { if (isset($phpgw_info["user"]["preferences"]["addressbook"][$column[0]]) && $phpgw_info["user"]["preferences"]["addressbook"][$column[0]]) { $columns_to_display[$column[0]] = True; $colname[$column[0]] = $column[1]; } } // merge in what are now extra fields $extrafields = array ("pager" => "pager", "mphone" => "mphone", "ophone" => "ophone", "address2" => "address2", "bday" => "bday", "url" => "url", "notes" => "notes"); $qfields = $this->stock_contact_fields + $extrafields; $fields = $this->read_single_entry($ab_id,$qfields); //$access = $fields[0]["access"]; $owner = $fields[0]["owner"]; $view_header = "
" . lang("Address book - view") . "
"; $view_header .= '
" . lang(display_name($colname[$column[0]])) . ": | "; $ref=$data=""; $coldata = $fields[0][$column[0]]; // Some fields require special formatting. if ($column[0] == "url") { $ref=''; $data=$coldata.''; } elseif ($column[0] == "email") { if ($phpgw_info["user"]["apps"]["email"]) { $ref=''; } else { $ref=''; } $data=$coldata.""; } else { // But these do not $ref=""; $data=$coldata; } $columns_html .= "" . $ref . $data . " | "; } $columns_html .= '||
' . lang("Record owner") . ' | ' . $phpgw->common->grab_owner_name($owner) . ' | ' . lang("Record Access") . ' |