3 [%- BLOCK area_name -%]
5 [%- CASE 'CIRC' -%]Circulation
6 [%- CASE 'CAT' -%]Catalog
7 [%- CASE 'PAT' -%]Patrons
8 [%- CASE 'ACQ' -%]Acquisitions
9 [%- CASE 'ACC' -%]Accounts
10 [%- CASE 'SER' -%]Serials
14 [% INCLUDE 'doc-head-open.inc' %]
16 <title>Koha › Reports › Guided reports wizard [%- IF ( saved1 ) -%]› Saved reports
17 [%- ELSIF ( create ) -%]› Create from SQL
18 [%- ELSIF ( showsql ) -%]› Saved reports › SQL view
19 [%- ELSIF ( execute ) -%]› Saved reports › [% name %] Report
20 [%- ELSIF ( editsql ) -%]› Saved reports › Edit SQL report
22 [%- IF ( build1 ) -%]› Build a report, step 1 of 6: Choose a module
23 [%- ELSIF ( build2 ) -%]› Build a report, step 2 of 6: Pick a report type
24 [%- ELSIF ( build3 ) -%]› Build a report, step 3 of 6: Select columns for display
25 [%- ELSIF ( build4 ) -%]› Build a report, step 4 of 6: Select criteria to limit on
26 [%- ELSIF ( build5 ) -%]› Build a report, step 5 of 6: Pick which columns to total
27 [%- ELSIF ( build6 ) -%]› Build a report, step 6 of 6: Select how you want the report ordered
30 [% INCLUDE 'doc-head-close.inc' %]
31 [% INCLUDE 'calendar.inc' %]
32 <style type="text/css">
33 #sql { width: 90%; height: 9em;}
36 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
37 [% INCLUDE 'datatables.inc' %]
40 <script type="text/javascript">
42 var group_subgroups = {};
43 [% FOREACH group IN groups_with_subgroups %]
44 var gid = "[% group.id %]"
45 group_subgroups[gid] = new Array();
46 [% FOREACH subgroup IN group.subgroups %]
47 var sgid = "[% subgroup.id %]";
48 var sgname = "[% subgroup.name %]";
49 group_subgroups[gid].push([sgid, sgname]);
53 function load_group_subgroups () {
54 var group = $("#group_select").val();
55 var sg = $("#subgroup");
56 $(sg).find('option[value!=""]').each(function() {
61 var select = $(sg).find('select')[0];
62 $.each( group_subgroups[group], function(index, value) {
63 $('<option value="' + value[0] + '">' + value[1] + '</option>').appendTo(select);
65 $("#subgroup, #subgroup *").show();
69 $(document).ready(function(){
71 $(".goback").on("click",function(e){
73 window.history.back();
76 $("#addColumn").on("click",function(){
80 $("#delColumn").on("click",function(){
85 var rtable = $("#table_reports").dataTable($.extend(true, {}, dataTablesDefaults, {
87 'sDom': 't<"bottom pager"ilpf>',
88 'sPaginationType': 'four_button',
89 'aaSorting': [[ 1, "asc" ]],
91 { 'bSortable': false, 'bSearchable':false, 'aTargets': [0, -1] },
92 { 'bSearchable': false, 'aTargets': [3] },
93 { "aTargets": [ 1, 2 ], "sType": "natural" }
96 null,null,null,null,null,null,null,null,{ "sType": "title-string" },null,[% IF (usecache) %]null,[% END %]null,null
99 'sZeroRecords': _("No matching reports found")
103 var rtabs = $("#tabs").tabs();
104 rtabs.on("tabsactivate", function(e, ui) {
105 $("#subgroup_filter option").each(function() {
106 if($(this).val().length > 0) {
110 rtable.fnFilter('', 4);
111 rtable.fnFilter('', 5);
112 rtable.fnSetColumnVis(4, true);
113 rtable.fnSetColumnVis(5, true);
115 var g_id = $(ui.newTab).children().attr('id');
116 var g_name = $(ui.newTab).text();
117 if ( g_name == _("All") ) {
122 if (g_id && g_id.length > 0) {
123 rtable.fnFilter('^' + g_name + '$', 4, true, true, true, false);
124 rtable.fnSetColumnVis(4, false);
125 for(var i in group_subgroups[g_id]) {
126 $("#subgroup_filter").append(
127 '<option value="' + group_subgroups[g_id][i][0] + '">'
128 + group_subgroups[g_id][i][1] + '</option>'
131 $("#subgroup_filter_block").show();
133 $("#subgroup_filter_block").hide();
136 $("#subgroup_filter_block").hide();
138 $("#subgroup_filter").change(function() {
139 var selected = $(this).find('option:selected');
140 var sg_id = $(selected).val();
141 var sg_name = $(selected).text();
142 if (sg_id.length > 0) {
143 rtable.fnFilter('^' + sg_name + '$', 5, true, true, true, false);
144 rtable.fnSetColumnVis(5, false);
146 rtable.fnFilter('', 5);
147 rtable.fnSetColumnVis(5, true);
151 $("#reports_form").submit(function(){
152 var checkedItems = $("input[name=ids]:checked");
153 if ($(checkedItems).size() == 0) {
154 alert(_("You must select one or more reports to delete"));
157 $(checkedItems).parents('tr').addClass("warn");
158 if( confirm(_("Are you sure you want to delete the selected reports?")) ) {
161 $(checkedItems).parents('tr').removeClass("warn");
168 $("#sql").focus(function() {
173 $("#table_reports").delegate(".confirmdelete", 'click', function(){
174 $(this).parents('tr').attr("class","warn");
175 if(confirm(_("Are you sure you want to delete this saved report?"))){
178 $(this).parents('tr').attr("class","");
183 [% IF (create || editsql || save) %]
184 $("#select_group").change(function() {
185 if($(this).prop('checked')) {
186 $("#group_input").attr('disabled', 'disabled');
187 $("#groupdesc_input").attr('disabled', 'disabled');
188 $("#group_select").attr('disabled', false);
189 if ($("#group_select").val().length > 0) {
190 $("#select_subgroup").prop('checked', true);
191 $("#select_subgroup").change();
192 $("#subgroup, #subgroup *").show();
194 $("#subgroup").hide();
198 $("#create_group").change(function() {
199 if($(this).prop('checked')) {
200 $("#group_input").attr('disabled', false);
201 $("#groupdesc_input").attr('disabled', false);
202 $("#group_select").attr('disabled', 'disabled');
203 $("#create_subgroup").prop('checked', true).change();
204 $("#subgroup_select").hide();
205 $("#subgroup input[type='radio']").hide();
206 $("#subgroup label[for]").hide();
207 $("#subgroup_input").show();
208 $("#subgroupdesc_input").show();
209 $("#subgroup").show();
212 $("#select_subgroup").change(function() {
213 if($(this).prop('checked')) {
214 $("#subgroup_select").attr('disabled', false);
215 $("#subgroup_input").attr('disabled', 'disabled');
216 $("#subgroupdesc_input").attr('disabled', 'disabled');
219 $("#create_subgroup").change(function() {
220 if($(this).prop('checked')) {
221 $("#subgroup_input").attr('disabled', false);
222 $("#subgroupdesc_input").attr('disabled', false);
223 $("#subgroup_select").attr('disabled', 'disabled');
226 $("#select_group").change();
227 $("#select_subgroup").change();
233 <body id="rep_guided_reports_start" class="rep">
234 [% INCLUDE 'header.inc' %]
235 [% INCLUDE 'circ-search.inc' %]
237 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a>
238 › <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
239 › <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided reports wizard</a>
241 [% IF ( saved1 ) %]› Saved reports
242 [% ELSIF ( create ) %]› Create from SQL
243 [% ELSIF ( showsql ) %]› <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports</a> › SQL view
244 [% ELSIF ( editsql ) %]› <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports</a> › Edit SQL report
245 [% ELSIF ( execute ) %]› <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports</a> › <em>[% name %]</em> Report
246 [% ELSIF ( build1 || build2 || build3 || build4 || build5 || build6 ) %]› <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build a report</a>
247 [% IF ( build1 ) %]› Step 1 of 6: Choose a module
248 [% ELSIF ( build2 ) %]› Step 2 of 6: Pick a report type
249 [% ELSIF ( build3 ) %]› Step 3 of 6: Select columns for display
250 [% ELSIF ( build4 ) %]› Step 4 of 6: Select criteria to limit on
251 [% ELSIF ( build5 ) %]› Step 5 of 6: Pick which columns to total
252 [% ELSIF ( build6 ) %]› Step 6 of 6: Select how you want the report ordered
257 <div id="doc3" class="yui-t1">
261 [% INCLUDE "reports-toolbar.inc" %]
264 <h2>Guided reports</h2>
265 <p>Use the guided reports engine to create non standard reports.
266 This feature aims to provide some middle ground between the built in
267 canned reports and writing custom SQL reports.</p>
269 <h3>Build and run reports</h3>
270 [% IF ( CAN_user_reports_create_reports ) %]
271 <form action="/cgi-bin/koha/reports/guided_reports.pl">
272 <input type="hidden" name="phase" value="Build new" />
273 <input type="submit" name="submit" value="Build new"/>
276 [% IF ( CAN_user_reports_execute_reports ) %]
277 <form action="/cgi-bin/koha/reports/guided_reports.pl">
278 <input type="hidden" name="phase" value="Use saved"/>
279 <input type="submit" name="submit" value="Use saved"/>
282 [% IF ( CAN_user_reports_create_reports ) %]
283 <form action="/cgi-bin/koha/reports/guided_reports.pl">
284 <input type="hidden" name="phase" value="Create report from SQL"/>
285 <input type="submit" name="submit" value="Create report from SQL"/>
288 <h3>Reports Dictionary</h3>
289 <p>Use the reports dictionary to define custom criteria to use in your reports</p>
290 <form action="/cgi-bin/koha/reports/dictionary.pl">
291 <input type="hidden" name="phase" value="View Dictionary"/>
292 <input type="submit" name="submit" value="View dictionary"/>
297 [% IF ( savedreports ) %]<h1>Saved reports</h1>
299 <div id="tabs" class="toptabs">
301 <li><a href="#reports">All</a></li>
302 [% FOREACH group IN groups_with_subgroups %]
303 <li><a id="[% group.id %]" href="#reports">[% group.name %]</a></li>
307 <div id="subgroup_filter_block">
308 <label for="subgroup_filter">Subgroup:</label>
309 <select id="subgroup_filter">
310 <option value="">All</option>
313 <form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post">
314 <input type="hidden" name="phase" value="Delete Multiple" />
315 <table id="table_reports">
326 <th>Creation date</th>
328 [% IF (usecache) %] <th>Cache expiry (seconds)</th> [% END %]
329 <th>Saved results</th>
334 [% FOREACH savedreport IN savedreports %]
335 [% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %]
336 <td><input type="checkbox" name="ids" value="[% savedreport.id %]" /></td>
337 <td><label for="ids">[% savedreport.id %]</label></td>
339 [% IF ( savedreport.report_name ) %]
340 [% savedreport.report_name %]
345 <td>[% savedreport.type %]</td>
346 <td>[% savedreport.groupname %]</td>
347 <td>[% savedreport.subgroupname %]</td>
348 <td>[% savedreport.notes %]</td>
349 <td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td>
350 <td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td>
351 [% IF (savedreport.public) %]
356 [% IF (usecache) %] <td>[% savedreport.cache_expiry %]</td> [% END %]
357 <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 %]
360 <div class="dropdown">
361 <a class="btn btn-mini dropdown-toggle" id="reportactions[% savedreport.id %]" role="button" data-toggle="dropdown" href="#">
362 Actions <b class="caret"></b>
364 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reportactions[% savedreport.id %]">
365 <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Show%20SQL"><i class="fa fa-search"></i> Show</a></li>
366 [% IF ( CAN_user_reports_create_reports ) %]
367 <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Edit%20SQL"><i class="fa fa-pencil"></i> Edit</a></li>
368 <li><a title="Duplicate this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Create report from SQL&sql=[% savedreport.savedsql |uri %]&reportname=[% savedreport.report_name |uri %]&notes=[% savedreport.notes |uri %]"><i class="fa fa-copy"></i> Duplicate</a></li>
370 <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Run%20this%20report"><i class="fa fa-play"></i> Run</a></li>
371 <li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li>
372 [% IF ( CAN_user_reports_create_reports ) %]
373 <li><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Delete%20Saved"><i class="fa fa-remove"></i> Delete</a></li>
382 <fieldset class="action">
383 <input type="submit" value="Delete selected" />
388 [% ELSE %]<div class="dialog message">
389 [% IF (filter_set || filters.date || filters.author || filters.keyword) %]
390 <h4>No saved reports match your criteria. </h4>
391 [% IF ( CAN_user_reports_create_reports ) %]
392 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get">
393 <input type="hidden" name="phase" value="Build new" />
394 <button type="submit" class="new"><i class="fa fa-plus"></i> New guided report</button>
397 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get">
398 <input type="hidden" name="phase" value="Create report from SQL" />
399 <button type="submit" class="new"><i class="fa fa-plus"></i> New SQL report</button>
402 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get">
403 <input type="hidden" name="phase" value="Use saved" />
404 <input type="hidden" name="filter_set" value="1" />
405 <input type="hidden" name="filter_keyword" value="" />
406 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> Cancel filter</button>
411 <h4>There are no saved reports. </h4>
412 [% IF ( CAN_user_reports_create_reports ) %]
413 <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build a new report?</a>
422 [% IF ( cache_error) %]
423 <div class="dialog alert">
424 <b> Please choose a cache_expiry less than 30 days </b>
427 <h1>Build a report</h1>
428 <form action="/cgi-bin/koha/reports/guided_reports.pl">
429 <fieldset class="rows">
430 <legend>Step 1 of 6: Choose a module to report on,[% IF (usecache) %] Set cache expiry, [% END %] and choose report visibility </legend>
433 <label for="area">Choose: </label>
434 <select name="area" id="area">
435 [%- FOREACH area IN areas -%]
436 <option value="[% area %]">[%- PROCESS area_name area=area -%]</option>
441 <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</option> </select></li>
443 <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</option> </select></li>
445 [% IF (usecache) %] <li>
446 <label for="cache_expiry">Cache expiry:</label><input type="text" id="cache_expiry" name="cache_expiry" value="[% cache_expiry %]"></input>
447 <select id="cache_expiry_units" name="cache_expiry_units">
448 <option value="seconds">Seconds (default)</option>
449 <option value="minutes">Minutes</option>
450 <option value="hours">Hours</option>
451 <option value="days">Days</option>
456 <fieldset class="action">
457 <input type="hidden" name="phase" value="Report on this Area" />
458 <input type="submit" name="submit" value="Next >>" />
466 <h1>Build a report</h1>
467 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
468 <input type="hidden" name="area" value="[% area %]" />
469 <input type="hidden" name="public" value="[% public %]" />
470 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
471 <fieldset class="rows"><legend>Step 2 of 6: Pick a report type</legend>
472 <ol><li><label for="types">Choose: </label>
473 <select id="types" name="types">
474 <option value="1">Tabular</option>
475 <option value="2" disabled="disabled">Summary</option>
476 <option value="3" disabled="disabled">Matrix</option>
478 </li></ol></fieldset>
480 <fieldset class="action">
481 <input type="hidden" name="phase" value="Choose this type" />
482 <input type="button" name="back" value="<< Back" class="goback" />
483 <input type="submit" name="submit" value="Next >>" />
487 <div class="yui-gb"><div class="yui-u first"></div>
489 <!--- Summary and Matrix reports have not yet been implemented-->
490 <!--<div class="yui-u">Summary:
491 <img src="[% interface %]/[% theme %]/img/reports-summary-graphic.gif" /></div>
492 <div class="yui-u">Matrix:
493 <img src="[% interface %]/[% theme %]/img/reports-matrix-graphic.gif" /></div>-->
498 <h1>Build a report</h1>
499 <h3>Step 3 of 6: Select columns for display</h3>
500 <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>
502 <form id="column_submit" action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
503 <input type="hidden" name="area" value="[% area %]" />
504 <input type="hidden" name="type" value="[% type %]" />
505 <input type="hidden" name="public" value="[% public %]" />
506 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
509 <div class="yui-u first"> <div style="float: left;"><select id="availableColumns" name="oldcolumns2" multiple="multiple" size="25" style="min-width: 200px;height:300px;">
510 [% FOREACH column IN columns %]
511 [% IF ( column.table ) %]
513 [% IF ( loop.first ) %]
518 <optgroup label="[% column.table %]">
520 <option value="[% column.name %]">
521 [% IF ( column.description ) %][% column.description %] / [% column.name %]
530 <div style="width: 6.3em; float: right; margin-top: 100px"><input type="button" name="Add" value="Add" class="button" style="width:6em;" id="addColumn" /><br />
531 <input type="button" name="delete" value="<< Delete" class="button" style="width: 6em; margin: 1em 0;" id="delColumn" /></div>
535 <select id="selectedColumns" name="columns" multiple="multiple" size="25" style="width:200px; height:300px;"></select>
540 <fieldset class="action">
541 <input type="hidden" name="phase" value="Choose these columns" />
542 <input type="button" name="back" value="<< Back" class="goback" />
543 <input type="submit" name="submit" value="Next >>" />
551 <h1>Build a report</h1>
552 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" >
553 <input type="hidden" name="area" value="[% area %]" />
554 <input type="hidden" name="type" value="[% type %]" />
555 <input type="hidden" name="column" value="[% column %]" />
556 <input type="hidden" name="public" value="[% public %]" />
557 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
558 <fieldset><legend>Step 4 of 6: Select criteria to limit on</legend>
560 [% FOREACH criteri IN criteria %]
563 <input type="checkbox" name="criteria_column" id="[% criteri.name %]" value="[% criteri.name %]" />
564 <label for="[% criteri.name %]">[% criteri.description %] </label>
566 [% IF ( criteri.date ) %]
568 <input type="text" size="10" id="[% criteri.name %]_value" name="[% criteri.name %]_value" value="" class="datepicker" />
569 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
573 [% IF ( criteri.textrange ) %]
575 <input type="text" size="10" id="[% criteri.from %]_value" name="[% criteri.from %]_value" value="" /> to
576 <input type="text" size="10" id="[% criteri.to %]_value" name="[% criteri.to %]_value" value="" />
580 [% IF ( criteri.daterange ) %]
582 <input type="text" size="10" id="from_[% criteri.name %]_value" name="from_[% criteri.name %]_value" value="" class="datepickerfrom" />
584 <input type="text" size="10" id="to_[% criteri.name %]_value" name="to_[% criteri.name %]_value" value="" class="datepickerto" />
585 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
590 <select name="[% criteri.name %]_value">
591 [% FOREACH value IN criteri.values %]
592 <option value="[% value.availablevalues %]">[% IF ( value.default ) %]Default[% ELSE %][% value.display_value |html %][% END %]</option>
604 [% IF ( definitions ) %]
605 <fieldset><legend>Dictionary definitions</legend>
607 [% FOREACH definition IN definitions %]
608 <tr><td><input type="checkbox" name="definition" value="[% definition.id %]" /> [% definition.name %]</td></tr>
614 <fieldset class="action"><input type="hidden" name="phase" value="Choose these criteria" />
615 <input type="button" name="back" value="<< Back" class="goback" />
616 <input type="submit" name="submit" value="Next >>" /> </fieldset>
622 <h1>Build a report</h1>
623 <h3>Step 5 of 6: Pick which columns to total</h3>
624 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
625 <input type="hidden" name="area" value="[% area %]" />
626 <input type="hidden" name="type" value="[% type %]" />
627 <input type="hidden" name="column" value="[% column %]" />
628 <input type="hidden" name="definition" value="[% definition %]" />
629 <input type="hidden" name="criteria" value="[% criteriastring %]" />
630 <input type="hidden" name="public" value="[% public %]" />
631 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
633 [% FOREACH total_b IN total_by %]
634 <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>
635 <td><select name="[% total_b.name %]_tvalue">
637 [% FOREACH selec IN total_b.select %]
638 <option value="[% selec.value %]">[% selec.value %]</option>
646 <fieldset class="action"><input type="hidden" name="phase" value="Choose these operations" />
647 <input type="button" name="back" value="<< Back" class="goback" />
648 <input type="submit" name="submit" value="Next >>" /></fieldset>
654 <h1>Build a report</h1>
655 <h3>Step 6 of 6: Choose how you want the report ordered</h3>
656 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
657 <input type="hidden" name="area" value="[% area %]" />
658 <input type="hidden" name="type" value="[% type %]" />
659 <input type="hidden" name="column" value="[% column %]" />
660 <input type="hidden" name="criteria" value="[% criteriastring %]" />
661 <input type="hidden" name="definition" value="[% definition %]" />
662 <input type="hidden" name="totals" value="[% totals %]" />
663 <input type="hidden" name="public" value="[% public %]" />
664 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
665 <fieldset><table>[% FOREACH order_b IN order_by %]
666 <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>
667 <select name="[% order_b.name %]_ovalue">
669 [% FOREACH selec IN order_b.select %]
670 <option value="[% selec.value %]">[% selec.value %]</option>
678 <fieldset class="action">
679 <input type="hidden" name="phase" value="Build report" />
680 <input type="submit" name="submit" value="Finish" /></fieldset>
685 [% IF ( showreport ) %]
686 <h1>Confirm custom report</h1>
687 <p>Your report will be generated with the following SQL statement.</p>
692 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
693 <input type="hidden" name="sql" value="[% sql %]" />
694 <input type="hidden" name="type" value="[% type %]" />
695 <input type="hidden" name="public" value="[% public %]" />
696 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
697 <p>You will need to save the report before you can execute it</p>
698 <fieldset class="action"><input type="hidden" name="phase" value="Save" />
699 <input type="submit" name="submit" value="Save" /> </fieldset>
704 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" class="validated">
705 <input type="hidden" name="sql" value="[% sql |html %]" />
706 <input type="hidden" name="type" value="[% type %]" />
707 <input type="hidden" name="area" value="[% area %]" />
708 <input type="hidden" name="public" value="[% public %]" />
709 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
710 <fieldset class="rows">
711 <legend>Save your custom report</legend>
713 <li><label for="reportname" class="required">Report name: </label><input type="text" id="reportname" name="reportname" class="required" required="required" /> <span class="required">Required</span></li>
714 [% PROCESS group_and_subgroup_selection %]
715 <li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li>
717 <fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
718 <input type="submit" name="submit" value="Save report" /></fieldset>
722 [% IF ( warn_authval_problem ) %]
723 <div class="dialog alert">
724 <h3>Errors found when processing parameters for report: [% name %]</h3>
725 [% FOREACH problematic_authval IN problematic_authvals %]
727 <strong>[% problematic_authval.name %]:</strong> The authorized value category (<strong>[% problematic_authval.authval %]</strong>)
728 you selected does not exist.
731 <!-- Save Anyway Form -->
732 <form action='/cgi-bin/koha/reports/guided_reports.pl'>
733 <!--Every parameter the user issued is provided as a hidden field for recovery-->
734 <input type='hidden' name='id' value='[% id %]' />
735 <input type='hidden' name='sql' value='[% sql %]' />
736 <input type='hidden' name='reportname' value='[% reportname %]' />
737 <input type='hidden' name='group' value='[% group %]' />
738 <input type='hidden' name='subgroup' value='[% subgroup %]' />
739 <input type='hidden' name='notes' value='[% notes %]' />
740 <input type='hidden' name='cache_expiry' value='[% cache_expiry %]' />
741 <input type='hidden' name='cache_expiry_units' value='[% cache_expiry_units %]' />
742 <input type='hidden' name='public' value='[% public %]' />
743 [% IF ( phase_update) %]
744 <input type='hidden' name='phase' value='Update SQL' />
745 <button type="submit" name="save_anyway" value="Save anyway" class="approve"><i class="fa fa-fw fa-check"></i> Save anyway</button>
746 [% ELSIF ( phase_save) %]
747 <input type='hidden' name='area' value='[% area %]' />
748 <input type='hidden' name='phase' value='Save Report' />
749 <button type="submit" name="save_anyway" value="Save anyway" class="approve"><i class="fa fa-fw fa-check"></i> Save anyway</button>
752 <!-- Go back to editing -->
753 <form action='/cgi-bin/koha/reports/guided_reports.pl'>
754 <button type="button" class="new goback"><i class="fa fa-fw fa-pencil"></i> Edit SQL</button>
759 [% IF ( enter_params ) %]
760 <form action='/cgi-bin/koha/reports/guided_reports.pl'>
761 <input type='hidden' name='reports' value="[% reports %]" />
762 [% IF ( auth_val_error ) %]
763 <input type='hidden' name='phase' value='Edit SQL' />
764 <div class="dialog alert">
765 <h3>Errors found when processing parameters for report: [% name %]</h3>
766 [% FOREACH auth_val_error IN auth_val_errors %]
768 <strong>[% auth_val_error.entry %]:</strong> The authorized value category (<strong>[% auth_val_error.auth_val %]</strong>)
769 you selected does not exist.
773 <fieldset class="action"><input type="submit" value="Edit SQL" /></fieldset>
775 <input type='hidden' name='phase' value='Run this report' />
776 <h1>Enter parameters for report [% name %]:</h1>
777 [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
778 <fieldset class="rows">
780 [% FOREACH sql_param IN sql_params %]
781 [% IF sql_param.input == 'date' %]
783 <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" />
785 [% ELSIF ( sql_param.input == 'text' ) %]
786 <li><label for="sql_params[% loop.count %]">[% sql_param.entry %]: </label><input id="sql_params[% loop.count %]" type="text" name="sql_params" /></li>
788 <li><label for="sql_params_[% sql_param.labelid %]">[% sql_param.entry %]:</label>
789 <select name="[%- sql_param.input.name -%]" tabindex="1" size="1" id="[%- sql_param.input.id -%]">
790 [% FOREACH value IN sql_param.input.values %]
791 <option value="[%- value -%]">[%- sql_param.input.labels.$value -%]</option>
799 <fieldset class="action"><input type="submit" value="Run the report" /></fieldset>
806 [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
807 [% IF ( unlimited_total ) %]<p>Total number of rows matching the (unlimited) query is [% unlimited_total %].</p>[% END %]
808 <pre id="sql_output">[% sql |html %]</pre>
810 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get">
811 <input type="hidden" name="phase" value="Run this report"/>
812 <input type="hidden" name="reports" value="[% report_id %]"/>
814 [% FOREACH p IN sql_params %]
815 <input type="hidden" name="sql_params" value="[% p %]"/>
818 <label for="limit">Rows per page: </label>
819 <select name="limit">
820 [% limits = [ 10, 20, 50, 100, 200, 300, 400, 500, 1000 ] %]
821 [% FOREACH l IN limits %]
823 <option value="[% l %]" selected="selected">[% l %]</option>
825 <option value="[% l %]">[% l %]</option>
830 <input type="submit" value="Update" />
833 <div class="pages">[% pagination_bar %]</div>
834 [% UNLESS ( errors ) %]
836 <tr>[% FOREACH header_ro IN header_row %]<th>[% header_ro.cell %]</th>[% END %]</tr>
837 [% FOREACH result IN results %]
839 [% FOREACH cell IN result.cells %]<td>[% cell.cell %]</td>[% END %]
843 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
844 <fieldset class="action">
845 <label for="format">Download the report: </label>
846 <select name="format" id="format">
847 <option value="csv">Comma separated text</option>
848 <option value="tab">Tab separated text</option>
849 <option value="ods">Open Document Spreadsheet</option>
851 <input type="hidden" name="sql" value="[% sql |html %]" />
852 <input type="hidden" name="phase" value="Export" />
853 <input type="submit" name="submit" value="Download" /></fieldset>
854 <input type="hidden" name="reportname" value="[% name %]" />
860 <script type="text/javascript">
861 $(document).ready(function() {
862 load_group_subgroups();
865 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" class="validated">
866 <fieldset class="rows">
867 <legend>Create report from SQL</legend>
869 <li><label for="reportname" class="required">Report name:</label>
870 [% IF ( reportname ) %]<input type="text" class="required" required="required" id="reportname" name="reportname" value="[% reportname %]" size="50"/>
871 [% ELSE %]<input type="text" class="required" required="required" id="reportname" name="reportname" size="50" />[% END %] <span class="required">Required</span>
873 [% PROCESS group_and_subgroup_selection %]
876 <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</option> </select></li>
878 <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</option> </select></li>
880 [% IF (usecache) %] <li>
881 <label for="cache_expiry">Cache expiry:</label><input type="text" id="cache_expiry" name="cache_expiry" value="[% cache_expiry %]"></input>
882 <select id="cache_expiry_units" name="cache_expiry_units">
883 <option value="seconds" selected="selected">Seconds (default)</option>
884 <option value="minutes">Minutes</option>
885 <option value="hours">Hours</option>
886 <option value="days">Days</option>
889 <li><label for="notes">Notes:</label> <textarea id="notes" name="notes" cols="50" rows="2">[% notes %]</textarea></li>
892 <fieldset class="rows">
893 <legend>SQL:</legend>
894 <div style="margin:1em;">
895 <textarea id="sql" name="sql" class="required" required="required" cols="50" rows="10">[% sql %]</textarea> <span class="required">Required</span>
899 <fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
900 <input type="submit" name="submit" value="Save report" /> <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved" class="cancel">Cancel</a>
905 [% IF ( compound ) %]
906 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
907 Master: <select name="master">
908 [% FOREACH savedreport IN savedreports %]
909 <option value="[% savedreport.id %]">[% savedreport.report_name %]</option>
913 Sub report:<select name="subreport">
914 [% FOREACH savedreport IN savedreports %]
915 <option value="[% savedreport.id %]">[% savedreport.report_name %]</option>
919 <input type="hidden" name="phase" value="Save Compound" />
920 <input type="submit" name="submit" value="Save compound" />
924 [% IF ( save_compound ) %]
930 [% IF ( retresults ) %]
931 <h1>Saved report results</h1>
935 [% FOREACH result IN results %]
942 <fieldset class="rows">
943 <legend>[% reportname %]</legend>
945 [% IF ( notes ) %]<li><span class="label">Notes:</span> [% notes %]</li>[% ELSE %][% END %]
946 <li><textarea id="sql">[% sql %]</textarea></li>
952 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" class="validated">
953 <input type="hidden" name="phase" value="Update SQL" />
954 <input type="hidden" name="id" value="[% id %]"/>
955 <fieldset class="rows">
956 <legend>Edit SQL report</legend>
958 <li><label for="reportname" class="required">Report name: </label><input type="text" id="reportname" name="reportname" value="[% reportname %]" size="50" class="required" required="required" /> <span class="required">Required</span></li>
959 [% PROCESS group_and_subgroup_selection %]
961 <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</option> </select></li>
963 <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</option> </select></li>
965 [% IF (usecache) %] <li>
966 <label for="cache_expiry">Cache expiry:</label><input type="text" id="cache_expiry" name="cache_expiry" value="[% cache_expiry %]"></input>
967 <select id="cache_expiry_units" name="cache_expiry_units">
968 <option value="seconds">Seconds (default)</option>
969 <option value="minutes">Minutes</option>
970 <option value="hours">Hours</option>
971 <option value="days">Days</option>
974 <li><label for="notes">Notes:</label><textarea id="notes" name="notes" cols="50" rows="2">[% notes %]</textarea></li>
978 <fieldset class="rows">
979 <legend>SQL:</legend>
980 <div style="margin:1em;">
981 <textarea id="sql" name="sql" class="required" required="required" cols="50" rows="10">[% sql %]</textarea> <span class="required">Required</span>
985 <fieldset class="action">
986 <input type="submit" name="submit" value="Update SQL" /> <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved" class="cancel">Cancel</a>
993 [% IF ( save_successful ) %]
994 [% UNLESS ( errors ) %]
995 <h2>Your report has been saved</h2>
996 <h4>[% reportname %]</h4>
999 <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Run%20this%20report">Run this report</a></li>
1001 <li>Access this report from the: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports page</a></li>
1002 <li>Schedule this report to run using the: <a href="/cgi-bin/koha/tools/scheduler.pl">Scheduler tool</a></li>
1003 <li>Return to: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Guided reports</a></li>
1009 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
1010 <div class="dialog alert">
1011 <b>The following error was encountered:</b><br />
1012 [% FOREACH error IN errors %]
1013 [% IF ( error.sqlerr ) %]This report contains the SQL keyword <b>[% error.sqlerr %]</b>.
1014 <br />Use of this keyword is not allowed in Koha reports due to security and data integrity risks. Only SELECT queries are allowed.
1015 <br />Please return to the "Saved Reports" screen and delete this report or retry creating a new one.
1016 [% ELSIF ( error.queryerr ) %]The database returned the following error: <br />[% error.queryerr %]<br />Please check the log for further details.
1017 [% ELSIF ( error.cache_expiry ) %]Please select a cache expiry less than 30 days.
1020 <div id="onerror_actions">
1021 <a href="#" class="button goback">Return to previous page</a>
1025 <fieldset class="action"><input type="hidden" name="phase" value="Use saved" />
1026 <input type="submit" name="submit" value="Saved reports" /></fieldset>
1035 <div id="saved-reports-filter">
1036 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get">
1037 <input type="hidden" name="phase" value="Use saved" />
1038 <input type="hidden" name="filter_set" value="1" />
1039 <fieldset class="brief">
1042 <li><label for="filter_date">Date:</label> <input type="text" id="filter_date" name="filter_date" size="10" value="[% filters.date %]" class="datepicker" />
1043 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1046 <li><label for="filter_author">Author:</label> <input type="text" id="filter_author" name="filter_author" value="[% filters.author %]" size="16" /></li>
1047 <li><label for="filter_keyword">Keyword:</label> <input type="text" id="filter_keyword" name="filter_keyword" value="[% filters.keyword %]" size="16" /></li>
1050 <fieldset class="action">
1051 <input type="submit" value="Apply filter" />
1052 <a id="resetReportsFilter" href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved&clear_filters=1">Clear</a>
1059 [% INCLUDE 'guided-reports-view.inc' %]
1062 <script type="text/javascript">
1064 function addColumn() {
1065 $("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected");
1067 function delColumn() {
1068 $("#selectedColumns option:selected").remove();
1070 $("#column_submit").submit(function() {
1071 if ($("#selectedColumns option").size() < 1) {
1072 alert(_("No columns selected!"));
1075 $("#selectedColumns option").attr("selected", "selected"); // Select everything still in #selectedColumns
1080 [% INCLUDE 'intranet-bottom.inc' %]
1083 [% BLOCK group_and_subgroup_selection %]
1085 <label>Report group:</label>
1086 <input type="radio" name="select_or_create_group"
1087 id="select_group" checked="checked" />
1088 <label for="select_group" style="float:none">Select</label>
1089 <select name="group" onChange="load_group_subgroups();" id="group_select">
1090 <option value="">(None)</option>
1091 [% FOREACH group IN groups_with_subgroups %]
1092 [% IF (group.selected) %]
1093 <option value="[% group.id %]" selected="selected">
1095 <option value="[% group.id %]">
1101 <input type="radio" name="select_or_create_group" id="create_group" />
1102 <label for="create_group" style="float:none">or create:</label>
1103 <input type="text" name="group" id="group_input" title="Group code" placeholder="Code" />
1104 <input type="text" name="groupdesc" id="groupdesc_input" title="Group name" placeholder="Name" />
1107 <label>Report subgroup:</label>
1108 <input type="radio" name="select_or_create_subgroup"
1109 id="select_subgroup" checked="checked" />
1110 <label for="select_subgroup" style="float:none">Select</label>
1111 <select name="subgroup" id="subgroup_select">
1112 <option value="">(None)</option>
1113 [% FOREACH group IN groups_with_subgroups %]
1114 [% IF (group.selected) %]
1115 [% FOREACH subgroup IN group.subgroups %]
1116 [% IF (subgroup.selected) %]
1117 <option value="[% subgroup.id %]" selected="selected">
1119 <option value="[% subgroup.id %]">
1127 <input type="radio" name="select_or_create_subgroup"
1128 id="create_subgroup" />
1129 <label for="create_subgroup" style="float:none">or create</label>
1130 <input type="text" name="subgroup" id="subgroup_input" title="Subgroup code" placeholder="Code" />
1131 <input type="text" name="subgroupdesc" id="subgroupdesc_input" title="Subgroup name" placeholder="Name" />