From a56fea43cd819626121c05902d67fec5bf52d69b Mon Sep 17 00:00:00 2001 From: Victor Grousset Date: Tue, 16 Jan 2018 10:06:20 +0100 Subject: [PATCH] Bug 19972: Make holds to pull list honors item-level_itypes syspref And reflect that in the UI strings + variable names Test plan: 1. Set syspref "item-level_itypes" to "specific item" 2. Create a hold on a record with one item 3. Change the document type of the item 4. Check that the item edition page and the record page show 2 different types. 5. Go to /cgi-bin/koha/circ/pendingreserves.pl 6. Check that the displayed type is the item one 7. Set syspref "item-level_itypes" to "biblio record" 8. Go to /cgi-bin/koha/circ/pendingreserves.pl 9. See that the displayed type is the item one. When the sysopref says "record" This is the bug. 10. Apply this patch 11. Go to /cgi-bin/koha/circ/pendingreserves.pl 12. See that the displayed type now follows the syspref 13. Set syspref "item-level_itypes" to "specific item" 14. Go to /cgi-bin/koha/circ/pendingreserves.pl 15. See that the displayed type still follows the syspref Signed-off-by: Lucie Gay Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart (cherry picked from commit 4c9b26e437f70f9ad422586cc3a40812aa660aff) Signed-off-by: Fridolin Somers --- circ/pendingreserves.pl | 9 ++++++--- .../prog/en/modules/circ/pendingreserves.tt | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 15873201b1..6c9a0cfce8 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -89,6 +89,8 @@ if ($enddate_iso) { push @query_params, $enddate_iso; } +my $item_type = C4::Context->preference('item-level_itypes') ? "items.itype" : "biblioitems.itemtype"; + my $strsth = "SELECT min(reservedate) as l_reservedate, reserves.borrowernumber as borrowernumber, @@ -96,8 +98,8 @@ my $strsth = ORDER BY items.itemnumber SEPARATOR '|') l_holdingbranch, reserves.biblionumber, reserves.branchcode as l_branch, - GROUP_CONCAT(DISTINCT items.itype - ORDER BY items.itemnumber SEPARATOR '|') l_itype, + GROUP_CONCAT(DISTINCT $item_type + ORDER BY items.itemnumber SEPARATOR '|') l_item_type, GROUP_CONCAT(DISTINCT items.location ORDER BY items.itemnumber SEPARATOR '|') l_location, GROUP_CONCAT(DISTINCT items.itemcallnumber @@ -115,6 +117,7 @@ my $strsth = FROM reserves LEFT JOIN items ON items.biblionumber=reserves.biblionumber LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber + LEFT JOIN biblioitems ON biblio.biblionumber=biblioitems.biblionumber LEFT JOIN branchtransfers ON items.itemnumber=branchtransfers.itemnumber LEFT JOIN issues ON items.itemnumber=issues.itemnumber LEFT JOIN borrowers ON reserves.borrowernumber=borrowers.borrowernumber @@ -165,7 +168,7 @@ while ( my $data = $sth->fetchrow_hashref ) { count => $data->{icount}, rcount => $data->{rcount}, pullcount => $data->{icount} <= $data->{rcount} ? $data->{icount} : $data->{rcount}, - itypes => [split('\|', $data->{l_itype})], + itemTypes => [split('\|', $data->{l_item_type})], locations => [split('\|', $data->{l_location})], } ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt index 62cdc26ba9..0fec2b4051 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt @@ -56,7 +56,7 @@ $(document).ready(function() { holdst.fnFilter( filter_value, 5, true ); } ); } ); - $("#itypefilter").each( function () { + $("#type-filter").each( function () { $(this).html( createSelect( holdst.fnGetColumnData(9) ) ); $('select', this).change( function () { holdst.fnFilter( $(this).val(), 9 ); @@ -102,7 +102,7 @@ $(document).ready(function() { Available call numbers Available copy numbers Available enumeration - Available itypes + Available item types Available locations Earliest hold date @@ -137,8 +137,8 @@ $(document).ready(function() {

[% reserveloo.copyno %]

[% reserveloo.enumchron %]

- [% FOREACH itype IN reserveloo.itypes %] - [% ItemTypes.GetDescription( itype ) %] + [% FOREACH itemType IN reserveloo.itemTypes %] + [% ItemTypes.GetDescription( itemType ) %] [% END %] @@ -163,7 +163,7 @@ $(document).ready(function() { - + -- 2.39.5