diff --git a/addressbook/inc/functions.inc.php b/addressbook/inc/functions.inc.php index 63d28760d7..e083d8294f 100755 --- a/addressbook/inc/functions.inc.php +++ b/addressbook/inc/functions.inc.php @@ -12,31 +12,49 @@ /* $Id$ */ + $abc = array('company' => 'company', // AddressBook Columns and their descriptions + 'firstname' => 'first name', + 'lastname' => 'last name', + 'email' => 'email', + 'wphone' => 'work phone', + 'hphone' => 'home phone', + 'fax' => 'fax', + 'pager' => 'pager', + 'mphone' => 'mobile phone', + 'ophone' => 'other phone', + 'street' => 'street', + 'city' => 'city', + 'state' => 'state', + 'zip' => 'zip code', + 'bday' => 'birthday', + 'url' => 'URL' + ); + function form($format,$action,$title,$fields) { global $phpgw; global $phpgw_info; - $email = $fields["email"]; - $firstname = $fields["firstname"]; - $lastname = $fields["lastname"]; - $title = $fields["title"]; - $hphone = $fields["hphone"]; - $wphone = $fields["wphone"]; - $fax = $fields["fax"]; - $pager = $fields["pager"]; - $mphone = $fields["mphone"]; - $ophone = $fields["ophone"]; - $street = $fields["street"]; - $address2 = $fields["address2"]; - $city = $fields["city"]; - $state = $fields["state"]; - $zip = $fields["zip"]; - $bday = $fields["bday"]; - $notes = $fields["notes"]; - $access = $fields["access"]; - $ab_company = $fields["company"]; - $company_id = $fields["company_id"]; + $email = $fields["email"]; + $firstname = $fields["firstname"]; + $lastname = $fields["lastname"]; + $title = $fields["title"]; + $hphone = $fields["hphone"]; + $wphone = $fields["wphone"]; + $fax = $fields["fax"]; + $pager = $fields["pager"]; + $mphone = $fields["mphone"]; + $ophone = $fields["ophone"]; + $street = $fields["street"]; + $address2 = $fields["address2"]; + $city = $fields["city"]; + $state = $fields["state"]; + $zip = $fields["zip"]; + $bday = $fields["bday"]; + $notes = $fields["notes"]; + $access = $fields["access"]; + $ab_company = $fields["company"]; + $company_id = $fields["company_id"]; $company_name = $fields["company_name"]; if ($format != "view") { diff --git a/addressbook/index.php b/addressbook/index.php index af5d88b3dd..efbf002feb 100755 --- a/addressbook/index.php +++ b/addressbook/index.php @@ -52,7 +52,7 @@ . "%$query%' OR a.ab_firstname like '%$query%' OR a.ab_email like '%$query%' OR " . "a.ab_street like '%$query%' OR a.ab_city like '%$query%' OR a.ab_state " . "like '%$query%' OR a.ab_zip like '%$query%' OR a.ab_notes like " - . "'%$query%' OR c.company_name like '%$query%')"); + . "'%$query%' OR c.company_name like '%$query%' OR a.ab_url like '%$query%')"); // . "'%$query%' OR c.company_name like '%$query%')" // . " $ordermethod limit $limit"); } else { @@ -62,7 +62,7 @@ . "%$query%' OR ab_firstname like '%$query%' OR ab_email like '%$query%' OR " . "ab_street like '%$query%' OR ab_city like '%$query%' OR ab_state " . "like '%$query%' OR ab_zip like '%$query%' OR ab_notes like " - . "'%$query%' OR ab_company like '%$query%')"); + . "'%$query%' OR ab_company like '%$query%' OR ab_url like '%$query$%')"); // . "'%$query%' OR ab_company like '%$query%')" // . " $ordermethod limit $limit"); } @@ -100,39 +100,17 @@
'; - echo ''; - echo $phpgw->nextmatchs->show_sort_order($sort,"ab_lastname",$order,"index.php", - lang("Last Name")); - echo ' | '; - } - if ($phpgw_info["user"]["preferences"]["addressbook"]["firstname"]) { - echo ''; - echo ''; - echo $phpgw->nextmatchs->show_sort_order($sort,"ab_firstname",$order,"index.php", - lang("First Name")); - echo ' | '; - } - if ($phpgw_info["user"]["preferences"]["addressbook"]["email"]) { - echo ''; - echo ''; - echo $phpgw->nextmatchs->show_sort_order($sort,"ab_email",$order,"index.php", - lang("Email")); - echo ' | '; - } - if ($phpgw_info["user"]["preferences"]["addressbook"]["wphone"]) { - echo ''; - echo ''; - echo $phpgw->nextmatchs->show_sort_order($sort,"ab_wphone",$order,"index.php", - lang("Work Phone")); - echo ' | '; + while ($column = each($abc)) { + if ($phpgw_info["user"]["preferences"]["addressbook"][$column[0]]) { + echo ''; + echo ''; + echo $phpgw->nextmatchs->show_sort_order($sort,"ab_" . $column[0],$order,"index.php",lang($column[1])); + echo ' | '; + echo "\n"; + + // To be used when displaying the rows + $columns_to_display[$column[0]] = True; + } } ?> @@ -149,97 +127,80 @@|||||||||
' + . '' . $field. ' | '; + } else if ($column[0] == "email") { + if ($phpgw_info["user"]["apps"]["email"]) { + echo '' + . '' . $field . ' | '; + } else { + echo '' + . '' . $field. ' | '; + } + } else { + echo '' + . $field . ' | '; + } + } - $wphone = $phpgw->db->f("ab_wphone"); - $ab_id = $phpgw->db->f("ab_id"); - - if ($firstname == "") $firstname = " "; - if ($lastname == "") $lastname = " "; - if ($email == "") $email = " "; - if ($company == "") $company = " "; - if ($wphone == "") $wphone = " "; - ?> - '; - if ($phpgw_info["user"]["preferences"]["addressbook"]["company"]) { - echo ''; - echo ''; - echo $company; - echo ' | '; - }; - if ($phpgw_info["user"]["preferences"]["addressbook"]["lastname"]) { - echo ''; - echo ''; - echo $lastname; - echo ' | '; - }; - if ($phpgw_info["user"]["preferences"]["addressbook"]["firstname"]) { - echo ''; - echo ''; - echo $firstname; - echo ' | '; - }; - if ($phpgw_info["user"]["preferences"]["addressbook"]["email"]) { - echo ''; - echo ''; - echo '' . $email . ''; - echo ' | '; - }; - if ($phpgw_info["user"]["preferences"]["addressbook"]["wphone"]) { - echo ''; - echo ''; - echo $wphone; - echo ' | '; - }; - ?> -+ | ||||
' . $descr . ' | '; - if ($i ==3) { + if ($i == 3) { echo "|||||||||||||
"; + } + if ($i == 2) { + echo " | "; + } echo " | ||||||||||||
No table changes were needed. The script only updated your version setting. | \n";