Improved guided reports (#3929)
authorPaul Poulain <paul.poulain@biblibre.com>
Tue, 15 Dec 2009 18:55:58 +0000 (19:55 +0100)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Thu, 28 Jan 2010 14:11:46 +0000 (15:11 +0100)
commit7d8b369ba4066d485e5aa7739b1b073f0db80b45
treefdc257c8b5b260dfc4edd30b1c48cef1940f4121
parent94cca6a22b4738d4cec857ecbf40ef81fb2fbdcd
Improved guided reports (#3929)

added runtime parameters for guided reports. Online help:

Can I have run-time defined parameters?

Yes, you can: there is a specific syntax that Koha will understand as 'ask for values when running the report'. The syntax is &lt;&lt;Question to ask|authorised_value&gt;&gt;.

The &lt;&lt; and &gt;&gt; are just delimiters. You must put &lt;&lt; at the beginning and &gt;&gt; at the end of your parameter
The Question to ask will be displayed on the left of the string to enter.
The authorised_value can be omitted if not applicable. If it contains an authorised value category, or <strong>branches</strong> or <strong>itemtype</strong> or <strong>categorycode</strong>, a list with the Koha authorised values will be displayed instead of a free field

Note that you can have more than one parameter in a given SQL
Note that entering nothing at run time won't probably work as you expect. It will be considered as "value empty" not as "ignore this parameter". For example entering nothing for : "title=&lt;&lt;Enter title&gt;&gt;" will display results with title='' (no title). If you want to have to have something not mandatory, use "title like &lt;&lt;Enter title&gt;&gt;" and enter a % at run time instead of nothing
Sample :
SELECT surname,firstname FROM borrowers WHERE branchcode=&lt;&lt;Enter patrons library|branches&gt;&gt; AND surname like &lt;&lt;Enter filter for patron surname (% if none)&gt;&gt;
C4/Reports/Guided.pm
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/guided_reports.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl
reports/guided_reports.pl