From ab9141c35c68f38ddbb7426476ede22243f6ed7d Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 23 Jan 2002 08:41:42 +0000 Subject: [PATCH] Added "Search all logbooks" flag SVN revision: 20 --- doc/config.html | 7 +++++++ elogd.c | 30 +++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/doc/config.html b/doc/config.html index b8b12fc2..c91cd204 100755 --- a/doc/config.html +++ b/doc/config.html @@ -592,6 +592,13 @@ no text at all. The default is 3. If this flag is 1, the result of the "Last day" and "Last 10" queries is sorted in reverse order (newest entry down to oldest). Default is 0.

+

  • Search all logbooks = 0/1 +
    +If this flag is 1, the search form displays the button "Search all +logbooks". The default is 1. It might be necessary to turn this option +off for public logbooks if there are also protected logbooks. Otherwise the +search result would also display entries from the protected logbooks.

    +

  • Enable browsing = 0/1
    If this flag is 1, browsing (hitting the next/previous button) is enabled. diff --git a/elogd.c b/elogd.c index 63f590fe..24fec5c9 100755 --- a/elogd.c +++ b/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.7 2002/01/23 08:41:42 midas + Added "Search all logbooks" flag + Revision 1.6 2002/01/15 10:23:59 midas - Remove "back" button from error display (NS4.7 does not support it) - Fixed wrong URL in email notification @@ -3725,8 +3728,11 @@ char str[256]; if (i > 2) { - rsprintf("", gt("Categories bgcolor2")); - rsprintf("%s\n", loc("Search all logbooks")); + if (!getcfg(logbook, "Search all logbooks", str) || atoi(str) == 1) + { + rsprintf("", gt("Categories bgcolor2")); + rsprintf("%s\n", loc("Search all logbooks")); + } } rsprintf("%s:", gt("Categories bgcolor1"), loc("Start date")); @@ -3989,7 +3995,7 @@ void show_elog_submit_find(INT past_n, INT last_n) { int i, j, n, size, status, d1, m1, y1, d2, m2, y2, index, colspan, i_line, n_line, i_col; int current_year, current_month, current_day, printable, n_logbook, lindex, n_attr, - reverse, n_attr_disp, n_found; + reverse, n_attr_disp, n_found, search_all; char date[80], attrib[MAX_N_ATTR][NAME_LENGTH], disp_attr[MAX_N_ATTR][NAME_LENGTH], list[10000], text[TEXT_SIZE], text1[TEXT_SIZE], text2[TEXT_SIZE], orig_tag[80], reply_tag[80], attachment[MAX_ATTACHMENTS][256], encoding[80]; @@ -4353,6 +4359,12 @@ FILE *f; if (getcfg(logbook, "Summary lines", str)) n_line = atoi(str); + /* check for search all */ + search_all = atoi(getparam("all")); + + if (getcfg(logbook, "Search all logbooks", str) && atoi(str) == 0) + search_all = 0; + /*---- table titles ----*/ rsprintf("\n", @@ -4365,7 +4377,7 @@ FILE *f; rsprintf("", col, size); - if (atoi(getparam("all")) == 1) + if (search_all) rsprintf("", col, size); rsprintf("", col, size); @@ -4403,7 +4415,7 @@ FILE *f; n_found = 0; old_data_dir[0] = 0; - if (atoi(getparam("all")) == 1) + if (search_all) { /* count logbooks */ for (i=n_logbook=0 ; ; i++) @@ -4668,7 +4680,7 @@ FILE *f; rsprintf("", col, size, ref, n_found); - if (atoi(getparam("all")) == 1) + if (search_all) rsprintf("", nowrap, col, size, logbook_list[lindex]); if (getcfg(logbook, "Date format", format)) @@ -4722,7 +4734,7 @@ FILE *f; rsprintf("\n"); - if (atoi(getparam("all")) == 1) + if (search_all) colspan = 3+n_attr_disp; else colspan = 2+n_attr_disp; @@ -4836,7 +4848,7 @@ FILE *f; rsprintf("", col, size, ref, n_found); - if (atoi(getparam("all")) == 1) + if (search_all) rsprintf("", nowrap, col, logbook_list[lindex]); if (getcfg(logbook, "Date format", format)) @@ -7934,7 +7946,7 @@ struct tm *tms; else { usage: - printf("usage: %s [-p port] [-h hostname] [-D] [-c file] [-r pwd] [-w pwd] [-a pwd] [-l loggbook]\n\n", argv[0]); + printf("usage: %s [-p port] [-h hostname] [-D] [-c file] [-r pwd] [-w pwd] [-a pwd] [-l logbook]\n\n", argv[0]); printf(" -p TCP/IP port\n"); printf(" -h TCP/IP hostname\n"); printf(" -D become a daemon\n");
    #LogbookDate  %d  %s
      %d  %s