-/*
- * $Id$
- */
#include "webcit.h"
#include "calendar.h"
}
-/*
- * display the adressbook overview
- */
-void display_addressbook(long msgnum, char alpha) {
- //char buf[SIZ];
- /* char mime_partnum[SIZ]; */
- ///char mime_disposition[SIZ];
- //int mime_length;
- char vcard_partnum[SIZ];
- StrBuf *vcard_source = NULL;
- message_summary summ;////TODO: this will leak
-
- memset(&summ, 0, sizeof(summ));
- // safestrncpy(summ.subj, _("(no subject)"), sizeof summ.subj);
- // Load Message headers
- if (!IsEmptyStr(vcard_partnum)) {
- vcard_source = load_mimepart(msgnum, vcard_partnum);
- if (vcard_source != NULL) {
-
- /* Display the summary line */
- display_vcard(WC->WBuf, vcard_source, alpha, 0, NULL, msgnum);
-
- /* If it's my vCard I can edit it */
- if ( (!strcasecmp(ChrPtr(WC->CurRoom.name), USERCONFIGROOM))
- || (!strcasecmp(&(ChrPtr(WC->CurRoom.name)[11]), USERCONFIGROOM))
- || (WC->CurRoom.view == VIEW_ADDRESSBOOK)
- ) {
- wc_printf("<a href=\"edit_vcard?"
- "msgnum=%ld&partnum=%s\">",
- msgnum, vcard_partnum);
- wc_printf("[%s]</a>", _("edit"));
- }
-
- FreeStrBuf(&vcard_source);
- }
- }
-
-}
-
-
-
/*
* If it's an old "Firstname Lastname" style record, try to convert it.
*/
return;
/* Grab the name off the card */
- display_vcard(WC->WBuf, VCMime->Data, 0, 0, namebuf, Msg->msgnum);
+ display_vcard(WC->WBuf, VCMime, 0, 0, namebuf, Msg->msgnum);
if (*namebuf != NULL) {
lastfirst_firstlast(*namebuf);
* full display all items of the vcard?
* msgnum Citadel message pointer
*/
-void display_parsed_vcard(StrBuf *Target, struct vCard *v, int full, long msgnum) {
+void display_parsed_vcard(StrBuf *Target, struct vCard *v, int full, wc_mime_attachment *Mime)
+{
int i, j;
char buf[SIZ];
char *name;
* msgnum Citadel message pointer
*/
void display_vcard(StrBuf *Target,
- StrBuf *vcard_source,
+ wc_mime_attachment *Mime,
char alpha,
int full,
char **storename,
StrBuf *Buf2;
char this_alpha = 0;
- v = VCardLoad(vcard_source);
+ v = VCardLoad(Mime->Data);
if (v == NULL) return;
if (storename != NULL) {
fetchname_parsed_vcard(v, storename);
}
- else if (
- (alpha == 0)
- || ((isalpha(alpha)) && (tolower(alpha) == tolower(this_alpha)))
- || ((!isalpha(alpha)) && (!isalpha(this_alpha)))
- ) {
- display_parsed_vcard(Target, v, full,msgnum);
+ else if ((alpha == 0) ||
+ ((isalpha(alpha)) && (tolower(alpha) == tolower(this_alpha))) ||
+ ((!isalpha(alpha)) && (!isalpha(this_alpha)))
+ )
+ {
+ display_parsed_vcard(Target, v, full, Mime);
}
vcard_free(v);
/* Display the form */
output_headers(1, 1, 1, 0, 0, 0);
- svput("BOXTITLE", WCS_STRING, _("Edit contact information"));
- do_template("beginboxx", NULL);
+ do_template("beginbox_1", NULL);
+ StrBufAppendBufPlain(WC->WBuf, _("Edit contact information"), -1, 0);
+ do_template("beginbox_2", NULL);
wc_printf("<form method=\"POST\" action=\"submit_vcard\">\n");
wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
wc_printf("\">\n");
}
- wc_printf("<div class=\"fix_scrollbar_bug\">"
- "<table class=\"vcard_edit_background\"><tr><td>\n");
+ wc_printf("<table class=\"vcard_edit_background\"><tr><td>\n");
wc_printf("<table border=0><tr>"
"<td>%s</td>"
"<td>%s</td>"
"<td>%s</td>"
"<td>%s</td></tr>\n",
- _("Prefix"), _("First"), _("Middle"), _("Last"), _("Suffix")
+ _("Prefix"), _("First Name"), _("Middle Name"), _("Last Name"), _("Suffix")
);
wc_printf("<tr><td><input type=\"text\" name=\"prefix\" "
"value=\"%s\" maxlength=\"5\" size=\"5\"></td>",
int i;
if (!havebstr("ok_button")) {
- readloop(readnew);
+ readloop(readnew, eUseDefault);
return;
}
http_redirect(bstr("return_to"));
}
else {
- readloop(readnew);
+ readloop(readnew, eUseDefault);
}
return;
}
http_redirect(bstr("return_to"));
}
else {
- readloop(readnew);
+ readloop(readnew, eUseDefault);
}
}
VIEW_ADDRESSBOOK,
vcard_GetParamsGetServerCall,
NULL,
+ NULL,
vcard_LoadMsgFromServer,
vcard_RenderView_or_Tail,
vcard_Cleanup);