'Show all entries' keeps parameters from original search

SVN revision: 1408
This commit is contained in:
Stefan Ritt 2005-07-04 20:43:39 +00:00
parent 26e749deba
commit 077108eafc

View File

@ -6,6 +6,9 @@
Contents: Web server program for Electronic Logbook ELOG Contents: Web server program for Electronic Logbook ELOG
$Log$ $Log$
Revision 1.688 2005/07/04 20:43:39 ritt
'Show all entries' keeps parameters from original search
Revision 1.687 2005/07/04 20:17:25 ritt Revision 1.687 2005/07/04 20:17:25 ritt
Put absolute link for CSS Put absolute link for CSS
@ -15746,7 +15749,7 @@ BOOL is_command_allowed(LOGBOOK * lbs, char *command)
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
void build_ref(char *ref, int size, char *mode, char *expand) void build_ref(char *ref, int size, char *mode, char *expand, char *new_entries)
{ {
char str[1000]; char str[1000];
@ -15765,6 +15768,10 @@ void build_ref(char *ref, int size, char *mode, char *expand)
if (expand[0]) if (expand[0])
subst_param(ref, size, "expand", expand); subst_param(ref, size, "expand", expand);
/* eliminate old new_entries if new one is present */
if (new_entries[0])
subst_param(ref, size, "new_entries", new_entries);
/* eliminate old last= */ /* eliminate old last= */
subst_param(ref, size, "last", getparam("last")); subst_param(ref, size, "last", getparam("last"));
@ -15793,7 +15800,7 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
sprintf(ref, "page%d", page_n); sprintf(ref, "page%d", page_n);
else else
ref[0] = 0; ref[0] = 0;
build_ref(ref, sizeof(ref), "full", ""); build_ref(ref, sizeof(ref), "full", "", "");
rsprintf("&nbsp;<a href=\"%s\">%s</a>&nbsp;|", ref, loc("Full")); rsprintf("&nbsp;<a href=\"%s\">%s</a>&nbsp;|", ref, loc("Full"));
} }
@ -15801,14 +15808,14 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
sprintf(ref, "page%d", page_n); sprintf(ref, "page%d", page_n);
else else
ref[0] = 0; ref[0] = 0;
build_ref(ref, sizeof(ref), "summary", ""); build_ref(ref, sizeof(ref), "summary", "", "");
rsprintf("&nbsp;<a href=\"%s\">%s</a>&nbsp;|", ref, loc("Summary")); rsprintf("&nbsp;<a href=\"%s\">%s</a>&nbsp;|", ref, loc("Summary"));
if (page_n != 1) if (page_n != 1)
sprintf(ref, "page%d", page_n); sprintf(ref, "page%d", page_n);
else else
ref[0] = 0; ref[0] = 0;
build_ref(ref, sizeof(ref), "threaded", ""); build_ref(ref, sizeof(ref), "threaded", "", "");
rsprintf("&nbsp;<a href=\"%s\">%s</a>&nbsp;", ref, loc("Threaded")); rsprintf("&nbsp;<a href=\"%s\">%s</a>&nbsp;", ref, loc("Threaded"));
if (threaded) { if (threaded) {
@ -15825,7 +15832,7 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
if (cur_exp > 0) { if (cur_exp > 0) {
sprintf(str, "%d", cur_exp > 0 ? cur_exp - 1 : 0); sprintf(str, "%d", cur_exp > 0 ? cur_exp - 1 : 0);
build_ref(ref, sizeof(ref), "", str); build_ref(ref, sizeof(ref), "", str, "");
rsprintf("|&nbsp;<a href=\"%s\">%s</a>&nbsp;", ref, loc("Collapse")); rsprintf("|&nbsp;<a href=\"%s\">%s</a>&nbsp;", ref, loc("Collapse"));
} else } else
rsprintf("|&nbsp;%s&nbsp;", loc("Collapse")); rsprintf("|&nbsp;%s&nbsp;", loc("Collapse"));
@ -15836,7 +15843,7 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
else else
ref[0] = 0; ref[0] = 0;
sprintf(str, "%d", cur_exp < 3 ? cur_exp + 1 : 3); sprintf(str, "%d", cur_exp < 3 ? cur_exp + 1 : 3);
build_ref(ref, sizeof(ref), "", str); build_ref(ref, sizeof(ref), "", str, "");
rsprintf("|&nbsp;<a href=\"%s\">%s</a>&nbsp;", ref, loc("Expand")); rsprintf("|&nbsp;<a href=\"%s\">%s</a>&nbsp;", ref, loc("Expand"));
} else } else
rsprintf("|&nbsp;%s&nbsp;", loc("Expand")); rsprintf("|&nbsp;%s&nbsp;", loc("Expand"));
@ -15847,10 +15854,14 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
rsprintf("<td class=\"menu2b\">\n"); rsprintf("<td class=\"menu2b\">\n");
if (!isparam("new_entries")) ref[0] = 0;
rsprintf("<a href=\"?new_entries=1\">%s</a>&nbsp;&nbsp;", loc("Show only new entries")); if (!isparam("new_entries") || atoi(getparam("new_entries")) == 0) {
else build_ref(ref, sizeof(ref), "", "", "1");
rsprintf("<a href=\".\">%s</a>&nbsp;&nbsp;", loc("Show all entries")); rsprintf("<a href=\"%s\">%s</a>&nbsp;&nbsp;", ref, loc("Show only new entries"));
} else {
build_ref(ref, sizeof(ref), "", "", "0");
rsprintf("<a href=\"%s\">%s</a>&nbsp;&nbsp;", ref, loc("Show all entries"));
}
if (getcfg(lbs->name, "Quick filter", str, sizeof(str))) { if (getcfg(lbs->name, "Quick filter", str, sizeof(str))) {
@ -15987,7 +15998,7 @@ void show_page_navigation(int n_msg, int page_n, int n_page)
if (page_n > 1) { if (page_n > 1) {
sprintf(ref, "page%d", page_n - 1); sprintf(ref, "page%d", page_n - 1);
build_ref(ref, sizeof(ref), "", ""); build_ref(ref, sizeof(ref), "", "", "");
rsprintf("<a href=\"%s\">%s</a>&nbsp;&nbsp;", ref, loc("Previous")); rsprintf("<a href=\"%s\">%s</a>&nbsp;&nbsp;", ref, loc("Previous"));
} }
@ -15999,7 +16010,7 @@ void show_page_navigation(int n_msg, int page_n, int n_page)
for (i = 1; i <= num_pages; i++) { for (i = 1; i <= num_pages; i++) {
sprintf(ref, "page%d", i); sprintf(ref, "page%d", i);
build_ref(ref, sizeof(ref), "", ""); build_ref(ref, sizeof(ref), "", "", "");
if (i <= 3 || (i >= page_n - 1 && i <= page_n + 1) if (i <= 3 || (i >= page_n - 1 && i <= page_n + 1)
|| i >= num_pages - 2) { || i >= num_pages - 2) {
@ -16035,14 +16046,14 @@ void show_page_navigation(int n_msg, int page_n, int n_page)
if (page_n != -1 && n_page < n_msg && page_n * n_page < n_msg) { if (page_n != -1 && n_page < n_msg && page_n * n_page < n_msg) {
sprintf(ref, "page%d", page_n + 1); sprintf(ref, "page%d", page_n + 1);
build_ref(ref, sizeof(ref), "", ""); build_ref(ref, sizeof(ref), "", "", "");
rsprintf("<a href=\"%s\">%s</a>&nbsp;&nbsp;", ref, loc("Next")); rsprintf("<a href=\"%s\">%s</a>&nbsp;&nbsp;", ref, loc("Next"));
} }
if (page_n != -1 && n_page < n_msg) { if (page_n != -1 && n_page < n_msg) {
sprintf(ref, "page"); sprintf(ref, "page");
build_ref(ref, sizeof(ref), "", ""); build_ref(ref, sizeof(ref), "", "", "");
rsprintf("<a href=\"%s\">%s</a>\n", ref, loc("All")); rsprintf("<a href=\"%s\">%s</a>\n", ref, loc("All"));
} }
@ -17397,7 +17408,7 @@ void show_elog_list(LOGBOOK * lbs, INT past_n, INT last_n, INT page_n, char *inf
} }
} }
if (isparam("new_entries")) { if (isparam("new_entries") && atoi(getparam("new_entries")) == 1) {
rsprintf("<tr><td class=\"listframe\">\n"); rsprintf("<tr><td class=\"listframe\">\n");
rsprintf("<table width=\"100%%\" border=0 cellpadding=0 cellspacing=0>\n"); rsprintf("<table width=\"100%%\" border=0 cellpadding=0 cellspacing=0>\n");
rsprintf("<tr><td nowrap width=\"10%%\" class=\"attribname\">%s:</td>", loc("New entries since")); rsprintf("<tr><td nowrap width=\"10%%\" class=\"attribname\">%s:</td>", loc("New entries since"));