Adds a date picker for SQL reports with the 'date' authorised_value. Updates help
documentation for this new feature, as well.
To test:
1. Create a new report with two date parameters, using the syntax:
<<Label for this selection of date|date>>
2. Run the report
3. Select dates
4. The SQL generated should format the dates properly in ISO, and keep track of which
date is which
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
<ul>
<li>The << and >> are just delimiters. You must put << at the beginning and >> at the end of your parameter</li>
<li>The <strong>Question to ask</strong> will be displayed on the left of the string to enter.
-<li>The <strong>authorised_value</strong> 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</li>
+<li>The <strong>authorised_value</strong> 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. If the authorised value is <strong>date</strong>, a date selector button will be added after the input field</li>
</ul>
<p>Note that you can have more than one parameter in a given SQL</p>
for(my $i=0;$i<($#split/2);$i++) {
my ($text,$authorised_value) = split /\|/,$split[$i*2+1];
my $input;
- if ($authorised_value) {
+ if ($authorised_value eq "date") {
+ $input = qq(<input id="date_$text" type="text" value="" size="10" name="sql_params">
+ <img id="date_picker_$text" alt="Show Calendar" src="/intranet-tmpl/prog/en/lib/calendar/cal.gif">
+ <script type="text/javascript">
+ Calendar.setup(
+ {
+ inputField : "date_$text",
+ ifFormat : "%Y-%m-%d",
+ button : "date_picker_$text"
+ }
+ );
+ </script>
+ );
+ }
+ elsif ($authorised_value) {
my $dbh=C4::Context->dbh;
my @authorised_values;
my %authorised_lib;