Fixed some mistakes.
[squirrelmail.git] / src / addrbook_search_html.php
index e388debd4972c42813bfe39720b81f088005d365..0150e815dbf3de45d693a9db56f81f90c2522bab 100644 (file)
@@ -3,33 +3,37 @@
 /**
  * addrbook_search_html.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Handle addressbook searching with pure html.
  *
  * This file is included from compose.php
  *
- * NOTE: A lot of this code is similar to the code in
- *       addrbook_search.html -- If you change one, change
- *       the other one too!
- *
  * $Id$
  */
 
 /* Path for SquirrelMail required files. */
-define('SM_PATH','../');
+if (! defined('SM_PATH') ) {
+       define('SM_PATH','../');
+}
 
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'include/validate.php');
+require_once(SM_PATH . 'functions/global.php');
 require_once(SM_PATH . 'functions/date.php');
-require_once(SM_PATH . 'functions/smtp.php');
 require_once(SM_PATH . 'functions/display_messages.php');
 require_once(SM_PATH . 'functions/addressbook.php');
 require_once(SM_PATH . 'functions/plugin.php');
 require_once(SM_PATH . 'functions/strings.php');
 require_once(SM_PATH . 'functions/html.php');
 
+sqgetGlobalVar('session',   $session,   SQ_POST);
+sqgetGlobalVar('mailbox',   $mailbox,   SQ_POST);
+sqgetGlobalVar('addrquery', $addrquery, SQ_POST);
+sqgetGlobalVar('listall',   $listall,   SQ_POST);
+sqgetGlobalVar('backend',   $backend,   SQ_POST);
+
 /* Insert hidden data */
 function addr_insert_hidden() {
     global $body, $subject, $send_to, $send_to_cc, $send_to_bcc, $mailbox,
@@ -59,7 +63,7 @@ function addr_insert_hidden() {
 
 /* List search results */
 function addr_display_result($res, $includesource = true) {
-    global $color, $javascript_on, $PHP_SELF;
+    global $color, $javascript_on, $PHP_SELF, $squirrelmail_language;
 
     if (sizeof($res) <= 0) return;
 
@@ -105,6 +109,21 @@ if ($javascript_on) {
         $tr_bgcolor = '';
         $email = AddressBook::full_address($row);
         if ($line % 2) { $tr_bgcolor = $color[0]; }
+        if ($squirrelmail_language == 'ja_JP')
+            {
+        echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .
+        html_tag( 'td',
+             '<input type=checkbox name="send_to_search[T' . $line . ']" value = "' .
+             htmlspecialchars($email) . '">&nbsp;' . _("To") . '&nbsp;' .
+             '<input type=checkbox name="send_to_search[C' . $line . ']" value = "' .
+             htmlspecialchars($email) . '">&nbsp;' . _("Cc") . '&nbsp;' .
+             '<input type=checkbox name="send_to_search[B' . $line . ']" value = "' .
+             htmlspecialchars($email) . '">&nbsp;' . _("Bcc") . '&nbsp;' ,
+        'center', '', 'width="5%" nowrap' ) .
+        html_tag( 'td', '&nbsp;' . htmlspecialchars($row['lastname']) . ' ' . htmlspecialchars($row['firstname']) . '&nbsp;', 'left', '', 'nowrap' ) .
+        html_tag( 'td', '&nbsp;' . htmlspecialchars($row['email']) . '&nbsp;', 'left', '', 'nowrap' ) .
+        html_tag( 'td', '&nbsp;' . htmlspecialchars($row['label']) . '&nbsp;', 'left', '', 'nowrap' );
+            } else {
         echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .
         html_tag( 'td',
              '<input type=checkbox name="send_to_search[T' . $line . ']" value = "' .
@@ -117,6 +136,7 @@ if ($javascript_on) {
         html_tag( 'td', '&nbsp;' . htmlspecialchars($row['name']) . '&nbsp;', 'left', '', 'nowrap' ) .
         html_tag( 'td', '&nbsp;' . htmlspecialchars($row['email']) . '&nbsp;', 'left', '', 'nowrap' ) .
         html_tag( 'td', '&nbsp;' . htmlspecialchars($row['label']) . '&nbsp;', 'left', '', 'nowrap' );
+            }
 
          if ($includesource) {
              echo html_tag( 'td', '&nbsp;' . $row['source'] . '&nbsp;', 'left', '', 'nowrap' );
@@ -138,7 +158,6 @@ if ($javascript_on) {
 
 /* --- End functions --- */
 
-global $mailbox;
 if ($compose_new_win == '1') {
     compose_Header($color, $mailbox);
 }