From 3eda2a2fd1789f373b043892850655e5e3c52dd7 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 17 Mar 2004 18:25:31 +0000 Subject: [PATCH] * When creating a new user, auto-chain to the "edit user configuration" screen, and subsequently auto-chain to the "edit address book entry" screen. This creates a nice sensible workflow. --- webcit/ChangeLog | 6 ++++++ webcit/useredit.c | 26 ++++++++++++++++++++++---- webcit/webcit.c | 2 +- webcit/webcit.h | 2 +- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 7f6e1c796..d59b019b4 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,9 @@ $Log$ +Revision 505.17 2004/03/17 18:25:31 ajc +* When creating a new user, auto-chain to the "edit user configuration" + screen, and subsequently auto-chain to the "edit address book entry" + screen. This creates a nice sensible workflow. + Revision 505.16 2004/03/15 22:47:09 ajc * Prettied up the chat window a little more. @@ -1727,3 +1732,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/useredit.c b/webcit/useredit.c index 850b39058..0ccf14e90 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -211,8 +211,11 @@ void display_edit_address_book_entry(char *username, long usernum) { /* * Edit a user. If supplied_username is null, look in the "username" * web variable for the name of the user to edit. + * + * If "is_new" is set to nonzero, this screen will set the web variables + * to send the user to the vCard editor next. */ -void display_edituser(char *supplied_username) { +void display_edituser(char *supplied_username, int is_new) { char buf[SIZ]; char error_message[SIZ]; time_t now; @@ -271,6 +274,9 @@ void display_edituser(char *supplied_username) { "\n"); + wprintf("\n" + "\n", + is_new, usernum); wprintf("\n", flags); @@ -344,6 +350,9 @@ void display_edituser(char *supplied_username) { void edituser(void) { char message[SIZ]; char buf[SIZ]; + int is_new = 0; + + is_new = atoi(bstr("is_new")); if (strcasecmp(bstr("action"), "OK")) { strcpy(message, "Edit user cancelled."); @@ -373,7 +382,15 @@ void edituser(void) { } } - select_user_to_edit(message, bstr("username")); + /* If we are in the middle of creating a new user, move on to + * the vCard edit screen. + */ + if (is_new) { + display_edit_address_book_entry( bstr("username"), atol(bstr("usernum")) ); + } + else { + select_user_to_edit(message, bstr("username")); + } } @@ -390,8 +407,9 @@ void create_user(void) { serv_gets(buf); if (buf[0] == '2') { - sprintf(error_message, "User has been created."); - select_user_to_edit(error_message, username); + /* sprintf(error_message, "User has been created."); + select_user_to_edit(error_message, username); */ + display_edituser(username, 1); } else { sprintf(error_message, diff --git a/webcit/webcit.c b/webcit/webcit.c index 914484cef..ea7a94e07 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1182,7 +1182,7 @@ void session_loop(struct httprequest *req) } else if (!strcasecmp(action, "select_user_to_edit")) { select_user_to_edit(NULL, NULL); } else if (!strcasecmp(action, "display_edituser")) { - display_edituser(NULL); + display_edituser(NULL, 0); } else if (!strcasecmp(action, "edituser")) { edituser(); } else if (!strcasecmp(action, "create_user")) { diff --git a/webcit/webcit.h b/webcit/webcit.h index d600c4131..3290f4a97 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -365,7 +365,7 @@ void edit_vcard(void); void submit_vcard(void); void striplt(char *); void select_user_to_edit(char *message, char *preselect); -void display_edituser(char *who); +void display_edituser(char *who, int is_new); void create_user(void); void edituser(void); void do_change_view(int); -- 2.30.2