Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / searchresultlist-auth.tt
index 415185a..0ba25ac 100644 (file)
@@ -1,60 +1,38 @@
+[% USE raw %]
+[% USE Asset %]
+[% SET footerjs = 1 %]
 [% PROCESS 'authorities-search-results.inc' %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Cataloging authority plugin</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<style type="text/css">
-#custom-doc { width:51.46em;*width:50.17em;min-width:675px; margin:auto; text-align:left; } 
-</style>
-<script type="text/javascript">
-
-function jumpfull(page)
-{      
-    window.open(page,'','fullscreen,scrollbars');
-}
-
-function doauth(authid, index, repet)
-{
-[% IF source == 'auth' %]
-    var e = document.getElementById("relationship");
-    var relationship = e.options[e.selectedIndex].value;
-
-    jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&relationship=' + relationship);
-[% ELSE %]
-    jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet);
-[% END %]
-}
-</script>
 </head>
-<body id="auth_searchresultlist_auth" class="auth">
-<div id="custom-doc" class="yui-t7">
 
-   <div id="bd">
-           <div id="yui-main">
-                  <div class="yui-b"><div class="yui-g">
+<body id="auth_searchresultlist_auth" class="auth">
+    <div class="container-fluid">
 
        <h1>Authority search results</h1>
        [% INCLUDE 'auth-finder-search.inc' %]
-       [% IF ( total ) %]<div id="resultnumber">
+        [% IF ( total ) %]<div class="resultnumber">
             [% IF ( displayprev ) %]
-                    <a href="auth_finder.pl?startfrom=[% startfromprev %]&amp;authtypecode=[% authtypecode %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term %]=[% searchdat.val %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index %]&amp;tagid=[% tagid %]&amp;orderby=[% orderby %]">
+                    <a href="auth_finder.pl?startfrom=[% startfromprev | html %]&amp;authtypecode=[% authtypecode | html %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term | html %]=[% searchdat.val | html %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index | html %]&amp;tagid=[% tagid | html %]&amp;orderby=[% orderby | html %]">
                         &lt;&lt;
                     </a>
                 [% END %]
                 [% FOREACH number IN numbers %]
                     [% IF ( number.highlight ) %]
-                        [% number.number %]
+                        [% number.number | html %]
                     [% ELSE %]
-                        <a href="auth_finder.pl?startfrom=[% number.startfrom %]&amp;authtypecode=[% authtypecode %][% FOREACH searchdat IN number.searchdata %]&amp;[% searchdat.term %]=[% searchdat.val %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index %]&amp;tagid=[% tagid %]&amp;orderby=[% orderby %]">
-                            [% number.number %]</a>
+                        <a href="auth_finder.pl?startfrom=[% number.startfrom | html %]&amp;authtypecode=[% authtypecode | html %][% FOREACH searchdat IN number.searchdata %]&amp;[% searchdat.term | html %]=[% searchdat.val | html %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index | html %]&amp;tagid=[% tagid | html %]&amp;orderby=[% orderby | html %]">
+                            [% number.number | html %]</a>
                     [% END %]
                 [% END %]
                 [% IF ( displaynext ) %]
-                    <a href="auth_finder.pl?startfrom=[% startfromnext %]&amp;authtypecode=[% authtypecode %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term %]=[% searchdat.val %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index %]&amp;tagid=[% tagid %]&amp;orderby=[% orderby %]">
+                    <a href="auth_finder.pl?startfrom=[% startfromnext | html %]&amp;authtypecode=[% authtypecode | html %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term | html %]=[% searchdat.val | html %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index | html %]&amp;tagid=[% tagid | html %]&amp;orderby=[% orderby | html %]">
                         &gt;&gt;</a>
                 [% END %]
             <div>
                 
-                    <p><b>Results [% from %] to [% to %] of [% total %]</b></p>
+                    <p><b>Results [% from | html %] to [% to | html %] of [% total | html %]</b></p>
                 [% ELSE %]
                     
                 
@@ -71,44 +49,66 @@ function doauth(authid, index, repet)
                 [% FOREACH resul IN result %]
                     <tr>
                         <td>[% PROCESS authresult summary=resul.summary %]</td>
-                        <td>[% resul.used %] times</td>
+                        <td>[% resul.used | html %] times</td>
                         <td>
