X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fcalendar.c;h=fb3f19e89427a6a11b0f1617f3a64417e7976668;hb=038aeea0faf257e005d81ad4196aa40489ad6705;hp=c61fc7c464365b245aeb568108fb4cfcd9217192;hpb=5878e31ae2ba761bd5119afdafdbafa3f9240e83;p=citadel.git
diff --git a/webcit/calendar.c b/webcit/calendar.c
index c61fc7c46..fb3f19e89 100644
--- a/webcit/calendar.c
+++ b/webcit/calendar.c
@@ -1,80 +1,26 @@
/*
* $Id$
+ *
+ * Functions which handle calendar objects and their processing/display.
*/
-/**
- * \defgroup calav Functions which handle calendar objects and their processing/display.
- * \ingroup Calendaring
- */
-/* @{ */
#include "webcit.h"
#include "webserver.h"
-#ifndef WEBCIT_WITH_CALENDAR_SERVICE
-
-/**
- * \brief get around non existing types
- * Handler stubs for builds with no calendar library available
- * \param part_source dummy pointer to the source
- * \param msgnum number of the mesage in the db
- * \param cal_partnum number of the calendar part
- */
-void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
-
- wprintf(_("This message contains calendaring/scheduling information,"
- " but support for calendars is not available on this "
- "particular system. Please ask your system administrator to "
- "install a new version of the Citadel web service with "
- "calendaring enabled.
\n")
- );
-
-}
-
-/**
- * \brief say we can't display calendar items
- * \param msgnum number of the mesage in our db
- */
-void display_calendar(long msgnum) {
- wprintf(_(""
- "Cannot display calendar item. You are seeing this error "
- "because your WebCit service has not been installed with "
- "calendar support. Please contact your system administrator."
- "
\n"));
-}
-
-/**
- * \brief say we can't display task items
- * \param msgnum number of the mesage in our db
- */
-void display_task(long msgnum) {
- wprintf(_(""
- "Cannot display to-do item. You are seeing this error "
- "because your WebCit service has not been installed with "
- "calendar support. Please contact your system administrator."
- "
\n"));
-}
-/** ok, we have calendaring available */
-#else /* WEBCIT_WITH_CALENDAR_SERVICE */
-
-
-/****** End of handler stubs. Everything below this line is real. ******/
-
-
-
-/**
- * \brief Process a calendar object
- * ...at this point it's already been deserialized by cal_process_attachment()
- * \param cal the calendar object
- * \param recursion_level call stack depth ??????
- * \param msgnum number of the mesage in our db
- * \param cal_partnum of the calendar object ????
+/*
+ * Process a calendar object. At this point it's already been deserialized by cal_process_attachment()
+ *
+ * cal: the calendar object
+ * recursion_level: Number of times we've recursed into this function
+ * msgnum: Message number on the Citadel server
+ * cal_partnum: MIME part number within that message containing the calendar object
*/
void cal_process_object(icalcomponent *cal,
int recursion_level,
long msgnum,
- char *cal_partnum
-) {
+ char *cal_partnum)
+{
icalcomponent *c;
icalproperty *method = NULL;
icalproperty_method the_method = ICAL_METHOD_NONE;
@@ -90,15 +36,15 @@ void cal_process_object(icalcomponent *cal,
sprintf(divname, "rsvp%04x", ++divcount);
- /** Leading HTML for the display of this object */
+ /* Leading HTML for the display of this object */
if (recursion_level == 0) {
wprintf("
" + /* Display the Accept/Decline buttons */ + wprintf("
" "%s " + "
\n", + " \n", divname, _("How would you like to respond to this invitation?"), divname, divname, msgnum, cal_partnum, _("Accept"), divname, divname, msgnum, cal_partnum, _("Tentative"), divname, divname, msgnum, cal_partnum, _("Decline") - ); + ); } - /** If this is a REPLY, display update button */ + /* If this is a REPLY, display update button */ if (the_method == ICAL_METHOD_REPLY) { - /** \todo In the future, if we want to validate this object before \ + /* In the future, if we want to validate this object before * continuing, we can do it this way: - serv_printf("ICAL whatever|%ld|%s|", msgnum, cal_partnum); - serv_getln(buf, sizeof buf); - } - ***********/ + serv_printf("ICAL whatever|%ld|%s|", msgnum, cal_partnum); + serv_getln(buf, sizeof buf); + } + ***********/ - /** Display the update buttons */ - wprintf("" - "%s" + /* Display the update buttons */ + wprintf("
" + "%s " + "
\n", + "\n", divname, _("Click Update to accept this reply and update your calendar."), divname, divname, msgnum, cal_partnum, _("Update"), divname, divname, msgnum, cal_partnum, _("Ignore") - ); - + ); + } - - /** Trailing HTML for the display of this object */ + + /* Trailing HTML for the display of this object */ if (recursion_level == 0) { - wprintf("
\n"); } } @@ -321,7 +270,8 @@ void cal_process_object(icalcomponent *cal, * \param msgnum number of the mesage in our db * \param cal_partnum the number of the calendar item */ -void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) { +void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) +{ icalcomponent *cal; cal = icalcomponent_new_from_string(part_source); @@ -346,7 +296,8 @@ void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) { * \brief accept/decline meeting * Respond to a meeting request */ -void respond_to_request(void) { +void respond_to_request(void) +{ char buf[1024]; begin_ajax_response(); @@ -359,8 +310,7 @@ void respond_to_request(void) { serv_getln(buf, sizeof buf); if (buf[0] == '2') { - wprintf("
"); - wprintf(" | "); + wprintf(""); if (!strcasecmp(bstr("sc"), "accept")) { wprintf(_("You have accepted this meeting invitation. " "It has been entered into your calendar.") @@ -371,15 +321,16 @@ void respond_to_request(void) { ); } else if (!strcasecmp(bstr("sc"), "decline")) { wprintf(_("You have declined this meeting invitation. " - "It has not been entered into your calendar.") - ); + "It has not been entered into your calendar.") + ); } wprintf(" "); wprintf(_("A reply has been sent to the meeting organizer.")); - wprintf(" |
"); - wprintf(" | "); + wprintf(""); if (!strcasecmp(bstr("sc"), "update")) { wprintf(_("Your calendar has been updated to reflect this RSVP.")); } else if (!strcasecmp(bstr("sc"), "ignore")) { wprintf(_("You have chosen to ignore this RSVP. " - "Your calendar has not been updated.") - ); + "Your calendar has not been updated.") + ); } - wprintf(" |