/*
- * $Id: $
- *//**
+ * $Id$
+ *
* \defgroup AjaxAutoCompletion ajax-powered autocompletion...
* \ingroup ClientPower
*/
void display_address_book_inner_div() {
char buf[256];
char username[256];
+ int num_targets = 0;
+ char target_id[64];
+ char target_label[64];
+ int i;
begin_ajax_response();
wprintf("</select>\n");
- wprintf("<INPUT TYPE=\"submit\" NAME=\"select_button\" VALUE=\"%s\" ", _("Select"));
- wprintf("onClick=\"AddContactsToTarget($('%s'),$('whichaddr'));\">", bstr("target_input"));
+ wprintf("%s: ", _("Add"));
+
+ num_targets = num_tokens(bstr("target_input"), '|');
+ for (i=0; i<num_targets; i+=2) {
+ extract_token(target_id, bstr("target_input"), i, '|', sizeof target_id);
+ extract_token(target_label, bstr("target_input"), i+1, '|', sizeof target_label);
+ wprintf("<INPUT TYPE=\"submit\" NAME=\"select_button\" VALUE=\"%s\" ", target_label);
+ wprintf("onClick=\"AddContactsToTarget($('%s'),$('whichaddr'));\">", target_id);
+ }
+
+ /* This 'close window' button works. Omitting it because we already have a close button
+ * in the upper right corner, and this one takes up space.
+ *
wprintf("<INPUT TYPE=\"submit\" NAME=\"close_button\" VALUE=\"%s\" ", _("Close window"));
wprintf("onclick=\"javascript:$('address_book_popup').style.display='none';\">");
+ */
wprintf("</form></div>\n");
escputs(bstr("recp"));
wprintf("\" size=50 maxlength=1000 />");
wprintf("<div class=\"auto_complete\" id=\"recp_name_choices\"></div>");
+ wprintf("</td><td rowspan=3>");
/** Pop open an address book -- begin **/
wprintf(
- " <a href=\"javascript:PopOpenAddressBook('recp_id');\" title=\"%s\">"
- "<img align=middle border=0 width=16 height=16 src=\"static/viewcontacts_16x.gif\">"
- "</a>", _("Contacts")
+ "<a href=\"javascript:PopOpenAddressBook('recp_id|%s|cc_id|%s|bcc_id|%s');\" "
+ "title=\"%s\">"
+ "<img align=middle border=0 width=24 height=24 src=\"static/viewcontacts_24x.gif\">"
+ " %s</a>",
+ _("To:"), _("CC:"), _("BCC:"),
+ _("Contacts"), _("Contacts")
);
/** Pop open an address book -- end **/
- wprintf("</td><td></td></tr>\n");
+ wprintf("</td></tr>\n");
wprintf("<tr><td>");
wprintf("<font size=-1>");
escputs(bstr("cc"));
wprintf("\" size=50 maxlength=1000 />");
wprintf("<div class=\"auto_complete\" id=\"cc_name_choices\"></div>");
-
- /** Pop open an address book -- begin **/
- wprintf(
- " <a href=\"javascript:PopOpenAddressBook('cc_id');\" title=\"%s\">"
- "<img align=middle border=0 width=16 height=16 src=\"static/viewcontacts_16x.gif\">"
- "</a>", _("Contacts")
- );
- /** Pop open an address book -- end **/
-
- wprintf("</td><td></td></tr>\n");
+ wprintf("</td></tr>\n");
wprintf("<tr><td>");
wprintf("<font size=-1>");
escputs(bstr("bcc"));
wprintf("\" size=50 maxlength=1000 />");
wprintf("<div class=\"auto_complete\" id=\"bcc_name_choices\"></div>");
-
- /** Pop open an address book -- begin **/
- wprintf(
- " <a href=\"javascript:PopOpenAddressBook('bcc_id');\" title=\"%s\">"
- "<img align=middle border=0 width=16 height=16 src=\"static/viewcontacts_16x.gif\">"
- "</a>", _("Contacts")
- );
- /** Pop open an address book -- end **/
- wprintf("</td><td></td></tr>\n");
+ wprintf("</td></tr>\n");
/** Initialize the autocomplete ajax helpers (found in wclib.js) */
wprintf("<script type=\"text/javascript\"> \n"