[Koha-patches] [PATCH] change in yuipath management :

Henri-Damien LAURENT henridamien at koha-fr.org
Mon May 12 17:21:20 CEST 2008


now yuipath is added in C4::Output and uses themelang
In my opinion, all the general variables that are used in output should get in C4::Output (since there is theme lang computed.)
rather than in C4::Auth
---
 C4/Auth.pm                                         |    2 --
 C4/Output.pm                                       |    7 ++++---
 installer/data/mysql/en/mandatory/sysprefs.sql     |    2 +-
 .../1-Obligatoire/unimarc_standard_systemprefs.sql |    2 +-
 installer/data/mysql/updatedatabase.pl             |    6 ++++++
 kohaversion.pl                                     |    2 +-
 6 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/C4/Auth.pm b/C4/Auth.pm
index 279c471..0e97604 100755
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -250,7 +250,6 @@ sub get_template_and_user {
             IntranetmainUserblock   => C4::Context->preference("IntranetmainUserblock"),
             IndependantBranches     => C4::Context->preference("IndependantBranches"),
 			CircAutocompl => C4::Context->preference("CircAutocompl"),
-			yuipath => C4::Context->preference("yuipath"),
 			FRBRizeEditions => C4::Context->preference("FRBRizeEditions"),
 			AmazonSimilarItems => C4::Context->preference("AmazonSimilarItems"),
 			'item-level_itypes' => C4::Context->preference('item-level_itypes'),
@@ -315,7 +314,6 @@ sub get_template_and_user {
             OPACFRBRizeEditions => C4::Context->preference("OPACFRBRizeEditions"),
             'item-level_itypes' => C4::Context->preference('item-level_itypes'),
             'Version' => C4::Context->preference('Version'),
-			yuipath => C4::Context->preference("yuipath"),
             singleBranchMode => C4::Context->preference("singleBranchMode"),
             XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"),
             XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"),
diff --git a/C4/Output.pm b/C4/Output.pm
index 4ad79da..fc1a840 100644
--- a/C4/Output.pm
+++ b/C4/Output.pm
@@ -90,10 +90,11 @@ sub gettemplate {
         case_sensitive    => 1,
         path              => ["$htdocs/$theme/$lang/$path"]
     );
-
+    my $themelang=( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' )
+          . "/$theme/$lang";
     $template->param(
-        themelang => ( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' )
-          . "/$theme/$lang",
+        themelang => $themelang,
+        yuipath => (C4::Context->preference("yuipath") eq "local"?"$themelang/lib/yui":C4::Context->preference("yuipath")),
         interface => ( $interface ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' ),
         theme => $theme,
         opacstylesheet      => $opacstylesheet,
diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql
index ab7f551..1b62951 100644
--- a/installer/data/mysql/en/mandatory/sysprefs.sql
+++ b/installer/data/mysql/en/mandatory/sysprefs.sql
@@ -113,7 +113,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('QueryStemming',1,'If ON, enables query stemming',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('QueryFuzzy',1,'If ON, enables fuzzy option for searches',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('QueryWeightFields',1,'If ON, enables field weighting',NULL,'YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('yuipath','/intranet-tmpl/prog/en/lib/yui/','Insert the path to YUI libraries, /intranet-tmpl/prog/en/lib/yui if you use koha offline',"/intranet-tmpl/prog/en/lib/yui/|http://yui.yahooapis.com/2.5.1/build",'Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('yuipath','local','Insert the path to YUI libraries, choose local if you use koha offline',"local|http://yui.yahooapis.com/2.5.1/build",'Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('canreservefromotherbranches',1,'With Independent branches on, can a user from one library place a hold on an item from another library','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('FRBRizeEditions',0,'If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFRBRizeEditions',0,'If ON, the OPAC will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','','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 ee843b6..1e8ccb1 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
@@ -127,7 +127,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryStemming','1','Si activé, permetla suggestion orthographique',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryFuzzy','1','Si activé, permet la recherche ''floue''',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryWeightFields','1','Si activé, permet la pondération des champs',NULL,'YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('yuipath','/intranet-tmpl/prog/en/lib/yui/','Insérer le chemin pour les outils yahoo. Mettez /intranet-tmpl/prog/en/lib/yui si vous n''êtes pas connecté en permanence à l''internet',"/intranet-tmpl/prog/en/lib/yui/|http://yui.yahooapis.com/2.5.1/build",'Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('yuipath','local','Insérer le chemin pour les outils yahoo. Mettez local si vous n''êtes pas connecté en permanence à l''internet',"local|http://yui.yahooapis.com/2.5.1/build",'Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('canreservefromotherbranches','1','Si le paramètre IndependantBranches est activé, permet à un utilisateur de réserver un document sur un autre site ou non','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FRBRizeEditions',0,'Si activé, Koha va interroger un ou plusieurs webservices associés aux ISBN et afficher un onglet supplémentaire dans la page de détail d''une notice','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACFRBRizeEditions',0,'Si activé, l''OPAC Koha va interroger un ou plusieurs webservices associés aux ISBN et afficher un onglet supplémentaire dans la page de détail d''une notice','','YesNo');
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 55f203e..b3903a3 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -1553,6 +1553,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
 	print "Upgrade to $DBversion done (catch up on DB schema changes since alpha and beta)\n";
 	SetVersion ($DBversion);
 }
+$DBversion = "3.00.00.083";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do( qq(UPDATE systempreferences SET value='local' where variable='yuipath' and value like "%/intranet-tmpl/prog/%"));
+    print "Upgrade to $DBversion done (Changing yuipath behaviour in managing a local value)\n";
+    SetVersion ($DBversion);
+}
 
 =item DropAllForeignKeys($table)
 
diff --git a/kohaversion.pl b/kohaversion.pl
index 58f3915..8b3e02d 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = "3.00.00.082";
+    our $VERSION = "3.00.00.083";
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
-- 
1.5.4.3




More information about the Koha-patches mailing list