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="[% themelang %]/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(){
72 var rtable = $("#table_reports").dataTable($.extend(true, {}, dataTablesDefaults, {
74 'sDom': 't<"bottom pager"ilpf>',
75 'sPaginationType': 'four_button',
76 'aaSorting': [[ 1, "asc" ]],
78 { 'bSortable': false, 'bSearchable':false, 'aTargets': [0, -1] },
79 { 'bSearchable': false, 'aTargets': [3] },
80 { "aTargets": [ 1, 2 ], "sType": "natural" }
83 null,null,null,null,null,null,null,null,{ "sType": "title-string" },null,[% IF (usecache) %]null,[% END %]null,null
86 'sZeroRecords': _("No matching reports found")
90 var rtabs = $("#tabs").tabs();
91 rtabs.on("tabsactivate", function(e, ui) {
92 $("#subgroup_filter option").each(function() {
93 if($(this).val().length > 0) {
97 rtable.fnFilter('', 4);
98 rtable.fnFilter('', 5);
99 rtable.fnSetColumnVis(4, true);
100 rtable.fnSetColumnVis(5, true);
102 var g_id = $(ui.newTab).children().attr('id');
103 var g_name = $(ui.newTab).text();
104 if ( g_name == _("All") ) {
109 if (g_id && g_id.length > 0) {
110 rtable.fnFilter('^' + g_name + '$', 4, true, true, true, false);
111 rtable.fnSetColumnVis(4, false);
112 for(var i in group_subgroups[g_id]) {
113 $("#subgroup_filter").append(
114 '<option value="' + group_subgroups[g_id][i][0] + '">'
115 + group_subgroups[g_id][i][1] + '</option>'
118 $("#subgroup_filter_block").show();
120 $("#subgroup_filter_block").hide();
123 $("#subgroup_filter_block").hide();
125 $("#subgroup_filter").change(function() {
126 var selected = $(this).find('option:selected');
127 var sg_id = $(selected).val();
128 var sg_name = $(selected).text();
129 if (sg_id.length > 0) {
130 rtable.fnFilter('^' + sg_name + '$', 5, true, true, true, false);
131 rtable.fnSetColumnVis(5, false);
133 rtable.fnFilter('', 5);
134 rtable.fnSetColumnVis(5, true);
138 $("#reports_form").submit(function(){
139 var checkedItems = $("input[name=ids]:checked");
140 if ($(checkedItems).size() == 0) {
141 alert(_("You must select one or more reports to delete"));
144 $(checkedItems).parents('tr').addClass("warn");
145 if( confirm(_("Are you sure you want to delete the selected reports?")) ) {
148 $(checkedItems).parents('tr').removeClass("warn");
155 $("#sql").focus(function() {
160 $(".confirmdelete").click(function(){
161 $(this).parents('tr').attr("class","warn");
162 if(confirm(_("Are you sure you want to delete this saved report?"))){
165 $(this).parents('tr').attr("class","");
170 [% IF (create || editsql || save) %]
171 $("#select_group").change(function() {
172 if($(this).attr('checked')) {
173 $("#group_input").attr('disabled', 'disabled');
174 $("#groupdesc_input").attr('disabled', 'disabled');
175 $("#group_select").attr('disabled', false);
176 if ($("#group_select").val().length > 0) {
177 $("#select_subgroup").attr('checked', 'checked');
178 $("#select_subgroup").change();
179 $("#subgroup, #subgroup *").show();
181 $("#subgroup").hide();
185 $("#create_group").change(function() {
186 if($(this).attr('checked')) {
187 $("#group_input").attr('disabled', false);
188 $("#groupdesc_input").attr('disabled', false);
189 $("#group_select").attr('disabled', 'disabled');
190 $("#create_subgroup").attr('checked', 'checked').change();
191 $("#subgroup_select").hide();
192 $("#subgroup input[type='radio']").hide();
193 $("#subgroup label[for]").hide();
194 $("#subgroup_input").show();
195 $("#subgroupdesc_input").show();
196 $("#subgroup").show();
199 $("#select_subgroup").change(function() {
200 if($(this).attr('checked')) {
201 $("#subgroup_select").attr('disabled', false);
202 $("#subgroup_input").attr('disabled', 'disabled');
203 $("#subgroupdesc_input").attr('disabled', 'disabled');
206 $("#create_subgroup").change(function() {
207 if($(this).attr('checked')) {
208 $("#subgroup_input").attr('disabled', false);
209 $("#subgroupdesc_input").attr('disabled', false);
210 $("#subgroup_select").attr('disabled', 'disabled');
213 $("#select_group").change();
214 $("#select_subgroup").change();
220 <body id="rep_guided_reports_start" class="rep">
221 [% INCLUDE 'header.inc' %]
222 [% INCLUDE 'circ-search.inc' %]
224 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a>
225 › <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
226 › <a href="/cgi-bin/koha/reports/guided_reports.pl">Guided reports wizard</a>
228 [% IF ( saved1 ) %]› Saved reports
229 [% ELSIF ( create ) %]› Create from SQL
230 [% ELSIF ( showsql ) %]› <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports</a> › SQL view
231 [% ELSIF ( editsql ) %]› <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports</a> › Edit SQL report
232 [% ELSIF ( execute ) %]› <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports</a> › <em>[% name %]</em> Report
233 [% ELSIF ( build1 || build2 || build3 || build4 || build5 || build6 ) %]› <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build a report</a>
234 [% IF ( build1 ) %]› Step 1 of 6: Choose a module
235 [% ELSIF ( build2 ) %]› Step 2 of 6: Pick a report type
236 [% ELSIF ( build3 ) %]› Step 3 of 6: Select columns for display
237 [% ELSIF ( build4 ) %]› Step 4 of 6: Select criteria to limit on
238 [% ELSIF ( build5 ) %]› Step 5 of 6: Pick which columns to total
239 [% ELSIF ( build6 ) %]› Step 6 of 6: Select how you want the report ordered
244 <div id="doc3" class="yui-t1">
248 [% INCLUDE "reports-toolbar.inc" %]
251 <h2>Guided reports</h2>
252 <p>Use the guided reports engine to create non standard reports.
253 This feature aims to provide some middle ground between the built in
254 canned reports and writing custom SQL reports.</p>
256 <h3>Build and run reports</h3>
257 [% IF ( CAN_user_reports_create_reports ) %]
258 <form action="/cgi-bin/koha/reports/guided_reports.pl">
259 <input type="hidden" name="phase" value="Build new" />
260 <input type="submit" name="submit" value="Build new"/>
263 [% IF ( CAN_user_reports_execute_reports ) %]
264 <form action="/cgi-bin/koha/reports/guided_reports.pl">
265 <input type="hidden" name="phase" value="Use saved"/>
266 <input type="submit" name="submit" value="Use saved"/>
269 [% IF ( CAN_user_reports_create_reports ) %]
270 <form action="/cgi-bin/koha/reports/guided_reports.pl">
271 <input type="hidden" name="phase" value="Create report from SQL"/>
272 <input type="submit" name="submit" value="Create report from SQL"/>
275 <h3>Reports Dictionary</h3>
276 <p>Use the reports dictionary to define custom criteria to use in your reports</p>
277 <form action="/cgi-bin/koha/reports/dictionary.pl">
278 <input type="hidden" name="phase" value="View Dictionary"/>
279 <input type="submit" name="submit" value="View dictionary"/>
284 [% IF ( savedreports ) %]<h1>Saved reports</h1>
286 <div id="tabs" class="toptabs">
288 <li><a href="#reports">All</a></li>
289 [% FOREACH group IN groups_with_subgroups %]
290 <li><a id="[% group.id %]" href="#reports">[% group.name %]</a></li>
294 <div id="subgroup_filter_block">
295 <label for="subgroup_filter">Subgroup:</label>
296 <select id="subgroup_filter">
297 <option value="">All</option>
300 <form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post">
301 <input type="hidden" name="phase" value="Delete Multiple" />
302 <table id="table_reports">
313 <th>Creation date</th>
315 [% IF (usecache) %] <th>Cache expiry (seconds)</th> [% END %]
316 <th>Saved results</th>
321 [% FOREACH savedreport IN savedreports %]
322 [% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %]
323 <td><input type="checkbox" name="ids" value="[% savedreport.id %]" /></td>
324 <td><label for="ids">[% savedreport.id %]</label></td>
326 [% IF ( savedreport.report_name ) %]
327 [% savedreport.report_name %]
332 <td>[% savedreport.type %]</td>
333 <td>[% savedreport.groupname %]</td>
334 <td>[% savedreport.subgroupname %]</td>
335 <td>[% savedreport.notes %]</td>
336 <td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td>
337 <td><span title="[% savedreport.date_created %]">[% savedreport.date_created | $KohaDates %]</span></td>
338 [% IF (savedreport.public) %]
343 [% IF (usecache) %] <td>[% savedreport.cache_expiry %]</td> [% END %]
344 <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 %]
347 <div class="dropdown">
348 <a class="btn btn-mini dropdown-toggle" id="reportactions[% savedreport.id %]" role="button" data-toggle="dropdown" href="#">
349 Actions <b class="caret"></b>
351 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reportactions[% savedreport.id %]">
352 <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>
353 [% IF ( CAN_user_reports_create_reports ) %]
354 <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>
355 <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>
357 <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>
358 <li><a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]"><i class="fa fa-clock-o"></i> Schedule</a></li>
359 [% IF ( CAN_user_reports_create_reports ) %]
360 <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>
369 <fieldset class="action">
370 <input type="submit" value="Delete selected" />
375 [% ELSE %]<div class="dialog message">
376 [% IF (filter_set || filters.date || filters.author || filters.keyword) %]
377 <h4>No saved reports match your criteria. </h4>
378 [% IF ( CAN_user_reports_create_reports ) %]
379 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get">
380 <input type="hidden" name="phase" value="Build new" />
381 <input type="submit" class="edit" value="Build a new report" accesskey="y" />
384 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get">
385 <input type="hidden" name="phase" value="Use saved" />
386 <input type="hidden" name="filter_set" value="1" />
387 <input type="hidden" name="filter_keyword" value="" />
388 <input type="submit" class="deny" value="Cancel filter" accesskey="n" />
393 <h4>There are no saved reports. </h4>
394 [% IF ( CAN_user_reports_create_reports ) %]
395 <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build a new report?</a>
404 [% IF ( cache_error) %]
405 <div class="dialog alert">
406 <b> Please choose a cache_expiry less than 30 days </b>
409 <h1>Build a report</h1>
410 <form action="/cgi-bin/koha/reports/guided_reports.pl">
411 <fieldset class="rows">
412 <legend>Step 1 of 6: Choose a module to report on,[% IF (usecache) %] Set cache expiry, [% END %] and Choose report visibility </legend>
415 <label for="area">Choose: </label>
416 <select name="area" id="area">
417 [%- FOREACH area IN areas -%]
418 <option value="[% area %]">[%- PROCESS area_name area=area -%]</option>
423 <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>
425 <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>
427 [% IF (usecache) %] <li>
428 <label for="cache_expiry">Cache expiry:</label><input type="text" id="cache_expiry" name="cache_expiry" value="[% cache_expiry %]"></input>
429 <select id="cache_expiry_units" name="cache_expiry_units">
430 <option value="seconds">Seconds (default)</option>
431 <option value="minutes">Minutes</option>
432 <option value="hours">Hours</option>
433 <option value="days">Days</option>
438 <fieldset class="action">
439 <input type="hidden" name="phase" value="Report on this Area" />
440 <input type="submit" name="submit" value="Next >>" />
448 <h1>Build a report</h1>
449 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
450 <input type="hidden" name="area" value="[% area %]" />
451 <input type="hidden" name="public" value="[% public %]" />
452 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
453 <fieldset class="rows"><legend>Step 2 of 6: Pick a report type</legend>
454 <ol><li><label for="types">Choose: </label>
455 <select id="types" name="types">
456 <option value="1">Tabular</option>
457 <option value="2" disabled="disabled">Summary</option>
458 <option value="3" disabled="disabled">Matrix</option>
460 </li></ol></fieldset>
462 <fieldset class="action">
463 <input type="hidden" name="phase" value="Choose this type" />
464 <input type="button" name="back" value="<< Back" onclick="javascript:history.back()" />
465 <input type="submit" name="submit" value="Next >>" />
469 <div class="yui-gb"><div class="yui-u first"></div>
471 <!--- Summary and Matrix reports have not yet been implemented-->
472 <!--<div class="yui-u">Summary:
473 <img src="[% interface %]/[% theme %]/img/reports-summary-graphic.gif" /></div>
474 <div class="yui-u">Matrix:
475 <img src="[% interface %]/[% theme %]/img/reports-matrix-graphic.gif" /></div>-->
480 <h1>Build a report</h1>
481 <h3>Step 3 of 6: Select columns for display</h3>
482 <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>
484 <form id="column_submit" action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
485 <input type="hidden" name="area" value="[% area %]" />
486 <input type="hidden" name="type" value="[% type %]" />
487 <input type="hidden" name="public" value="[% public %]" />
488 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
491 <div class="yui-u first"> <div style="float: left;"><select id="availableColumns" name="oldcolumns2" multiple="multiple" size="25" style="min-width: 200px;height:300px;">
492 [% FOREACH column IN columns %]
493 [% IF ( column.table ) %]
495 [% IF ( loop.first ) %]
500 <optgroup label="[% column.table %]">
502 <option value="[% column.name %]">
503 [% IF ( column.description ) %][% column.description %] / [% column.name %]
512 <div style="width: 6.3em; float: right; margin-top: 100px"><input type="button" name="Add" value="Add" class="button" style="width:6em;" onclick="addColumn()" /><br />
513 <input type="button" name="delete" value="<< Delete" class="button" style="width: 6em; margin: 1em 0;" onclick="delColumn()" /></div>
517 <select id="selectedColumns" name="columns" multiple="multiple" size="25" style="width:200px; height:300px;"></select>
522 <fieldset class="action">
523 <input type="hidden" name="phase" value="Choose these columns" />
524 <input type="button" name="back" value="<< Back" onclick="javascript:history.back()" />
525 <input type="submit" name="submit" value="Next >>" />
533 <h1>Build a report</h1>
534 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" >
535 <input type="hidden" name="area" value="[% area %]" />
536 <input type="hidden" name="type" value="[% type %]" />
537 <input type="hidden" name="column" value="[% column %]" />
538 <input type="hidden" name="public" value="[% public %]" />
539 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
540 <fieldset><legend>Step 4 of 6: Select criteria to limit on</legend>
542 [% FOREACH criteri IN criteria %]
545 <input type="checkbox" name="criteria_column" id="[% criteri.name %]" value="[% criteri.name %]" />
546 <label for="[% criteri.name %]">[% criteri.description %] </label>
548 [% IF ( criteri.date ) %]
550 <input type="text" size="10" id="[% criteri.name %]_value" name="[% criteri.name %]_value" value="" class="datepicker" />
551 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
555 [% IF ( criteri.textrange ) %]
557 <input type="text" size="10" id="[% criteri.from %]_value" name="[% criteri.from %]_value" value="" /> to
558 <input type="text" size="10" id="[% criteri.to %]_value" name="[% criteri.to %]_value" value="" />
562 [% IF ( criteri.daterange ) %]
564 <input type="text" size="10" id="from_[% criteri.name %]_value" name="from_[% criteri.name %]_value" value="" class="datepickerfrom" />
566 <input type="text" size="10" id="to_[% criteri.name %]_value" name="to_[% criteri.name %]_value" value="" class="datepickerto" />
567 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
572 <select name="[% criteri.name %]_value">
573 [% FOREACH value IN criteri.values %]
574 <option value="[% value.availablevalues %]">[% IF ( value.default ) %]Default[% ELSE %][% value.display_value |html %][% END %]</option>
586 [% IF ( definitions ) %]
587 <fieldset><legend>Dictionary definitions</legend>
589 [% FOREACH definition IN definitions %]
590 <tr><td><input type="checkbox" name="definition" value="[% definition.id %]" /> [% definition.name %]</td></tr>
596 <fieldset class="action"><input type="hidden" name="phase" value="Choose these criteria" />
597 <input type="button" name="back" value="<< Back" onclick="javascript:history.back()" />
598 <input type="submit" name="submit" value="Next >>" /> </fieldset>
604 <h1>Build a report</h1>
605 <h3>Step 5 of 6: Pick which columns to total</h3>
606 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
607 <input type="hidden" name="area" value="[% area %]" />
608 <input type="hidden" name="type" value="[% type %]" />
609 <input type="hidden" name="column" value="[% column %]" />
610 <input type="hidden" name="definition" value="[% definition %]" />
611 <input type="hidden" name="criteria" value="[% criteriastring %]" />
612 <input type="hidden" name="public" value="[% public %]" />
613 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
615 [% FOREACH total_b IN total_by %]
616 <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>
617 <td><select name="[% total_b.name %]_tvalue">
619 [% FOREACH selec IN total_b.select %]
620 <option value="[% selec.value %]">[% selec.value %]</option>
628 <fieldset class="action"><input type="hidden" name="phase" value="Choose these operations" />
629 <input type="button" name="back" value="<< Back" onclick="javascript:history.back()" />
630 <input type="submit" name="submit" value="Next >>" /></fieldset>
636 <h1>Build a report</h1>
637 <h3>Step 6 of 6: Choose how you want the report ordered</h3>
638 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
639 <input type="hidden" name="area" value="[% area %]" />
640 <input type="hidden" name="type" value="[% type %]" />
641 <input type="hidden" name="column" value="[% column %]" />
642 <input type="hidden" name="criteria" value="[% criteriastring %]" />
643 <input type="hidden" name="definition" value="[% definition %]" />
644 <input type="hidden" name="totals" value="[% totals %]" />
645 <input type="hidden" name="public" value="[% public %]" />
646 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
647 <fieldset><table>[% FOREACH order_b IN order_by %]
648 <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>
649 <select name="[% order_b.name %]_ovalue">
651 [% FOREACH selec IN order_b.select %]
652 <option value="[% selec.value %]">[% selec.value %]</option>
660 <fieldset class="action">
661 <input type="hidden" name="phase" value="Build report" />
662 <input type="submit" name="submit" value="Finish" /></fieldset>
667 [% IF ( showreport ) %]
668 <h1>Confirm custom report</h1>
669 <p>Your report will be generated with the following SQL statement.</p>
674 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
675 <input type="hidden" name="sql" value="[% sql %]" />
676 <input type="hidden" name="type" value="[% type %]" />
677 <input type="hidden" name="public" value="[% public %]" />
678 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
679 <p>You will need to save the report before you can execute it</p>
680 <fieldset class="action"><input type="hidden" name="phase" value="Save" />
681 <input type="submit" name="submit" value="Save" /> </fieldset>
686 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" class="validated">
687 <input type="hidden" name="sql" value="[% sql |html %]" />
688 <input type="hidden" name="type" value="[% type %]" />
689 <input type="hidden" name="area" value="[% area %]" />
690 <input type="hidden" name="public" value="[% public %]" />
691 <input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
692 <fieldset class="rows">
693 <legend>Save your custom report</legend>
695 <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>
696 [% PROCESS group_and_subgroup_selection %]
697 <li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li>
699 <fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
700 <input type="submit" name="submit" value="Save report" /></fieldset>
704 [% IF ( warn_authval_problem ) %]
705 <form action='/cgi-bin/koha/reports/guided_reports.pl'>
706 <!--Every parameter the user issued is provided as a hidden field for recovery-->
707 <input type='hidden' name='id' value='[% id %]' />
708 <input type='hidden' name='sql' value='[% sql %]' />
709 <input type='hidden' name='reportname' value='[% reportname %]' />
710 <input type='hidden' name='group' value='[% group %]' />
711 <input type='hidden' name='subgroup' value='[% subgroup %]' />
712 <input type='hidden' name='notes' value='[% notes %]' />
713 <input type='hidden' name='cache_expiry' value='[% cache_expiry %]' />
714 <input type='hidden' name='cache_expiry_units' value='[% cache_expiry_units %]' />
715 <input type='hidden' name='public' value='[% public %]' />
717 <div class="dialog alert">
718 <h3>Errors found when processing parameters for report: [% name %]</h3>
719 [% FOREACH problematic_authval IN problematic_authvals %]
721 <strong>[% problematic_authval.name %]:</strong> The authorized value category (<strong>[% problematic_authval.authval %]</strong>)
722 you selected does not exist.
725 <!-- Save Anyway Form -->
726 <form action='/cgi-bin/koha/reports/guided_reports.pl'>
727 <!--Every parameter the user issued is provided as a hidden field for recovery-->
728 <input type='hidden' name='id' value='[% id %]' />
729 <input type='hidden' name='sql' value='[% sql %]' />
730 <input type='hidden' name='reportname' value='[% reportname %]' />
731 <input type='hidden' name='group' value='[% group %]' />
732 <input type='hidden' name='subgroup' value='[% subgroup %]' />
733 <input type='hidden' name='notes' value='[% notes %]' />
734 <input type='hidden' name='cache_expiry' value='[% cache_expiry %]' />
735 <input type='hidden' name='cache_expiry_units' value='[% cache_expiry_units %]' />
736 <input type='hidden' name='public' value='[% public %]' />
737 [% IF ( phase_update) %]
738 <input type='hidden' name='phase' value='Update SQL' />
739 <input type="submit" name="save_anyway" class="approve" value="Save anyway" />
740 [% ELSIF ( phase_save) %]
741 <input type='hidden' name='area' value='[% area %]' />
742 <input type='hidden' name='phase' value='Save Report' />
743 <input type="submit" name="save_anyway" class="approve" value="Save anyway" />
746 <!-- Go back to editing -->
747 <form action='/cgi-bin/koha/reports/guided_reports.pl'>
748 <input type="button" name='back' class="deny" value="Edit SQL"
749 onclick="javascript:history.back()" />
755 [% IF ( enter_params ) %]
756 <form action='/cgi-bin/koha/reports/guided_reports.pl'>
757 <input type='hidden' name='reports' value="[% reports %]" />
758 [% IF ( auth_val_error ) %]
759 <input type='hidden' name='phase' value='Edit SQL' />
760 <div class="dialog alert">
761 <h3>Errors found when processing parameters for report: [% name %]</h3>
762 [% FOREACH auth_val_error IN auth_val_errors %]
764 <strong>[% auth_val_error.entry %]:</strong> The authorized value category (<strong>[% auth_val_error.auth_val %]</strong>)
765 you selected does not exist.
769 <fieldset class="action"><input type="submit" value="Edit SQL" /></fieldset>
771 <input type='hidden' name='phase' value='Run this report' />
772 <h1>Enter parameters for report [% name %]:</h1>
773 [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
774 <fieldset class="rows">
776 [% FOREACH sql_param IN sql_params %]
777 [% IF sql_param.input == 'date' %]
779 <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" />
781 [% ELSIF ( sql_param.input == 'text' ) %]
782 <li><label for="sql_params[% loop.count %]">[% sql_param.entry %]: </label><input id="sql_params[% loop.count %]" type="text" name="sql_params" /></li>
784 <li><label for="sql_params_[% sql_param.labelid %]">[% sql_param.entry %]:</label>
785 <select name="[%- sql_param.input.name -%]" tabindex="1" size="1" id="[%- sql_param.input.id -%]">
786 [% FOREACH value IN sql_param.input.values %]
787 <option value="[%- value -%]">[%- sql_param.input.labels.$value -%]</option>
795 <fieldset class="action"><input type="submit" value="Run the report" /></fieldset>
802 [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
803 [% IF ( unlimited_total ) %]<p>Total number of rows matching the (unlimited) query is [% unlimited_total %].</p>[% END %]
804 <pre id="sql_output">[% sql |html %]</pre>
806 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get">
807 <input type="hidden" name="phase" value="Run this report"/>
808 <input type="hidden" name="reports" value="[% report_id %]"/>
810 [% FOREACH p IN sql_params %]
811 <input type="hidden" name="sql_params" value="[% p %]"/>
814 <label for="limit">Rows per page: </label>
815 <select name="limit">
816 [% limits = [ 10, 20, 50, 100, 200, 300, 400, 500, 1000 ] %]
817 [% FOREACH l IN limits %]
819 <option value="[% l %]" selected="selected">[% l %]</option>
821 <option value="[% l %]">[% l %]</option>
826 <input type="submit" value="Update" />
829 <div class="pages">[% pagination_bar %]</div>
830 [% UNLESS ( errors ) %]
832 <tr>[% FOREACH header_ro IN header_row %]<th>[% header_ro.cell %]</th>[% END %]</tr>
833 [% FOREACH result IN results %]
835 [% FOREACH cell IN result.cells %]<td>[% cell.cell %]</td>[% END %]
839 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
840 <fieldset class="action">
841 <label for="format">Download the report: </label>
842 <select name="format" id="format">
843 <option value="csv">Comma separated text</option>
844 <option value="tab">Tab separated text</option>
845 <option value="ods">Open Document Spreadsheet</option>
847 <input type="hidden" name="sql" value="[% sql |html %]" />
848 <input type="hidden" name="phase" value="Export" />
849 <input type="submit" name="submit" value="Download" /></fieldset>
850 <input type="hidden" name="reportname" value="[% name %]" />
856 <script type="text/javascript">
857 $(document).ready(function() {
858 load_group_subgroups();
861 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" class="validated">
862 <fieldset class="rows">
863 <legend>Create report from SQL</legend>
865 <li><label for="reportname" class="required">Report name:</label>
866 [% IF ( reportname ) %]<input type="text" class="required" required="required" id="reportname" name="reportname" value="[% reportname %]" size="50"/>
867 [% ELSE %]<input type="text" class="required" required="required" id="reportname" name="reportname" size="50" />[% END %] <span class="required">Required</span>
869 [% PROCESS group_and_subgroup_selection %]
872 <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>
874 <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>
876 [% IF (usecache) %] <li>
877 <label for="cache_expiry">Cache expiry:</label><input type="text" id="cache_expiry" name="cache_expiry" value="[% cache_expiry %]"></input>
878 <select id="cache_expiry_units" name="cache_expiry_units">
879 <option value="seconds" selected="selected">Seconds (default)</option>
880 <option value="minutes">Minutes</option>
881 <option value="hours">Hours</option>
882 <option value="days">Days</option>
885 <li><label for="notes">Notes:</label> <textarea id="notes" name="notes" cols="50" rows="2">[% notes %]</textarea></li>
888 <fieldset class="rows">
889 <legend>SQL:</legend>
890 <div style="margin:1em;">
891 <textarea id="sql" name="sql" class="required" required="required" cols="50" rows="10">[% sql %]</textarea> <span class="required">Required</span>
895 <fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
896 <input type="submit" name="submit" value="Save report" /> <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved" class="cancel">Cancel</a>
901 [% IF ( compound ) %]
902 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
903 Master: <select name="master">
904 [% FOREACH savedreport IN savedreports %]
905 <option value="[% savedreport.id %]">[% savedreport.report_name %]</option>
909 Sub report:<select name="subreport">
910 [% FOREACH savedreport IN savedreports %]
911 <option value="[% savedreport.id %]">[% savedreport.report_name %]</option>
915 <input type="hidden" name="phase" value="Save Compound" />
916 <input type="submit" name="submit" value="Save compound" />
920 [% IF ( save_compound ) %]
926 [% IF ( retresults ) %]
927 <h1>Saved report results</h1>
931 [% FOREACH result IN results %]
938 <fieldset class="rows">
939 <legend>[% reportname %]</legend>
941 [% IF ( notes ) %]<li><span class="label">Notes:</span> [% notes %]</li>[% ELSE %][% END %]
942 <li><textarea id="sql">[% sql %]</textarea></li>
948 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post" class="validated">
949 <input type="hidden" name="phase" value="Update SQL" />
950 <input type="hidden" name="id" value="[% id %]"/>
951 <fieldset class="rows">
952 <legend>Edit SQL report</legend>
954 <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>
955 [% PROCESS group_and_subgroup_selection %]
957 <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>
959 <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>
961 [% IF (usecache) %] <li>
962 <label for="cache_expiry">Cache expiry:</label><input type="text" id="cache_expiry" name="cache_expiry" value="[% cache_expiry %]"></input>
963 <select id="cache_expiry_units" name="cache_expiry_units">
964 <option value="seconds">Seconds (default)</option>
965 <option value="minutes">Minutes</option>
966 <option value="hours">Hours</option>
967 <option value="days">Days</option>
970 <li><label for="notes">Notes:</label><textarea id="notes" name="notes" cols="50" rows="2">[% notes %]</textarea></li>
974 <fieldset class="rows">
975 <legend>SQL:</legend>
976 <div style="margin:1em;">
977 <textarea id="sql" name="sql" class="required" required="required" cols="50" rows="10">[% sql %]</textarea> <span class="required">Required</span>
981 <fieldset class="action">
982 <input type="submit" name="submit" value="Update SQL" /> <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved" class="cancel">Cancel</a>
989 [% IF ( save_successful ) %]
990 [% UNLESS ( errors ) %]
991 <h2>Your report has been saved</h2>
992 <h4>[% reportname %]</h4>
995 <li><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% id %]&phase=Run%20this%20report">Run this report</a></li>
997 <li>Access this report from the: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Saved reports page</a></li>
998 <li>Schedule this report to run using the: <a href="/cgi-bin/koha/tools/scheduler.pl">Scheduler tool</a></li>
999 <li>Return to: <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved">Guided reports</a></li>
1005 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
1006 <div class="dialog alert">
1007 <b>The following error was encountered:</b><br />
1008 [% FOREACH error IN errors %]
1009 [% IF ( error.sqlerr ) %]This report contains the SQL keyword <b>[% error.sqlerr %]</b>.
1010 <br />Use of this keyword is not allowed in Koha reports due to security and data integrity risks. Only SELECT queries are allowed.
1011 <br />Please return to the "Saved Reports" screen and delete this report or retry creating a new one.
1012 [% ELSIF ( error.queryerr ) %]The database returned the following error: <br />[% error.queryerr %]<br />Please check the log for further details.
1013 [% ELSIF ( error.cache_expiry ) %]Please select a cache expiry less than 30 days.
1016 <div id="onerror_actions">
1017 <a href="javascript:window.history.back()" class="button">Return to previous page</a>
1021 <fieldset class="action"><input type="hidden" name="phase" value="Use saved" />
1022 <input type="submit" name="submit" value="Saved reports" /></fieldset>
1031 <div id="saved-reports-filter">
1032 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get">
1033 <input type="hidden" name="phase" value="Use saved" />
1034 <input type="hidden" name="filter_set" value="1" />
1035 <fieldset class="brief">
1038 <li><label for="filter_date">Date:</label> <input type="text" id="filter_date" name="filter_date" size="10" value="[% filters.date %]" class="datepicker" />
1039 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1042 <li><label for="filter_author">Author:</label> <input type="text" id="filter_author" name="filter_author" value="[% filters.author %]" /></li>
1043 <li><label for="filter_keyword">Keyword:</label> <input type="text" id="filter_keyword" name="filter_keyword" value="[% filters.keyword %]" /></li>
1046 <fieldset class="action">
1047 <input type="submit" value="Apply filter" />
1048 <a id="resetReportsFilter" href="?phase=Use saved&clear_filters=1">Clear</a>
1055 [% INCLUDE 'guided-reports-view.inc' %]
1058 <script type="text/javascript">
1060 function addColumn() {
1061 $("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected");
1063 function delColumn() {
1064 $("#selectedColumns option:selected").remove();
1066 $("#column_submit").submit(function() {
1067 if ($("#selectedColumns option").size() < 1) {
1068 alert(_("No columns selected!"));
1071 $("#selectedColumns option").attr("selected", "selected"); // Select everything still in #selectedColumns
1076 [% INCLUDE 'intranet-bottom.inc' %]
1079 [% BLOCK group_and_subgroup_selection %]
1081 <label>Report group:</label>
1082 <input type="radio" name="select_or_create_group"
1083 id="select_group" checked="checked" />
1084 <label for="select_group" style="float:none">Select</label>
1085 <select name="group" onChange="load_group_subgroups();" id="group_select">
1086 <option value="">(None)</option>
1087 [% FOREACH group IN groups_with_subgroups %]
1088 [% IF (group.selected) %]
1089 <option value="[% group.id %]" selected="selected">
1091 <option value="[% group.id %]">
1097 <input type="radio" name="select_or_create_group" id="create_group" />
1098 <label for="create_group" style="float:none">or create</label>
1099 <input type="text" name="group" id="group_input" title="Group code" placeholder="Code" />
1100 <input type="text" name="groupdesc" id="groupdesc_input" title="Group name" placeholder="Name" />
1103 <label>Report subgroup:</label>
1104 <input type="radio" name="select_or_create_subgroup"
1105 id="select_subgroup" checked="checked" />
1106 <label for="select_subgroup" style="float:none">Select</label>
1107 <select name="subgroup" id="subgroup_select">
1108 <option value="">(None)</option>
1109 [% FOREACH group IN groups_with_subgroups %]
1110 [% IF (group.selected) %]
1111 [% FOREACH subgroup IN group.subgroups %]
1112 [% IF (subgroup.selected) %]
1113 <option value="[% subgroup.id %]" selected="selected">
1115 <option value="[% subgroup.id %]">
1123 <input type="radio" name="select_or_create_subgroup"
1124 id="create_subgroup" />
1125 <label for="create_subgroup" style="float:none">or create</label>
1126 <input type="text" name="subgroup" id="subgroup_input" title="Subgroup code" placeholder="Code" />
1127 <input type="text" name="subgroupdesc" id="subgroupdesc_input" title="Subgroup name" placeholder="Name" />