Bug 10328 - Rename opaccolorstylesheet to OpacAdditionalStylesheet
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 23 Feb 2015 15:24:12 +0000 (16:24 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 31 Mar 2015 14:30:54 +0000 (11:30 -0300)
Test plan (from comment #1)
1) Apply this patch
2) Run updatedatabase.pl
3) Verify the system pref OpacColorStyleSheet still works
   i.e. no change should be noted

Additionally, I changed the path to an other stylesheet and verified that it worked.

Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described and no more occurences of opaccolorstylesheet were found.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Auth.pm
C4/Templates.pm
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc

index 345fd44..6bdab57 100644 (file)
@@ -459,7 +459,7 @@ sub get_template_and_user {
             $opac_base_url = $ENV{'SERVER_NAME'} . ( $ENV{'SERVER_PORT'} eq ( $using_https ? "443" : "80" ) ? '' : ":$ENV{'SERVER_PORT'}" );
         }
         $template->param(
-            opaccolorstylesheet                   => C4::Context->preference("opaccolorstylesheet"),
+            OpacAdditionalStylesheet                   => C4::Context->preference("OpacAdditionalStylesheet"),
             AnonSuggestions                       => "" . C4::Context->preference("AnonSuggestions"),
             AuthorisedValueImages                 => C4::Context->preference("AuthorisedValueImages"),
             BranchesLoop                          => GetBranchesLoop($opac_name),
@@ -1155,7 +1155,7 @@ sub checkauth {
     my $template = C4::Templates::gettemplate( $template_name, $type, $query );
     $template->param(
         branchloop                            => GetBranchesLoop(),
-        opaccolorstylesheet                   => C4::Context->preference("opaccolorstylesheet"),
+        OpacAdditionalStylesheet                   => C4::Context->preference("OpacAdditionalStylesheet"),
         opaclayoutstylesheet                  => C4::Context->preference("opaclayoutstylesheet"),
         login                                 => 1,
         INPUTS                                => \@inputs,
index 52a7229..3befb5d 100644 (file)
@@ -106,8 +106,8 @@ sub output {
     $vars->{interface} =
       ( $self->{interface} ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' );
     $vars->{theme} = $self->theme;
-    $vars->{opaccolorstylesheet} =
-        C4::Context->preference('opaccolorstylesheet');
+    $vars->{OpacAdditionalStylesheet} =
+        C4::Context->preference('OpacAdditionalStylesheet');
     $vars->{opaclayoutstylesheet} =
         C4::Context->preference('opaclayoutstylesheet');
 
index 77d7873..30b7ee5 100644 (file)
@@ -244,7 +244,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('OpacBrowser','0',NULL,'If ON, enables subject authorities browser on OPAC (needs to set misc/cronjob/sbuild_browser_and_cloud.pl)','YesNo'),
 ('OpacBrowseResults','1',NULL,'Disable/enable browsing and paging search results from the OPAC detail page.','YesNo'),
 ('OpacCloud','0',NULL,'If ON, enables subject cloud on OPAC','YesNo'),
-('opaccolorstylesheet','','','Define an auxiliary stylesheet for OPAC use, to override specified settings from the primary opac.css stylesheet. Enter the filename (if the file is in the server\'s css directory) or a complete URL beginning with http (if the file lives on a remote server).','free'),
+('OpacAdditionalStylesheet','','','Define an auxiliary stylesheet for OPAC use, to override specified settings from the primary opac.css stylesheet. Enter the filename (if the file is in the server\'s css directory) or a complete URL beginning with http (if the file lives on a remote server).','free'),
 ('OpacCustomSearch','','70|10','Replace the search box on the OPAC with the provided HTML','Textarea'),
 ('opaccredits','','70|10','Define HTML Credits at the bottom of the OPAC page','Textarea'),
 ('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'),
index 88e031f..a68d9d9 100755 (executable)
@@ -9944,6 +9944,16 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion = "3.19.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q|
+        UPDATE systempreferences set variable="OpacAdditionalStylesheet" WHERE variable="opaccolorstylesheet"
+    |);
+    print "Upgrade to $DBversion done (Bug 10328: Rename opaccolorstylesheet to OpacAdditionalStylesheet\n";
+    SetVersion ($DBversion);
+}
+
+
 # DEVELOPER PROCESS, search for anything to execute in the db_update directory
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.
index 69ba743..c26d048 100644 (file)
@@ -187,7 +187,7 @@ OPAC:
               class: code
         -
             - Include the additional CSS stylesheet
-            - pref: opaccolorstylesheet
+            - pref: OpacAdditionalStylesheet
               class: file
             - to override specified settings from the default stylesheet (leave blank to disable). Enter just a filename, a full local path or a complete URL starting with <code>http://</code> (if the file lives on a remote server). Please note that if you just enter a filename, the file should be in the css subdirectory for each active theme and language within the Koha templates directory. A full local path is expected to start from your HTTP document root.
         -
index c3e2d83..a063346 100644 (file)
 [% ELSE %]
     <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/[% opaclayoutstylesheet %]" />
 [% END %]
-[% IF ( opaccolorstylesheet ) %]
-    [% IF (opaccolorstylesheet.match('^https?:|^\/')) %]
-        <link rel="stylesheet" type="text/css" href="[% opaccolorstylesheet %]" />
+[% IF ( OpacAdditionalStylesheet ) %]
+    [% IF (OpacAdditionalStylesheet.match('^https?:|^\/')) %]
+        <link rel="stylesheet" type="text/css" href="[% OpacAdditionalStylesheet %]" />
     [% ELSE %]
-        <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/[% opaccolorstylesheet %]" />
+        <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/[% OpacAdditionalStylesheet %]" />
     [% END %]
 [% END %]
 [% IF ( opac_css_override ) %]