projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
moved filter update on folder rename/delete to
[squirrelmail.git]
/
src
/
addrbook_search_html.php
diff --git
a/src/addrbook_search_html.php
b/src/addrbook_search_html.php
index a1604e6de2da0a84338d10846d0b471601d7c65f..81cb0bc4ebf2c91ed53db422f61334ff5ca33802 100644
(file)
--- a/
src/addrbook_search_html.php
+++ b/
src/addrbook_search_html.php
@@
-23,6
+23,7
@@
require_once('../functions/smtp.php');
require_once('../functions/display_messages.php');
require_once('../functions/addressbook.php');
require_once('../functions/plugin.php');
require_once('../functions/display_messages.php');
require_once('../functions/addressbook.php');
require_once('../functions/plugin.php');
+require_once('../functions/strings.php');
/* Insert hidden data */
function addr_insert_hidden() {
/* Insert hidden data */
function addr_insert_hidden() {
@@
-30,8
+31,9
@@
function addr_insert_hidden() {
$identity;
echo '<input type=hidden value="';
$identity;
echo '<input type=hidden value="';
- if (substr($body, 0, 1) == "\r")
+ if (substr($body, 0, 1) == "\r")
{
echo "\n";
echo "\n";
+ }
echo htmlspecialchars($body) . '" name=body>' . "\n" .
'<input type=hidden value="' . htmlspecialchars($subject) .
'" name=subject>' . "\n" .
echo htmlspecialchars($body) . '" name=body>' . "\n" .
'<input type=hidden value="' . htmlspecialchars($subject) .
'" name=subject>' . "\n" .
@@
-77,11
+79,11
@@
function addr_display_result($res, $includesource = true) {
if ($line % 2) { echo ' bgcolor="' . $color[0] . '"'; }
echo ' nowrap><td nowrap align=center width="5%">' .
'<input type=checkbox name="send_to_search[T' . $line . ']" value = "' .
if ($line % 2) { echo ' bgcolor="' . $color[0] . '"'; }
echo ' nowrap><td nowrap align=center width="5%">' .
'<input type=checkbox name="send_to_search[T' . $line . ']" value = "' .
- htmlspecialchars($row['email']) . '">
To
' .
+ htmlspecialchars($row['email']) . '">
' . _("To") . '
' .
'<input type=checkbox name="send_to_search[C' . $line . ']" value = "' .
'<input type=checkbox name="send_to_search[C' . $line . ']" value = "' .
- htmlspecialchars($row['email']) . '">
Cc
' .
+ htmlspecialchars($row['email']) . '">
' . _("Cc") . '
' .
'<input type=checkbox name="send_to_search[B' . $line . ']" value = "' .
'<input type=checkbox name="send_to_search[B' . $line . ']" value = "' .
- htmlspecialchars($row['email']) . '">
Bcc
' .
+ htmlspecialchars($row['email']) . '">
' . _("Bcc") . '
' .
'</td><td nowrap> ' . $row['name'] . ' </td>' .
'<td nowrap> ' . $row['email'] . ' </td>' .
'<td nowrap> ' . $row['label'] . ' </td>';
'</td><td nowrap> ' . $row['name'] . ' </td>' .
'<td nowrap> ' . $row['email'] . ' </td>' .
'<td nowrap> ' . $row['label'] . ' </td>';
@@
-103,15
+105,19
@@
function addr_display_result($res, $includesource = true) {
/* --- End functions --- */
global $mailbox;
/* --- End functions --- */
global $mailbox;
-displayPageHeader($color, $mailbox);
-
+if ($compose_new_win == '1') {
+ compose_Header($color, $mailbox);
+}
+else {
+ displayPageHeader($color, $mailbox);
+}
/* Initialize addressbook */
$abook = addressbook_init();
?>
<br>
/* Initialize addressbook */
$abook = addressbook_init();
?>
<br>
-<table width=
95%
align=center cellpadding=2 cellspacing=2 border=0>
+<table width=
"95%"
align=center cellpadding=2 cellspacing=2 border=0>
<tr><td bgcolor="<?php echo $color[0] ?>">
<center><b><?php echo _("Address Book Search") ?></b></center>
</td></tr></table>
<tr><td bgcolor="<?php echo $color[0] ?>">
<center><b><?php echo _("Address Book Search") ?></b></center>
</td></tr></table>
@@
-156,7
+162,12
@@
do_hook('addrbook_html_search_below');
/* End search form */
/* Show personal addressbook */
/* End search form */
/* Show personal addressbook */
-if ($addrquery == '' || !empty($listall)) {
+
+if ( !empty( $listall ) ){
+ $addrquery = '*';
+}
+
+if ($addrquery == '' && empty($listall)) {
if (! isset($backend) || $backend != -1 || $addrquery == '') {
if ($addrquery == '') {
if (! isset($backend) || $backend != -1 || $addrquery == '') {
if ($addrquery == '') {
@@
-168,6
+179,7
@@
if ($addrquery == '' || !empty($listall)) {
$res = $abook->list_addr($backend);
if (is_array($res)) {
$res = $abook->list_addr($backend);
if (is_array($res)) {
+ usort($res,'alistcmp');
addr_display_result($res, false);
} else {
echo '<P ALIGN=center><STRONG>' .
addr_display_result($res, false);
} else {
echo '<P ALIGN=center><STRONG>' .
@@
-178,14
+190,15
@@
if ($addrquery == '' || !empty($listall)) {
} else {
$res = $abook->list_addr();
} else {
$res = $abook->list_addr();
+ usort($res,'alistcmp');
addr_display_result($res, true);
}
exit;
addr_display_result($res, true);
}
exit;
-
-
}
else {
+}
+else {
/* Do the search */
/* Do the search */
- if (!empty($addrquery)
&& empty($listall)
) {
+ if (!empty($addrquery)) {
if ($backend == -1) {
$res = $abook->s_search($addrquery);
if ($backend == -1) {
$res = $abook->s_search($addrquery);