From 6f675c8c86a49b88679bd6e588a5740ecd6d5e3e Mon Sep 17 00:00:00 2001 From: jengo Date: Sun, 12 Nov 2000 11:35:51 +0000 Subject: [PATCH] Added the date preferences into the addressbook, added special formating to view, fixed date preference not working in todo list, and fixed the target of accounts->array_to_string($access,$n_groups); } + + if ($url == "http://") { + $url = ""; + } if ($phpgw_info["apps"]["timetrack"]["enabled"]) { $sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email," diff --git a/addressbook/edit.php b/addressbook/edit.php index 499108d165..b2440e70c2 100755 --- a/addressbook/edit.php +++ b/addressbook/edit.php @@ -59,6 +59,10 @@ form("","edit.php","Edit",$fields); } else { + if ($url == "http://") { + $url = ""; + } + if (! $bday_month && ! $bday_day && ! $bday_year) { $bday = ""; } else { diff --git a/addressbook/inc/functions.inc.php b/addressbook/inc/functions.inc.php index 3b40612388..a85e877c7a 100755 --- a/addressbook/inc/functions.inc.php +++ b/addressbook/inc/functions.inc.php @@ -13,14 +13,14 @@ /* $Id$ */ // NOTE: This entire file needs to be rewritten. There is a great deal of code not being used - // anymore. (jengo) + // anymore. This should also be converted to templates while where at it (jengo) $abc = array('company' => 'company', // AddressBook Columns and their descriptions 'firstname' => 'first name', 'lastname' => 'last name', 'email' => 'email', 'wphone' => 'work phone', - 'hphone' => 'home phone', + 'hphone' => 'home phone', 'fax' => 'fax', 'pager' => 'pager', 'mphone' => 'mobile phone', @@ -76,7 +76,7 @@ $city = ""; $state = ""; $zip = ""; - $url = ""; + //$url = ""; if($phpgw_info["apps"]["timetrack"]["enabled"]) { $company = '" - . "" - . "" - . "" - . "" - . "" - . "" - . "" - . "" - . "" - . "" - . "" - . "" - . "" - . "" - . "" - . "" - . "(e.g. 1969)"; + $bday_month = "" +; + $bday_day = '' +; + $bday_year = ''; } else { - $bday ="" - . "" - . "" - . "(e.g. 1969)"; + $bday_month = "" +; + $bday_day = '' +; + $bday_year = '' +; } - $notes = ""; + $notes = ''; } else { $notes = "
"; @@ -203,9 +206,12 @@ : - - - + "> @@ -254,9 +260,11 @@ : - - - + common->dateformatorder($bday_year,$bday_month,$bday_day) + . '(e.g. 1969)'; + ?> + : diff --git a/addressbook/index.php b/addressbook/index.php index 0ffeb924bc..57d6344339 100755 --- a/addressbook/index.php +++ b/addressbook/index.php @@ -185,16 +185,19 @@ // Some fields require special formating. if ($column[0] == "url") { + if (! ereg("^http://",$field)) { + $data = "http://" . $field; + } echo '' . '
' . $field. ' '; } else if ($column[0] == "email") { if ($phpgw_info["user"]["apps"]["email"]) { echo '' . '' . $field . ' '; + "to=" . urlencode($field)) . '" target="_new">' . $field . ' '; } else { echo '' - . '' . $field. ' '; + . '' . $field. ' '; } } else { echo '' diff --git a/addressbook/view.php b/addressbook/view.php index 81f067cf33..c8d7aaf50c 100755 --- a/addressbook/view.php +++ b/addressbook/view.php @@ -19,6 +19,31 @@ $phpgw_info["flags"]["currentapp"] = "addressbook"; 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")); } @@ -58,14 +83,16 @@ if (! $columns_to_display[$i]["field_name"]) break; $columns_html .= "" . lang($columns_to_display[$i]["field_name"]) . ":" - . "" . $columns_to_display[$i]["field_value"] . ""; + . "" . checkfor_specialformat($columns_to_display[$i]["field_name"],$columns_to_display[$i]["field_value"]) + . ""; $i++; if (! $columns_to_display[$i]["field_name"]) break; - $columns_html .= "" . lang($columns_to_display[$i]["field_name"]) . ":" - . "" . $columns_to_display[$i]["field_value"]; + $columns_html .= "" . lang($columns_to_display[$i]["field_name"]) . ":" + . "" . checkfor_specialformat($columns_to_display[$i]["field_name"],$columns_to_display[$i]["field_value"]) + . ""; $i++; $columns_html .= "";