Bug 29965: Preview MARC in authority search results
[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 [% INCLUDE 'authority-detail-modal.inc' %]
93
94 [% MACRO jsinclude BLOCK %]
95     <script>
96         var index = "[% index | html %]";
97         var authtypecode = "[% authtypecode | html %]";
98     </script>
99     [% Asset.js("js/auth-finder-search.js") | $raw %]
100     <script>
101         $(document).ready(function(){
102             $(".authorizedheading a").on("click", function(e){
103                 e.preventDefault();
104                 var authid = $(this).data("authid");
105
106                 $.get("/cgi-bin/koha/authorities/detail.pl", { authid : authid }, function( data ){
107                     var auth_detail = $(data).find("#authoritiestabs");
108                     auth_detail.find("ul").remove();
109                     $("#authorityDetail .modal-title").html(_("Authority") + " " + authid );
110                     $("#authorityDetail .modal-body").html( auth_detail );
111                 });
112
113                 $("#authorityDetail").modal("show");
114             });
115             $("#authorityDetail").on("hidden.bs.modal", function(){
116                 $("#authorityDetail .modal-body, #authorityDetail .modal-title").html("");
117                 $("#authorityDetail .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /></div>");
118             });
119         });
120         function jumpfull(page){
121             window.open(page,'','width=100,height=100,resizable=yes,toolbar=false,scrollbars=yes,top');
122         }
123
124         function doauth(authid, index, repet){
125             [% IF source == 'auth' %]
126                 var e = document.getElementById("relationship");
127                 var relationship = e.options[e.selectedIndex].value;
128
129                 jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&relationship=' + relationship);
130             [% ELSE %]
131                 jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet);
132             [% END %]
133         }
134     </script>
135 [% END %]
136
137 [% INCLUDE 'intranet-bottom.inc' popup_window = 1 %]