|
Lines 32-56
Link Here
|
| 32 |
dt_add_type_uk_date(); |
32 |
dt_add_type_uk_date(); |
| 33 |
[% END %] |
33 |
[% END %] |
| 34 |
var group_subgroups = {}; |
34 |
var group_subgroups = {}; |
| 35 |
var no_subgroup_label = _( "(None)" ); |
35 |
[% FOREACH group IN groups_with_subgroups %] |
|
|
36 |
var gid = "[% group.id %]" |
| 37 |
group_subgroups[gid] = new Array(); |
| 38 |
[% FOREACH subgroup IN group.subgroups %] |
| 39 |
var sgid = "[% subgroup.id %]"; |
| 40 |
var sgname = "[% subgroup.name %]"; |
| 41 |
group_subgroups[gid].push([sgid, sgname]); |
| 42 |
[% END %] |
| 43 |
[% END %] |
| 44 |
|
| 36 |
function load_group_subgroups () { |
45 |
function load_group_subgroups () { |
| 37 |
var group = $("#group").val(); |
46 |
var group = $("#group_select").val(); |
| 38 |
var sg = $("#subgroup"); |
47 |
var sg = $("#subgroup"); |
| 39 |
var has_subgroups = false; |
48 |
$(sg).find('option[value!=""]').each(function() { |
| 40 |
$(sg).empty().append('<option value="">' + no_subgroup_label + '</option>'); |
49 |
$(this).remove(); |
|
|
50 |
}); |
| 51 |
$(sg).hide(); |
| 41 |
if (group) { |
52 |
if (group) { |
|
|
53 |
var select = $(sg).find('select')[0]; |
| 42 |
$.each( group_subgroups[group], function(index, value) { |
54 |
$.each( group_subgroups[group], function(index, value) { |
| 43 |
has_subgroups = true; |
55 |
$('<option value="' + value[0] + '">' + value[1] + '</option>').appendTo(select); |
| 44 |
$('<option value="' + value[0] + '">' + value[1] + '</option>').appendTo(sg); |
|
|
| 45 |
} ); |
56 |
} ); |
| 46 |
} |
57 |
$("#subgroup, #subgroup *").show(); |
| 47 |
if (has_subgroups) { |
|
|
| 48 |
$(sg).show(); |
| 49 |
} else { |
| 50 |
$(sg).hide(); |
| 51 |
} |
58 |
} |
| 52 |
} |
59 |
} |
|
|
60 |
|
| 53 |
$(document).ready(function(){ |
61 |
$(document).ready(function(){ |
|
|
62 |
|
| 63 |
[% IF (saved1) %] |
| 64 |
[% IF (dateformat == "metric") %] |
| 65 |
dt_add_type_uk_date(); |
| 66 |
[% END %] |
| 67 |
var rtable = $("#table_reports").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 68 |
'bAutoWidth': false, |
| 69 |
'sDom': 't<"bottom pager"ilpf>', |
| 70 |
'sPaginationType': 'four_button', |
| 71 |
'aLengthMenu': [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]], |
| 72 |
'iDisplayLength': 20, |
| 73 |
'aaSorting': [[ 1, "asc" ]], |
| 74 |
'aoColumnDefs': [ |
| 75 |
{ 'bSortable': false, 'bSearchable':false, 'aTargets': [-1, -2, -3, -4] }, |
| 76 |
{ 'bSearchable': false, 'aTargets': [3, 4] } |
| 77 |
], |
| 78 |
'oLanguage': { |
| 79 |
'sZeroRecords': _('No matching reports found') |
| 80 |
} |
| 81 |
})); |
| 82 |
|
| 83 |
var rtabs = $("#tabs").tabs(); |
| 84 |
rtabs.bind("tabsshow", function(e, ui) { |
| 85 |
$("#subgroup_filter option").each(function() { |
| 86 |
if($(this).val().length > 0) { |
| 87 |
$(this).remove(); |
| 88 |
} |
| 89 |
}); |
| 90 |
rtable.fnFilter('', 3); |
| 91 |
rtable.fnFilter('', 4); |
| 92 |
rtable.fnSetColumnVis(3, true); |
| 93 |
rtable.fnSetColumnVis(4, true); |
| 94 |
|
| 95 |
var g_id = $(ui.tab).attr('id') |
| 96 |
var g_name = $(ui.tab).text(); |
| 97 |
if (g_id && g_id.length > 0) { |
| 98 |
rtable.fnFilter(g_name, 3); |
| 99 |
rtable.fnSetColumnVis(3, false); |
| 100 |
for(var i in group_subgroups[g_id]) { |
| 101 |
$("#subgroup_filter").append( |
| 102 |
'<option value="' + group_subgroups[g_id][i][0] + '">' |
| 103 |
+ group_subgroups[g_id][i][1] + '</option>' |
| 104 |
); |
| 105 |
} |
| 106 |
$("#subgroup_filter_block").show(); |
| 107 |
} else { |
| 108 |
$("#subgroup_filter_block").hide(); |
| 109 |
} |
| 110 |
}); |
| 111 |
$("#subgroup_filter_block").hide(); |
| 112 |
|
| 113 |
$("#subgroup_filter").change(function() { |
| 114 |
var selected = $(this).find('option:selected'); |
| 115 |
var sg_id = $(selected).val(); |
| 116 |
var sg_name = $(selected).text(); |
| 117 |
if (sg_id.length > 0) { |
| 118 |
rtable.fnFilter(sg_name, 4); |
| 119 |
rtable.fnSetColumnVis(4, false); |
| 120 |
} else { |
| 121 |
rtable.fnFilter('', 4); |
| 122 |
rtable.fnSetColumnVis(4, true); |
| 123 |
} |
| 124 |
}); |
| 125 |
[% END %] |
| 126 |
|
| 54 |
[% IF ( showsql ) %] |
127 |
[% IF ( showsql ) %] |
| 55 |
$("#sql").focus(function() { |
128 |
$("#sql").focus(function() { |
| 56 |
$(this).select(); |
129 |
$(this).select(); |
|
Lines 66-85
$(document).ready(function(){
Link Here
|
| 66 |
return false; |
139 |
return false; |
| 67 |
} |
140 |
} |
| 68 |
}); |
141 |
}); |
| 69 |
// call the datatables plugin |
|
|
| 70 |
$("#table_reports").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 71 |
"aoColumnDefs": [ |
| 72 |
{ "aTargets": [ -1, -2, -3, -4 ], "bSortable": false, "bSearchable": false }, |
| 73 |
], |
| 74 |
"aaSorting": [[ 1, "asc" ]], |
| 75 |
"aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]], |
| 76 |
"iDisplayLength": 20, |
| 77 |
"sPaginationType": "four_button" |
| 78 |
})); |
| 79 |
[% END %] |
142 |
[% END %] |
| 80 |
// redefine the datepicker's default because reports require ISO |
143 |
// redefine the datepicker's default because reports require ISO |
| 81 |
// http://jqueryui.com/demos/datepicker/#option-dateFormat |
144 |
// http://jqueryui.com/demos/datepicker/#option-dateFormat |
| 82 |
$( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" ); |
145 |
$( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" ); |
|
|
146 |
|
| 147 |
[% IF (create || editsql || save) %] |
| 148 |
$("#select_group").change(function() { |
| 149 |
if($(this).attr('checked')) { |
| 150 |
$("#group_input").attr('disabled', 'disabled'); |
| 151 |
$("#groupdesc_input").attr('disabled', 'disabled'); |
| 152 |
$("#group_select").attr('disabled', false); |
| 153 |
if ($("#group_select").val().length > 0) { |
| 154 |
$("#select_subgroup").attr('checked', 'checked'); |
| 155 |
$("#select_subgroup").change(); |
| 156 |
$("#subgroup, #subgroup *").show(); |
| 157 |
} else { |
| 158 |
$("#subgroup").hide(); |
| 159 |
} |
| 160 |
} |
| 161 |
}); |
| 162 |
$("#create_group").change(function() { |
| 163 |
if($(this).attr('checked')) { |
| 164 |
$("#group_input").attr('disabled', false); |
| 165 |
$("#groupdesc_input").attr('disabled', false); |
| 166 |
$("#group_select").attr('disabled', 'disabled'); |
| 167 |
$("#create_subgroup").attr('checked', 'checked').change(); |
| 168 |
$("#subgroup_select").hide(); |
| 169 |
$("#subgroup input[type='radio']").hide(); |
| 170 |
$("#subgroup label[for]").hide(); |
| 171 |
$("#subgroup_input").show(); |
| 172 |
$("#subgroupdesc_input").show(); |
| 173 |
$("#subgroup").show(); |
| 174 |
} |
| 175 |
}); |
| 176 |
$("#select_subgroup").change(function() { |
| 177 |
if($(this).attr('checked')) { |
| 178 |
$("#subgroup_select").attr('disabled', false); |
| 179 |
$("#subgroup_input").attr('disabled', 'disabled'); |
| 180 |
$("#subgroupdesc_input").attr('disabled', 'disabled'); |
| 181 |
} |
| 182 |
}); |
| 183 |
$("#create_subgroup").change(function() { |
| 184 |
if($(this).attr('checked')) { |
| 185 |
$("#subgroup_input").attr('disabled', false); |
| 186 |
$("#subgroupdesc_input").attr('disabled', false); |
| 187 |
$("#subgroup_select").attr('disabled', 'disabled'); |
| 188 |
} |
| 189 |
}); |
| 190 |
$("#select_group").change(); |
| 191 |
$("#select_subgroup").change(); |
| 192 |
[% END %] |
| 83 |
}); |
193 |
}); |
| 84 |
//]]> |
194 |
//]]> |
| 85 |
</script> |
195 |
</script> |
|
Lines 149-209
canned reports and writing custom SQL reports.</p>
Link Here
|
| 149 |
[% IF ( saved1 ) %] |
259 |
[% IF ( saved1 ) %] |
| 150 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
260 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
| 151 |
|
261 |
|
| 152 |
<table id="table_reports" class="tablesorter"> |
262 |
<div id="tabs" class="toptabs"> |
| 153 |
<thead> |
263 |
<ul> |
| 154 |
<tr> |
264 |
<li><a href="#reports">All</a></li> |
| 155 |
<th>ID</th> |
265 |
[% FOREACH group IN groups_with_subgroups %] |
| 156 |
<th>Report name</th> |
266 |
<li><a id="[% group.id %]" href="#reports">[% group.name %]</a></li> |
| 157 |
<th>Type</th> |
|
|
| 158 |
<th>Area</th> |
| 159 |
<th>Group</th> |
| 160 |
<th>Subgroup</th> |
| 161 |
<th>Notes</th> |
| 162 |
<th>Author</th> |
| 163 |
<th>Creation date</th> |
| 164 |
<th>Public</th> |
| 165 |
[% IF (usecache) %] <th>Cache expiry (seconds)</th> [% END %] |
| 166 |
<th>Saved results</th> |
| 167 |
<th>Saved SQL</th> |
| 168 |
<th> </th> |
| 169 |
<th> </th> |
| 170 |
</tr> |
| 171 |
</thead> |
| 172 |
<tbody> |
| 173 |
[% FOREACH savedreport IN savedreports %] |
| 174 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
| 175 |
<td>[% savedreport.id %]</td> |
| 176 |
<td>[% savedreport.report_name %]</td> |
| 177 |
<td>[% savedreport.type %]</td> |
| 178 |
<td>[% savedreport.areaname %]</td> |
| 179 |
<td>[% savedreport.groupname %]</td> |
| 180 |
<td>[% savedreport.subgroupname %]</td> |
| 181 |
<td>[% savedreport.notes %]</td> |
| 182 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
| 183 |
<td>[% savedreport.date_created %]</td> |
| 184 |
[% IF (savedreport.public) %] |
| 185 |
<td>Yes</td> |
| 186 |
[% ELSE %] |
| 187 |
<td>No</td> |
| 188 |
[% END %] |
| 189 |
[% IF (usecache) %] <td>[% savedreport.cache_expiry %]</td> [% END %] |
| 190 |
<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 %] |
| 191 |
</td> |
| 192 |
<td> |
| 193 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Show%20SQL">Show</a> |
| 194 |
[% IF ( CAN_user_reports_create_reports ) %] |
| 195 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Edit%20SQL">Edit</a> |
| 196 |
[% END %] |
267 |
[% END %] |
| 197 |
</td> |
268 |
</ul> |
| 198 |
<td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Run%20this%20report">Run</a> |
269 |
<div id="reports"> |
| 199 |
<a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]">Schedule</a></td> |
270 |
<div id="subgroup_filter_block"> |
| 200 |
[% IF ( CAN_user_reports_create_reports ) %] |
271 |
<label for="subgroup_filter">Subgroup:</label> |
| 201 |
<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> |
272 |
<select id="subgroup_filter"> |
| 202 |
[% END %] |
273 |
<option value="">All</option> |
| 203 |
</tr> |
274 |
</select> |
| 204 |
[% END %] |
275 |
</div> |
| 205 |
</tbody> |
276 |
<table id="table_reports"> |
| 206 |
</table> |
277 |
<thead> |
|
|
278 |
<tr> |
| 279 |
<th>ID</th> |
| 280 |
<th>Report name</th> |
| 281 |
<th>Type</th> |
| 282 |
<th>Group</th> |
| 283 |
<th>Subgroup</th> |
| 284 |
<th>Notes</th> |
| 285 |
<th>Author</th> |
| 286 |
<th>Creation date</th> |
| 287 |
<th>Public</th> |
| 288 |
[% IF (usecache) %] <th>Cache expiry (seconds)</th> [% END %] |
| 289 |
<th>Saved results</th> |
| 290 |
<th>Saved SQL</th> |
| 291 |
<th> </th> |
| 292 |
<th> </th> |
| 293 |
</tr> |
| 294 |
</thead> |
| 295 |
<tbody> |
| 296 |
[% FOREACH savedreport IN savedreports %] |
| 297 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
| 298 |
<td>[% savedreport.id %]</td> |
| 299 |
<td>[% savedreport.report_name %]</td> |
| 300 |
<td>[% savedreport.type %]</td> |
| 301 |
<td>[% savedreport.groupname %]</td> |
| 302 |
<td>[% savedreport.subgroupname %]</td> |
| 303 |
<td>[% savedreport.notes %]</td> |
| 304 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
| 305 |
<td>[% savedreport.date_created %]</td> |
| 306 |
[% IF (savedreport.public) %] |
| 307 |
<td>Yes</td> |
| 308 |
[% ELSE %] |
| 309 |
<td>No</td> |
| 310 |
[% END %] |
| 311 |
[% IF (usecache) %] <td>[% savedreport.cache_expiry %]</td> [% END %] |
| 312 |
<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 %] |
| 313 |
</td> |
| 314 |
<td> |
| 315 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Show%20SQL">Show</a> |
| 316 |
[% IF ( CAN_user_reports_create_reports ) %] |
| 317 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Edit%20SQL">Edit</a> |
| 318 |
<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> |
| 319 |
[% END %] |
| 320 |
</td> |
| 321 |
<td> |
| 322 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Run%20this%20report">Run</a> |
| 323 |
<a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]">Schedule</a> |
| 324 |
</td> |
| 325 |
[% IF ( CAN_user_reports_create_reports ) %] |
| 326 |
<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> |
| 327 |
[% END %] |
| 328 |
</tr> |
| 329 |
[% END %] |
| 330 |
</tbody> |
| 331 |
</table> |
| 332 |
</div> |
| 333 |
</div> |
| 207 |
[% ELSE %]<div class="dialog message"> |
334 |
[% ELSE %]<div class="dialog message"> |
| 208 |
[% IF (filter_set) %] |
335 |
[% IF (filter_set) %] |
| 209 |
<h4>No saved reports match your criteria. </h4> |
336 |
<h4>No saved reports match your criteria. </h4> |
|
Lines 515-545
canned reports and writing custom SQL reports.</p>
Link Here
|
| 515 |
<legend>Save your custom report</legend> |
642 |
<legend>Save your custom report</legend> |
| 516 |
<ol> |
643 |
<ol> |
| 517 |
<li><label for="reportname">Report name: </label><input type="text" id="reportname" name="reportname" /></li> |
644 |
<li><label for="reportname">Report name: </label><input type="text" id="reportname" name="reportname" /></li> |
| 518 |
[% IF groups_with_subgroups %] |
645 |
[% PROCESS group_and_subgroup_selection %] |
| 519 |
<li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> |
|
|
| 520 |
[% FOR g IN groups_with_subgroups %] |
| 521 |
[% IF g.selected %] |
| 522 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
| 523 |
[% ELSE %] |
| 524 |
<option value="[% g.id %]">[% g.name %]</option> |
| 525 |
[% END %] |
| 526 |
<script type="text/javascript"> |
| 527 |
var g_sg = new Array(); |
| 528 |
[% FOR sg IN g.subgroups %] |
| 529 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
| 530 |
[% IF sg.selected %] |
| 531 |
$(document).ready(function() { |
| 532 |
$("#subgroup").val("[% sg.id %]"); |
| 533 |
}); |
| 534 |
[% END %] |
| 535 |
[% END %] |
| 536 |
group_subgroups["[% g.id %]"] = g_sg; |
| 537 |
</script> |
| 538 |
[% END %] |
| 539 |
</select></li> |
| 540 |
<li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> |
| 541 |
</select></li> |
| 542 |
[% END %] |
| 543 |
<li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li> |
646 |
<li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li> |
| 544 |
</ol></fieldset> |
647 |
</ol></fieldset> |
| 545 |
<fieldset class="action"><input type="hidden" name="phase" value="Save Report" /> |
648 |
<fieldset class="action"><input type="hidden" name="phase" value="Save Report" /> |
|
Lines 635-665
$(document).ready(function() {
Link Here
|
| 635 |
[% IF ( reportname ) %]<input type="text" id="reportname" name="reportname" value="[% reportname %]" /> |
738 |
[% IF ( reportname ) %]<input type="text" id="reportname" name="reportname" value="[% reportname %]" /> |
| 636 |
[% ELSE %]<input type="text" id="reportname" name="reportname" />[% END %] |
739 |
[% ELSE %]<input type="text" id="reportname" name="reportname" />[% END %] |
| 637 |
</li> |
740 |
</li> |
| 638 |
[% IF groups_with_subgroups %] |
741 |
[% PROCESS group_and_subgroup_selection %] |
| 639 |
<li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> |
742 |
|
| 640 |
[% FOR g IN groups_with_subgroups %] |
|
|
| 641 |
[% IF g.selected %] |
| 642 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
| 643 |
[% ELSE %] |
| 644 |
<option value="[% g.id %]">[% g.name %]</option> |
| 645 |
[% END %] |
| 646 |
<script type="text/javascript"> |
| 647 |
var g_sg = new Array(); |
| 648 |
[% FOR sg IN g.subgroups %] |
| 649 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
| 650 |
[% IF sg.selected %] |
| 651 |
$(document).ready(function() { |
| 652 |
$("#subgroup").val("[% sg.id %]"); |
| 653 |
}); |
| 654 |
[% END %] |
| 655 |
[% END %] |
| 656 |
group_subgroups["[% g.id %]"] = g_sg; |
| 657 |
</script> |
| 658 |
[% END %] |
| 659 |
</select></li> |
| 660 |
<li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> |
| 661 |
</select></li> |
| 662 |
[% END %] |
| 663 |
[% IF (public) %] |
743 |
[% IF (public) %] |
| 664 |
<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> |
744 |
<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> |
| 665 |
[% ELSE %] |
745 |
[% ELSE %] |
|
Lines 744-754
Sub report:<select name="subreport">
Link Here
|
| 744 |
[% END %] |
824 |
[% END %] |
| 745 |
|
825 |
|
| 746 |
[% IF ( editsql ) %] |
826 |
[% IF ( editsql ) %] |
| 747 |
<script type="text/javascript"> |
|
|
| 748 |
$(document).ready(function() { |
| 749 |
load_group_subgroups(); |
| 750 |
}); |
| 751 |
</script> |
| 752 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> |
827 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> |
| 753 |
<input type="hidden" name="phase" value="Update SQL" /> |
828 |
<input type="hidden" name="phase" value="Update SQL" /> |
| 754 |
<input type="hidden" name="id" value="[% id %]"/> |
829 |
<input type="hidden" name="id" value="[% id %]"/> |
|
Lines 756-786
$(document).ready(function() {
Link Here
|
| 756 |
<legend>Edit SQL report</legend> |
831 |
<legend>Edit SQL report</legend> |
| 757 |
<ol> |
832 |
<ol> |
| 758 |
<li><label for="reportname">Report name:</label><input type="text" id="reportname" name="reportname" value="[% reportname %]" size="50" /></li> |
833 |
<li><label for="reportname">Report name:</label><input type="text" id="reportname" name="reportname" value="[% reportname %]" size="50" /></li> |
| 759 |
[% IF groups_with_subgroups %] |
834 |
[% PROCESS group_and_subgroup_selection %] |
| 760 |
<li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> |
|
|
| 761 |
[% FOR g IN groups_with_subgroups %] |
| 762 |
[% IF g.selected %] |
| 763 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
| 764 |
[% ELSE %] |
| 765 |
<option value="[% g.id %]">[% g.name %]</option> |
| 766 |
[% END %] |
| 767 |
<script type="text/javascript"> |
| 768 |
var g_sg = new Array(); |
| 769 |
[% FOR sg IN g.subgroups %] |
| 770 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
| 771 |
[% IF sg.selected %] |
| 772 |
$(document).ready(function() { |
| 773 |
$("#subgroup").val("[% sg.id %]"); |
| 774 |
}); |
| 775 |
[% END %] |
| 776 |
[% END %] |
| 777 |
group_subgroups["[% g.id %]"] = g_sg; |
| 778 |
</script> |
| 779 |
[% END %] |
| 780 |
</select></li> |
| 781 |
<li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> |
| 782 |
</select></li> |
| 783 |
[% END %] |
| 784 |
[% IF (public) %] |
835 |
[% IF (public) %] |
| 785 |
<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> |
836 |
<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> |
| 786 |
[% ELSE %] |
837 |
[% ELSE %] |
|
Lines 848-890
$(document).ready(function() {
Link Here
|
| 848 |
|
899 |
|
| 849 |
[% IF ( saved1 ) %] |
900 |
[% IF ( saved1 ) %] |
| 850 |
<div id="saved-reports-filter"> |
901 |
<div id="saved-reports-filter"> |
| 851 |
<script type="text/javascript"> |
|
|
| 852 |
$(document).ready(function() { |
| 853 |
no_subgroup_label = _( "-- All --" ); |
| 854 |
load_group_subgroups(); |
| 855 |
}); |
| 856 |
</script> |
| 857 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="get"> |
902 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="get"> |
| 858 |
<input type="hidden" name="phase" value="Use saved" /> |
903 |
<input type="hidden" name="phase" value="Use saved" /> |
| 859 |
<input type="hidden" name="filter_set" value="1" /> |
904 |
<input type="hidden" name="filter_set" value="1" /> |
| 860 |
<fieldset class="brief"> |
905 |
<fieldset class="brief"> |
| 861 |
<h3>Filter</h3> |
906 |
<h3>Filter</h3> |
| 862 |
<ol> |
907 |
<ol> |
| 863 |
<li><label for="group">Choose Group and Subgroup: </label> |
|
|
| 864 |
<select name="group" id="group" onChange="load_group_subgroups();"> |
| 865 |
<option value="">-- All --</option> |
| 866 |
[% FOR g IN groups_with_subgroups %] |
| 867 |
[% IF g.selected %] |
| 868 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
| 869 |
[% ELSE %] |
| 870 |
<option value="[% g.id %]">[% g.name %]</option> |
| 871 |
[% END %] |
| 872 |
<script type="text/javascript"> |
| 873 |
var g_sg = new Array(); |
| 874 |
[% FOR sg IN g.subgroups %] |
| 875 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
| 876 |
[% IF sg.selected %] |
| 877 |
$(document).ready(function() { |
| 878 |
$("#subgroup").val("[% sg.id %]"); |
| 879 |
}); |
| 880 |
[% END %] |
| 881 |
[% END %] |
| 882 |
group_subgroups["[% g.id %]"] = g_sg; |
| 883 |
</script> |
| 884 |
[% END %] |
| 885 |
</select> |
| 886 |
<select name="subgroup" id="subgroup"></select> |
| 887 |
</li> |
| 888 |
<li><label for="filter_date">Date:</label> <input type="text" id="filter_date" name="filter_date" size="10" value="[% filter_date %]" class="datepicker" /> |
908 |
<li><label for="filter_date">Date:</label> <input type="text" id="filter_date" name="filter_date" size="10" value="[% filter_date %]" class="datepicker" /> |
| 889 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
909 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
| 890 |
|
910 |
|
|
Lines 920-922
$("#column_submit").submit(function() {
Link Here
|
| 920 |
//]]> |
940 |
//]]> |
| 921 |
</script> |
941 |
</script> |
| 922 |
[% INCLUDE 'intranet-bottom.inc' %] |
942 |
[% INCLUDE 'intranet-bottom.inc' %] |
|
|
943 |
|
| 944 |
|
| 945 |
[% BLOCK group_and_subgroup_selection %] |
| 946 |
<li id="group"> |
| 947 |
<label>Report group:</label> |
| 948 |
<input type="radio" name="select_or_create_group" |
| 949 |
id="select_group" checked="checked" /> |
| 950 |
<label for="select_group" style="float:none">Select</label> |
| 951 |
<select name="group" onChange="load_group_subgroups();" id="group_select"> |
| 952 |
<option value="">(None)</option> |
| 953 |
[% FOREACH group IN groups_with_subgroups %] |
| 954 |
[% IF (group.selected) %] |
| 955 |
<option value="[% group.id %]" selected="selected"> |
| 956 |
[% ELSE %] |
| 957 |
<option value="[% group.id %]"> |
| 958 |
[% END %] |
| 959 |
[% group.name %] |
| 960 |
</option> |
| 961 |
[% END %] |
| 962 |
</select> |
| 963 |
<input type="radio" name="select_or_create_group" id="create_group" /> |
| 964 |
<label for="create_group" style="float:none">or create</label> |
| 965 |
<input type="text" name="group" id="group_input" title="Group code" placeholder="Code" /> |
| 966 |
<input type="text" name="groupdesc" id="groupdesc_input" title="Group name" placeholder="Name" /> |
| 967 |
</li> |
| 968 |
<li id="subgroup"> |
| 969 |
<label>Report subgroup:</label> |
| 970 |
<input type="radio" name="select_or_create_subgroup" |
| 971 |
id="select_subgroup" checked="checked" /> |
| 972 |
<label for="select_subgroup" style="float:none">Select</label> |
| 973 |
<select name="subgroup" id="subgroup_select"> |
| 974 |
<option value="">(None)</option> |
| 975 |
[% FOREACH group IN groups_with_subgroups %] |
| 976 |
[% IF (group.selected) %] |
| 977 |
[% FOREACH subgroup IN group.subgroups %] |
| 978 |
[% IF (subgroup.selected) %] |
| 979 |
<option value="[% subgroup.id %]" selected="selected"> |
| 980 |
[% ELSE %] |
| 981 |
<option value="[% subgroup.id %]"> |
| 982 |
[% END %] |
| 983 |
[% subgroup.name %] |
| 984 |
</option> |
| 985 |
[% END %] |
| 986 |
[% END %] |
| 987 |
[% END %] |
| 988 |
</select> |
| 989 |
<input type="radio" name="select_or_create_subgroup" |
| 990 |
id="create_subgroup" /> |
| 991 |
<label for="create_subgroup" style="float:none">or create</label> |
| 992 |
<input type="text" name="subgroup" id="subgroup_input" title="Subgroup code" placeholder="Code" /> |
| 993 |
<input type="text" name="subgroupdesc" id="subgroupdesc_input" title="Subgroup name" placeholder="Name" /> |
| 994 |
</li> |
| 995 |
[% END %] |