@@ -, +, @@ results - Run the report and confirm that a new "Batch operations" button appears at the top of the results. Test each option: - Batch record modification - Batch record deletion - Add to list - Batch item modification - Batch item deletion --- koha-tmpl/intranet-tmpl/prog/css/reports.css | 11 -- .../en/modules/reports/guided_reports_start.tt | 159 +++++++++++++++++---- 2 files changed, 134 insertions(+), 36 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/css/reports.css +++ a/koha-tmpl/intranet-tmpl/prog/css/reports.css @@ -36,17 +36,6 @@ del { font-family: monospace; } -.send_to_item_mod { - background-color: #EBF3FF; - border: 1px solid #88b0e8; - border-radius: 5px; - display: inline-block; - font-size: 75%; - margin: 3px 5px; - padding: 3px 5px; - white-space: nowrap; -} - .filter { background-color: #EBF3FF; border-radius: 5px; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -731,6 +731,104 @@ canned reports and writing custom SQL reports.

+[% IF ( execute ) %] + [% UNLESS ( errors ) %] +
+ + + [% # Preserve the whitespace of the following textarea in order to format the values correctly %] + +
+ +
+ + + [% # Preserve the whitespace of the following textarea in order to format the values correctly %] + +
+ +
+ + [% FOREACH result IN results %] + [% FOREACH cells IN result.cells %] + [% place = loop.index %] + [% IF header_row.$place.cell == 'itemnumber' %] + [% SET batch_itemnumbers = 1 %] + + [% END %] + [% END %] + [% END %] +
+ +
+ + + [% FOREACH result IN results %] + [% FOREACH cells IN result.cells %] + [% place = loop.index %] + [% IF header_row.$place.cell == 'itemnumber' %] + [% SET batch_itemnumbers = 1 %] + + [% END %] + [% END %] + [% END %] +
+ +
+ [% FOREACH result IN results %] + [% FOREACH cells IN result.cells %] + [% place = loop.index %] + [% IF header_row.$place.cell == 'biblionumber' %] + [% SET batch_biblionumbers = 1 %] + + [% END %] + [% END %] + [% END %] +
+ + [% IF ( batch_biblionumbers || batch_itemnumbers ) %] +

+

+

+ [% END %] + [% END # UNLESS ( errors ) %] +[% END # IF ( execute ) %] +
@@ -757,34 +855,20 @@ canned reports and writing custom SQL reports.

[% pagination_bar | $raw %]
[% UNLESS ( errors ) %] - - - +
+ + [% FOREACH header_ro IN header_row %] + + [% END %] + + [% FOREACH result IN results %] - [% FOREACH header_ro IN header_row %] - [% IF header_ro.cell == 'itemnumber' %] - - [% ELSE %] - - [% END %] + [% FOREACH cells IN result.cells %] + [% END %] - [% FOREACH result IN results %] - - [% FOREACH cells IN result.cells %] - [% place = loop.index %] - [% IF header_row.$place.cell == 'itemnumber' %] - - [% END %] - - [% END %] - - [% END %] -
[% header_ro.cell | html %]
- [% header_ro.cell | html %] - [% header_ro.cell | html %][% cells.cell | $raw %]
[% cells.cell | $raw %]
-
- + [% END %] + [% END %] [% INCLUDE 'chart.inc' %] @@ -1426,6 +1510,17 @@ canned reports and writing custom SQL reports.

$("#mana_result_content").html(""); $("#mana_search_field").val(""); }); + + $(".batch_op").on("click", function(e){ + e.preventDefault(); + var target_form = $(this).data("submit"); + $("#" + target_form ).submit(); + }); + + $("#batch_add_to_list").on("submit", function(e){ + e.preventDefault(); + addToList(); + }); }); function addColumn() { @@ -1502,6 +1597,20 @@ canned reports and writing custom SQL reports.

} }); } + + function addToList() { + var biblionumbers = []; + $(".bib_to_list").each(function() { + var biblionumber = Number( $(this).val() ); + if( biblionumbers.indexOf( biblionumber ) < 0 ){ + biblionumbers.push( biblionumber ); + } + }); + bibs = biblionumbers.join("/"); + var url = "/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumbers=" + bibs; + window.open(url, 'Add_to_virtualshelf', 'width=500, height=400, toolbar=false, scrollbars=yes'); + return false; + } [% END %] --