diff --git a/src/elogd.c b/src/elogd.c index a1f3d0ba..0ba66dd8 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.271 2004/02/26 21:06:32 midas + Added CVS import page + Revision 1.270 2004/02/26 13:41:17 midas Changed strupr() to toupper() @@ -5018,6 +5021,7 @@ void show_plain_header(int size) rsprintf("Pragma: no-cache\r\n"); rsprintf("Expires: Fri, 01 Jan 1983 00:00:00 GMT\r\n"); rsprintf("Content-Type: text/plain\r\n"); + rsprintf("Content-disposition: attachment; filename=\"export.txt\"\r\n"); if (size) rsprintf("Content-Length: %d\r\n", size); rsprintf("\r\n"); @@ -7204,6 +7208,8 @@ void show_find_form(LOGBOOK * lbs) rsprintf("\n", loc("Display comma-separated values (CSV)")); + rsprintf("\n", loc("CSV Import")); + rsprintf("\n"); rsprintf("%s:
", loc("Options")); @@ -8620,6 +8626,55 @@ int show_download_page(LOGBOOK * lbs, char *path) /*------------------------------------------------------------------*/ +void show_import_page(LOGBOOK * lbs) +{ + /*---- header ----*/ + + show_standard_header(lbs, TRUE, loc("ELOG CVS import"), "."); + + /*---- title ----*/ + + show_standard_title(lbs->name, "", 0); + + /*---- menu buttons ----*/ + + rsprintf("\n"); + + rsprintf("\n", loc("Cancel")); + rsprintf("\n", loc("Import")); + + rsprintf("\n\n"); + + /* table for two-column items */ + rsprintf(""); + rsprintf("\n"); + + /*---- entry form ----*/ + + rsprintf("\n", loc("CSV filename")); + rsprintf("\n"); + + rsprintf("\n", loc("Field separator")); + rsprintf("\n"); + + rsprintf("\n", loc("Options")); + rsprintf("\n"); + + rsprintf("
%s:"); + rsprintf("
%s:"); + rsprintf(""); + rsprintf("
%s:"); + rsprintf("\n"); + rsprintf("\n", loc("Derive attributes from CVS file")); + rsprintf("
\n\n"); + show_bottom_text(lbs); + rsprintf("\r\n"); + +} + +/*------------------------------------------------------------------*/ + int show_md5_page(LOGBOOK * lbs) { int i, j; @@ -10895,8 +10950,8 @@ BOOL is_command_allowed(LOGBOOK * lbs, char *command) strlcat(menu_str, "Config, ", sizeof(menu_str)); } - strcpy(other_str, - "Update, Upload, Submit, Back, Search, Save, Download, Cancel, First, Last, Previous, Next, Requested, Forgot, "); + strcpy(other_str, "Update, Upload, Submit, Back, Search, Save, Download, CSV Import, "); + strcat(other_str, "Cancel, First, Last, Previous, Next, Requested, Forgot, "); /* admin commands */ if (getcfg(lbs->name, "Admin user", str) && *getparam("unm") @@ -14546,8 +14601,8 @@ BOOL check_user_password(LOGBOOK * lbs, char *user, char *password, char *redir) ("\n"); if (!getcfg(lbs->name, "Login expiration", str) || atoi(str) > 0) { - rsprintf - ("\n"); + rsprintf(""); + rsprintf("\n"); rsprintf("%s\n", loc("Remember me on this computer")); } @@ -15794,6 +15849,11 @@ void interprete(char *lbook, char *path) return; } + if (strieq(command, loc("CSV Import"))) { + show_import_page(lbs); + return; + } + if (strieq(command, "getmd5")) { show_md5_page(lbs); return;