Bug 21200 - Allow default values for saved SQL report "date" parameters
Summary: Allow default values for saved SQL report "date" parameters
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: paxed
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-10 05:47 UTC by paxed
Modified: 2018-08-14 06:06 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21200: Allow default values for saved SQL report "date" parameters (8.05 KB, patch)
2018-08-10 07:17 UTC, paxed
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2018-08-10 05:47:46 UTC
It would be nice to let the saved SQL report define default date values, relative to the time the report is being run, for any "date" fields. Often such date fields require entering a date eg. 6 months past or similar, and having the default value in would make it much less likely for the user to choose the wrong date.
Comment 1 paxed 2018-08-10 07:17:27 UTC
Created attachment 77643 [details] [review]
Bug 21200: Allow default values for saved SQL report "date" parameters

Let the saved SQL report define default date values, relative to
the time the report is being run, for any "date" fields.

Often such date fields require entering a date eg. 6 months past
or similar, and having the default value in would make it much less
likely for the user to choose the wrong date.

The default value is put after the "date" text, separated by a pipe.

Format for the default date value is either "now", or "<value> <unit>",
where value is a positive or negative integer value, and unit is
one of "hour", "day", "week", "month", "year".

Not putting in the default value would behave the same as before,
leaving the date input field empty.

For example:

    SELECT count(*) FROM items
    WHERE DATE(dateaccessioned)
        BETWEEN <<Start|date|-6 month>>
            AND <<End|date|now>>

Would default to the last 6 months.
Comment 2 paxed 2018-08-14 06:06:34 UTC
Failing this due to tests, and because bug 21215 will make coding this easier.