- Cleanup variable name in address search for compose to clearup confusion.
[squirrelmail.git] / templates / util_addressbook.php
index 92c1b2f..8b582c0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Functions to make working with address books easier
  * 
- * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @copyright © 1999-2009 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -21,7 +21,7 @@
  */
 function composeLink ($row) {
     return makeComposeLink('src/compose.php?send_to=' .
-                           rawurlencode($row['FullAddress']),
+                           rawurlencode($row['RawFullAddress']),
                            htmlspecialchars($row['Email']));
 }
 
@@ -41,16 +41,17 @@ function formatAddressList ($addresses) {
     $contacts = array();
     while(list($undef,$row) = each($addresses)) {
         $contact = array (
-                            'FirstName'     => htmlspecialchars($row['firstname']),
-                            'LastName'      => htmlspecialchars($row['lastname']),
-                            'FullName'      => htmlspecialchars($row['name']),
-                            'NickName'      => htmlspecialchars($row['nickname']),
-                            'Email'         => htmlspecialchars($row['email']),
-                            'FullAddress'   => htmlspecialchars(AddressBook::full_address($row)),
-                            'Info'          => htmlspecialchars($row['label']),
-                            'Extra'         => (isset($row['extra']) ? $row['extra'] : NULL),
-                            'Source'        => htmlspecialchars($row['source']),
-                            'JSEmail'       => htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES),
+                            'FirstName'      => htmlspecialchars($row['firstname']),
+                            'LastName'       => htmlspecialchars($row['lastname']),
+                            'FullName'       => htmlspecialchars($row['name']),
+                            'NickName'       => htmlspecialchars($row['nickname']),
+                            'Email'          => htmlspecialchars($row['email']),
+                            'FullAddress'    => htmlspecialchars(AddressBook::full_address($row)),
+                            'RawFullAddress' => AddressBook::full_address($row),
+                            'Info'           => htmlspecialchars($row['label']),
+                            'Extra'          => (isset($row['extra']) ? $row['extra'] : NULL),
+                            'Source'         => htmlspecialchars($row['source']),
+                            'JSEmail'        => htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES),
                          );
         $contacts[] = $contact;
     }
@@ -122,6 +123,16 @@ function insert_javascript() {
         }
     }
 
+    function CheckAll(ch) {
+        var chkObj = "";
+        for (var i = 0; i < document.addressbook.elements.length; i++) {
+            chkObj = document.addressbook.elements[i];
+            if (chkObj.type == "checkbox" && chkObj.name.substr(0,16) == "send_to_search[" + ch) {
+                chkObj.checked = !(chkObj.checked);
+            }
+        }
+    }
+
 // --></script>
 <?php
 } /* End of included JavaScript */