Bug 21526: Use the 'url' filter when needed
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / authorities-search-results.inc
index a009c7d..3832d3c 100644 (file)
@@ -1,32 +1,36 @@
+[% USE raw %]
 [% BLOCK showreference %]
-[%#
-    Parameters:
-    heading: the heading itself
-    linkType: currently 'seefrom' or 'seealso', controls the label for the entry
-    type:
-    authid: if it is a linked authority, its authid
-%]
+[%# Parameters: %]
+[%# heading: the heading itself %]
+[%# linkType: currently 'seefrom' or 'seealso', controls the label for the entry type: %]
+[%# authid: if it is a linked authority, its authid %]
+
     [% SET authidurl = '/cgi-bin/koha/authorities/detail.pl?authid=' %]
     [% SET searchurl = '/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&orderby=HeadingAsc&value=' %]
 
     [% IF marcflavour == 'UNIMARC' %]
+        [% IF authid %]
+            [% link = BLOCK %]<a href="[% authidurl _ authid | url %]">[% heading | html %]</a>[% END %]
+        [% ELSE %]
+            [% link = BLOCK %][% heading | html %][% END %]
+        [% END %]
         [% SWITCH type %]
         [% CASE 'broader' %]
-            <span class="BT">BT: [% heading | html %]</span>
+            <span class="BT"><abbr title="Broader Term">BT</abbr>: [% link | $raw %]</span>
         [% CASE 'narrower' %]
-            <span class="NT">NT: [% heading | html %]</span>
+            <span class="NT"><abbr title="Narrower Term">NT</abbr>: [% link | $raw %]</span>
         [% CASE 'seefrom' %]
-            <span class="UF">UF: [% heading | html %]</span>
+            <span class="UF"><abbr title="Used For">UF</abbr>: [% link | $raw %]</span>
         [% CASE 'seealso' %]
-            <span class="RT">RT: [% heading | html %]</span>
+            <span class="RT"><abbr title="Related Term">RT</abbr>: [% link | $raw %]</span>
         [% END %]
     [% ELSE %]
         <span class="heading">
         [% IF ( linkType=='seealso' ) %]
             [% IF ( authid ) %]
-            <a href="[% authidurl | url %][% authid | url %]">[% heading | html %]</a>
+            <a href="[% authidurl | url %][% authid | uri %]">[% heading | html %]</a>
             [% ELSE %]
-            <a href="[% searchurl | url %][% heading | html %]">[% heading | html %]</a>
+            <a href="[% searchurl | url %][% heading | uri %]">[% heading | html %]</a>
             [% END %]
         [% ELSE %]
             [% heading | html %]
@@ -53,7 +57,7 @@
     [% IF ( summary.label ) %][% summary.label | html %]:[% END %]
     [% IF summary.summary %]
       <div class="authority-summary">
-        [% summary.summary %]
+        [% summary.summary | html %]
       </div>
     [% END %]
     [% UNLESS ( summary.summaryonly ) %]
@@ -74,7 +78,7 @@
           [% IF summary.seefrom %]
             <div class="authres_seefrom">
             [% FOREACH see IN summary.seefrom %]
-              [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %]
+              [% PROCESS showreference heading=see.heading linkType="" type=see.type authid=see.authid %]
               [% IF ! loop.last %] ; [% END %]
             [% END %]
             </div>
@@ -82,7 +86,7 @@
             [% IF summary.seealso %]
               <div class="authres_seealso">
               [% FOREACH see IN summary.seealso %]
-                 [% PROCESS showreference heading=see.heading linkType="" type=see.type search='' %]
+                 [% PROCESS showreference heading=see.heading linkType="" type=see.type authid=see.authid %]
                  [% IF ! loop.last %] ; [% END %]
               [% END %]
               </div>
@@ -91,7 +95,7 @@
               <div class="authres_otherscript">
               [% FOREACH other IN summary.otherscript %]
                 [% PROCESS language lang=other.lang | trim %]:
-                [% other.term %]
+                [% other.term | html %]
                 [% IF ! loop.last %] ; [% END %]
               [% END %]
               </div>
                 <span class="seefrom">used for/see from:</span>
                 [% FOREACH seefro IN summary.seefrom %]
                     <div class="authref">
-                    [% PROCESS showreference
-                        heading=seefro.heading
-                        linkType='seefrom'
-                        type=seefro.type
-                        authid=seefro.authid
-                    %]
+                    [%# Following on one line for translatability %]
+                    [% PROCESS showreference heading=seefro.heading linkType='seefrom' type=seefro.type authid=seefro.authid %]
                     </div>
                 [% END %]
             </div>
                 <span class="seealso">see also:</span>
                 [% FOREACH seeals IN summary.seealso %]
                     <div class="authref">
-                    [% PROCESS showreference
-                        heading=seeals.heading
-                        linkType='seealso'
-                        type=seeals.type
-                        authid=seeals.authid
-                    %]
+                    [%# Following on one line for translatability %]
+                    [% PROCESS showreference heading=seeals.heading linkType='seealso' type=seeals.type authid=seeals.authid %]
                     </div>
                 [% END %]
             </div>
    [% CASE ['ara'] %]Arabic
    [% CASE ['gre'] %]Greek (modern)
    [% CASE ['grc'] %]Greek (to 1453)
-   [% CASE %][% lang %]
+   [% CASE %][% lang | html %]
   [% END %]
 [% END %]