From e7ba466192542da7c18b40122b49bd823b13cffa Mon Sep 17 00:00:00 2001 From: Luedeke Andreas Date: Wed, 13 Nov 2013 13:57:19 +0100 Subject: [PATCH] retry: new find web form and new CSV3 export --- src/elogd.c | 56 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index af9fe9ad..af41029e 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -11593,9 +11593,9 @@ void show_find_form(LOGBOOK * lbs) /*---- entry form ----*/ - rsprintf("\n"); + rsprintf("\n"); + rsprintf("\n"); - rsprintf("\n"); + rsprintf("
\n"); - rsprintf("%s:  ", loc("Mode")); + rsprintf("%s:
", loc("Mode")); if (!getcfg(lbs->name, "Display mode", mode, sizeof(mode))) strcpy(mode, "Full"); @@ -11605,20 +11605,20 @@ void show_find_form(LOGBOOK * lbs) rsprintf(""); else rsprintf(""); - rsprintf("\n", loc("Display full entries")); + rsprintf("
\n", loc("Display full entries")); if (strieq(mode, "Summary")) rsprintf(""); else rsprintf(""); - rsprintf("\n", loc("Summary only")); + rsprintf("
\n", loc("Summary only")); } else { if (strieq(mode, "Full") || strieq(mode, "Summary")) rsprintf(""); else rsprintf(""); - rsprintf("\n", loc("Summary")); + rsprintf("
\n", loc("Summary")); } if (strieq(mode, "Threaded")) @@ -11627,35 +11627,41 @@ void show_find_form(LOGBOOK * lbs) rsprintf(""); rsprintf("\n", loc("Display threads")); - rsprintf("%s:  ", loc("Export to")); + rsprintf("
%s:
", loc("Export to")); if (strieq(mode, "CSV1")) rsprintf(""); else rsprintf(""); - rsprintf("\n", loc("CSV (\",\" separated)")); + rsprintf("
\n", loc("CSV (\",\" separated)")); if (strieq(mode, "CSV2")) rsprintf(""); else rsprintf(""); - rsprintf("\n", loc("CSV (\";\" separated)")); + rsprintf("
\n", loc("CSV (\";\" separated)")); + + if (strieq(mode, "CSV3")) + rsprintf(""); + else + rsprintf(""); + rsprintf("
\n", loc("CSV (\";\" separated) + Text")); if (strieq(mode, "XML")) rsprintf(""); else rsprintf(""); - rsprintf("\n"); + rsprintf("
\n"); if (strieq(mode, "Raw")) rsprintf(""); else rsprintf(""); - rsprintf("\n"); + rsprintf("
\n"); - rsprintf("
%s:
", loc("Options")); + rsprintf("
%s:
", loc("Options")); rsprintf(""); rsprintf("\n", loc("Show attachments")); @@ -11697,7 +11703,7 @@ void show_find_form(LOGBOOK * lbs) rsprintf(" ", str); rsprintf(loc("entries per page")); - rsprintf("
\n"); rsprintf("%s:", loc("Filters")); sprintf(str, ""); @@ -19542,7 +19548,7 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa } threaded = strieq(mode, "threaded"); - csv = strieq(mode, "CSV1") || strieq(mode, "CSV2"); + csv = strieq(mode, "CSV1") || strieq(mode, "CSV2") || strieq(mode, "CSV3"); xml = strieq(mode, "XML"); raw = strieq(mode, "Raw"); @@ -20273,9 +20279,12 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa rsprintf(","); else rsprintf(";"); - } else + } else { + if (strieq(mode, "CSV3")) + rsprintf(";\"Text\""); rsprintf("\r\n"); } + } } else if (xml) { @@ -20977,9 +20986,24 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa rsprintf(","); else rsprintf(";"); - } else + } else { + if (strlen(text)>0 && strieq(mode, "CSV3")) { + rsprintf(";"); + strlcpy(str, text, sizeof(str)); + rsputs("\""); + pt1 = str; + while ((pt2 = strchr(pt1, '"')) != NULL) { + *pt2 = 0; + rsputs(pt1); + rsputs("\"\""); + pt1 = pt2 + 1; + } + rsputs(pt1); + rsputs("\""); + } rsprintf("\r\n"); } + } } else if (xml) {