@@ -, +, @@ --- C4/XSLT.pm | 18 ++-- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 + .../prog/en/modules/admin/preferences/opac.pref | 7 ++ .../prog/en/xslt/MARC21slim2OPACResults.xsl | 103 ++++++++++++-------- 5 files changed, 88 insertions(+), 47 deletions(-) --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -190,7 +190,7 @@ sub XSLTParse4Display { UseControlNumber IntranetBiblioDefaultView BiblioDefaultView singleBranchMode OPACItemLocation DisplayIconsXSLT AlternateHoldingsField AlternateHoldingsSeparator - TrackClicks / ) + TrackClicks OPACResultsBranchXSLT / ) { my $sp = C4::Context->preference( $syspref ); next unless defined($sp); @@ -283,13 +283,15 @@ sub buildKohaItemsNamespace { $location = $item->{location}? xml_escape($shelflocations->{$item->{location}}||$item->{location}):''; $ccode = $item->{ccode}? xml_escape($ccodes->{$item->{ccode}}||$item->{ccode}):''; my $itemcallnumber = xml_escape($item->{itemcallnumber}); - $xml.= "$homebranch". - "$holdingbranch". - "$location". - "$ccode". - "$status". - "".$itemcallnumber."" - . ""; + $xml .= + "" + . "$homebranch" + . "$holdingbranch" + . "$location" + . "$ccode" + . "$status" + . "$itemcallnumber" + . ""; } $xml = "".$xml.""; --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -424,3 +424,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES(' INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo'); INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UniqueItemFields', 'barcode', 'Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table', '', 'Free'); +INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('OPACResultsBranchXSLT', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -6784,6 +6784,12 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.11.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('OPACResultsBranchXSLT', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice')"); + print "Upgrade to $DBversion done (Add syspref OPACResultsBranchXSLT)\n"; + SetVersion($DBversion); +} =head1 FUNCTIONS --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -83,6 +83,13 @@ OPAC: no: "Don't show" - the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC. - + - On search result pages displayed with XSLT stylesheets on the OPAC, show the item's + - pref: OPACResultsBranchXSLT + choices: + holdingbranch: "holding branch" + homebranch: "home branch" + - icons for itemtype and authorized values. + - - pref: COinSinOPACResults choices: yes: Include --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl +++ a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl @@ -9,7 +9,8 @@ - + + @@ -19,6 +20,7 @@ + @@ -1051,53 +1053,76 @@ - - - [] - ( - - ) - . , + + + [] + ( + + ) + . , + + + + + + + + [] + ( + + ) + . , - - - - - [] - ( - - ) - . , + + + + + [] + ( + + ) + . , - + + + - - - - Copies available for reference: - - - - [] - ( - - ) - . , - - - - + + + + Copies available for reference: + - - -
-
-
+ + + + + [] + ( + + ) + . , + + + + + + [] + ( + + ) + . , + + + +
+
+
--