Bug 12494 - Remove yuipath system preference
authorOwen Leonard <oleonard@myacpl.org>
Fri, 27 Jun 2014 13:11:21 +0000 (09:11 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 30 Oct 2014 01:06:57 +0000 (22:06 -0300)
With the OPAC prog template going away, the only remaining use of the
yuipath preference is on the basketgroups template. The yuipath
preference should be removed and the local path hard-coded.

This patch:
  - removes yuipath handling from C4/Templates.pm
  - removes the preference from sysprefs.sql
  - deletes the preference via updatedatabase.pl
  - removes the preference from the staff client preferences file
  - removes unused references to the YUI assets from the help file
    header include
  - adds the local YUI asset path to acqui/basketgroup.tt

To test, apply the patch and run the database update. View some online
help pages and confirm that they function correctly. View the
basketgroups page (Acquisition -> Vendor -> Basket groups), edit a
basket group, and confirm that basket drag and drop operations work
correctly.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Online help and basket group drag&drop functionality still work correctly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Templates.pm
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/includes/help-top.inc
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref

index 879249a..7d09a58 100644 (file)
@@ -100,10 +100,6 @@ sub output {
     }
     $vars->{lang} = $self->lang;
     $vars->{themelang} .= '/' . $self->preferredtheme . '/' . $self->lang;
-    $vars->{yuipath} =
-      ( C4::Context->preference("yuipath") eq "local"
-        ? ( $self->interface eq 'intranet' ? $vars->{themelang} . "/lib/yui" : "/opac-tmpl/lib/yui" )
-        : C4::Context->preference("yuipath") );
     $vars->{interface} =
       ( $self->{interface} ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' );
     $vars->{theme} = $self->theme;
@@ -216,6 +212,19 @@ sub gettemplate {
     $filename = $tmplbase if ( $is_plugin );
     my $template = C4::Templates->new($interface, $filename, $tmplbase, $query);
 
+# NOTE: Commenting these out rather than deleting them so that those who need
+# to know how we previously shimmed these directories will be able to understand.
+#    my $is_intranet = $interface eq 'intranet';
+#    my $themelang =
+#        ($is_intranet ? '/intranet-tmpl' : '/opac-tmpl') .
+#        "/$theme/$lang";
+#    $template->param(
+#        themelang => $themelang,
+#        interface => $is_intranet ? '/intranet-tmpl' : '/opac-tmpl',
+#        theme     => $theme,
+#        lang      => $lang
+#    );
+
     # Bidirectionality, must be sent even if is the only language
     my $current_lang = regex_lang_subtags($lang);
     my $bidi;
index b483584..efd12fd 100644 (file)
@@ -451,7 +451,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('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'),
 ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
-('yuipath','local','local|http://yui.yahooapis.com/2.5.1/build','Insert the path to YUI libraries, choose local if you use koha offline','Choice'),
 ('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')
 ;
index daca3d5..057943f 100755 (executable)
@@ -8935,6 +8935,13 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.17.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do("DELETE FROM systempreferences WHERE variable='yuipath'");
+    print "Upgrade to $DBversion done (Bug 12494: Remove yuipath system preference)\n";
+    SetVersion ($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)
index 5dcbe27..ef87e1e 100644 (file)
@@ -1,5 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Online Help</title>
+<title>Online help</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui.css" />
 <script type="text/javascript" src="[% interface %]/lib/jquery/jquery.js"></script>
 <script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui.js"></script>
 <script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script>
-<!-- yui js --> 
-<script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script> 
-<script type="text/javascript" src="[% yuipath %]/button/button-min.js"></script> 
-<script type="text/javascript" src="[% yuipath %]/container/container_core-min.js"></script> 
-<script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script> 
 <!-- koha core js -->
 <script type="text/javascript" src="[% themelang %]/js/staff-global.js"></script>
 
index 32cefa7..13b1dcd 100644 (file)
@@ -4,16 +4,16 @@
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'datatables.inc' %]
-<script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script>
-<script type="text/javascript" src="[% yuipath %]/button/button-min.js"></script>
-<script type="text/javascript" src="[% yuipath %]/container/container_core-min.js"></script>
-<script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/yui/utilities/utilities.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/yui/button/button-min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/yui/container/container_core-min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/yui/menu/menu-min.js"></script>
 <script type="text/javascript" src="[% themelang %]/js/basketgroup.js"></script>
 [% IF ( grouping ) %]
-<script type="text/javascript" src="[% yuipath %]/yahoo-dom-event/yahoo-dom-event.js"></script>
-<script type="text/javascript" src="[% yuipath %]/animation/animation-min.js"></script>
-<script type="text/javascript" src="[% yuipath %]/dragdrop/dragdrop-min.js"></script>
-<script type="text/javascript" src="[% yuipath %]/element/element-min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/yui/yahoo-dom-event/yahoo-dom-event.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/yui/animation/animation-min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/yui/dragdrop/dragdrop-min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/yui/element/element-min.js"></script>
 <style type="text/css">
 /*margin and padding on body element
   can introduce errors in determining
index 53cd72f..bbadc70 100644 (file)
@@ -71,12 +71,6 @@ Staff Client:
                   yes: Show
                   no: "Don't show"
             - the format, audience, and material type icons in XSLT MARC21 results and detail pages in the staff client.
-        -
-            - Use the Yahoo UI libraries
-            - pref: yuipath
-              choices:
-                  local: "included with Koha (faster, will work if internet goes down)."
-                  "http://yui.yahooapis.com/2.5.1/build": "from Yahoo's own servers (less demand on your servers)."
         -
             - pref: StaffAuthorisedValueImages
               choices: