Bug 19786: Move template JavaScript to the footer: Authorities, part 2
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / searchresultlist-auth.tt
1 [% SET footerjs = 1 %]
2 [% PROCESS 'authorities-search-results.inc' %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Cataloging authority plugin</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 <style type="text/css">
7 #custom-doc { width:51.46em;*width:50.17em;min-width:675px; margin:auto; text-align:left; } 
8 </style>
9 </head>
10
11 <body id="auth_searchresultlist_auth" class="auth">
12 <div id="custom-doc" class="yui-t7">
13
14    <div id="bd">
15            <div id="yui-main">
16                    <div class="yui-b"><div class="yui-g">
17
18         <h1>Authority search results</h1>
19         [% INCLUDE 'auth-finder-search.inc' %]
20         [% IF ( total ) %]<div id="resultnumber">
21             [% IF ( displayprev ) %]
22                     <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 %]">
23                         &lt;&lt;
24                     </a>
25                 [% END %]
26                 [% FOREACH number IN numbers %]
27                     [% IF ( number.highlight ) %]
28                         [% number.number %]
29                     [% ELSE %]
30                         <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 %]">
31                             [% number.number %]</a>
32                     [% END %]
33                 [% END %]
34                 [% IF ( displaynext ) %]
35                     <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 %]">
36                         &gt;&gt;</a>
37                 [% END %]
38             <div>
39                 
40                     <p><b>Results [% from %] to [% to %] of [% total %]</b></p>
41                 [% ELSE %]
42                     
43                 
44             </div><p>No results found</p>[% END %]
45         </div>
46         [% IF ( result ) %]<div id="resultlist">
47             <table>
48                 <tr>
49                     <th>Summary</th>
50                     <th>Used</th>
51                     <th>Get it!</th>
52                     <th>Other action</th>
53                 </tr>
54                 [% FOREACH resul IN result %]
55                     <tr>
56                         <td>[% PROCESS authresult summary=resul.summary %]</td>
57                         <td>[% resul.used %] times</td>
58                         <td>
59                             [% IF resul.summary && resul.summary.authorized && resul.summary.authorized.size > 1 %]
60                                 [% FOREACH authorized IN resul.summary.authorized %]
61                                     <a href="javascript:doauth('[% resul.authid %]', '[% index %]', '[% loop.count %]')" title="[% authorized.heading | html %]">[% loop.count %]</a>
62                                 [% END %]
63                           [% ELSE %]
64                                 <a class="btn btn-xs btn-default" href="javascript:doauth('[% resul.authid %]', '[% index %]', '')"><i class="fa fa-plus"></i> Choose</a>
65                           [% END %]
66                         </td>
67                         <td><a class="btn btn-xs btn-default" href="authorities.pl?authid=[% resul.authid %]"><i class="fa fa-pencil"></i> Edit authority</a></td>
68                     </tr>
69                 [% END %]
70             </table>
71     
72         </div>
73         <div id="resultnumber">
74             [% IF ( displayprev ) %]
75                     <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 %]">
76                         &lt;&lt;
77                     </a>
78                 [% END %]
79                 [% FOREACH number IN numbers %]
80                     [% IF ( number.highlight ) %]
81                         [% number.number %]
82                     [% ELSE %]
83                         <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 %]">
84                             [% number.number %]</a>
85                     [% END %]
86                 [% END %]
87                 [% IF ( displaynext ) %]
88                     <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 %]">
89                         &gt;&gt;</a>
90                 [% END %]
91         </div>[% END %]
92 </div>
93 </div>
94 </div>
95 </div>
96 </div>
97
98 [% MACRO jsinclude BLOCK %]
99     <script type="text/javascript">
100         var index = "[% index %]";
101         var authtypecode = "[% authtypecode %]";
102     </script>
103     <script type="text/javascript" src="[% interface %]/[% theme %]/js/auth-finder-search.js"></script>
104     <script type="text/javascript">
105
106         function jumpfull(page){
107             window.open(page,'','width=100,height=100,resizable=yes,toolbar=false,scrollbars=yes,top');
108         }
109
110         function doauth(authid, index, repet){
111             [% IF source == 'auth' %]
112                 var e = document.getElementById("relationship");
113                 var relationship = e.options[e.selectedIndex].value;
114
115                 jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&relationship=' + relationship);
116             [% ELSE %]
117                 jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet);
118             [% END %]
119         }
120     </script>
121 [% END %]
122
123 [% INCLUDE 'intranet-bottom.inc' popup_window = 1 %]