Lines 14-49
Link Here
|
14 |
[% END %] |
14 |
[% END %] |
15 |
[% END %] |
15 |
[% END %] |
16 |
</title> |
16 |
</title> |
|
|
17 |
<link rel="stylesheet" href="[% themelang %]/css/datatables.css" /> |
17 |
[% INCLUDE 'doc-head-close.inc' %] |
18 |
[% INCLUDE 'doc-head-close.inc' %] |
18 |
[% INCLUDE 'calendar.inc' %] |
19 |
[% INCLUDE 'calendar.inc' %] |
19 |
<style type="text/css"> |
20 |
<style type="text/css"> |
20 |
#sql { width: 90%; height: 9em;} |
21 |
#sql { width: 90%; height: 9em;} |
21 |
</style> |
22 |
</style> |
22 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script> |
23 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> |
23 |
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script> |
24 |
[% INCLUDE 'datatables-strings.inc' %] |
24 |
|
25 |
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> |
25 |
<script type="text/javascript"> |
26 |
<script type="text/javascript"> |
26 |
//<![CDATA[ |
27 |
//<![CDATA[ |
27 |
var group_subgroups = {}; |
28 |
var group_subgroups = {}; |
28 |
var no_subgroup_label = _( "(None)" ); |
29 |
[% FOREACH group IN groups_with_subgroups %] |
|
|
30 |
var gid = "[% group.id %]" |
31 |
group_subgroups[gid] = new Array(); |
32 |
[% FOREACH subgroup IN group.subgroups %] |
33 |
var sgid = "[% subgroup.id %]"; |
34 |
var sgname = "[% subgroup.name %]"; |
35 |
group_subgroups[gid].push([sgid, sgname]); |
36 |
[% END %] |
37 |
[% END %] |
38 |
|
29 |
function load_group_subgroups () { |
39 |
function load_group_subgroups () { |
30 |
var group = $("#group").val(); |
40 |
var group = $("#group_select").val(); |
31 |
var sg = $("#subgroup"); |
41 |
var sg = $("#subgroup"); |
32 |
var has_subgroups = false; |
42 |
$(sg).find('option[value!=""]').each(function() { |
33 |
$(sg).empty().append('<option value="">' + no_subgroup_label + '</option>'); |
43 |
$(this).remove(); |
|
|
44 |
}); |
45 |
$(sg).hide(); |
34 |
if (group) { |
46 |
if (group) { |
|
|
47 |
var select = $(sg).find('select')[0]; |
35 |
$.each( group_subgroups[group], function(index, value) { |
48 |
$.each( group_subgroups[group], function(index, value) { |
36 |
has_subgroups = true; |
49 |
$('<option value="' + value[0] + '">' + value[1] + '</option>').appendTo(select); |
37 |
$('<option value="' + value[0] + '">' + value[1] + '</option>').appendTo(sg); |
|
|
38 |
} ); |
50 |
} ); |
39 |
} |
51 |
$("#subgroup, #subgroup *").show(); |
40 |
if (has_subgroups) { |
|
|
41 |
$(sg).show(); |
42 |
} else { |
43 |
$(sg).hide(); |
44 |
} |
52 |
} |
45 |
} |
53 |
} |
|
|
54 |
|
46 |
$(document).ready(function(){ |
55 |
$(document).ready(function(){ |
|
|
56 |
|
57 |
[% IF (saved1) %] |
58 |
[% IF (dateformat == "metric") %] |
59 |
dt_add_type_uk_date(); |
60 |
[% END %] |
61 |
var rtable = $("#table_reports").dataTable($.extend(true, {}, dataTablesDefaults, { |
62 |
'bAutoWidth': false, |
63 |
'sDom': 't<"bottom pager"ilpf>', |
64 |
'sPaginationType': 'four_button', |
65 |
'aoColumnDefs': [ |
66 |
{ 'bSortable': false, 'bSearchable':false, 'aTargets': [-1, -2, -3, -4] }, |
67 |
{ 'bSearchable': false, 'aTargets': [3, 4] } |
68 |
], |
69 |
'oLanguage': { |
70 |
'sZeroRecords': _('No matching reports found') |
71 |
} |
72 |
})); |
73 |
|
74 |
var rtabs = $("#tabs").tabs(); |
75 |
rtabs.bind("tabsshow", function(e, ui) { |
76 |
$("#subgroup_filter option").each(function() { |
77 |
if($(this).val().length > 0) { |
78 |
$(this).remove(); |
79 |
} |
80 |
}); |
81 |
rtable.fnFilter('', 3); |
82 |
rtable.fnFilter('', 4); |
83 |
rtable.fnSetColumnVis(3, true); |
84 |
rtable.fnSetColumnVis(4, true); |
85 |
|
86 |
var g_id = $(ui.tab).attr('id') |
87 |
var g_name = $(ui.tab).text(); |
88 |
if (g_id && g_id.length > 0) { |
89 |
rtable.fnFilter(g_name, 3); |
90 |
rtable.fnSetColumnVis(3, false); |
91 |
for(var i in group_subgroups[g_id]) { |
92 |
$("#subgroup_filter").append( |
93 |
'<option value="' + group_subgroups[g_id][i][0] + '">' |
94 |
+ group_subgroups[g_id][i][1] + '</option>' |
95 |
); |
96 |
} |
97 |
$("#subgroup_filter_block").show(); |
98 |
} else { |
99 |
$("#subgroup_filter_block").hide(); |
100 |
} |
101 |
}); |
102 |
$("#subgroup_filter_block").hide(); |
103 |
|
104 |
$("#subgroup_filter").change(function() { |
105 |
var selected = $(this).find('option:selected'); |
106 |
var sg_id = $(selected).val(); |
107 |
var sg_name = $(selected).text(); |
108 |
if (sg_id.length > 0) { |
109 |
rtable.fnFilter(sg_name, 4); |
110 |
rtable.fnSetColumnVis(4, false); |
111 |
} else { |
112 |
rtable.fnFilter('', 4); |
113 |
rtable.fnSetColumnVis(4, true); |
114 |
} |
115 |
}); |
116 |
[% END %] |
117 |
|
47 |
[% IF ( showsql ) %] |
118 |
[% IF ( showsql ) %] |
48 |
$("#sql").focus(function() { |
119 |
$("#sql").focus(function() { |
49 |
$(this).select(); |
120 |
$(this).select(); |
Lines 60-84
$(document).ready(function(){
Link Here
|
60 |
} |
131 |
} |
61 |
}); |
132 |
}); |
62 |
[% END %] |
133 |
[% END %] |
63 |
// call the tablesorter plugin |
|
|
64 |
$("#table_reports").tablesorter({ |
65 |
widgets : ['zebra'], |
66 |
sortList: [[1,0]], |
67 |
headers: { |
68 |
6: { sorter: false}, |
69 |
7: { sorter: false}, |
70 |
8: { sorter: false}, |
71 |
9: { sorter: false}, |
72 |
10: { sorter: false} |
73 |
} |
74 |
}).tablesorterPager({ |
75 |
container: $("#pagertable_reports"), |
76 |
positionFixed: false, |
77 |
size: 20 |
78 |
}); |
79 |
// redefine the datepicker's default because reports require ISO |
134 |
// redefine the datepicker's default because reports require ISO |
80 |
// http://jqueryui.com/demos/datepicker/#option-dateFormat |
135 |
// http://jqueryui.com/demos/datepicker/#option-dateFormat |
81 |
$( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" ); |
136 |
$( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" ); |
|
|
137 |
|
138 |
[% IF (create || editsql || save) %] |
139 |
$("#select_group").change(function() { |
140 |
if($(this).attr('checked')) { |
141 |
$("#group_input").attr('disabled', 'disabled'); |
142 |
$("#groupdesc_input").attr('disabled', 'disabled'); |
143 |
$("#group_select").attr('disabled', false); |
144 |
if ($("#group_select").val().length > 0) { |
145 |
$("#select_subgroup").attr('checked', 'checked'); |
146 |
$("#select_subgroup").change(); |
147 |
$("#subgroup, #subgroup *").show(); |
148 |
} else { |
149 |
$("#subgroup").hide(); |
150 |
} |
151 |
} |
152 |
}); |
153 |
$("#create_group").change(function() { |
154 |
if($(this).attr('checked')) { |
155 |
$("#group_input").attr('disabled', false); |
156 |
$("#groupdesc_input").attr('disabled', false); |
157 |
$("#group_select").attr('disabled', 'disabled'); |
158 |
$("#create_subgroup").attr('checked', 'checked').change(); |
159 |
$("#subgroup_select").hide(); |
160 |
$("#subgroup input[type='radio']").hide(); |
161 |
$("#subgroup label[for]").hide(); |
162 |
$("#subgroup_input").show(); |
163 |
$("#subgroupdesc_input").show(); |
164 |
$("#subgroup").show(); |
165 |
} |
166 |
}); |
167 |
$("#select_subgroup").change(function() { |
168 |
if($(this).attr('checked')) { |
169 |
$("#subgroup_select").attr('disabled', false); |
170 |
$("#subgroup_input").attr('disabled', 'disabled'); |
171 |
$("#subgroupdesc_input").attr('disabled', 'disabled'); |
172 |
} |
173 |
}); |
174 |
$("#create_subgroup").change(function() { |
175 |
if($(this).attr('checked')) { |
176 |
$("#subgroup_input").attr('disabled', false); |
177 |
$("#subgroupdesc_input").attr('disabled', false); |
178 |
$("#subgroup_select").attr('disabled', 'disabled'); |
179 |
} |
180 |
}); |
181 |
$("#select_group").change(); |
182 |
$("#select_subgroup").change(); |
183 |
[% END %] |
82 |
}); |
184 |
}); |
83 |
//]]> |
185 |
//]]> |
84 |
</script> |
186 |
</script> |
Lines 148-212
canned reports and writing custom SQL reports.</p>
Link Here
|
148 |
[% IF ( saved1 ) %] |
250 |
[% IF ( saved1 ) %] |
149 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
251 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
150 |
|
252 |
|
151 |
<div id="pagertable_reports"> |
253 |
<div id="tabs" class="toptabs"> |
152 |
[% INCLUDE 'table-pager.inc' perpage='20' %] |
254 |
<ul> |
153 |
</div> |
255 |
<li><a href="#reports">All</a></li> |
154 |
|
256 |
[% FOREACH group IN groups_with_subgroups %] |
155 |
<table id="table_reports" class="tablesorter"> |
257 |
<li><a id="[% group.id %]" href="#reports">[% group.name %]</a></li> |
156 |
<thead> |
|
|
157 |
<tr> |
158 |
<th>ID</th> |
159 |
<th>Report name</th> |
160 |
<th>Type</th> |
161 |
<th>Area</th> |
162 |
<th>Group</th> |
163 |
<th>Subgroup</th> |
164 |
<th>Notes</th> |
165 |
<th>Author</th> |
166 |
<th>Creation date</th> |
167 |
<th>Public</th> |
168 |
[% IF (usecache) %] <th>Cache expiry (seconds)</th> [% END %] |
169 |
<th>Saved results</th> |
170 |
<th>Saved SQL</th> |
171 |
<th> </th> |
172 |
<th> </th> |
173 |
</tr> |
174 |
</thead> |
175 |
<tbody> |
176 |
[% FOREACH savedreport IN savedreports %] |
177 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
178 |
<td>[% savedreport.id %]</td> |
179 |
<td>[% savedreport.report_name %]</td> |
180 |
<td>[% savedreport.type %]</td> |
181 |
<td>[% savedreport.areaname %]</td> |
182 |
<td>[% savedreport.groupname %]</td> |
183 |
<td>[% savedreport.subgroupname %]</td> |
184 |
<td>[% savedreport.notes %]</td> |
185 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
186 |
<td>[% savedreport.date_created %]</td> |
187 |
[% IF (savedreport.public) %] |
188 |
<td>Yes</td> |
189 |
[% ELSE %] |
190 |
<td>No</td> |
191 |
[% END %] |
192 |
[% IF (usecache) %] <td>[% savedreport.cache_expiry %]</td> [% END %] |
193 |
<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 %] |
194 |
</td> |
195 |
<td> |
196 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Show%20SQL">Show</a> |
197 |
[% IF ( CAN_user_reports_create_reports ) %] |
198 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Edit%20SQL">Edit</a> |
199 |
[% END %] |
258 |
[% END %] |
200 |
</td> |
259 |
</ul> |
201 |
<td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Run%20this%20report">Run</a> |
260 |
<div id="reports"> |
202 |
<a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]">Schedule</a></td> |
261 |
<div id="subgroup_filter_block"> |
203 |
[% IF ( CAN_user_reports_create_reports ) %] |
262 |
<label for="subgroup_filter">Subgroup:</label> |
204 |
<td><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Delete%20Saved">Delete</a></td> |
263 |
<select id="subgroup_filter"> |
205 |
[% END %] |
264 |
<option value="">All</option> |
206 |
</tr> |
265 |
</select> |
207 |
[% END %] |
266 |
</div> |
208 |
</tbody> |
267 |
<table id="table_reports"> |
209 |
</table> |
268 |
<thead> |
|
|
269 |
<tr> |
270 |
<th>ID</th> |
271 |
<th>Report name</th> |
272 |
<th>Type</th> |
273 |
<th>Group</th> |
274 |
<th>Subgroup</th> |
275 |
<th>Notes</th> |
276 |
<th>Author</th> |
277 |
<th>Creation date</th> |
278 |
<th>Public</th> |
279 |
[% IF (usecache) %] <th>Cache expiry (seconds)</th> [% END %] |
280 |
<th>Saved results</th> |
281 |
<th>Saved SQL</th> |
282 |
<th> </th> |
283 |
<th> </th> |
284 |
</tr> |
285 |
</thead> |
286 |
<tbody> |
287 |
[% FOREACH savedreport IN savedreports %] |
288 |
<tr> |
289 |
<td>[% savedreport.id %]</td> |
290 |
<td>[% savedreport.report_name %]</td> |
291 |
<td>[% savedreport.type %]</td> |
292 |
<td>[% savedreport.groupname %]</td> |
293 |
<td>[% savedreport.subgroupname %]</td> |
294 |
<td>[% savedreport.notes %]</td> |
295 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
296 |
<td>[% savedreport.date_created %]</td> |
297 |
[% IF (savedreport.public) %] |
298 |
<td>Yes</td> |
299 |
[% ELSE %] |
300 |
<td>No</td> |
301 |
[% END %] |
302 |
[% IF (usecache) %] <td>[% savedreport.cache_expiry %]</td> [% END %] |
303 |
<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 %] |
304 |
</td> |
305 |
<td> |
306 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Show%20SQL">Show</a> |
307 |
[% IF ( CAN_user_reports_create_reports ) %] |
308 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Edit%20SQL">Edit</a> |
309 |
<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 %]¬es=[% savedreport.notes |uri %]">Duplicate</a> |
310 |
[% END %] |
311 |
</td> |
312 |
<td> |
313 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Run%20this%20report">Run</a> |
314 |
<a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]">Schedule</a> |
315 |
</td> |
316 |
[% IF ( CAN_user_reports_create_reports ) %] |
317 |
<td><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Delete%20Saved">Delete</a></td> |
318 |
[% END %] |
319 |
</tr> |
320 |
[% END %] |
321 |
</tbody> |
322 |
</table> |
323 |
</div> |
324 |
</div> |
210 |
[% ELSE %]<div class="dialog message"> |
325 |
[% ELSE %]<div class="dialog message"> |
211 |
[% IF (filter_set) %] |
326 |
[% IF (filter_set) %] |
212 |
<h4>No saved reports match your criteria. </h4> |
327 |
<h4>No saved reports match your criteria. </h4> |
Lines 518-548
canned reports and writing custom SQL reports.</p>
Link Here
|
518 |
<legend>Save your custom report</legend> |
633 |
<legend>Save your custom report</legend> |
519 |
<ol> |
634 |
<ol> |
520 |
<li><label for="reportname">Report name: </label><input type="text" id="reportname" name="reportname" /></li> |
635 |
<li><label for="reportname">Report name: </label><input type="text" id="reportname" name="reportname" /></li> |
521 |
[% IF groups_with_subgroups %] |
636 |
[% PROCESS group_and_subgroup_selection %] |
522 |
<li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> |
|
|
523 |
[% FOR g IN groups_with_subgroups %] |
524 |
[% IF g.selected %] |
525 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
526 |
[% ELSE %] |
527 |
<option value="[% g.id %]">[% g.name %]</option> |
528 |
[% END %] |
529 |
<script type="text/javascript"> |
530 |
var g_sg = new Array(); |
531 |
[% FOR sg IN g.subgroups %] |
532 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
533 |
[% IF sg.selected %] |
534 |
$(document).ready(function() { |
535 |
$("#subgroup").val("[% sg.id %]"); |
536 |
}); |
537 |
[% END %] |
538 |
[% END %] |
539 |
group_subgroups["[% g.id %]"] = g_sg; |
540 |
</script> |
541 |
[% END %] |
542 |
</select></li> |
543 |
<li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> |
544 |
</select></li> |
545 |
[% END %] |
546 |
<li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li> |
637 |
<li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li> |
547 |
</ol></fieldset> |
638 |
</ol></fieldset> |
548 |
<fieldset class="action"><input type="hidden" name="phase" value="Save Report" /> |
639 |
<fieldset class="action"><input type="hidden" name="phase" value="Save Report" /> |
Lines 618-648
$(document).ready(function() {
Link Here
|
618 |
[% IF ( reportname ) %]<input type="text" id="reportname" name="reportname" value="[% reportname %]" /> |
709 |
[% IF ( reportname ) %]<input type="text" id="reportname" name="reportname" value="[% reportname %]" /> |
619 |
[% ELSE %]<input type="text" id="reportname" name="reportname" />[% END %] |
710 |
[% ELSE %]<input type="text" id="reportname" name="reportname" />[% END %] |
620 |
</li> |
711 |
</li> |
621 |
[% IF groups_with_subgroups %] |
712 |
[% PROCESS group_and_subgroup_selection %] |
622 |
<li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> |
713 |
|
623 |
[% FOR g IN groups_with_subgroups %] |
|
|
624 |
[% IF g.selected %] |
625 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
626 |
[% ELSE %] |
627 |
<option value="[% g.id %]">[% g.name %]</option> |
628 |
[% END %] |
629 |
<script type="text/javascript"> |
630 |
var g_sg = new Array(); |
631 |
[% FOR sg IN g.subgroups %] |
632 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
633 |
[% IF sg.selected %] |
634 |
$(document).ready(function() { |
635 |
$("#subgroup").val("[% sg.id %]"); |
636 |
}); |
637 |
[% END %] |
638 |
[% END %] |
639 |
group_subgroups["[% g.id %]"] = g_sg; |
640 |
</script> |
641 |
[% END %] |
642 |
</select></li> |
643 |
<li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> |
644 |
</select></li> |
645 |
[% END %] |
646 |
[% IF (public) %] |
714 |
[% IF (public) %] |
647 |
<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> |
715 |
<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> |
648 |
[% ELSE %] |
716 |
[% ELSE %] |
Lines 727-737
Sub report:<select name="subreport">
Link Here
|
727 |
[% END %] |
795 |
[% END %] |
728 |
|
796 |
|
729 |
[% IF ( editsql ) %] |
797 |
[% IF ( editsql ) %] |
730 |
<script type="text/javascript"> |
|
|
731 |
$(document).ready(function() { |
732 |
load_group_subgroups(); |
733 |
}); |
734 |
</script> |
735 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> |
798 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> |
736 |
<input type="hidden" name="phase" value="Update SQL" /> |
799 |
<input type="hidden" name="phase" value="Update SQL" /> |
737 |
<input type="hidden" name="id" value="[% id %]"/> |
800 |
<input type="hidden" name="id" value="[% id %]"/> |
Lines 739-769
$(document).ready(function() {
Link Here
|
739 |
<legend>Edit SQL report</legend> |
802 |
<legend>Edit SQL report</legend> |
740 |
<ol> |
803 |
<ol> |
741 |
<li><label for="reportname">Report name:</label><input type="text" id="reportname" name="reportname" value="[% reportname %]" size="50" /></li> |
804 |
<li><label for="reportname">Report name:</label><input type="text" id="reportname" name="reportname" value="[% reportname %]" size="50" /></li> |
742 |
[% IF groups_with_subgroups %] |
805 |
[% PROCESS group_and_subgroup_selection %] |
743 |
<li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> |
|
|
744 |
[% FOR g IN groups_with_subgroups %] |
745 |
[% IF g.selected %] |
746 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
747 |
[% ELSE %] |
748 |
<option value="[% g.id %]">[% g.name %]</option> |
749 |
[% END %] |
750 |
<script type="text/javascript"> |
751 |
var g_sg = new Array(); |
752 |
[% FOR sg IN g.subgroups %] |
753 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
754 |
[% IF sg.selected %] |
755 |
$(document).ready(function() { |
756 |
$("#subgroup").val("[% sg.id %]"); |
757 |
}); |
758 |
[% END %] |
759 |
[% END %] |
760 |
group_subgroups["[% g.id %]"] = g_sg; |
761 |
</script> |
762 |
[% END %] |
763 |
</select></li> |
764 |
<li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> |
765 |
</select></li> |
766 |
[% END %] |
767 |
[% IF (public) %] |
806 |
[% IF (public) %] |
768 |
<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> |
807 |
<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> |
769 |
[% ELSE %] |
808 |
[% ELSE %] |
Lines 831-873
$(document).ready(function() {
Link Here
|
831 |
|
870 |
|
832 |
[% IF ( saved1 ) %] |
871 |
[% IF ( saved1 ) %] |
833 |
<div id="saved-reports-filter"> |
872 |
<div id="saved-reports-filter"> |
834 |
<script type="text/javascript"> |
|
|
835 |
$(document).ready(function() { |
836 |
no_subgroup_label = _( "-- All --" ); |
837 |
load_group_subgroups(); |
838 |
}); |
839 |
</script> |
840 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="get"> |
873 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="get"> |
841 |
<input type="hidden" name="phase" value="Use saved" /> |
874 |
<input type="hidden" name="phase" value="Use saved" /> |
842 |
<input type="hidden" name="filter_set" value="1" /> |
875 |
<input type="hidden" name="filter_set" value="1" /> |
843 |
<fieldset class="brief"> |
876 |
<fieldset class="brief"> |
844 |
<h3>Filter</h3> |
877 |
<h3>Filter</h3> |
845 |
<ol> |
878 |
<ol> |
846 |
<li><label for="group">Choose Group and Subgroup: </label> |
|
|
847 |
<select name="group" id="group" onChange="load_group_subgroups();"> |
848 |
<option value="">-- All --</option> |
849 |
[% FOR g IN groups_with_subgroups %] |
850 |
[% IF g.selected %] |
851 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
852 |
[% ELSE %] |
853 |
<option value="[% g.id %]">[% g.name %]</option> |
854 |
[% END %] |
855 |
<script type="text/javascript"> |
856 |
var g_sg = new Array(); |
857 |
[% FOR sg IN g.subgroups %] |
858 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
859 |
[% IF sg.selected %] |
860 |
$(document).ready(function() { |
861 |
$("#subgroup").val("[% sg.id %]"); |
862 |
}); |
863 |
[% END %] |
864 |
[% END %] |
865 |
group_subgroups["[% g.id %]"] = g_sg; |
866 |
</script> |
867 |
[% END %] |
868 |
</select> |
869 |
<select name="subgroup" id="subgroup"></select> |
870 |
</li> |
871 |
<li><label for="filter_date">Date:</label> <input type="text" id="filter_date" name="filter_date" size="10" value="[% filter_date %]" class="datepicker" /> |
879 |
<li><label for="filter_date">Date:</label> <input type="text" id="filter_date" name="filter_date" size="10" value="[% filter_date %]" class="datepicker" /> |
872 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
880 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
873 |
|
881 |
|
Lines 903-905
$("#column_submit").submit(function() {
Link Here
|
903 |
//]]> |
911 |
//]]> |
904 |
</script> |
912 |
</script> |
905 |
[% INCLUDE 'intranet-bottom.inc' %] |
913 |
[% INCLUDE 'intranet-bottom.inc' %] |
|
|
914 |
|
915 |
|
916 |
[% BLOCK group_and_subgroup_selection %] |
917 |
<li id="group"> |
918 |
<label>Report group:</label> |
919 |
<input type="radio" name="select_or_create_group" |
920 |
id="select_group" checked="checked" /> |
921 |
<label for="select_group" style="float:none">Select</label> |
922 |
<select name="group" onChange="load_group_subgroups();" id="group_select"> |
923 |
<option value="">(None)</option> |
924 |
[% FOREACH group IN groups_with_subgroups %] |
925 |
[% IF (group.selected) %] |
926 |
<option value="[% group.id %]" selected="selected"> |
927 |
[% ELSE %] |
928 |
<option value="[% group.id %]"> |
929 |
[% END %] |
930 |
[% group.name %] |
931 |
</option> |
932 |
[% END %] |
933 |
</select> |
934 |
<input type="radio" name="select_or_create_group" id="create_group" /> |
935 |
<label for="create_group" style="float:none">or create</label> |
936 |
<input type="text" name="group" id="group_input" title="Group code" placeholder="Code" /> |
937 |
<input type="text" name="groupdesc" id="groupdesc_input" title="Group name" placeholder="Name" /> |
938 |
</li> |
939 |
<li id="subgroup"> |
940 |
<label>Report subgroup:</label> |
941 |
<input type="radio" name="select_or_create_subgroup" |
942 |
id="select_subgroup" checked="checked" /> |
943 |
<label for="select_subgroup" style="float:none">Select</label> |
944 |
<select name="subgroup" id="subgroup_select"> |
945 |
<option value="">(None)</option> |
946 |
[% FOREACH group IN groups_with_subgroups %] |
947 |
[% IF (group.selected) %] |
948 |
[% FOREACH subgroup IN group.subgroups %] |
949 |
[% IF (subgroup.selected) %] |
950 |
<option value="[% subgroup.id %]" selected="selected"> |
951 |
[% ELSE %] |
952 |
<option value="[% subgroup.id %]"> |
953 |
[% END %] |
954 |
[% subgroup.name %] |
955 |
</option> |
956 |
[% END %] |
957 |
[% END %] |
958 |
[% END %] |
959 |
</select> |
960 |
<input type="radio" name="select_or_create_subgroup" |
961 |
id="create_subgroup" /> |
962 |
<label for="create_subgroup" style="float:none">or create</label> |
963 |
<input type="text" name="subgroup" id="subgroup_input" title="Subgroup code" placeholder="Code" /> |
964 |
<input type="text" name="subgroupdesc" id="subgroupdesc_input" title="Subgroup name" placeholder="Name" /> |
965 |
</li> |
966 |
[% END %] |