From 6d87e39f6fbdbc1da1228fc98f5bbcf65f980618 Mon Sep 17 00:00:00 2001 From: Axel Amghar Date: Tue, 28 May 2019 10:20:35 +0200 Subject: [PATCH] Bug 22992: Ability to return to the list when you merge records of a list Test plan: Without the patch : - Create 2 records - Add them to the same list - Go to the list and merge these two patrons - In the nav bar you can't go back to the list Apply the patch - Now you should have a nav bar to return to the list like that :https://snag.gy/cnWxa2.jpg - Test every link of the nav bar, they should work - Make all the merge process, and test the links on the 3 pages --- cataloguing/merge.pl | 22 +++++++++++--- .../prog/en/modules/cataloguing/merge.tt | 35 +++++++++++++++++++++- .../prog/en/modules/virtualshelves/shelves.tt | 5 +++- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index 146e88e..1c27c6e 100755 --- a/cataloguing/merge.pl +++ b/cataloguing/merge.pl @@ -53,6 +53,15 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( #------------------------ # Merging #------------------------ + +my %shelf; +if ($input->param("shelfname")){ + %shelf = ( + private => $input->param("shelf_private"), + name => $input->param("shelfname"), + number => $input->param("shelfnumber") + ); +} if ($merge) { my $dbh = C4::Context->dbh; @@ -182,10 +191,11 @@ if ($merge) { # Parameters $template->param( - result => 1, - report_records => \@report_records, - report_header => $report_header, - ref_biblionumber => scalar $input->param('ref_biblionumber') + result => 1, + report_records => \@report_records, + report_header => $report_header, + ref_biblionumber => scalar $input->param('ref_biblionumber'), + shelf => \%shelf ); #------------------------- @@ -255,6 +265,10 @@ if ($merge) { my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); $template->param( frameworks => $frameworks ); } + $template->param( + biblionumbers => \@biblionumbers, + shelf => \%shelf + ); } if (@errors) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt index c21baca..3d99058 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt @@ -17,7 +17,26 @@ div#result { margin-top: 1em; } [% INCLUDE 'header.inc' %] [% INCLUDE 'cataloging-search.inc' %] - +
@@ -122,6 +141,13 @@ div#result { margin-top: 1em; } [% FOREACH record IN records %] [% END %] + + [% IF shelf %] + + + + [% END %] +
@@ -168,6 +194,13 @@ div#result { margin-top: 1em; } [% END %] +[% IF shelf %] + + + + +[% END %] +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index 023922a..d6f3030 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -646,7 +646,10 @@ $(checkboxes).each(function() { params.push('biblionumber=' + $(this).val()); }); - var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&'); + var url = '/cgi-bin/koha/cataloguing/merge.pl?' + params.join('&') + [% IF shelf %] + + '&shelf_private=[% shelf.is_private | html %]&shelfname=[% shelf.shelfname | html %]&shelfnumber=[% shelf.shelfnumber | html %]' + [% END %]; location.href = url; } return false; -- 2.7.4