Enabled user selection of address format when adding from address book during message...
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 1 Oct 2007 20:11:00 +0000 (20:11 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 1 Oct 2007 20:11:00 +0000 (20:11 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12719 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/addressbook.php
include/load_prefs.php
include/options/compose.php

index d7bc837..02bdeed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -220,6 +220,8 @@ Version 1.5.2 - SVN
   - Added "preselected" query argument to mailbox list.
   - Make the Message Details plugin actually show the correct entity when
     viewing details of attached messages.
+  - Enabled user selection of address format when adding from address
+    book during message composition.
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------
index 3408c83..086e078 100644 (file)
@@ -485,15 +485,14 @@ class AddressBook {
      * @return string email address with real name prepended
      */
     function full_address($row) {
-        global $addrsrch_fullname, $data_dir, $username;
-        $prefix = getPref($data_dir, $username, 'addrsrch_fullname');
-        if (($prefix != "" || (isset($addrsrch_fullname) &&
-            $prefix == $addrsrch_fullname)) && $prefix != 'noprefix') {
-            $name = ($prefix == 'nickname' ? $row['nickname'] : $row['name']);
-            return $name . ' <' . trim($row['email']) . '>';
-        } else {
+        global $data_dir, $username;
+        $addrsrch_fullname = getPref($data_dir, $username, 'addrsrch_fullname');
+        if ($addrsrch_fullname == 'fullname')
+            return $row['name'] . ' <' . trim($row['email']) . '>';
+        else if ($addrsrch_fullname == 'nickname')
+            return $row['nickname'] . ' <' . trim($row['email']) . '>';
+        else // "noprefix"
             return trim($row['email']);
-        }
     }
 
     /**
index 2774b7c..5cc6974 100644 (file)
@@ -256,6 +256,9 @@ $collapse_folders =
 $show_html_default =
    getPref($data_dir, $username, 'show_html_default', SMPREF_ON);
 
+$addrsrch_fullname =
+   getPref($data_dir, $username, 'addrsrch_fullname', SMPREF_ON);
+
 $enable_forward_as_attachment =
    getPref($data_dir, $username, 'enable_forward_as_attachment', SMPREF_ON);
 
index 1b6ce41..dbc53c4 100644 (file)
@@ -71,11 +71,22 @@ function load_optpage_data_compose() {
 
     $optvals[SMOPT_GRP_COMPOSE][] = array(
         'name'    => 'use_javascript_addr_book',
-        'caption' => _("Addressbook Display Format"),
+        'caption' => _("Address Book Display Format"),
         'type'    => SMOPT_TYPE_STRLIST,
         'refresh' => SMOPT_REFRESH_NONE,
-        'posvals' => array('1' => _("Javascript"),
-                           '0' => _("HTML"))
+        'posvals' => array('1' => _("Pop-up window"),
+                           '0' => _("In-page"))
+    );
+
+
+    $optvals[SMOPT_GRP_COMPOSE][] = array(
+        'name'    => 'addrsrch_fullname',
+        'caption' => _("Format of Addresses Added From Address Book"),
+        'type'    => SMOPT_TYPE_STRLIST,
+        'refresh' => SMOPT_REFRESH_NONE,
+        'posvals' => array('noprefix' => _("No prefix/Address only"),
+                           'nickname' => _("Nickname and address"),
+                           'fullname' => _("Full name and address"))
     );