Bug 3920 - Add 2 syspref to activate XSLT use in OPAC/Intranet
authorFrédéric Demians <f.demians@tamil.fr>
Sat, 6 Feb 2010 18:17:06 +0000 (19:17 +0100)
committerGalen Charlton <gmcharlt@gmail.com>
Mon, 8 Feb 2010 13:08:44 +0000 (08:08 -0500)
- 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 <gmcharlt@gmail.com>
13 files changed:
C4/Auth.pm
installer/data/mysql/en/mandatory/sysprefs.sql
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref
koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl
koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl
kohaversion.pl
opac/opac-detail.pl

index 90ce2b8..e156474 100755 (executable)
@@ -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(),
     );
 
index dc52237..704fe5c 100644 (file)
@@ -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');
index ca0d072..1cd4a8b 100644 (file)
@@ -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');
index e1a59c0..bc7f3e1 100755 (executable)
@@ -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
index 8194f81..81844c0 100644 (file)
@@ -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.
index b963268..444eb7e 100644 (file)
@@ -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
index 66bf089..efdf89a 100644 (file)
           <xsl:otherwise> | </xsl:otherwise>
         </xsl:choose>      
       </xsl:for-each>
-    </strong>
+    </li>
   </xsl:if>
 
         <!-- 780 -->
index 5f591b1..d7fb2b0 100644 (file)
@@ -7,7 +7,7 @@
        }); 
 //]]>
 </script>
-<!-- TMPL_IF NAME="XSLTDetailsDisplay" --><script type="text/javascript">
+<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" --><script type="text/javascript">
     var GB_ROOT_DIR = "/opac-tmpl/prog/en/lib/greybox/";
 </script>
 <script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS.js"></script>
@@ -30,7 +30,7 @@
     <div id="catalogue_detail_biblio">
        
      <h1 style="float:left;margin:0 1em 1em 0;">ISBD View</h1> <div id="views">
-        <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Normal View</a></span> <!-- TMPL_IF NAME="XSLTDetailsDisplay" -->
+        <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Normal View</a></span> <!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
 <span class="view"><a id="MARCviewPop" href="/cgi-bin/koha/opac-showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">MARC View</a></span>
        <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Expanded MARC View</a></span>
 <!-- TMPL_ELSE -->
index 79bb431..68777ac 100644 (file)
@@ -1,6 +1,6 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo;  MARC Details for Record No. <!-- TMPL_VAR name="biblionumber" -->
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-<!-- TMPL_IF NAME="XSLTDetailsDisplay" --><script type="text/javascript">
+<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" --><script type="text/javascript">
     var GB_ROOT_DIR = "/opac-tmpl/prog/en/lib/greybox/";
 </script>
 <script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS.js"></script>
@@ -26,7 +26,7 @@
        <div id="views">
        <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Normal View</a></span> 
 
-<!-- TMPL_IF NAME="XSLTDetailsDisplay" -->
+<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
 <span class="view"><a id="MARCviewPop" href="/cgi-bin/koha/opac-showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">MARC View</a></span>
         <span class="view"><span id="MARCview">Expanded MARC View</span></span>
 <!-- TMPL_ELSE -->
index 2ae4318..f765f43 100644 (file)
@@ -47,7 +47,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 <style type="text/css">
     #addtagl { display: none; }
 </style>
-<!-- TMPL_IF NAME="XSLTDetailsDisplay" --><script type="text/javascript">
+<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" --><script type="text/javascript">
     var GB_ROOT_DIR = "/opac-tmpl/prog/en/lib/greybox/";                               
 </script>
 <script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS.js"></script>
@@ -82,7 +82,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <span class="Z3988" title="<!-- TMPL_VAR NAME="ocoins" -->"></span>
     <!-- /TMPL_IF -->
 
-    <!-- TMPL_IF NAME="XSLTDetailsDisplay" -->
+    <!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
         <!-- TMPL_VAR NAME="XSLTBloc" -->
     <!-- TMPL_ELSE -->
     <h1><!-- TMPL_VAR NAME="title" escape="html" --><!-- TMPL_IF NAME="subtitle" -->, <span class="subtitle"><!-- TMPL_LOOP NAME="subtitle" --><!-- TMPL_VAR NAME="subfield" --> <!-- /TMPL_LOOP --></span><!-- /TMPL_IF --></h1>
index 7455ff3..86bb4c5 100644 (file)
@@ -391,7 +391,7 @@ $(document).ready(function(){
                     <!-- COinS / OpenURL --><span class="Z3988" title="<!-- TMPL_VAR NAME="coins" -->"></span>
                 <!-- /TMPL_IF -->
 
-                               <!-- TMPL_IF NAME="XSLTResultsDisplay" -->
+                               <!-- TMPL_IF NAME="OPACXSLTResultsDisplay" -->
                 <!-- TMPL_VAR NAME="XSLTResultsRecord" -->
                                <!-- TMPL_ELSE -->
                                <!-- TMPL_IF name="BiblioDefaultViewmarc" --><a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->" title="View details for this title">
index 5cfd314..1748ebc 100644 (file)
@@ -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
index 47da84c..cf5cf1b 100755 (executable)
@@ -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' );
 }