From ff4d456072fecb4045928015d57c1594b911ef96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Sat, 6 Feb 2010 19:17:06 +0100 Subject: [PATCH] Bug 3920 - Add 2 syspref to activate XSLT use in OPAC/Intranet - Add two syspref: - OPACXSLTResultsDisplay - OPACXSLDetailsDispay - Add them to .pref files and dispatch them beetween OPAC and Search tab. - Upgrade DB version to 3.2 .113 - Fix something wrong in UNIMARCslim2intranetDetail.xsl - Display OPAC result and detail pages using those syspref. Signed-off-by: Galen Charlton --- C4/Auth.pm | 4 ++-- installer/data/mysql/en/mandatory/sysprefs.sql | 6 ++++-- .../unimarc_standard_systemprefs.sql | 6 ++++-- installer/data/mysql/updatedatabase.pl | 15 +++++++++++++++ .../prog/en/modules/admin/preferences/opac.pref | 10 ++++++++-- .../en/modules/admin/preferences/searching.pref | 10 ++++++++-- .../prog/en/xslt/UNIMARCslim2intranetDetail.xsl | 2 +- .../prog/en/modules/opac-ISBDdetail.tmpl | 4 ++-- .../prog/en/modules/opac-MARCdetail.tmpl | 4 ++-- .../opac-tmpl/prog/en/modules/opac-detail.tmpl | 4 ++-- .../opac-tmpl/prog/en/modules/opac-results.tmpl | 2 +- kohaversion.pl | 2 +- opac/opac-detail.pl | 2 +- 13 files changed, 51 insertions(+), 20 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 90ce2b83ef..e156474ba8 100755 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -350,8 +350,8 @@ sub get_template_and_user { 'item-level_itypes' => C4::Context->preference('item-level_itypes'), patronimages => C4::Context->preference("patronimages"), singleBranchMode => C4::Context->preference("singleBranchMode"), - XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"), - XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"), + OPACXSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"), + OPACXSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"), BranchesLoop => GetBranchesLoop(), ); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index dc52237e79..704fe5cfd0 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -212,8 +212,10 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OPACShelfBrowser','1','','Enable/disable Shelf Browser on item details page. WARNING: this feature is very resource consuming on collections with large numbers of items.','YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES -('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC WARNING: MARC21 Only','YesNo'), -('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on OPAC WARNING: MARC21 Only','YesNo'); +('OPACXSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on OPAC','YesNo'), +('OPACXSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on OPAC','YesNo'); +('XSLTDetailsDisplay','0','','Enable XSL stylesheet control over details page display on intranet','YesNo'), +('XSLTResultsDisplay','0','','Enable XSL stylesheet control over results page display on intranet','YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index ca0d0724c9..1cd4a8b8f5 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -214,8 +214,10 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('TagsShowOnList', '6','','Nombre de tags à afficher sur la page de résultat, 0 désactivant l\'affichage.','Integer'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OPACShelfBrowser','1','','Active le parcours des rayonnages sur la page de détail','YesNo'); -INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTDetailsDisplay','0','','Activer la feuille XSL pour l''affichage des notices détaillées','YesNo'); -INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTResultsDisplay','0','','Activer la feuille XSL pour l''affichage des listes de résultat','YesNo'); +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OPACXSLTDetailsDisplay','0','','Activer la feuille XSL pour l''affichage à l''OPAC des notices détaillées','YesNo'); +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OPACXSLTResultsDisplay','0','','Activer la feuille XSL pour l''affichage à l''OPAC des listes de résultat','YesNo'); +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTDetailsDisplay','0','','Activer la feuille XSL pour l''affichage des notices détaillées dans la partie pro','YesNo'); +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('XSLTResultsDisplay','0','','Activer la feuille XSL pour l''affichage des listes de résultat dans la partie pro','YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Définit quel champ est utilisé pour la limitation par type de document dans la recherche avancée','Choice'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Autorise les réservations de documents en rayon.', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Autorise les réservations de documents déclarés endommagés', 'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e1a59c0c3a..bc7f3e1ee8 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3398,6 +3398,21 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.01.00.113'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + my $value = C4::Context->preference("XSLTResultsDisplay"); + $dbh->do( + "INSERT INTO systempreferences (variable,value,type) + VALUES('OPACXSLTResultsDisplay',$value,'YesNo')"); + $value = C4::Context->preference("XSLTDetailsDisplay"); + $dbh->do( + "INSERT INTO systempreferences (variable,value,type) + VALUES('OPACXSLTDetailsDisplay',$value,'YesNo')"); + print "Upgrade done (added two new syspref: OPACXSLTResultsDisplay and OPACXSLTDetailDisplay). You may have to go in Admin > System preference to tweak XSLT related syspref both in OPAC and Search tabs.\n "; + SetVersion ($DBversion); +} + + =item DropAllForeignKeys($table) Drop all foreign keys of the table $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 8194f815fa..81844c0adb 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 @@ -54,9 +54,15 @@ OPAC: yes: Show no: "Don't show" - lost items on search and detail pages. + - + - Show biblio records on OPAC result page + - pref: OPACXSLTResultsDisplay + choices: + yes: using XSLT stylesheets. + no: normally. - - Show item details pages on the OPAC - - pref: XSLTDetailsDisplay + - pref: OPACXSLTDetailsDisplay choices: yes: using XSLT stylesheets. no: normally. @@ -296,4 +302,4 @@ OPAC: choices: yes: Allow no: "Don't allow" - - patrons to opt-in/opt-out of saving their reading/circulation history. \ No newline at end of file + - patrons to opt-in/opt-out of saving their reading/circulation history. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index b963268e98..444eb7e0b1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -73,12 +73,18 @@ Searching: no: "don't show" - '"More options" on the OPAC and staff advanced search pages.' Results Display: - - - - Show search results + - + - Show biblio records on result page - pref: XSLTResultsDisplay choices: yes: using XSLT stylesheets. no: normally. + - + - Show item details pages on the OPAC + - pref: XSLTDetailsDisplay + choices: + yes: using XSLT stylesheets. + no: normally. - - By default, sort search results in the staff client by - pref: defaultSortField diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl index 66bf089c9d..efdf89adac 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl @@ -386,7 +386,7 @@ | - + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl index 5f591b191b..d7fb2b095a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl @@ -7,7 +7,7 @@ }); //]]> - @@ -30,7 +30,7 @@

ISBD View

- ">Normal View + ">Normal View " title="MARC" rel="gb_page_center[600,500]">MARC View ">Expanded MARC View diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl index 79bb431ae2..68777ac1c9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl @@ -1,6 +1,6 @@ Koha Online Catalog › MARC Details for Record No. - @@ -26,7 +26,7 @@
">Normal View - + " title="MARC" rel="gb_page_center[600,500]">MARC View Expanded MARC View diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl index 2ae4318de3..f765f43b4d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -47,7 +47,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { - @@ -82,7 +82,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { "> - +

,

diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl index 7455ff3c03..86bb4c53cf 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl @@ -391,7 +391,7 @@ $(document).ready(function(){ "> - + " title="View details for this title"> diff --git a/kohaversion.pl b/kohaversion.pl index 5cfd314874..1748ebc14c 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.01.00.112'; + our $VERSION = '3.01.00.113'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 47da84c9a3..cf5cf1bab7 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -72,7 +72,7 @@ if ( ! $record ) { } $template->param( biblionumber => $biblionumber ); # XSLT processing of some stuff -if (C4::Context->preference("XSLTDetailsDisplay") ) { +if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { $template->param( 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, 'Detail'),'opac' ); } -- 2.39.5