updated html address book
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 5 May 2000 00:40:00 +0000 (00:40 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 5 May 2000 00:40:00 +0000 (00:40 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@495 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/addrbook_search_html.php
src/compose.php

index 5ef9a06edb3a92e36402a190f2289e6190639f84..1809f6f7f7b98f953fc96ed34c76eae65911f201 100644 (file)
    displayPageHeader($color, "None");
    //<form method=post action="compose.php?html_addr_search=true">
 
+   
+   $body = stripslashes($body);
+   $send_to = stripslashes($send_to);
+   $send_to_cc = stripslashes($send_to_cc);
+   $send_to_bcc = stripslashes($send_to_bcc);
+   $subject = stripslashes($subject);
+
    echo "<center>";
-   echo "<form method=post action=\"addrbook_search_html.php\">";
+   echo "<form method=post action=\"compose.php?html_addr_search=true\">";
    echo "   <input type=text value=\"$query\"name=query>";
    echo "   <input type=submit value=Submit>";
+   echo "   <input type=hidden value=\"$body\" name=body>";
+   echo "   <input type=hidden value=\"$subject\" name=subject>";
+   echo "   <input type=hidden value=\"$send_to\" name=send_to>";
+   echo "   <input type=hidden value=\"$send_to_cc\" name=send_to_cc>";
+   echo "   <input type=hidden value=\"$send_to_bcc\" name=send_to_bcc>";
    echo "</form>";
    echo "</center>";
 
+   echo "<tt>".nl2br($body)."</tt>";
+
    if(!empty($query)) {
       $abook = addressbook_init();
       $res = $abook->s_search($query);
              "&nbsp;%s</tr>\n",
              _("Name"), _("E-mail"), _("Info"), _("Source"));
 
+      ?> 
+         <form method=post action"compose.php?html_addr_search_done=true"> 
+      <?
+   echo "   <input type=hidden value=\"$body\" name=body>";
+   echo "   <input type=hidden value=\"$subject\" name=subject>";
+   echo "   <input type=hidden value=\"$send_to\" name=send_to>";
+   echo "   <input type=hidden value=\"$send_to_cc\" name=send_to_cc>";
+   echo "   <input type=hidden value=\"$send_to_bcc\" name=send_to_bcc>";
+      
       while(list($key, $row) = each($res)) {
          printf("<tr%s nowrap><td nowrap align=center width=\"5%%\">".
-                "<a href=\"compose.php?send_to=%s\">To</A> | ".
-                "<a href=\"compose.php?send_to_cc=%s\">Cc</A>".
+                "<input type=checkbox name=send_to_search[] value=\"%s\">&nbsp;To".
+                "<input type=checkbox name=send_to_cc_search[] value=\"%s\">&nbsp;Cc&nbsp;".
                 "<td nowrap>&nbsp;%s&nbsp;<td nowrap>&nbsp;".
-                "<a href=\"compose.php?send_to=%s\">%s</A>&nbsp;".
+                "<a href=\"compose.php?send_to_search=%s\">%s</A>&nbsp;".
                 "<td nowrap>&nbsp;%s&nbsp;<td nowrap>&nbsp;%s</tr>\n",
                 ($line % 2) ? " bgcolor=\"$color[0]\"" : "", $row["email"],
                 $row["email"], $row["name"], $row["email"], $row["email"],
          $line++;
       }
       print "</TABLE>";
+      echo "<input type=hidden value=1 name=html_addr_search_done>";
+      echo "<center><input type=submit value=addr_search_done name=\"Use Addresses\"></center>";
+      echo "</form>";
    }
 
 ?>
index 9b6472958e5de644939ed9ee23523a0b92a7e4c0..8a67bac689618247127585de46bbbd8cbe7e2263 100644 (file)
          echo "         &nbsp;&nbsp;<TEXTAREA NAME=body ROWS=20 COLS=\"$editor_size\" WRAP=HARD>".$body."</TEXTAREA><BR>\n";
       echo "      </TD>\n";
       echo "   </TR>\n";
-      echo "   <TR><TD COLSPAN=2 ALIGN=CENTER><INPUT TYPE=SUBMIT NAME=send VALUE=\"";
+      echo "   <TR><TD COLSPAN=3 ALIGN=CENTER><INPUT TYPE=SUBMIT NAME=send VALUE=\"";
       echo _("Send");
       echo "\"></TD></TR>\n";
       
       echo "   <tr>\n";
       echo "     <TD WIDTH=50 BGCOLOR=\"$color[0]\" VALIGN=TOP ALIGN=RIGHT>\n";
       echo "      <SMALL><BR></SMALL>"._("Attach:");
-      echo "      </td><td width=% ALIGN=left BGCOLOR=\"$color[0]\">\n";
+      echo "      </td><td width=% colspan=2 ALIGN=left BGCOLOR=\"$color[0]\">\n";
       //      echo "      <INPUT TYPE=\"hidden\" name=\"MAX_FILE_SIZE\"\n";
       //      echo "      value=\"10000\">\n";
       echo "      <INPUT NAME=\"attachfile\" TYPE=\"file\">\n";
       if (isset($attachments) && count($attachments)>0) {
          echo "</tr><tr><td width=50 bgcolor=\"$color[0]\" align=right>\n";
          echo "&nbsp;";
-         echo "</td><td width=% align=left bgcolor=\"$color[0]\">";
+         echo "</td><td width=% align=left colspan=2 bgcolor=\"$color[0]\">";
          while (list($localname, $remotename) = each($attachments)) {
             echo "<input type=\"checkbox\" name=\"delete[]\" value=\"$localname\">\n";
             echo "$remotename <input type=\"hidden\" name=\"attachments[$localname]\" value=\"$remotename\"><br>\n";
 
 
 
-
-
-
    if(isset($send)) {
       if (checkInput(false)) {
          sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body);
          
          showInputForm();
       }
-   } else if ($html_addr_search) {
-      //* I am using an include so as to elminiate an extra unnecessary click.  If you
-      //* can think of a better way, please implement it.
-      include ("addrbook_search_html.php");
    } else if ($html_addr_search_done) {
       echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
       $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
       $send_to_bcc = stripslashes($send_to_bcc);
       $subject = stripslashes($subject);
       
+      for ($i=0; $i < count($send_to_search); $i++) {
+         if ($send_to)
+            $send_to .= ", ";
+         $send_to .= $send_to_search[$i];   
+      }
+      
+      for ($i=0; $i < count($send_to_cc_search); $i++) {
+         if ($send_to_cc)
+            $send_to_cc .= ", ";
+         $send_to_cc .= $send_to_cc_search[$i];   
+      }
+      
       showInputForm();
+   } else if ($html_addr_search) {
+      //* I am using an include so as to elminiate an extra unnecessary click.  If you
+      //* can think of a better way, please implement it.
+      include ("addrbook_search_html.php");
    } else if (isset($attach)) {
       echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
       $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);