-                          [% IF resul.repets %]
-                            [% FOREACH repet IN resul.repets %]
-                            <a href="javascript:doauth('[% resul.authid %]', '[% repet.index %]', '[% repet.repet %]')" title="[% repet.value %]">[% repet.repet %]</a>
-                            [% END %]
+                            [% IF resul.summary && resul.summary.authorized && resul.summary.authorized.size > 1 %]
+                                [% FOREACH authorized IN resul.summary.authorized %]
+                                    <a href="javascript:doauth('[% resul.authid | html %]', '[% index | html %]', '[% loop.count | html %]')" title="[% authorized.heading | html %]">[% loop.count | html %]</a>
+                                [% END %]
                           [% ELSE %]
-                            <a href="javascript:doauth('[% resul.authid %]', '[% index %]', '')">choose</a>
+                                <a class="btn btn-xs btn-default" href="javascript:doauth('[% resul.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a>
                           [% END %]
                         </td>
-                        <td><a href="authorities.pl?authid=[% resul.authid %]">Edit authority</a></td>
+                        <td><a class="btn btn-xs btn-default" href="authorities.pl?authid=[% resul.authid | html %]"><i class="fa fa-pencil"></i> Edit authority</a></td>
                     </tr>
                 [% END %]
             </table>
     
         </div>
-        <div id="resultnumber">
+        <div class="resultnumber">
             [% IF ( displayprev ) %]
-                    <a href="auth_finder.pl?startfrom=[% startfromprev %]&amp;authtypecode=[% authtypecode %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term %]=[% searchdat.val %][% END %]&amp;op=do_search&amp;type=intranetamp;&amp;index=[% index %]&amp;tagid=[% tagid %]&amp;orderby=[% orderby %]">
+                    <a href="auth_finder.pl?startfrom=[% startfromprev | html %]&amp;authtypecode=[% authtypecode | html %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term | html %]=[% searchdat.val | html %][% END %]&amp;op=do_search&amp;type=intranetamp;&amp;index=[% index | html %]&amp;tagid=[% tagid | html %]&amp;orderby=[% orderby | html %]">
                         &lt;&lt;
                     </a>
                 [% END %]
                 [% FOREACH number IN numbers %]
                     [% IF ( number.highlight ) %]
-                        [% number.number %]
+                        [% number.number | html %]
                     [% ELSE %]
-                        <a href="auth_finder.pl?startfrom=[% number.startfrom %]&amp;authtypecode=[% authtypecode %][% FOREACH searchdat IN number.searchdata %]&amp;[% searchdat.term %]=[% searchdat.val %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index %]&amp;tagid=[% tagid %]&amp;orderby=[% orderby %]">
-                            [% number.number %]</a>
+                        <a href="auth_finder.pl?startfrom=[% number.startfrom | html %]&amp;authtypecode=[% authtypecode | html %][% FOREACH searchdat IN number.searchdata %]&amp;[% searchdat.term | html %]=[% searchdat.val | html %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index | html %]&amp;tagid=[% tagid | html %]&amp;orderby=[% orderby | html %]">
+                            [% number.number | html %]</a>
                     [% END %]
                 [% END %]
                 [% IF ( displaynext ) %]
-                    <a href="auth_finder.pl?startfrom=[% startfromnext %]&amp;authtypecode=[% authtypecode %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term %]=[% searchdat.val %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index %]&amp;tagid=[% tagid %]&amp;orderby=[% orderby %]">
+                    <a href="auth_finder.pl?startfrom=[% startfromnext | html %]&amp;authtypecode=[% authtypecode | html %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term | html %]=[% searchdat.val | html %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index | html %]&amp;tagid=[% tagid | html %]&amp;orderby=[% orderby | html %]">
                         &gt;&gt;</a>
                 [% END %]
         </div>[% END %]
-</div>
-</div>
-</div>
-</div>
-</div>
-[% INCLUDE 'popup-bottom.inc' %]
+    </div>
+
+[% MACRO jsinclude BLOCK %]
+    <script type="text/javascript">
+        var index = "[% index | html %]";
+        var authtypecode = "[% authtypecode | html %]";
+    </script>
+    [% Asset.js("js/auth-finder-search.js") | $raw %]
+    <script type="text/javascript">
+
+        function jumpfull(page){
+            window.open(page,'','width=100,height=100,resizable=yes,toolbar=false,scrollbars=yes,top');
+        }
+
+        function doauth(authid, index, repet){
+            [% IF source == 'auth' %]
+                var e = document.getElementById("relationship");
+                var relationship = e.options[e.selectedIndex].value;
+
+                jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&relationship=' + relationship);
+            [% ELSE %]
+                jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet);
+            [% END %]
+        }
+    </script>
+[% END %]
+
+[% INCLUDE 'intranet-bottom.inc' popup_window = 1 %]