Bug 9618: Add support for intranetuserjs to labels/spinelabel-print.pl
authorOwen Leonard <oleonard@myacpl.org>
Mon, 18 Mar 2013 19:13:09 +0000 (15:13 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 16 Sep 2013 16:05:02 +0000 (16:05 +0000)
The template for printing a single spine label is a stripped-down
version of a standard Koha template, but it should include
intranetuserjs and IntranetUserCSS so that libraries can make local
customizations.

This patch updates the page's DOCTYPE to HTML5 and adds the missing
markup for including those preferences. Also added is jQuery, since
there's a good chance local customizations are using jQuery.

To test, make sure there is something in your intranetuserjs and
IntranetUserCSS system preferences. Visit
/cgi-bin/koha/labels/spinelabel-home.pl and submit a barcode. View
source on the spine label output page and confirm that your custom js
and css were included correctly.

Signed-off-by: Campbell Reid-Tait <campbellreidtait@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template only change, works nicely.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt

index ab51f9f..f028357 100644 (file)
@@ -1,10 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD Xhtml 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-[% IF ( bidi ) %]
-<html lang="[% lang %]" xml:lang="[% lang %]" dir="[% bidi %]" xmlns="http://www.w3.org/1999/xhtml">
-[% ELSE %]
-<html lang="[% lang %]" xml:lang="[% lang %]" xmlns="http://www.w3.org/1999/xhtml">
-[% END %]
+<!DOCTYPE html>
+[% IF ( bidi ) %]<html lang="[% lang %]" dir="[% bidi %]">[% ELSE %]<html lang="[% lang %]">[% END %]
 <head>
 <title>Koha &rsaquo; Tools &rsaquo; Spine labels</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                        .noprint { display: none; }
                }
        </style>
+[% IF ( IntranetUserCSS ) %]<style type="text/css">[% IntranetUserCSS %]</style>[% END %]
+<script type="text/javascript" src="[% interface %]/lib/jquery/jquery.js"></script>
+[% IF ( intranetuserjs ) %]
+    <script type="text/javascript">
+    //<![CDATA[
+    [% intranetuserjs %]
+    //]]>
+    </script>
+[% END %]
 </head>
        [% IF ( BarcodeNotFound ) %]
                <body id="labels_spinelabel-print" class="tools labels">