]> code.citadel.org Git - citadel.git/blobdiff - webcit/vcard_edit.c
Cleaned up some of the comments ... removed vestiges of last year's doxygen experiment
[citadel.git] / webcit / vcard_edit.c
index 4b036e03fab68237dd857983f48ac650fff0eb16..c5deb98225f32bb1da1d6fa503789579efec3aa9 100644 (file)
@@ -1,21 +1,14 @@
 /*
  * $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];
@@ -134,7 +127,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to, char *force_room
                                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);
@@ -144,23 +137,24 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to, char *force_room
                                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);
                                }
@@ -188,10 +182,10 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to, char *force_room
        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=\"");
@@ -360,13 +354,13 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to, char *force_room
        );
        
        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;
@@ -380,7 +374,7 @@ void edit_vcard(void) {
 
 
 /**
- * \brief parse edited vcard from the browser
+ *  parse edited vcard from the browser
  */
 void submit_vcard(void) {
        struct vCard *v;
@@ -485,4 +479,11 @@ void submit_vcard(void) {
 
 
 
-/*@}*/
+void 
+InitModule_VCARD
+(void)
+{
+       WebcitAddUrlHandler(HKEY("edit_vcard"), edit_vcard, 0);
+       WebcitAddUrlHandler(HKEY("submit_vcard"), submit_vcard, 0);
+}
+