mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Implemented "last default" to restrict quick filter display by default on the last n days
This commit is contained in:
parent
927ffac38c
commit
e41cb58950
@ -1475,6 +1475,14 @@ Subst on edit author = $full_name
|
|||||||
can be displayed. The <b><code>Subtext</code></b> filter works on the
|
can be displayed. The <b><code>Subtext</code></b> filter works on the
|
||||||
entry body text.
|
entry body text.
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<b><code>Last default = <n></code></b><br>
|
||||||
|
Some logbooks are very big ans searching through all entries with
|
||||||
|
quick filter can be time consuming. This option sets a default value
|
||||||
|
for the <code><b>Date</b></code> quick filter, so that by default
|
||||||
|
only the <n> days are displayed.
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><code>Format <attribute> =
|
<b><code>Format <attribute> =
|
||||||
<flags>,<css_class_name>,<css_class_value>,<width>,<size></code></b><br>
|
<flags>,<css_class_name>,<css_class_value>,<width>,<size></code></b><br>
|
||||||
|
|||||||
12
src/elogd.c
12
src/elogd.c
@ -19170,6 +19170,11 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
|
|||||||
if (strieq(list[index], "Date")) {
|
if (strieq(list[index], "Date")) {
|
||||||
i = isparam("last") ? atoi(getparam("last")) : 0;
|
i = isparam("last") ? atoi(getparam("last")) : 0;
|
||||||
|
|
||||||
|
if (i == 0 && getcfg(lbs->name, "Last default", str, sizeof(str))) {
|
||||||
|
i = atoi(str);
|
||||||
|
setparam("last", str);
|
||||||
|
}
|
||||||
|
|
||||||
rsprintf("<select title=\"%s\" name=last onChange=\"document.form1.submit()\">\n",
|
rsprintf("<select title=\"%s\" name=last onChange=\"document.form1.submit()\">\n",
|
||||||
loc("Select period"));
|
loc("Select period"));
|
||||||
|
|
||||||
@ -20419,9 +20424,12 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa
|
|||||||
msg_list[i].lbs = NULL;
|
msg_list[i].lbs = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isparam("last")) {
|
if (isparam("last") || getcfg(lbs->name, "Last default", str, sizeof(str))) {
|
||||||
date_filtering = TRUE;
|
date_filtering = TRUE;
|
||||||
n = atoi(getparam("last"));
|
if (isparam("last"))
|
||||||
|
n = atoi(getparam("last"));
|
||||||
|
else
|
||||||
|
n = atoi(str);
|
||||||
|
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
for (i = 0; i < n_msg; i++)
|
for (i = 0; i < n_msg; i++)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user