Address book popup now populates with actual contacts.
authorArt Cancro <ajc@citadel.org>
Thu, 19 Apr 2007 20:55:36 +0000 (20:55 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 19 Apr 2007 20:55:36 +0000 (20:55 +0000)
(Still need to add js code to fill the calling input box)

webcit/addressbook_popup.c

index d96122481b7f8cd0e26d27cc1a39b448d1b1b3f9..7d67bc74e18e03f79d68761307527bbaf19bf66d 100644 (file)
@@ -58,19 +58,23 @@ void display_address_book_middle_div(void) {
  * \brief Address book popup results
  */
 void display_address_book_inner_div() {
-       int i;
-       static int foo;
-       char *which_addr_book;
+       char buf[256];
 
-       which_addr_book = bstr("which_addr_book");
-       lprintf(9, "FIXME get addresses in <%s>\n", which_addr_book);
        begin_ajax_response();
 
        wprintf("<div align=center><form>"
                "<select name=\"whichaddr\" size=\"15\">\n");
 
-       for (i=0; i<100; ++i) {
-               wprintf("<option>Contact %d &lt;contact%d@example.com&gt;</option>\n", ++foo, foo);
+       serv_printf("GOTO %s", bstr("which_addr_book"));
+       serv_getln(buf, sizeof buf);
+       serv_puts("DVCA");
+       serv_getln(buf, sizeof buf);
+       if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+               wprintf("<option value=\">");
+               escputs(buf);
+               wprintf("\">");
+               escputs(buf);
+               wprintf("</option>\n");
        }
 
        wprintf("</select></form></div>\n");