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

Henri-Damien LAURENT henridamien at koha-fr.org
Mon May 12 11:15:11 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 +-
 4 files changed, 6 insertions(+), 7 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 64c7582..6e83945 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 bf5eb5b..54097af 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');
-- 
1.5.4.3




More information about the Koha-patches mailing list