|
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-83
$(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 |
10: { sorter: false}, |
| 69 |
11: { sorter: false}, |
| 70 |
12: { sorter: false}, |
| 71 |
13: { sorter: false} |
| 72 |
} |
| 73 |
}).tablesorterPager({ |
| 74 |
container: $("#pagertable_reports"), |
| 75 |
positionFixed: false, |
| 76 |
size: 20 |
| 77 |
}); |
| 78 |
// redefine the datepicker's default because reports require ISO |
134 |
// redefine the datepicker's default because reports require ISO |
| 79 |
// http://jqueryui.com/demos/datepicker/#option-dateFormat |
135 |
// http://jqueryui.com/demos/datepicker/#option-dateFormat |
| 80 |
$( ".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 %] |
| 81 |
}); |
184 |
}); |
| 82 |
//]]> |
185 |
//]]> |
| 83 |
</script> |
186 |
</script> |
|
Lines 147-211
canned reports and writing custom SQL reports.</p>
Link Here
|
| 147 |
[% IF ( saved1 ) %] |
250 |
[% IF ( saved1 ) %] |
| 148 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
251 |
[% IF ( savedreports ) %]<h1>Saved reports</h1> |
| 149 |
|
252 |
|
| 150 |
<div id="pagertable_reports"> |
253 |
<div id="tabs" class="toptabs"> |
| 151 |
[% INCLUDE 'table-pager.inc' perpage='20' %] |
254 |
<ul> |
| 152 |
</div> |
255 |
<li><a href="#reports">All</a></li> |
| 153 |
|
256 |
[% FOREACH group IN groups_with_subgroups %] |
| 154 |
<table id="table_reports" class="tablesorter"> |
257 |
<li><a id="[% group.id %]" href="#reports">[% group.name %]</a></li> |
| 155 |
<thead> |
|
|
| 156 |
<tr> |
| 157 |
<th>ID</th> |
| 158 |
<th>Report name</th> |
| 159 |
<th>Type</th> |
| 160 |
<th>Area</th> |
| 161 |
<th>Group</th> |
| 162 |
<th>Subgroup</th> |
| 163 |
<th>Notes</th> |
| 164 |
<th>Author</th> |
| 165 |
<th>Creation date</th> |
| 166 |
<th>Public</th> |
| 167 |
[% IF (usecache) %] <th>Cache expiry (seconds)</th> [% END %] |
| 168 |
<th>Saved results</th> |
| 169 |
<th>Saved SQL</th> |
| 170 |
<th> </th> |
| 171 |
<th> </th> |
| 172 |
</tr> |
| 173 |
</thead> |
| 174 |
<tbody> |
| 175 |
[% FOREACH savedreport IN savedreports %] |
| 176 |
[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %] |
| 177 |
<td>[% savedreport.id %]</td> |
| 178 |
<td>[% savedreport.report_name %]</td> |
| 179 |
<td>[% savedreport.type %]</td> |
| 180 |
<td>[% savedreport.areaname %]</td> |
| 181 |
<td>[% savedreport.groupname %]</td> |
| 182 |
<td>[% savedreport.subgroupname %]</td> |
| 183 |
<td>[% savedreport.notes %]</td> |
| 184 |
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td> |
| 185 |
<td>[% savedreport.date_created %]</td> |
| 186 |
[% IF (savedreport.public) %] |
| 187 |
<td>Yes</td> |
| 188 |
[% ELSE %] |
| 189 |
<td>No</td> |
| 190 |
[% END %] |
| 191 |
[% IF (usecache) %] <td>[% savedreport.cache_expiry %]</td> [% END %] |
| 192 |
<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 %] |
| 193 |
</td> |
| 194 |
<td> |
| 195 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Show%20SQL">Show</a> |
| 196 |
[% IF ( CAN_user_reports_create_reports ) %] |
| 197 |
<a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Edit%20SQL">Edit</a> |
| 198 |
[% END %] |
258 |
[% END %] |
| 199 |
</td> |
259 |
</ul> |
| 200 |
<td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=[% savedreport.id %]&phase=Run%20this%20report">Run</a> |
260 |
<div id="reports"> |
| 201 |
<a href="/cgi-bin/koha/tools/scheduler.pl?id=[% savedreport.id %]">Schedule</a></td> |
261 |
<div id="subgroup_filter_block"> |
| 202 |
[% IF ( CAN_user_reports_create_reports ) %] |
262 |
<label for="subgroup_filter">Subgroup:</label> |
| 203 |
<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"> |
| 204 |
[% END %] |
264 |
<option value="">All</option> |
| 205 |
</tr> |
265 |
</select> |
| 206 |
[% END %] |
266 |
</div> |
| 207 |
</tbody> |
267 |
<table id="table_reports"> |
| 208 |
</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> |
| 209 |
[% ELSE %]<div class="dialog message"> |
325 |
[% ELSE %]<div class="dialog message"> |
| 210 |
[% IF (filter_set) %] |
326 |
[% IF (filter_set) %] |
| 211 |
<h4>No saved reports match your criteria. </h4> |
327 |
<h4>No saved reports match your criteria. </h4> |
|
Lines 517-547
canned reports and writing custom SQL reports.</p>
Link Here
|
| 517 |
<legend>Save your custom report</legend> |
633 |
<legend>Save your custom report</legend> |
| 518 |
<ol> |
634 |
<ol> |
| 519 |
<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> |
| 520 |
[% IF groups_with_subgroups %] |
636 |
[% PROCESS group_and_subgroup_selection %] |
| 521 |
<li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> |
|
|
| 522 |
[% FOR g IN groups_with_subgroups %] |
| 523 |
[% IF g.selected %] |
| 524 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
| 525 |
[% ELSE %] |
| 526 |
<option value="[% g.id %]">[% g.name %]</option> |
| 527 |
[% END %] |
| 528 |
<script type="text/javascript"> |
| 529 |
var g_sg = new Array(); |
| 530 |
[% FOR sg IN g.subgroups %] |
| 531 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
| 532 |
[% IF sg.selected %] |
| 533 |
$(document).ready(function() { |
| 534 |
$("#subgroup").val("[% sg.id %]"); |
| 535 |
}); |
| 536 |
[% END %] |
| 537 |
[% END %] |
| 538 |
group_subgroups["[% g.id %]"] = g_sg; |
| 539 |
</script> |
| 540 |
[% END %] |
| 541 |
</select></li> |
| 542 |
<li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> |
| 543 |
</select></li> |
| 544 |
[% END %] |
| 545 |
<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> |
| 546 |
</ol></fieldset> |
638 |
</ol></fieldset> |
| 547 |
<fieldset class="action"><input type="hidden" name="phase" value="Save Report" /> |
639 |
<fieldset class="action"><input type="hidden" name="phase" value="Save Report" /> |
|
Lines 617-647
$(document).ready(function() {
Link Here
|
| 617 |
[% IF ( reportname ) %]<input type="text" id="reportname" name="reportname" value="[% reportname %]" /> |
709 |
[% IF ( reportname ) %]<input type="text" id="reportname" name="reportname" value="[% reportname %]" /> |
| 618 |
[% ELSE %]<input type="text" id="reportname" name="reportname" />[% END %] |
710 |
[% ELSE %]<input type="text" id="reportname" name="reportname" />[% END %] |
| 619 |
</li> |
711 |
</li> |
| 620 |
[% IF groups_with_subgroups %] |
712 |
[% PROCESS group_and_subgroup_selection %] |
| 621 |
<li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> |
713 |
|
| 622 |
[% FOR g IN groups_with_subgroups %] |
|
|
| 623 |
[% IF g.selected %] |
| 624 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
| 625 |
[% ELSE %] |
| 626 |
<option value="[% g.id %]">[% g.name %]</option> |
| 627 |
[% END %] |
| 628 |
<script type="text/javascript"> |
| 629 |
var g_sg = new Array(); |
| 630 |
[% FOR sg IN g.subgroups %] |
| 631 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
| 632 |
[% IF sg.selected %] |
| 633 |
$(document).ready(function() { |
| 634 |
$("#subgroup").val("[% sg.id %]"); |
| 635 |
}); |
| 636 |
[% END %] |
| 637 |
[% END %] |
| 638 |
group_subgroups["[% g.id %]"] = g_sg; |
| 639 |
</script> |
| 640 |
[% END %] |
| 641 |
</select></li> |
| 642 |
<li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> |
| 643 |
</select></li> |
| 644 |
[% END %] |
| 645 |
[% IF (public) %] |
714 |
[% IF (public) %] |
| 646 |
<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> |
| 647 |
[% ELSE %] |
716 |
[% ELSE %] |
|
Lines 726-736
Sub report:<select name="subreport">
Link Here
|
| 726 |
[% END %] |
795 |
[% END %] |
| 727 |
|
796 |
|
| 728 |
[% IF ( editsql ) %] |
797 |
[% IF ( editsql ) %] |
| 729 |
<script type="text/javascript"> |
|
|
| 730 |
$(document).ready(function() { |
| 731 |
load_group_subgroups(); |
| 732 |
}); |
| 733 |
</script> |
| 734 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> |
798 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post"> |
| 735 |
<input type="hidden" name="phase" value="Update SQL" /> |
799 |
<input type="hidden" name="phase" value="Update SQL" /> |
| 736 |
<input type="hidden" name="id" value="[% id %]"/> |
800 |
<input type="hidden" name="id" value="[% id %]"/> |
|
Lines 738-768
$(document).ready(function() {
Link Here
|
| 738 |
<legend>Edit SQL report</legend> |
802 |
<legend>Edit SQL report</legend> |
| 739 |
<ol> |
803 |
<ol> |
| 740 |
<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> |
| 741 |
[% IF groups_with_subgroups %] |
805 |
[% PROCESS group_and_subgroup_selection %] |
| 742 |
<li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();"> |
|
|
| 743 |
[% FOR g IN groups_with_subgroups %] |
| 744 |
[% IF g.selected %] |
| 745 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
| 746 |
[% ELSE %] |
| 747 |
<option value="[% g.id %]">[% g.name %]</option> |
| 748 |
[% END %] |
| 749 |
<script type="text/javascript"> |
| 750 |
var g_sg = new Array(); |
| 751 |
[% FOR sg IN g.subgroups %] |
| 752 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
| 753 |
[% IF sg.selected %] |
| 754 |
$(document).ready(function() { |
| 755 |
$("#subgroup").val("[% sg.id %]"); |
| 756 |
}); |
| 757 |
[% END %] |
| 758 |
[% END %] |
| 759 |
group_subgroups["[% g.id %]"] = g_sg; |
| 760 |
</script> |
| 761 |
[% END %] |
| 762 |
</select></li> |
| 763 |
<li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup"> |
| 764 |
</select></li> |
| 765 |
[% END %] |
| 766 |
[% IF (public) %] |
806 |
[% IF (public) %] |
| 767 |
<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> |
| 768 |
[% ELSE %] |
808 |
[% ELSE %] |
|
Lines 830-872
$(document).ready(function() {
Link Here
|
| 830 |
|
870 |
|
| 831 |
[% IF ( saved1 ) %] |
871 |
[% IF ( saved1 ) %] |
| 832 |
<div id="saved-reports-filter"> |
872 |
<div id="saved-reports-filter"> |
| 833 |
<script type="text/javascript"> |
|
|
| 834 |
$(document).ready(function() { |
| 835 |
no_subgroup_label = _( "-- All --" ); |
| 836 |
load_group_subgroups(); |
| 837 |
}); |
| 838 |
</script> |
| 839 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="get"> |
873 |
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="get"> |
| 840 |
<input type="hidden" name="phase" value="Use saved" /> |
874 |
<input type="hidden" name="phase" value="Use saved" /> |
| 841 |
<input type="hidden" name="filter_set" value="1" /> |
875 |
<input type="hidden" name="filter_set" value="1" /> |
| 842 |
<fieldset class="brief"> |
876 |
<fieldset class="brief"> |
| 843 |
<h3>Filter</h3> |
877 |
<h3>Filter</h3> |
| 844 |
<ol> |
878 |
<ol> |
| 845 |
<li><label for="group">Choose Group and Subgroup: </label> |
|
|
| 846 |
<select name="group" id="group" onChange="load_group_subgroups();"> |
| 847 |
<option value="">-- All --</option> |
| 848 |
[% FOR g IN groups_with_subgroups %] |
| 849 |
[% IF g.selected %] |
| 850 |
<option value="[% g.id %]" selected>[% g.name %]</option> |
| 851 |
[% ELSE %] |
| 852 |
<option value="[% g.id %]">[% g.name %]</option> |
| 853 |
[% END %] |
| 854 |
<script type="text/javascript"> |
| 855 |
var g_sg = new Array(); |
| 856 |
[% FOR sg IN g.subgroups %] |
| 857 |
g_sg.push(["[% sg.id %]", "[% sg.name %]"]); |
| 858 |
[% IF sg.selected %] |
| 859 |
$(document).ready(function() { |
| 860 |
$("#subgroup").val("[% sg.id %]"); |
| 861 |
}); |
| 862 |
[% END %] |
| 863 |
[% END %] |
| 864 |
group_subgroups["[% g.id %]"] = g_sg; |
| 865 |
</script> |
| 866 |
[% END %] |
| 867 |
</select> |
| 868 |
<select name="subgroup" id="subgroup"></select> |
| 869 |
</li> |
| 870 |
<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" /> |
| 871 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
880 |
<div class="hint">[% INCLUDE 'date-format.inc' %]</div> |
| 872 |
|
881 |
|
|
Lines 902-904
$("#column_submit").submit(function() {
Link Here
|
| 902 |
//]]> |
911 |
//]]> |
| 903 |
</script> |
912 |
</script> |
| 904 |
[% 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 %] |