Bug 11873: Upgrade jstree jQuery plugin to the latest version
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / authorities / searchresultlist-auth.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% PROCESS 'authorities-search-results.inc' %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Cataloging authority plugin &rsaquo; Koha</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% Asset.css("css/addbiblio.css") | $raw %]
9 </head>
10
11 <body id="auth_searchresultlist_auth" class="auth">
12     <div class="container-fluid">
13
14         <h1>Authority search results</h1>
15         [% INCLUDE 'auth-finder-search.inc' %]
16         [% IF ( total ) %]<div class="resultnumber">
17             [% IF ( displayprev ) %]
18                     <a href="auth_finder.pl?startfrom=[% startfromprev | uri %]&amp;authtypecode=[% authtypecode | uri %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term | uri %]=[% searchdat.val | uri %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index | uri %]&amp;tagid=[% tagid | uri %]&amp;orderby=[% orderby | uri %]&amp;source=[% source | uri %]">
19                         &lt;&lt;
20                     </a>
21                 [% END %]
22                 [% FOREACH number IN numbers %]
23                     [% IF ( number.highlight ) %]
24                         [% number.number | html %]
25                     [% ELSE %]
26                         <a href="auth_finder.pl?startfrom=[% number.startfrom | uri %]&amp;authtypecode=[% authtypecode | uri %][% FOREACH searchdat IN number.searchdata %]&amp;[% searchdat.term | uri %]=[% searchdat.val | uri %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index | uri %]&amp;tagid=[% tagid | uri %]&amp;orderby=[% orderby | uri %]&amp;source=[% source | uri %]">
27                             [% number.number | html %]</a>
28                     [% END %]
29                 [% END %]
30                 [% IF ( displaynext ) %]
31                     <a href="auth_finder.pl?startfrom=[% startfromnext | uri %]&amp;authtypecode=[% authtypecode | uri %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term | uri %]=[% searchdat.val | uri %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index | uri %]&amp;tagid=[% tagid | uri %]&amp;orderby=[% orderby | uri %]&amp;source=[% source | uri %]">
32                         &gt;&gt;</a>
33                 [% END %]
34             <div>
35                 
36                     <p><strong>Results [% from | html %] to [% to | html %] of [% total | html %]</strong></p>
37                 [% ELSE %]
38                     
39                 
40             </div><p>No results found</p>[% END %]
41         </div>
42         [% IF ( result ) %]<div id="resultlist">
43             <table>
44                 <tr>
45                     <th>Summary</th>
46                     <th>Heading type</th>
47                     <th>Used</th>
48                     <th>Get it!</th>
49                     <th>Other action</th>
50                 </tr>
51                 [% FOREACH resul IN result %]
52                     <tr>
53                         <td>[% PROCESS authresult summary=resul.summary authid=resul.authid %]</td>
54                         <td>[% resul.summary.label | html %]</td>
55                         <td>[% resul.used | html %] times</td>
56                         <td>
57                             [% IF resul.summary && resul.summary.authorized && resul.summary.authorized.size > 1 %]
58                                 [% FOREACH authorized IN resul.summary.authorized %]
59                                     <a href="javascript:doauth('[% resul.authid | uri %]', '[% index | uri %]', '[% loop.count | uri %]')" title="[% authorized.heading | html %]">[% loop.count | html %]</a>
60                                 [% END %]
61                           [% ELSE %]
62                                 <a class="btn btn-xs btn-default" href="javascript:doauth('[% resul.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a>
63                           [% END %]
64                         </td>
65                         <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>
66                     </tr>
67                 [% END %]
68             </table>
69     
70         </div>
71         <div class="resultnumber">
72             [% IF ( displayprev ) %]
73                     <a href="auth_finder.pl?startfrom=[% startfromprev | uri %]&amp;authtypecode=[% authtypecode | uri %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term | uri %]=[% searchdat.val | uri %][% END %]&amp;op=do_search&amp;type=intranetamp;&amp;index=[% index | uri %]&amp;tagid=[% tagid | uri %]&amp;orderby=[% orderby | uri %]&amp;source=[% source | uri %]">
74                         &lt;&lt;
75                     </a>
76                 [% END %]
77                 [% FOREACH number IN numbers %]
78                     [% IF ( number.highlight ) %]
79                         [% number.number | html %]
80                     [% ELSE %]
81                         <a href="auth_finder.pl?startfrom=[% number.startfrom | uri %]&amp;authtypecode=[% authtypecode | uri %][% FOREACH searchdat IN number.searchdata %]&amp;[% searchdat.term | uri %]=[% searchdat.val | uri %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index | uri %]&amp;tagid=[% tagid | uri %]&amp;orderby=[% orderby | uri %]&amp;source=[% source | uri %]">
82                             [% number.number | html %]</a>
83                     [% END %]
84                 [% END %]
85                 [% IF ( displaynext ) %]
86                     <a href="auth_finder.pl?startfrom=[% startfromnext | uri %]&amp;authtypecode=[% authtypecode | uri %][% FOREACH searchdat IN searchdata %]&amp;[% searchdat.term | uri %]=[% searchdat.val | uri %][% END %]&amp;op=do_search&amp;type=intranet&amp;index=[% index | uri %]&amp;tagid=[% tagid | uri %]&amp;orderby=[% orderby | uri %]&amp;source=[% source | uri %]">
87                         &gt;&gt;</a>
88                 [% END %]
89         </div>[% END %]
90     </div>
91
92 <!-- Authority details modal -->
93 <div class="modal" id="authorityDetail" tabindex="-1" role="dialog" aria-labelledby="authorityDetailLabel">
94     <div class="modal-dialog" role="document">
95         <div class="modal-content">
96             <div class="modal-header">
97                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
98                 <h4 class="modal-title" id="authorityDetailLabel"></h4>
99             </div>
100             <div class="modal-body">
101                 <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" />
102             </div>
103             <div class="modal-footer">
104                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
105             </div>
106         </div>
107     </div>
108 </div>
109
110 [% MACRO jsinclude BLOCK %]
111     <script>
112         var index = "[% index | html %]";
113         var authtypecode = "[% authtypecode | html %]";
114     </script>
115     [% Asset.js("js/auth-finder-search.js") | $raw %]
116     <script>
117         $(document).ready(function(){
118             $(".authorizedheading a").on("click", function(e){
119                 e.preventDefault();
120                 var authid = $(this).data("authid");
121
122                 $.get("/cgi-bin/koha/authorities/detail.pl", { authid : authid }, function( data ){
123                     var auth_detail = $(data).find("#authoritiestabs");
124                     auth_detail.find("ul").remove();
125                     $("#authorityDetail .modal-title").html(_("Authority") + " " + authid );
126                     $("#authorityDetail .modal-body").html( auth_detail );
127                 });
128
129                 $("#authorityDetail").modal("show");
130             });
131             $("#authorityDetail").on("hidden.bs.modal", function(){
132                 $("#authorityDetail .modal-body, #authorityDetail .modal-title").html("");
133                 $("#authorityDetail .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /></div>");
134             });
135         });
136         function jumpfull(page){
137             window.open(page,'','width=100,height=100,resizable=yes,toolbar=false,scrollbars=yes,top');
138         }
139
140         function doauth(authid, index, repet){
141             [% IF source == 'auth' %]
142                 var e = document.getElementById("relationship");
143                 var relationship = e.options[e.selectedIndex].value;
144
145                 jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&relationship=' + relationship);
146             [% ELSE %]
147                 jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet);
148             [% END %]
149         }
150     </script>
151 [% END %]
152
153 [% INCLUDE 'intranet-bottom.inc' popup_window = 1 %]