From 3365b736f85a274187ddd903b1f9e2995f511063 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 22 May 2012 09:00:30 -0400 Subject: [PATCH] Bug 7441 - Followup - Control display of branch via system preference --- C4/XSLT.pm | 2 +- 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 | 66 ++++++++++++++------ 5 files changed, 63 insertions(+), 20 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 6ca2ea1..58197ec 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -187,7 +187,7 @@ sub XSLTParse4Display { OPACBaseURL TraceCompleteSubfields UseICU UseAuthoritiesForTracings TraceSubjectSubdivisions Display856uAsImage OPACDisplay856uAsImage - UseControlNumber + UseControlNumber ResultsBranchXSLT AlternateHoldingsField AlternateHoldingsSeparator / ) { my $sp = C4::Context->preference( $syspref ); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 1edf08e..523b3b5 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -363,3 +363,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer'); +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'); \ No newline at end of file diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 38aa70c..dab8010 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5246,6 +5246,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.09.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 (Adds permissions flag for access to the patron modifications tool)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index eb74d81..49388ba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -73,6 +73,13 @@ OPAC: no: "don't show" - icons for itemtype and authorized values. - + - 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 diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl index cd7790a..d301368 100644 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl @@ -9,7 +9,12 @@ - + + + + + + @@ -1014,14 +1019,26 @@ Copies available for loan: - - - [] - ( - - ) -. , - + + + + [] + ( + + ) + . , + + + + + + [] + ( + + ) + . , + + @@ -1036,16 +1053,27 @@ Copies available for reference: - - - - [] - ( - - ) - . , - + + + + + [] + ( + + ) + . , + + + + + + [] + ( + + ) + . , + + -- 1.7.2.5