From e0911b0c4c11e894bb7303c4afb8324942887af1 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 7 Jun 2016 23:55:25 -0300 Subject: [PATCH] Bug 15485: Introduce new sysprefs for lists XSLTs This patch introduces two new sysprefs, allowing the users to set custom XSLTs for lists display. This is done almost the usual way. If none is specified (value='') it defaults to the current behaviour: using the *Results.xsl file for the corresponding interface. Sponsored-by: Carnegie Stout Library Signed-off-by: Nick Clemens Signed-off-by: Deb Stephenson Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- .../atomicupdate/bug_15485_xslt_for_lists.sql | 21 +++++++++++++++++++ installer/data/mysql/sysprefs.sql | 2 ++ .../en/modules/admin/preferences/opac.pref | 5 +++++ .../admin/preferences/staff_client.pref | 5 +++++ 4 files changed, 33 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_15485_xslt_for_lists.sql diff --git a/installer/data/mysql/atomicupdate/bug_15485_xslt_for_lists.sql b/installer/data/mysql/atomicupdate/bug_15485_xslt_for_lists.sql new file mode 100644 index 0000000000..f81813cdb8 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_15485_xslt_for_lists.sql @@ -0,0 +1,21 @@ +INSERT IGNORE INTO systempreferences ( variable, value, options, explanation,type ) +VALUES ('OPACXSLTListsDisplay','','','Enable XSLT stylesheet control over lists pages display on OPAC','Free'); +INSERT IGNORE INTO systempreferences ( variable, value, options, explanation,type ) +VALUES ('XSLTListsDisplay','','','Enable XSLT stylesheet control over lists pages display on intranet','Free'); + +-- $DBversion = '16.06.00.XXX'; +-- if ( CheckVersion($DBversion) ) { +-- $dbh->do(q{ +-- INSERT IGNORE INTO systempreferences ( variable, value, options, explanation,type ) +-- VALUES ('OPACXSLTListsDisplay','','','Enable XSLT stylesheet control over lists pages display on OPAC','Free') +-- }); + +-- $dbh->do(q{ +-- INSERT IGNORE INTO systempreferences ( variable, value, options, explanation,type ) +-- VALUES ('XSLTListsDisplay','','','Enable XSLT stylesheet control over lists pages display on intranet','Free') + +-- }); + +-- print "Upgrade to $DBversion done (Bug 12528 - Enable staff to deny message setting access to patrons on the OPAC)\n"; +-- SetVersion($DBversion); +-- } diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index cd0f8bfbdb..494627f437 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -360,6 +360,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('opacuserlogin','1',NULL,'Enable or disable display of user login features','YesNo'), ('OPACViewOthersSuggestions','0',NULL,'If ON, allows all suggestions to be displayed in the OPAC','YesNo'), ('OPACXSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on OPAC','Free'), +('OPACXSLTListsDisplay','','','Enable XSLT stylesheet control over lists pages display on OPAC','Free'), ('OPACXSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on OPAC','Free'), ('OpenLibraryCovers','0',NULL,'If ON Openlibrary book covers will be show','YesNo'), ('OpenLibrarySearch','0',NULL,'If Yes Open Library search results will show in OPAC','YesNo'), @@ -534,6 +535,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('XISBN','0','','Use with FRBRizeEditions. If ON, Koha will use the OCLC xISBN web service in the Editions tab on the detail pages. See: http://www.worldcat.org/affiliate/webservices/xisbn/app.jsp','YesNo'), ('XISBNDailyLimit','999','','The xISBN Web service is free for non-commercial use when usage does not exceed 1000 requests per day','Integer'), ('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'), +('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'), ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), ('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') 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 e1c72f0eb9..87bd661b90 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 @@ -79,6 +79,11 @@ OPAC: yes: "Don't show" no: Show - lost items on search and detail pages. + - + - 'Display lists in the OPAC using XSLT stylesheet at: ' + - pref: OPACXSLTListsDisplay + class: file + - '
Options:
  • Leave empty for the default stylesheet (picked from OPACXSLTResultsDisplay).
  • put a path to define an xslt file.
  • put an URL for an external specific stylesheet.
{langcode} will be replaced with current interface language' - - 'Display OPAC results using XSLT stylesheet at: ' - pref: OPACXSLTResultsDisplay diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref index 7c0c59049c..e10ce5d59e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref @@ -55,6 +55,11 @@ Staff Client: - pref: IntranetFavicon class: url - for the Staff Client's favicon. (This should be a complete URL, starting with http://.) + - + - 'Display lists in the staff client using XSLT stylesheet at: ' + - pref: XSLTListsDisplay + class: file + - '
Options:
  • Leave empty for the default stylesheet (picked from XSLTResultsDisplay).
  • put a path to define an xslt file.
  • put an URL for an external specific stylesheet.
{langcode} will be replaced with current interface language' - - 'Display results in the staff client using XSLT stylesheet at: ' - pref: XSLTResultsDisplay -- 2.39.5