Bug 29002: Tidy
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / z3950_auth_search.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% PROCESS 'i18n.inc' %]
4 [% USE Koha %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>[% FILTER collapse %]
8     [% IF ( opsearch ) %]
9         [% t("Z39.50 authority search points") | html %] &rsaquo;
10     [% ELSE %]
11         [% t("Z39.50 authority search results") | html %] &rsaquo;
12     [% END %]
13     [% t("Koha") | html %]
14 [% END %]</title>
15 [% INCLUDE 'doc-head-close.inc' %]
16 <style>
17     #marcPreview { width : 90%; top: 5%; } .modal-body { max-height: 380px; } .modal-header { padding: 0 14px; } @media (max-width: 767px) { #marcPreview { margin: 0; width : auto; } }
18 </style>
19
20 <body id="cat_z3950_auth_search" class="cat">
21     <div class="container-fluid">
22
23     [% IF ( opsearch ) %]
24         <h1>Z39.50 authority search points</h1>
25         <form method="post" action="z3950_auth_search.pl" name="f" class="checkboxed">
26         <input type="hidden" name="op" id="op" value="do_search" />
27         <input type="hidden" name="authid" value="[% authid | html %]" />
28         <input type="hidden" name="index" value="[% index | html %]" />
29             <div class="row">
30             <div class="col-xs-6">
31                 <fieldset class="rows">
32                 <ol>
33                     <li><label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="[% srchany | html %]" /></li>
34                     <li><label for="controlnumber">Control number: </label> <input type="text" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" /></li>
35                     <li><label for="nameany">Name (any): </label> <input type="text" id="nameany" name="nameany" value="[% nameany | html %]" /></li>
36                     <li><label for="authorany">Author (any): </label> <input type="text" id="authorany" name="authorany" value="[% authorany | html %]" /></li>
37                     <li><label for="authorpersonal">Author (personal): </label> <input type="text" id="authorpersonal" name="authorpersonal" value="[% authorpersonal | html %]" /></li>
38                     <li><label for="authorcorp">Author (corporate): </label> <input type="text" id="authorcorp" name="authorcorp" value="[% authorcorp | html %]" /></li>
39                     <li><label for="authormeetingcon">Author (meeting / conference): </label> <input type="text" id="authormeetingcon" name="authormeetingcon" value="[% authormeetingcon | html %]" /></li>
40                 </ol>
41                 </fieldset>
42             </div>
43             <div class="col-xs-6">
44                 <div class="row">
45                     <fieldset class="rows">
46                     <ol>
47                         <li><label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="[% subject | html %]" /></li>
48                         <li><label for="subjectsubdiv">Subject sub-division: </label> <input type="text" id="subjectsubdiv" name="subjectsubdiv" value="[% subjectsubdiv | html %]" /></li>
49                         <li><label for="title">Title (any): </label> <input type="text" id="title"  name="title" value="[% title | html %]" /></li>
50                         <li><label for="uniformtitle">Title (uniform): </label> <input type="text" id="uniformtitle"  name="uniformtitle" value="[% uniformtitle | html %]" /></li>
51                         <li><a id="resetZ3950Search" href="#"><i class="fa fa-trash-can"></i> Clear search form</a></li>
52                     </ol>
53                     </fieldset>
54                 </div>
55
56                 <div class="row">
57                     <h2>Search targets</h2>
58                     <div id="z3950_search_targets_auth">
59                         <span class="z3950checks"><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-times"></i> Clear all</a></span></span>
60                     [% FOREACH serverloo IN serverloop %]
61                         <p>
62                         [% IF ( serverloo.checked ) %]
63                             <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" checked="checked" />
64                         [% ELSE %]
65                             <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" />
66                         [% END %]
67                         <label for="z3950_[% serverloo.id | html %]">[% serverloo.servername | html %]</label>
68                         </p>
69                     [% END %]
70                     </div>
71                 </div>
72             </div>
73             </div>
74             <nav class="navbar navbar-default navbar-fixed-bottom">
75                 <div class="container-fluid">
76                      <fieldset class="action"><input type="submit" id="submit_z3950_search" class="btn btn-primary" value="Search" />
77                      <a class="btn btn-default close" href="#">Cancel</a></fieldset>
78                 </div>
79             </nav>
80         </form>
81 [% ELSE %]
82     <h1>Results for authority records</h1>
83     [% IF ( breeding_loop ) %]
84     <table id="resultst">
85 <thead>    <tr>
86         <th>Server</th>
87         <th>Heading</th>
88         <th>Authority type</th>
89         [% IF Koha.Preference('AdditionalFieldsInZ3950ResultAuthSearch') %]
90             <th>Additional fields</th>
91         [% END %]
92         <th class="noExport">Actions</th>
93     </tr></thead>
94     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
95         [% IF ( breeding_loo.breedingid ) %]
96         <tr id="row[% breeding_loo.breedingid | html %]">
97             <td>[% breeding_loo.server | html %]</td>
98             <td>[% breeding_loo.heading | html %]</td>
99             <td>[% breeding_loo.heading_code | html %]</td>
100             [% IF Koha.Preference('AdditionalFieldsInZ3950ResultAuthSearch') != '' %]
101                 <td>
102                    <dl>
103                       [% FOREACH addnumberfield IN breeding_loo.row.addnumberfields %]
104                         [% FOREACH string IN breeding_loo.row.$addnumberfield %]
105                             <dt>[% addnumberfield | html %]:</dt>
106                             <dd>[% string | html %]</dd>
107                         [% END %]
108                       [% END %]
109                    </dl>
110                 </td>
111             [% END %]
112             <td class="actions">
113                 <div class="btn-group dropup">
114                     <a class="btn btn-default btn-xs z3950actions" href="#">MARC</a><button class="btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
115                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="cataloguesearchactions[% breeding_loo.breedingid | html %]">
116                         <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid | uri %]" title="MARC" class="previewData" data-action="show_marc"><i class="fa-solid fa-eye"></i> MARC preview</a></li>
117                         <li><a href="/cgi-bin/koha/authorities/authorities.pl?breedingid=[% breeding_loo.breedingid | uri %]&authtypecode=[% breeding_loo.heading_code | uri %]&authid=[% breeding_loo.authid | uri %]&index=[% index | uri %]" class="chosen" title="Import" data-action="import"><i class="fa fa-download"></i> Import</a></li>
118                     </ul>
119                 </div>
120             </td>
121         </tr>
122         [% END %]
123     [% END %]</tbody>
124 </table>
125
126     <div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
127         <div class="modal-dialog">
128         <div class="modal-content">
129         <div class="modal-header">
130             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
131             <h3 id="dataPreviewLabel">MARC preview</h3>
132         </div>
133         <div class="modal-body">
134             <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
135         </div>
136         </div>
137         </div>
138     </div>
139
140     <form method="post" action="z3950_auth_search.pl" id="page_form" name="page_form" class="checkboxed">
141         <input type="hidden" name="op" id="op" value="do_search" />
142         <input type="hidden" name="current_page" id="current_page" value="[% current_page | html %]" />
143         <input type="hidden" id="nameany"  name="nameany" value="[% nameany | html %]" />
144         <input type="hidden" id="authorany"  name="authorany" value="[% authorany | html %]" />
145         <input type="hidden" id="authorcorp"  name="authorcorp" value="[% authorcorp | html %]" />
146         <input type="hidden" id="authorpersonal"  name="authorpersonal" value="[% authorpersonal | html %]" />
147         <input type="hidden" id="authormeetingcon"  name="authormeetingcon" value="[% authormeetingcon | html %]" />
148         <input type="hidden" id="title"  name="title" value="[% title | html %]" />
149         <input type="hidden" id="uniformtitle"  name="uniformtitle" value="[% uniformtitle | html %]" />
150         <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
151         <input type="hidden" id="subjectsubdiv" name="subjectsubdiv" value="[% subjectsubdiv | html %]" />
152         <input type="hidden" id="heading"  name="heading" value="[% heading | html %]" />
153         <input type="hidden" id="srchany" name="srchany" value="[% srchany | html %]" />
154         <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" />
155         <input type="hidden" name="authid" value="[% authid | html %]" />
156
157         [% FOREACH server IN servers %]
158         <input type="hidden" name="id" id="z3950_[% server.id | html %]" value="[% server.id | html %]" />
159         [% END %]
160
161         [% IF ( show_prevbutton ) %]
162             <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page | html %]" />
163         [% END %]
164         Page [% current_page | html %] / [% total_pages | html %]
165         [% IF ( show_nextbutton ) %]
166             <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page | html %]" />
167         [% END %]
168         <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page | html %]" size="4" type="text" /><input type="submit" name="changepage_goto" class="btn btn-primary" value="Go" />
169     </form>
170
171     <p>
172         <form method="get" action="/cgi-bin/koha/cataloguing/z3950_auth_search.pl">
173             <input type="hidden" id="nameany"  name="nameany" value="[% nameany | html %]" />
174             <input type="hidden" id="authorany"  name="authorany" value="[% authorany | html %]" />
175             <input type="hidden" id="authorcorp"  name="authorcorp" value="[% authorcorp | html %]" />
176             <input type="hidden" id="authorpersonal"  name="authorpersonal" value="[% authorpersonal | html %]" />
177             <input type="hidden" id="authormeetingcon"  name="authormeetingcon" value="[% authormeetingcon | html %]" />
178             <input type="hidden" id="title"  name="title" value="[% title | html %]" />
179             <input type="hidden" id="uniformtitle"  name="uniformtitle" value="[% uniformtitle | html %]" />
180             <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
181             <input type="hidden" id="subjectsubdiv" name="subjectsubdiv" value="[% subjectsubdiv | html %]" />
182             <input type="hidden" id="heading"  name="heading" value="[% heading | html %]" />
183             <input type="hidden" id="srchany" name="srchany" value="[% srchany | html %]" />
184             <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" />
185             <input type="hidden" name="authid" value="[% authid | html %]" />
186             <input type="submit" class="btn btn-primary" value="Try another search" />
187         </form>
188     </p>
189     [% ELSE %]
190         [% IF ( errconn ) %]
191             <div class="dialog alert">
192                 <ul>
193                 [% FOREACH errcon IN errconn %]
194                     [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server | html %]</li>
195                     [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server | html %]</li>[% END %]
196                 [% END %]
197                 </ul>
198             </div>
199          [% END %]
200    <div class="dialog message">Nothing found.</div>
201     <p>
202         <form method="get" action="/cgi-bin/koha/cataloguing/z3950_auth_search.pl">
203             <input type="hidden" id="nameany"  name="nameany" value="[% nameany | html %]" />
204             <input type="hidden" id="authorany"  name="authorany" value="[% authorany | html %]" />
205             <input type="hidden" id="authorcorp"  name="authorcorp" value="[% authorcorp | html %]" />
206             <input type="hidden" id="authorpersonal"  name="authorpersonal" value="[% authorpersonal | html %]" />
207             <input type="hidden" id="authormeetingcon"  name="authormeetingcon" value="[% authormeetingcon | html %]" />
208             <input type="hidden" id="title"  name="title" value="[% title | html %]" />
209             <input type="hidden" id="uniformtitle"  name="uniformtitle" value="[% uniformtitle | html %]" />
210             <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
211             <input type="hidden" id="subjectsubdiv" name="subjectsubdiv" value="[% subjectsubdiv | html %]" />
212             <input type="hidden" id="heading"  name="heading" value="[% heading | html %]" />
213             <input type="hidden" id="srchany" name="srchany" value="[% srchany | html %]" />
214             <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" />
215             <input type="hidden" name="authid" value="[% authid | html %]" />
216             <input type="submit" class="btn btn-primary" value="Try another search" />
217         </form>
218     </p>
219     [% END %]
220
221 [% END %]
222
223 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending | html %] servers to search</h3>[% END %]
224
225 [% MACRO jsinclude BLOCK %]
226     [% INCLUDE 'datatables.inc' %]
227     [% INCLUDE 'z3950_search.inc' %]
228     [% Asset.js("js/z3950_search.js") | $raw %]
229     <script>
230         $(document).ready(function(){
231             $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
232                 "sDom": 't',
233                 "aoColumnDefs": [
234                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
235                 ],
236                 "aaSorting": [[ 1, "asc" ]],
237                 "bPaginate": false
238             }));
239             InitLastAction();
240         });
241     </script>
242 [% END %]
243
244 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]