From 8525a441c52051a08ae4cd1867e227a92e76550e Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 27 Mar 2012 14:31:07 -0400 Subject: [PATCH] [SIGNED-OFF] Bug 7441 - search results showing wrong branch When you search in the OPAC it shows you the HOME branch on the location in XSLT, but if you click through to the detail page it shows you the HOLDING branch in the holdings table which is very confusing to patrons. Fixed by adding a system preference to choose whether to display the holding branch or the home branch on the XSLT OPAC search results page. Signed-off-by: Bernardo Gonzalez Kriegel Rebased on current master (2013-01-31). --- C4/XSLT.pm | 7 +- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 ++ .../prog/en/modules/admin/preferences/opac.pref | 7 ++ .../prog/en/xslt/MARC21slim2OPACResults.xsl | 86 +++++++++++++------- 5 files changed, 77 insertions(+), 31 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 19ec162..7fab3f8 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -188,7 +188,7 @@ sub XSLTParse4Display { UseAuthoritiesForTracings TraceSubjectSubdivisions Display856uAsImage OPACDisplay856uAsImage UseControlNumber IntranetBiblioDefaultView BiblioDefaultView - singleBranchMode + singleBranchMode OPACResultsBranchXSLT AlternateHoldingsField AlternateHoldingsSeparator / ) { my $sp = C4::Context->preference( $syspref ); @@ -272,8 +272,9 @@ sub buildKohaItemsNamespace { $status = "available"; } my $homebranch = $item->{homebranch}? xml_escape($branches->{$item->{homebranch}}->{'branchname'}):''; - my $itemcallnumber = xml_escape($item->{itemcallnumber}); - $xml.= "$homebranch". + my $holdingbranch = $item->{holdingbranch}? xml_escape($branches->{$item->{holdingbranch}}->{'branchname'}):''; + my $itemcallnumber = xml_escape($item->{itemcallnumber}); + $xml.= "$homebranch$holdingbranch". "$status". "".$itemcallnumber."" . ""; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 7e9f43d..b343fe7 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -408,3 +408,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free'); INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded