X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=koha-tmpl%2Fintranet-tmpl%2Fprog%2Fen%2Fmodules%2Freports%2Fguided_reports_start.tt;h=aa6a6271bef6fe51f8cdcdd16e419e08e35a10ca;hb=659a4aab574e77e65d8e0eb604763f832a5c0574;hp=ea933aaf58f9833af010f6c6035750ac25900f3a;hpb=0486d0c6b781fbda73df19eb825ef330bdc4544a;p=koha.git diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index ea933aaf58..aa6a6271be 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -1,14 +1,14 @@ [% INCLUDE 'doc-head-open.inc' %] -Koha › Reports › Guided Reports Wizard +<title>Koha › Reports › Guided reports wizard [% IF ( saved1 ) %]› Saved Reports [% ELSIF ( create ) %]› Create from SQL -[% ELSIF ( showsql ) %]› Saved Reports › SQL View -[% ELSIF ( execute ) %]› Saved Reports › [% name %] Report -[% ELSIF ( buildx ) %]› Build A Report, Step [% buildx %] of 6: -[% IF ( build1 ) %]Choose a Module -[% ELSIF ( build2 ) %]Pick a Report Type -[% ELSIF ( build3 ) %]Select Columns for Display -[% ELSIF ( build4 ) %]Select Criteria to Limit on +[% ELSIF ( showsql ) %]› Saved reports › SQL view +[% ELSIF ( execute ) %]› Saved reports › [% name %] Report +[% ELSIF ( buildx ) %]› Build a report, step [% buildx %] of 6: +[% IF ( build1 ) %]Choose a module +[% ELSIF ( build2 ) %]Pick a report type +[% ELSIF ( build3 ) %]Select columns for display +[% ELSIF ( build4 ) %]Select criteria to limit on [% ELSIF ( build5 ) %]Pick which columns to total [% ELSIF ( build6 ) %]Select how you want the report ordered [% END %] @@ -24,6 +24,25 @@ <script type="text/javascript"> //<![CDATA[ +var group_subgroups = {}; +var no_subgroup_label = _( "(None)" ); +function load_group_subgroups () { + var group = $("#group").val(); + var sg = $("#subgroup"); + var has_subgroups = false; + $(sg).empty().append('<option value="">' + no_subgroup_label + '</option>'); + if (group) { + $.each( group_subgroups[group], function(index, value) { + has_subgroups = true; + $('<option value="' + value[0] + '">' + value[1] + '</option>').appendTo(sg); + } ); + } + if (has_subgroups) { + $(sg).show(); + } else { + $(sg).hide(); + } +} $(document).ready(function(){ [% IF ( showsql ) %] $("#sql").focus(function() { @@ -56,6 +75,9 @@ $(document).ready(function(){ positionFixed: false, size: 20 }); + // redefine the datepicker's default because reports require ISO + // http://jqueryui.com/demos/datepicker/#option-dateFormat + $( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" ); }); //]]> </script> @@ -66,17 +88,17 @@ $(document).ready(function(){ <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> -› <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided Reports Wizard</a> +› <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided reports wizard</a> › -[% IF ( saved1 ) %]Saved Reports +[% IF ( saved1 ) %]Saved reports [% ELSIF ( create ) %]Create from SQL -[% ELSIF ( showsql ) %]<a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved Reports</a> › SQL View -[% ELSIF ( execute ) %]<a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved Reports</a> › <em>[% name %]</em> Report -[% ELSIF ( buildx ) %]<a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build A Report</a> › Step [% buildx %] of 6: - [% IF ( build1 ) %]Choose a Module - [% ELSIF ( build2 ) %]Pick a Report Type - [% ELSIF ( build3 ) %]Select Columns for Display - [% ELSIF ( build4 ) %]Select Criteria to Limit on +[% ELSIF ( showsql ) %]<a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports</a> › SQL view +[% ELSIF ( execute ) %]<a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports</a> › <em>[% name %]</em> Report +[% ELSIF ( buildx ) %]<a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build a report</a> › Step [% buildx %] of 6: + [% IF ( build1 ) %]Choose a module + [% ELSIF ( build2 ) %]Pick a report type + [% ELSIF ( build3 ) %]Select columns for display + [% ELSIF ( build4 ) %]Select criteria to limit on [% ELSIF ( build5 ) %]Pick which columns to total [% ELSIF ( build6 ) %]Select how you want the report ordered [% END %] @@ -90,12 +112,12 @@ $(document).ready(function(){ [% INCLUDE "reports-toolbar.inc" %] [% IF ( start ) %] - <h2>Guided Reports</h2> + <h2>Guided reports</h2> <p>Use the guided reports engine to create non standard reports. This feature aims to provide some middle ground between the built in canned reports and writing custom SQL reports.</p> - <h3>Build And Run Reports</h3> + <h3>Build and run reports</h3> [% IF ( CAN_user_reports_create_reports ) %] <form action="/cgi-bin/koha/reports/guided_reports.pl"> <input type="hidden" name="phase" value="Build new" /> @@ -118,12 +140,12 @@ canned reports and writing custom SQL reports.</p> <p>Use the reports dictionary to define custom criteria to use in your reports</p> <form action="/cgi-bin/koha/reports/dictionary.pl"> <input type="hidden" name="phase" value="View Dictionary"/> -<input type="submit" name="submit" value="View Dictionary"/> +<input type="submit" name="submit" value="View dictionary"/> </form> [% END %] [% IF ( saved1 ) %] -[% IF ( savedreports ) %]<h1>Saved Reports</h1> +[% IF ( savedreports ) %]<h1>Saved reports</h1> <div id="pagertable_reports"> [% INCLUDE 'table-pager.inc' perpage='20' %] @@ -133,12 +155,17 @@ canned reports and writing custom SQL reports.</p> <thead> <tr> <th>ID</th> - <th>Report Name</th> + <th>Report name</th> <th>Type</th> + <th>Area</th> + <th>Group</th> + <th>Subgroup</th> <th>Notes</th> <th>Author</th> - <th>Creation Date</th> - <th>Saved Results</th> + <th>Creation date</th> + <th>Public</th> + [% IF (usecache) %] <th>Cache expiry (seconds)</th> [% END %] + <th>Saved results</th> <th>Saved SQL</th> <th> </th> <th> </th> @@ -150,9 +177,18 @@ canned reports and writing custom SQL reports.</p> <td>[% savedreport.id %]</td> <td>[% savedreport.report_name %]</td> <td>[% savedreport.type %]</td> +<td>[% savedreport.areaname %]</td> +<td>[% savedreport.groupname %]</td> +<td>[% savedreport.subgroupname %]</td> <td>[% savedreport.notes %]</td> <td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> <td>[% savedreport.date_created %]</td> +[% IF (savedreport.public) %] +<td>Yes</td> +[% ELSE %] +<td>No</td> +[% END %] +[% IF (usecache) %] <td>[% savedreport.cache_expiry %]</td> [% END %] <td>[% IF ( savedreport.date_run ) %]<a href="/cgi-bin/koha/reports/guided_reports.pl?phase=retrieve%20results&id=[% savedreport.id %]">[% savedreport.date_run %]</a>[% END %] </td> <td> @@ -199,16 +235,36 @@ canned reports and writing custom SQL reports.</p> [% IF ( build1 ) %] -<h1>Build A Report</h1> +[% IF ( cache_error) %] +<div class="dialog alert"> +<b> Please choose a cache_expiry less than 30 days </b> +</div> +[% END %] +<h1>Build a report</h1> <form action="/cgi-bin/koha/reports/guided_reports.pl"> <fieldset class="rows"> -<legend>Step 1 of 6: Choose a Module to Report on</legend> -<ol><li><label for="areas">Choose: </label><select name="areas" id="areas"> +<legend>Step 1 of 6: Choose a module to report on,[% IF (usecache) %] Set cache expiry, [% END %] and Choose report visibility </legend> +<ol><li><label for="area">Choose: </label><select name="area" id="area"> [% FOREACH area IN areas %] <option value="[% area.id %]">[% area.name %]</option> [% END %] -</select></li></ol> -</fieldset> +</select></li> +[% IF (public) %] + <li><label for="public">Report is public:</label><select id="public" name="public"> <option value="0">No (default)</option> <option value="1" selected="selected">Yes</public> </select></li> +[% ELSE %] + <li><label for="public">Report is public:</label><select id="public" name="public"> <option value="0" selected="selected">No (default)</option> <option value="1">Yes</public> </select></li> +[% END %] +[% IF (usecache) %] <li> +<label for="cache_expiry">Cache expiry:</label><input type="text" id="cache_expiry" name="cache_expiry" value="[% cache_expiry %]"></input> +<select id="cache_expiry_units" name="cache_expiry_units"> +<option value="seconds">Seconds (default)</option> +<option value="minutes">Minutes</option> +<option value="hours">Hours</option> +<option value="days">Days</option> +</select> +</li>[% END %] +</ol> +<ofieldset> <fieldset class="action"> <input type="hidden" name="phase" value="Report on this Area" /> <input type="submit" name="submit" value="Next >>" /> @@ -222,7 +278,9 @@ canned reports and writing custom SQL reports.</p> <h1>Build A Report</h1> <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> <input type="hidden" name="area" value="[% area %]" /> -<fieldset class="rows"><legend>Step 2 of 6: Pick a Report Type</legend> +<input type="hidden" name="public" value="[% public %]" /> +<input type="hidden" name="cache_expiry" value="[% cache_expiry %]" /> +<fieldset class="rows"><legend>Step 2 of 6: Pick a report type</legend> <ol><li><label for="types">Choose: </label> <select id="types" name="types"> <option value="1">Tabular</option> @@ -249,12 +307,14 @@ canned reports and writing custom SQL reports.</p> [% END %] [% IF ( build3 ) %] -<h3>Step 3 of 6: Select Columns for Display</h3> +<h3>Step 3 of 6: Select columns for display</h3> <p>Note: Be careful selecting when selecting columns. If your choice is too broad it could result in a very large report that will either not complete, or slow your system down.</p> <form id="column_submit" action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> <input type="hidden" name="area" value="[% area %]" /> <input type="hidden" name="type" value="[% type %]" /> + <input type="hidden" name="public" value="[% public %]" /> + <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" /> <fieldset> <div class="yui-g"> <div class="yui-u first"> <div style="float: left;"><select id="availableColumns" name="oldcolumns2" multiple="multiple" size="25" style="min-width: 200px;height:300px;"> @@ -303,7 +363,9 @@ canned reports and writing custom SQL reports.</p> <input type="hidden" name="area" value="[% area %]" /> <input type="hidden" name="type" value="[% type %]" /> <input type="hidden" name="column" value="[% column %]" /> - <fieldset><legend>Step 4 of 6: Select Criteria to Limit on</legend> + <input type="hidden" name="public" value="[% public %]" /> + <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" /> + <fieldset><legend>Step 4 of 6: Select criteria to limit on</legend> <table> [% FOREACH criteri IN criteria %] <tr> @@ -313,16 +375,7 @@ canned reports and writing custom SQL reports.</p> </td> [% IF ( criteri.date ) %] <td> - <input type="text" size="10" id="[% criteri.name %]_value" name="[% criteri.name %]_value" value="" /> - <img src="[% themelang %]/lib/calendar/cal.gif" id="buttonfrom[% criteri.name %]" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" /> - <script type="text/javascript"> - Calendar.setup({ - inputField : "[% criteri.name %]_value", - ifFormat : "[% DHTMLcalendar_dateformat %]", - button : "buttonfrom[% criteri.name %]", - align : "Tl" - }); - </script> + <input type="text" size="10" id="[% criteri.name %]_value" name="[% criteri.name %]_value" value="" class="datepicker" /> <span class="hint">[% INCLUDE 'date-format.inc' %]</span> </td> </tr> @@ -336,27 +389,9 @@ canned reports and writing custom SQL reports.</p> [% ELSE %] [% IF ( criteri.daterange ) %] <td>from - <input type="text" size="10" id="from_[% criteri.name %]_value" name="from_[% criteri.name %]_value" value="" /> - <img src="[% themelang %]/lib/calendar/cal.gif" id="buttonfromfrom_[% criteri.name %]" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" /> - <script type="text/javascript"> - Calendar.setup({ - inputField : "from_[% criteri.name %]_value", - ifFormat : "[% DHTMLcalendar_dateformat %]", - button : "buttonfromfrom_[% criteri.name %]", - align : "Tl" - }); - </script> + <input type="text" size="10" id="from_[% criteri.name %]_value" name="from_[% criteri.name %]_value" value="" class="datepickerfrom" /> to - <input type="text" size="10" id="to_[% criteri.name %]_value" name="to_[% criteri.name %]_value" value="" /> - <img src="[% themelang %]/lib/calendar/cal.gif" id="buttonfromto_[% criteri.name %]" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" /> - <script type="text/javascript"> - Calendar.setup({ - inputField : "to_[% criteri.name %]_value", - ifFormat : "[% DHTMLcalendar_dateformat %]", - button : "buttonfromto_[% criteri.name %]", - align : "Tl" - }); - </script> + <input type="text" size="10" id="to_[% criteri.name %]_value" name="to_[% criteri.name %]_value" value="" class="datepickerto" /> <span class="hint">[% INCLUDE 'date-format.inc' %]</span> </td> </tr> @@ -377,7 +412,7 @@ canned reports and writing custom SQL reports.</p> </fieldset> [% IF ( definitions ) %] -<fieldset><legend>Dictionary Definitions</legend><table> +<fieldset><legend>Dictionary definitions</legend><table> [% FOREACH definition IN definitions %] <tr><td><input type="checkbox" name="definition" value="[% definition.id %]" /> [% definition.name %]</td></tr> [% END %] @@ -399,6 +434,8 @@ canned reports and writing custom SQL reports.</p> <input type="hidden" name="column" value="[% column %]" /> <input type="hidden" name="definition" value="[% definition %]" /> <input type="hidden" name="criteria" value="[% criteriastring %]" /> +<input type="hidden" name="public" value="[% public %]" /> +<input type="hidden" name="cache_expiry" value="[% cache_expiry %]" /> <fieldset><table> [% FOREACH total_b IN total_by %] <tr><td><input type="checkbox" name="total_by" id="[% total_b.name %]" value="[% total_b.name %]" /> <label for="[% total_b.name %]">[% total_b.name %]</label></td> @@ -413,7 +450,7 @@ canned reports and writing custom SQL reports.</p> [% END %] </table></fieldset> -<fieldset class="action"><input type="hidden" name="phase" value="Choose These Operations" /> +<fieldset class="action"><input type="hidden" name="phase" value="Choose these operations" /> <input type="button" name="back" value="<< Back" onclick="javascript:history.back()" /> <input type="submit" name="submit" value="Next >>" /></fieldset> </form> @@ -429,6 +466,8 @@ canned reports and writing custom SQL reports.</p> <input type="hidden" name="criteria" value="[% criteriastring %]" /> <input type="hidden" name="definition" value="[% definition %]" /> <input type="hidden" name="totals" value="[% totals %]" /> +<input type="hidden" name="public" value="[% public %]" /> +<input type="hidden" name="cache_expiry" value="[% cache_expiry %]" /> <fieldset><table>[% FOREACH order_b IN order_by %] <tr><td><input type="checkbox" id="[% order_b.name %]" name="order_by" value="[% order_b.name %]" /> <label for="[% order_b.name %]">[% order_b.name %]</label></td><td> <select name="[% order_b.name %]_ovalue"> @@ -443,14 +482,14 @@ canned reports and writing custom SQL reports.</p> </table></fieldset> <fieldset class="action"> -<input type="hidden" name="phase" value="Build Report" /> +<input type="hidden" name="phase" value="Build report" /> <input type="submit" name="submit" value="Finish" /></fieldset> </form> [% END %] [% IF ( showreport ) %] -<h1>Confirm Custom Report</h1> +<h1>Confirm custom report</h1> <p>Your report will be generated with the following SQL statement.</p> <p> [% sql |html %] @@ -459,6 +498,8 @@ canned reports and writing custom SQL reports.</p> <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> <input type="hidden" name="sql" value="[% sql %]" /> <input type="hidden" name="type" value="[% type %]" /> +<input type="hidden" name="public" value="[% public %]" /> +<input type="hidden" name="cache_expiry" value="[% cache_expiry %]" /> <p>You will need to save the report before you can execute it</p> <fieldset class="action"><input type="hidden" name="phase" value="Save" /> <input type="submit" name="submit" value="Save" /> </fieldset> @@ -469,10 +510,38 @@ canned reports and writing custom SQL reports.</p> <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> <input type="hidden" name="sql" value="[% sql |html %]" /> <input type="hidden" name="type" value="[% type %]" /> +<input type="hidden" name="area" value="[% area %]" /> +<input type="hidden" name="public" value="[% public %]" /> +<input type="hidden" name="cache_expiry" value="[% cache_expiry %]" /> <fieldset class="rows"> -<legend>Save Your Custom Report</legend> +<legend>Save your custom report</legend> <ol> - <li><label for="reportname">Report Name: </label><input type="text" id="reportname" name="reportname" /></li> + <li><label for="reportname">Report name: </label><input type="text" id="reportname" name="reportname" /></li> + [% IF groups_with_subgroups %] + <li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> + [% FOR g IN groups_with_subgroups %] + [% IF g.selected %] + <option value="[% g.id %]" selected>[% g.name %]</option> + [% ELSE %] + <option value="[% g.id %]">[% g.name %]</option> + [% END %] + <script type="text/javascript"> + var g_sg = new Array(); + [% FOR sg IN g.subgroups %] + g_sg.push(["[% sg.id %]", "[% sg.name %]"]); + [% IF sg.selected %] + $(document).ready(function() { + $("#subgroup").val("[% sg.id %]"); + }); + [% END %] + [% END %] + group_subgroups["[% g.id %]"] = g_sg; + </script> + [% END %] + </select></li> + <li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> + </select></li> + [% END %] <li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li> </ol></fieldset> <fieldset class="action"><input type="hidden" name="phase" value="Save Report" /> @@ -486,24 +555,22 @@ canned reports and writing custom SQL reports.</p> <input type='hidden' name='reports' value="[% reports %]" /> <h1>Enter parameters for report [% name %]:</h1> [% IF ( notes ) %]<p>[% notes %]</p>[% END %] + <fieldset class="rows"> + <ol> [% FOREACH sql_param IN sql_params %] [% IF sql_param.input == 'date' %] - <p> - [% sql_param.entry %]: <input id="date_[% sql_param_entry %]" type="text" value="" size="10" name="sql_params"> - <img id="date_picker_[% sql_param_entry %]" alt="Show Calendar" src="/intranet-tmpl/prog/en/lib/calendar/cal.gif"> - <script type="text/javascript"> - Calendar.setup( { - inputField : "date_[% sql_param_entry %]", - ifFormat : "%Y-%m-%d", - button : "date_picker_[% sql_param_entry %]" - } ); - </script> - </p> + <li> + <label for="date_[% sql_param_entry %][% loop.count %]">[% sql_param.entry %]:</label> <input id="date_[% sql_param_entry %][% loop.count %]" type="text" value="" size="10" name="sql_params" class="datepicker" /> + </li> + [% ELSIF ( sql_param.input == 'text' ) %] + <li><label for="sql_params[% loop.count %]">[% sql_param.entry %]: </label><input id="sql_params[% loop.count %]" type="text" name="sql_params" /></li> [% ELSE %] - <p>[% sql_param.entry %]: [% sql_param.input %]</p> + <li><label for="sql_params_[% sql_param.labelid %]">[% sql_param.entry %]:</label> [% sql_param.input %]</li> [% END %] [% END %] - <input type='submit' value='Run the report'/> + </ol> + </fieldset> + <fieldset class="action"><input type="submit" value="Run the report" /></fieldset> </form> [% END %] @@ -526,8 +593,8 @@ canned reports and writing custom SQL reports.</p> <fieldset class="action"> <label for="format">Download the report: </label> <select name="format" id="format"> -<option value="csv">Comma Separated Text</option> -<option value="tab">Tab Separated Text</option> +<option value="csv">Comma separated text</option> +<option value="tab">Tab separated text</option> </select> <input type="hidden" name="sql" value="[% sql |html %]" /> <input type="hidden" name="phase" value="Export" /> @@ -537,14 +604,58 @@ canned reports and writing custom SQL reports.</p> [% END %] [% IF ( create ) %] +<script type="text/javascript"> +$(document).ready(function() { + load_group_subgroups(); +}); +</script> <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> <fieldset class="rows"> -<legend>Create Report From SQL</legend> +<legend>Create report from SQL</legend> <ol> - <li><label for="reportname">Report Name:</label> + <li><label for="reportname">Report name:</label> [% IF ( reportname ) %]<input type="text" id="reportname" name="reportname" value="[% reportname %]" /> [% ELSE %]<input type="text" id="reportname" name="reportname" />[% END %] </li> + [% IF groups_with_subgroups %] + <li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> + [% FOR g IN groups_with_subgroups %] + [% IF g.selected %] + <option value="[% g.id %]" selected>[% g.name %]</option> + [% ELSE %] + <option value="[% g.id %]">[% g.name %]</option> + [% END %] + <script type="text/javascript"> + var g_sg = new Array(); + [% FOR sg IN g.subgroups %] + g_sg.push(["[% sg.id %]", "[% sg.name %]"]); + [% IF sg.selected %] + $(document).ready(function() { + $("#subgroup").val("[% sg.id %]"); + }); + [% END %] + [% END %] + group_subgroups["[% g.id %]"] = g_sg; + </script> + [% END %] + </select></li> + <li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> + </select></li> + [% END %] +[% IF (public) %] + <li><label for="public">Report is public:</label><select id="public" name="public"> <option value="0">No (default)</option> <option value="1" selected="selected">Yes</public> </select></li> +[% ELSE %] + <li><label for="public">Report is public:</label><select id="public" name="public"> <option value="0" selected="selected">No (default)</option> <option value="1">Yes</public> </select></li> +[% END %] +[% IF (usecache) %] <li> +<label for="cache_expiry">Cache expiry:</label><input type="text" id="cache_expiry" name="cache_expiry" value="[% cache_expiry %]"></input> +<select id="cache_expiry_units" name="cache_expiry_units"> +<option value="seconds" selected="selected">Seconds (default)</option> +<option value="minutes">Minutes</option> +<option value="hours">Hours</option> +<option value="days">Days</option> +</select> +</li>[% END %] <li><label for="notes">Notes:</label> <textarea id="notes" name="notes" cols="50" rows="2">[% notes %]</textarea></li> <li><label for="types">Type:</label> <select id="types" name="types"> @@ -583,7 +694,7 @@ Sub report:<select name="subreport"> </select> <br /> <input type="hidden" name="phase" value="Save Compound" /> -<input type="submit" name="submit" value="Save Compound" /> +<input type="submit" name="submit" value="Save compound" /> </form> [% END %] @@ -594,7 +705,7 @@ Sub report:<select name="subreport"> [% IF ( retresults ) %] -<h1>Saved Report Results</h1> +<h1>Saved report results</h1> <h2>[% name %]</h2> <p>[% notes %]</p> <table> @@ -615,13 +726,57 @@ Sub report:<select name="subreport"> [% END %] [% IF ( editsql ) %] +<script type="text/javascript"> +$(document).ready(function() { + load_group_subgroups(); +}); +</script> <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> <input type="hidden" name="phase" value="Update SQL" /> <input type="hidden" name="id" value="[% id %]"/> <fieldset class="rows"> <legend>Edit SQL report</legend> <ol> -<li><label for="reportname">Report Name:</label><input type="text" id="reportname" name="reportname" value="[% reportname %]" size="50" /></li> +<li><label for="reportname">Report name:</label><input type="text" id="reportname" name="reportname" value="[% reportname %]" size="50" /></li> + [% IF groups_with_subgroups %] + <li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> + [% FOR g IN groups_with_subgroups %] + [% IF g.selected %] + <option value="[% g.id %]" selected>[% g.name %]</option> + [% ELSE %] + <option value="[% g.id %]">[% g.name %]</option> + [% END %] + <script type="text/javascript"> + var g_sg = new Array(); + [% FOR sg IN g.subgroups %] + g_sg.push(["[% sg.id %]", "[% sg.name %]"]); + [% IF sg.selected %] + $(document).ready(function() { + $("#subgroup").val("[% sg.id %]"); + }); + [% END %] + [% END %] + group_subgroups["[% g.id %]"] = g_sg; + </script> + [% END %] + </select></li> + <li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> + </select></li> + [% END %] +[% IF (public) %] + <li><label for="public">Report is public:</label><select id="public" name="public"> <option value="0">No (default)</option> <option value="1" selected="selected">Yes</public> </select></li> +[% ELSE %] + <li><label for="public">Report is public:</label><select id="public" name="public"> <option value="0" selected="selelcted">No (default)</option> <option value="1">Yes</public> </select></li> +[% END %] +[% IF (usecache) %] <li> +<label for="cache_expiry">Cache expiry:</label><input type="text" id="cache_expiry" name="cache_expiry" value="[% cache_expiry %]"></input> +<select id="cache_expiry_units" name="cache_expiry_units"> +<option value="seconds">Seconds (default)</option> +<option value="minutes">Minutes</option> +<option value="hours">Hours</option> +<option value="days">Days</option> +</select> +</li>[% END %] <li><label for="notes">Notes:</label><textarea id="notes" name="notes" cols="50" rows="2">[% notes %]</textarea></li> <li><textarea id="sql" name="sql" rows="10" cols="60">[% sql %]</textarea></li> </ol> @@ -643,9 +798,9 @@ Sub report:<select name="subreport"> [% IF ( id ) %] <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Run%20this%20report">Run this report</a></li> [% END %] - <li>Access this report from the: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved Reports Page</a></li> - <li>Schedule this report to run using the: <a href="/cgi-bin/koha/tools/scheduler.pl">Scheduler Tool</a></li> - <li>Return to: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Guided Reports</a></li> + <li>Access this report from the: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports page</a></li> + <li>Schedule this report to run using the: <a href="/cgi-bin/koha/tools/scheduler.pl">Scheduler tool</a></li> + <li>Return to: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Guided reports</a></li> </ul> [% END %] [% END %] @@ -659,12 +814,13 @@ Sub report:<select name="subreport"> <br />Use of this keyword is not allowed in Koha reports due to security and data integrity risks. Only SELECT queries are allowed. <br />Please return to the "Saved Reports" screen and delete this report or retry creating a new one. [% ELSIF ( error.queryerr ) %]The database returned the following error: <br />[% error.queryerr %]<br />Please check the log for further details. + [% ELSIF ( error.cache_expiry ) %]Please select a cache expiry less than 30 days. [% ELSE %] [% END %] [% END %] </div> <fieldset class="action"><input type="hidden" name="phase" value="Use saved" /> -<input type="submit" name="submit" value="Saved Reports" /></fieldset> +<input type="submit" name="submit" value="Saved reports" /></fieldset> </form> [% END %] @@ -674,24 +830,46 @@ Sub report:<select name="subreport"> [% IF ( saved1 ) %] <div id="saved-reports-filter"> +<script type="text/javascript"> +$(document).ready(function() { + no_subgroup_label = _( "-- All --" ); + load_group_subgroups(); +}); +</script> <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get"> <input type="hidden" name="phase" value="Use saved" /> <input type="hidden" name="filter_set" value="1" /> <fieldset class="brief"> <h3>Filter</h3> <ol> - <li><label for="filter_date">Date: - <img src="[% themelang %]/lib/calendar/cal.gif" id="datedueto_button" alt="Show Calendar" /></label> <input type="text" id="filter_date" name="filter_date" size="10" value="[% filter_date %]" /> + <li><label for="group">Choose Group and Subgroup: </label> + <select name="group" id="group" onChange="load_group_subgroups();"> + <option value="">-- All --</option> + [% FOR g IN groups_with_subgroups %] + [% IF g.selected %] + <option value="[% g.id %]" selected>[% g.name %]</option> + [% ELSE %] + <option value="[% g.id %]">[% g.name %]</option> + [% END %] + <script type="text/javascript"> + var g_sg = new Array(); + [% FOR sg IN g.subgroups %] + g_sg.push(["[% sg.id %]", "[% sg.name %]"]); + [% IF sg.selected %] + $(document).ready(function() { + $("#subgroup").val("[% sg.id %]"); + }); + [% END %] + [% END %] + group_subgroups["[% g.id %]"] = g_sg; + </script> + [% END %] + </select> + <select name="subgroup" id="subgroup"></select> + </li> + <li><label for="filter_date">Date:</label> <input type="text" id="filter_date" name="filter_date" size="10" value="[% filter_date %]" class="datepicker" /> <div class="hint">[% INCLUDE 'date-format.inc' %]</div> - <script type="text/javascript"> - Calendar.setup( - { - inputField : "filter_date", - ifFormat : "[% DHTMLcalendar_dateformat %]", - button : "filter_date_button" - } - ); - </script> + </li> <li><label for="filter_author">Author:</label> <input type="text" id="filter_author" name="filter_author" value="[% filter_author %]" /></li> <li><label for="filter_keyword">Keyword:</label> <input type="text" id="filter_keyword" name="filter_keyword" value="[% filter_keyword %]" /></li>