/*
* $Id$
*/
-/**
- * \defgroup vCardEdit Handles on-screen editing of vCard objects.
- * \ingroup VCards
- */
-/*@{*/
+
#include "webcit.h"
-/**
- * \brief Edit the vCard component of a MIME message.
+/*
+ * Edit the vCard component of a MIME message.
* Supply the message number
* and MIME part number to fetch. Or, specify -1 for the message number
* to start with a blank card.
- * \param msgnum number of the item on the citadel server
- * \param partnum what???
- * \param return_to where to go back in the browser after edit ????
*/
void do_edit_vcard(long msgnum, char *partnum, char *return_to, char *force_room) {
char buf[SIZ];
safestrncpy(org, value, sizeof org);
}
- else if (!strcasecmp(key, "adr")) {
+ else if ( (!strcasecmp(key, "adr")) || (!strncasecmp(key, "adr;", 4)) ) {
extract_token(pobox, value, 0, ';', sizeof pobox);
extract_token(extadr, value, 1, ';', sizeof extadr);
extract_token(street, value, 2, ';', sizeof street);
extract_token(country, value, 6, ';', sizeof country);
}
- else if (!strcasecmp(key, "tel;home")) {
+ else if ( (!strcasecmp(key, "tel;home")) || (!strcasecmp(key, "tel;type=home")) ) {
extract_token(hometel, value, 0, ';', sizeof hometel);
}
- else if (!strcasecmp(key, "tel;work")) {
+ else if ( (!strcasecmp(key, "tel;work")) || (!strcasecmp(key, "tel;type=work")) ) {
extract_token(worktel, value, 0, ';', sizeof worktel);
}
- else if (!strcasecmp(key, "tel;fax")) {
+ else if ( (!strcasecmp(key, "tel;fax")) || (!strcasecmp(key, "tel;type=fax")) ) {
extract_token(faxtel, value, 0, ';', sizeof faxtel);
}
- else if (!strcasecmp(key, "tel;cell")) {
+ else if ( (!strcasecmp(key, "tel;cell")) || (!strcasecmp(key, "tel;type=cell")) ) {
extract_token(mobiletel, value, 0, ';', sizeof mobiletel);
}
- else if (!strcasecmp(key, "email;internet")) {
+ else if ( (!strcasecmp(key, "email;internet"))
+ || (!strcasecmp(key, "email;type=internet")) ) {
if (primary_inetemail[0] == 0) {
safestrncpy(primary_inetemail, value, sizeof primary_inetemail);
}
output_headers(1, 1, 1, 0, 0, 0);
svput("BOXTITLE", WCS_STRING, _("Edit contact information"));
- do_template("beginbox");
+ do_template("beginbox", NULL);
wprintf("<form method=\"POST\" action=\"submit_vcard\">\n");
- wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
+ wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
if (force_room != NULL) {
wprintf("<input type=\"hidden\" name=\"force_room\" value=\"");
);
wprintf("</td></tr></table>\n");
- do_template("endbox");
+ do_template("endbox", NULL);
wDumpContent(1);
}
/**
- * \brief commit the edits to the citadel server
+ * commit the edits to the citadel server
*/
void edit_vcard(void) {
long msgnum;
/**
- * \brief parse edited vcard from the browser
+ * parse edited vcard from the browser
*/
void submit_vcard(void) {
struct vCard *v;
-/*@}*/
+void
+InitModule_VCARD
+(void)
+{
+ WebcitAddUrlHandler(HKEY("edit_vcard"), edit_vcard, 0);
+ WebcitAddUrlHandler(HKEY("submit_vcard"), submit_vcard, 0);
+}
+