From 74d54f6c6e9428af6851688cfa7d6e4237882742 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Mon, 19 Feb 2001 13:16:07 +0000 Subject: [PATCH] Fix selection and display of extra fields in prefs and index --- addressbook/inc/functions.inc.php | 2 +- addressbook/index.php | 16 ++++++++++++++-- addressbook/preferences.php | 14 +++++++------- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/addressbook/inc/functions.inc.php b/addressbook/inc/functions.inc.php index 3366f200e6..f0fd650925 100755 --- a/addressbook/inc/functions.inc.php +++ b/addressbook/inc/functions.inc.php @@ -81,7 +81,7 @@ "d_email_work" => "", //yn "d_email_home" => "", //yn "bday" => "birthday", - "url" => "URL", + "url" => "url", //"access" => "access" ); diff --git a/addressbook/index.php b/addressbook/index.php index dfd24d7623..357d38d1c7 100755 --- a/addressbook/index.php +++ b/addressbook/index.php @@ -28,9 +28,19 @@ "addressbook_footer" => "footer.tpl" )); $this = CreateObject("phpgwapi.contacts"); + $extrafields = array( + "pager" => "pager", + "mphone" => "mphone", + "ophone" => "ophone", + "address2" => "address2", + "bday" => "bday", + "url" => "url", + "notes" => "notes" + ); + $qfields = $this->stock_contact_fields + $extrafields; // create column list and the top row of the table based on user prefs - while ($column = each($this->stock_contact_fields)) { + while ($column = each($qfields)) { if (isset($phpgw_info["user"]["preferences"]["addressbook"][$column[1]]) && $phpgw_info["user"]["preferences"]["addressbook"][$column[1]]) { $showcol = display_name($column[0]); @@ -57,7 +67,9 @@ // following sets up the filter for read, then restores the filter string for later checking if ($filter == "none") { $filter = ""; } $savefilter = $filter; - if ($filter != "" ) { $filter = "access=$filter"; } + // Set filter to display entries where tid is blank, else they may be accounts, etc. + if ($filter != "" ) { $filter = "tid="; } + //if ($filter != "" ) { $filter = "access=$filter"; } $qfilter = $filter; $filter = $savefilter; diff --git a/addressbook/preferences.php b/addressbook/preferences.php index 71e630edc2..5acf72df93 100644 --- a/addressbook/preferences.php +++ b/addressbook/preferences.php @@ -23,13 +23,13 @@ $this = CreateObject("phpgwapi.contacts"); $extrafields = array( - "pager" => "pager", - "mphone" => "mphone", - "ophone" => "ophone", + "pager" => "pager", + "mphone" => "mphone", + "ophone" => "ophone", "address2" => "address2", - "bday" => "bday", - "url" => "url", - "notes" => "notes" + "bday" => "bday", + "url" => "url", + "notes" => "notes" ); $qfields = $this->stock_contact_fields + $extrafields; @@ -40,7 +40,7 @@ } if (! $totalerrors) { $phpgw->preferences->read_repository(); - while (list($pref[0]) = each($this->stock_contact_fields)) { + while (list($pref[0]) = each($qfields)) { if ($ab_selected["$pref[0]"]) { $phpgw->preferences->change("addressbook",$pref[0],"addressbook_" . $ab_selected["$pref[0]"]); } else {