diff --git a/addressbook/oldview.php b/addressbook/oldview.php new file mode 100755 index 0000000000..fc9d84970f --- /dev/null +++ b/addressbook/oldview.php @@ -0,0 +1,141 @@ + * + * -------------------------------------------- * + * 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"]["currentapp"] = "addressbook"; + $phpgw_info["flags"]["enable_addressbook_class"] = True; + include("../header.inc.php"); + + function checkfor_specialformat($field,$data) + { + global $phpgw_info, $phpgw; + + if ($field == "email") { + if ($phpgw_info["user"]["apps"]["email"]) { + $s = '' . $data . ''; + } else { + $s = '' . $data . ''; + } + } else if ($field == "URL") { + if (! ereg("^http://",$data)) { + $data = "http://" . $data; + } + $s = '' . $data . ''; + } else if ($field == "birthday") { + $date = explode("/",$data); + $s = $phpgw->common->dateformatorder($date[2],$date[1],$date[0],True); + } else { + $s = $data . " "; + } + return $s; + } + + if (! $ab_id) { + Header("Location: " . $phpgw->link("index.php")); + } + + if ($filter != "private") { + $filtermethod = " or ab_access='public' " . $phpgw->accounts->sql_search("ab_access"); + } + + if ($phpgw_info["apps"]["timetrack"]["enabled"]) { + $phpgw->db->query("SELECT * FROM addressbook as a, customers as c WHERE a.ab_company_id = c.company_id " + . "AND ab_id=$ab_id AND (ab_owner='" + . $phpgw_info["user"]["account_id"] . "' $filtermethod)"); + } else { + $phpgw->db->query("SELECT * FROM addressbook WHERE ab_id=$ab_id AND (ab_owner='" + . $phpgw_info["user"]["account_id"] . "' $filtermethod)"); + } + $phpgw->db->next_record(); + + echo "

 " . lang("Address book - view") . "


"; + + $i = 0; + while ($column = each($abc)) { + if ($phpgw->db->f("ab_" . $column[0])) { + $columns_to_display[$i]["field_name"] = $column[1]; + $columns_to_display[$i]["field_value"] = $phpgw->db->f("ab_" . $column[0]); + $i++; + } + } + + if ($phpgw->db->f("ab_notes")) { + $columns_to_display[$i]["field_name"] = "Notes"; + $columns_to_display[$i]["field_value"] = $phpgw->db->f("ab_notes"); + } + + echo ''; + for ($i=0;$i<200;) { // The $i<200 is only used for a brake + if (! $columns_to_display[$i]["field_name"]) break; + + $columns_html .= "" + . ""; + + $i++; + + if (! $columns_to_display[$i]["field_name"]) break; + + $columns_html .= "" + . ""; + + $i++; + $columns_html .= ""; + } + $access = $phpgw->db->f("ab_access"); + $owner = $phpgw->db->f("ab_owner"); + $ab_id = $phpgw->db->f("ab_id"); + + echo $columns_html . ''; + echo "
" . lang($columns_to_display[$i]["field_name"]) . ":" . checkfor_specialformat($columns_to_display[$i]["field_name"],$columns_to_display[$i]["field_value"]) + . "
" . lang($columns_to_display[$i]["field_name"]) . ":" . checkfor_specialformat($columns_to_display[$i]["field_name"],$columns_to_display[$i]["field_value"]) + . "
 
" . lang("Record owner") . "" + . $phpgw->common->grab_owner_name($owner) . "" + . lang("Record Access") . ""; + + if ($access != "private" && $access != "public") { + echo lang("Group access") . " - " . $phpgw->accounts->convert_string_to_names_access($access); + } else { + echo $access; + } + + echo "
"; +?> + + + + + + + +
+ common->check_owner($owner,"edit.php","Edit","ab_id=$ab_id"); + ?> + +
" method="post" name="Vcardform"> + +
+
+
" method="post" name="Doneform"> + +
+
+ +common->phpgw_footer(); +?>