Implemented "last default" to restrict quick filter display by default on the last n days
This commit is contained in:
@@ -1475,6 +1475,14 @@ Subst on edit author = $full_name
|
||||
can be displayed. The <b><code>Subtext</code></b> filter works on the
|
||||
entry body text.
|
||||
</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>
|
||||
<b><code>Format <attribute> =
|
||||
<flags>,<css_class_name>,<css_class_value>,<width>,<size></code></b><br>
|
||||
|
||||
+10
-2
@@ -19169,6 +19169,11 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands,
|
||||
|
||||
if (strieq(list[index], "Date")) {
|
||||
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",
|
||||
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;
|
||||
}
|
||||
|
||||
if (isparam("last")) {
|
||||
if (isparam("last") || getcfg(lbs->name, "Last default", str, sizeof(str))) {
|
||||
date_filtering = TRUE;
|
||||
n = atoi(getparam("last"));
|
||||
if (isparam("last"))
|
||||
n = atoi(getparam("last"));
|
||||
else
|
||||
n = atoi(str);
|
||||
|
||||
if (n > 0) {
|
||||
for (i = 0; i < n_msg; i++)
|
||||
|
||||
Reference in New Issue
Block a user