From: Art Cancro Date: Fri, 20 Sep 2002 20:28:08 +0000 (+0000) Subject: * Smooth transition between "list tasks" & "edit task" screens X-Git-Tag: v7.86~6226 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=195b1a150845e8a8bdb2716c1880a792a2b6ccc1;p=citadel.git * Smooth transition between "list tasks" & "edit task" screens --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 483ca7bc2..a31ffbb88 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 400.19 2002/09/20 20:28:08 ajc +* Smooth transition between "list tasks" & "edit task" screens + Revision 400.18 2002/09/20 03:54:44 ajc * Display the "Tasks" view as a bulleted list with each task clickable * Clicking brings up an (unfinished) "edit task" screen @@ -1001,3 +1004,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/calendar.c b/webcit/calendar.c index 999191a8a..033d7952c 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -58,6 +58,8 @@ void display_task(long msgnum) { #else /* HAVE_ICAL_H */ +/****** End of handler stubs. Everything below this line is real. ******/ + /* * Process a single calendar component. @@ -245,14 +247,14 @@ void display_individual_task(icalcomponent *vtodo, long msgnum) { p = icalcomponent_get_first_property(vtodo, ICAL_SUMMARY_PROPERTY); wprintf("
  • ", msgnum); - if (p != NULL) escputs(icalproperty_get_comment(p)); + if (p != NULL) escputs((char *)icalproperty_get_comment(p)); wprintf("\n"); icalproperty_free(p); } /* - * Display/edit a task by itself FIXME + * Display a task by itself (for editing) */ void display_edit_individual_task(icalcomponent *vtodo, long msgnum) { icalproperty *p; @@ -264,7 +266,7 @@ void display_edit_individual_task(icalcomponent *vtodo, long msgnum) { "
    \n" ); - wprintf("
    \n"); + wprintf("\n"); wprintf("\n", msgnum); @@ -272,19 +274,56 @@ void display_edit_individual_task(icalcomponent *vtodo, long msgnum) { "\n"); + wprintf("\">
    \n"); - wprintf("
    \n"); + wprintf("Start date: FIXME
    \n"); - wprintf("

    \n" - "" - "Back to task list\n" + wprintf("Due date: FIXME
    \n"); + + wprintf("

    \n"); + + wprintf("" + "  " + "\n" + "
    \n" + ); + + wprintf("\n"); + wDumpContent(1); } +/* + * Save an edited task + */ +void edit_individual_task(icalcomponent *vtodo, long msgnum) { + + if (!strcasecmp(bstr("sc"), "Save")) { + + /* FIXME + 1. Replace property values with ones from the form + 2. Serialize the task + 3. Make a message out of it + 4. Delete the existing message (msgnum) + 5. Save the new message + */ + + } + + /* Go back to the task list */ + readloop("readfwd"); +} + + + /* * Code common to all display handlers. Given a message number and a MIME * type, we load the message and hunt for that MIME type. If found, we load @@ -369,4 +408,13 @@ void display_edit_task(void) { display_edit_individual_task); } +void save_task(void) { + long msgnum = 0L; + + msgnum = atol(bstr("msgnum")); + display_using_handler(msgnum, "text/calendar", + ICAL_VTODO_COMPONENT, + edit_individual_task); +} + #endif /* HAVE_ICAL_H */ diff --git a/webcit/webcit.c b/webcit/webcit.c index de3370150..e2f084ec5 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1240,6 +1240,8 @@ void session_loop(struct httprequest *req, int gzip) #ifdef HAVE_ICAL_H } else if (!strcasecmp(action, "display_edit_task")) { display_edit_task(); + } else if (!strcasecmp(action, "save_task")) { + save_task(); #endif } else if (!strcasecmp(action, "summary")) { summary(); diff --git a/webcit/webcit.h b/webcit/webcit.h index 97ac8f347..06db86fb1 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -347,4 +347,5 @@ void display_task(long msgnum); #ifdef HAVE_ICAL_H void display_edit_task(void); +void save_task(void); #endif