Bug 29002: Tidy
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / z3950_search.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE TablesSettings %]
5 [% PROCESS 'i18n.inc' %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% FILTER collapse %]
9     [% t("Z39.50/SRU search results") | html %] &rsaquo;
10     [% t("Koha") | html %]
11 [% END %]</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 <style>
14     #dataPreview {
15         width : 90%;
16         top: 5%;
17     }
18
19     #dataPreview pre {
20         overflow: unset;
21     }
22
23     .modal-body {
24         max-height: 380px;
25     }
26
27     .modal-header {
28         padding: 0 14px;
29     }
30
31     @media (max-width: 767px) {
32         #dataPreview {
33             margin: 0;
34             width : auto;
35         }
36     }
37 </style>
38 </head>
39
40 <body id="cat_z3950_search" class="cat">
41     <div class="container-fluid">
42         [% IF ( opsearch ) %]
43             <h1>Z39.50/SRU search</h1>
44             <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
45                 <div class="row">
46                     <div class="col-xs-6">
47                         <input type="hidden" name="op" id="op" value="do_search" />
48                         <fieldset class="rows">
49                             <ol>
50                                 <li>
51                                     <label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" class="focus" />
52                                 </li>
53                                 <li>
54                                     <label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn | html %]" />
55                                 </li>
56                                 <li>
57                                     <label for="title">Title: </label> <input type="text" id="title"  name="title" value="[% title | html %]" />
58                                 </li>
59                                 <li>
60                                     <label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author | html %]" />
61                                 </li>
62                                 <li>
63                                     <label for="publicationyear">Publication year: </label> <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear | html %]" />
64                                 </li>
65                                 <li>
66                                     <label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="[% subject | html %]" />
67                                 </li>
68                                 <li>
69                                     <label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="[% srchany | html %]" />
70                                 </li>
71                                 <li>
72                                     <label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="[% lccall | html %]" />
73                                 </li>
74                                 <li>
75                                     <label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" />
76                                 </li>
77                                 <li>
78                                     <label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="[% dewey | html %]" />
79                                 </li>
80                                 <li>
81                                     <label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="[% stdid | html %]" />
82                                 </li>
83                                 <li>
84                                     <a id="resetZ3950Search" href="#"><i class="fa fa-trash-can"></i> Clear search form</a>
85                                 </li>
86                             </ol>
87                             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
88                             <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
89                         </fieldset> <!-- /.rows -->
90                     </div> <!-- /.col-xs-6 -->
91
92                     <div class="col-xs-6">
93                         <h2>Search targets</h2>
94                         <div id="z3950_search_targets">
95                             <span class="z3950checks">
96                                 <span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> |
97                                 <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-times"></i> Clear all</a></span>
98                             </span>
99                             [% FOREACH serverloo IN serverloop %]
100                                 <p>
101                                     [% IF ( serverloo.checked ) %]
102                                         <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" checked="checked" />
103                                     [% ELSE %]
104                                         <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" />
105                                     [% END %]
106                                     <label for="z3950_[% serverloo.id | html %]">[% serverloo.servername | html %]</label>
107                                 </p>
108                             [% END %]
109                         </div> <!-- /#z3950_search_targets -->
110                     </div> <!-- /.col-xs-6 -->
111                 </div> <!-- /.row -->
112
113                 <nav class="navbar navbar-default navbar-fixed-bottom">
114                     <div class="container-fluid">
115                         <fieldset class="action">
116                             <input type="submit" id="submit_z3950_search" class="btn btn-primary" value="Search" />
117                             <a class="btn btn-default close" href="#">Cancel</a>
118                         </fieldset>
119                     </div>
120                 </nav>
121             </form> <!-- /.checkboxed -->
122
123         [% ELSE # IF opsearch %]
124
125             <div class="row">
126                 <div class="col-xs-12">
127                     <h1>Results</h1>
128                     <div class="page-section">
129                         <p>
130                             You searched for:
131                             [% IF ( title ) %]<em>Title: </em><span class="term">[% title | html %]</span> [% END %]
132                             [% IF ( author ) %]<em>Author: </em><span class="term">[% author | html %]</span> [% END %]
133                             [% IF ( publicationyear ) %]<em>Publication year: </em><span class="term">[% publicationyear | html %]</span> [% END %]
134                             [% IF ( isbn ) %]<em>ISBN: </em><span class="term">[% isbn | html %]</span> [% END %]
135                             [% IF ( issn ) %]<em>ISSN: </em><span class="term">[% issn | html %]</span> [% END %]
136                             [% IF ( lccall ) %]<em>LC call number: </em><span class="term">[% lccall | html %]</span> [% END %]
137                             [% IF ( subject ) %]<em>Subject heading: </em><span class="term">[% subject | html %]</span> [% END %]
138                             [% IF ( controlnumber ) %]<em>Control no: </em><span class="term">[% controlnumber | html %]</span> [% END %]
139                             [% IF ( dewey ) %]<em>Dewey: </em><span class="term">[% dewey | html %]</span> [%END %]
140                             [% IF ( srchany ) %]<em>Raw (any): </em><span class="term">[% srchany | html %]</span> [% END %]
141                             [% IF ( stdid ) %]<em>Standard ID: </em><span class="term">[% stdid | html %]</span> [% END %]
142                         </p>
143                         [% IF ( errconn ) %]
144                             <div class="dialog alert">
145                                 <ul>
146                                 [% FOREACH errcon IN errconn %]
147                                     [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server | html %]</li>
148                                     [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server | html %]</li>
149                                     [% ELSIF errcon.error.match( '^XSLTH' ) %]<li>[% errcon.server | html %] record [% errcon.seq | html %]: [% PROCESS 'xslt-handler.inc' code=errcon.error %]</li>
150                                     [% ELSE %]<li>[% errcon.server | html %] record [% errcon.seq | html %]: [% errcon.error | html %]</li>
151                                     [% END %]
152                                 [% END %]
153                                 </ul>
154                             </div>
155                         [% END %]
156
157                         [% IF ( breeding_loop ) %]
158                             <table id="resultst">
159                                 <thead>
160                                     <tr>
161                                         <th>Server</th>
162                                         <th>Title</th>
163                                         <th>Author</th>
164                                         <th>Year</th>
165                                         <th>Edition</th>
166                                         <th>ISBN</th>
167                                         <th>LCCN</th>
168                                         [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
169                                             <th>Additional fields</th>
170                                         [% END %]
171                                         <th class="noExport">Actions</th>
172                                     </tr>
173                                 </thead>
174                                 <tbody>
175                                     [% FOREACH breeding_loo IN breeding_loop %]
176                                         [% IF ( breeding_loo.breedingid ) %]
177                                             <tr id="row[% breeding_loo.breedingid | html %]">
178                                                 <td>[% breeding_loo.server | html %]</td>
179                                                 <td>[% breeding_loo.title | html %]</td>
180                                                 <td>[% breeding_loo.author | html %]</td>
181                                                 <td>[% breeding_loo.date | html %]</td>
182                                                 <td>[% breeding_loo.editionstatement | html %]</td>
183                                                 <td>[% breeding_loo.isbn | html %]</td>
184                                                 <td>[% breeding_loo.lccn | html %]</td>
185                                                 [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
186                                                     <td>
187                                                        <dl>
188                                                           [% FOREACH addnumberfield IN breeding_loo.addnumberfields %]
189                                                             [% FOREACH string IN breeding_loo.$addnumberfield %]
190                                                                 <dt>[% addnumberfield | html %]:</dt>
191                                                                 <dd>[% string | html %]</dd>
192                                                             [% END %]
193                                                           [% END %]
194                                                        </dl>
195                                                     </td>
196                                                 [% END %]
197                                                 <td class="actions">
198                                                     <div class="btn-group dropup">
199                                                         <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>
200                                                         <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="cataloguesearchactions[% breeding_loo.breedingid | html %]">
201                                                             <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>
202                                                             <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid | uri %]" title="Card" class="previewData" data-action="show_card"><i class="fa-solid fa-eye"></i> Card preview</a></li>
203                                                             <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% breeding_loo.biblionumber | uri %]&z3950=1&frameworkcode=[% frameworkcode | uri %]&breedingid=[% breeding_loo.breedingid | uri %]" class="chosen" title="Import" data-action="import"><i class="fa fa-download"></i> Import</a></li>
204                                                         </ul>
205                                                     </div>
206                                                 </td>
207                                             </tr>
208                                         [% END %]
209                                     [% END %]
210                                 </tbody>
211                             </table> <!-- /#resultst -->
212
213                             <div id="dataPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
214                                 <div class="modal-dialog">
215                                     <div class="modal-content">
216                                         <div class="modal-header">
217                                             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
218                                             <h3 id="dataPreviewLabel">Preview</h3>
219                                         </div>
220                                         <div class="modal-body">
221                                             <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
222                                         </div>
223                                     </div>
224                                 </div>
225                             </div>
226
227                             <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
228                                 <input type="hidden" name="op" id="op" value="do_search" />
229                                 <input type="hidden" name="current_page" id="current_page" value="[% current_page | html %]" />
230                                 <input type="hidden" id="title"  name="title" value="[% title | html %]" />
231                                 <input type="hidden" id="isbn" name="isbn" value="[% isbn | html %]" />
232                                 <input type="hidden" id="lccall" name="lccall" value="[% lccall | html %]" />
233                                 <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" />
234                                 <input type="hidden" id="srchany" name="srchany" value="[% srchany | html %]" />
235                                 <input type="hidden" id="author" name="author" value="[% author | html %]" />
236                                 <input type="hidden" id="publicationyear" name="publicationyear" value="[% publicationyear | html %]" />
237                                 <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
238                                 <input type="hidden" id="dewey" name="dewey" value="[% dewey | html %]" />
239                                 <input type="hidden" id="stdid" name="stdid" value="[% stdid | html %]" />
240                                 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
241                                 <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
242
243                                 [% FOREACH server IN servers %]
244                                     <input type="hidden" name="id" id="z3950_[% server.id | html %]" value="[% server.id | html %]" />
245                                 [% END %]
246
247                                 [% IF ( show_prevbutton ) %]
248                                     <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page | html %]" />
249                                 [% END %]
250                                 <span id="result_pagenumbers">Showing page [% current_page | html %] of [% total_pages | html %]</span>
251                                 [% IF ( show_nextbutton ) %]
252                                     <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page | html %]" />
253                                 [% END %]
254                                 <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" />
255                             </form> <!-- /#page_form -->
256
257                         [% ELSE %]
258                             <div class="dialog message">Nothing found.</div>
259                         [% END  # /IF breeding_loop %]
260                     </div> <!-- /.page-section -->
261
262                     <form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl">
263                         <p>
264                             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
265                             <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]"/>
266                             <input type="submit" class="btn btn-primary" value="Try another search" />
267                         </p>
268                     </form>
269                 </div> <!-- /.col-xs-12 -->
270             </div> <!-- /.row -->
271         [% END # /IF opsearch %]
272
273         [% IF ( numberpending ) %]
274             <h3 align="center">Still [% numberpending | html %] servers to search</h3>
275         [% END %]
276
277 [% MACRO jsinclude BLOCK %]
278     [% INCLUDE 'columns_settings.inc' %]
279     [% INCLUDE 'datatables.inc' %]
280     [% INCLUDE 'z3950_search.inc' %]
281     [% Asset.js("js/z3950_search.js") | $raw %]
282     <script>
283         $(document).ready(function(){
284             var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'z3950_search', 'resultst', 'json' ) | $raw %];
285             var thetable = KohaTable("resultst", {
286                 "aoColumnDefs": [
287                     { "aTargets": [ 1 ], "sType": "nsb-nse" },
288                 ],
289                 "bPaginate": false,
290                 "searching": false,
291                 "bInfo":false
292             }, table_settings );
293             InitLastAction();
294         });
295
296         function columnsInit(){
297             $(".dataTables_info").text( $("#result_pagenumbers").text() );
298             $("#result_pagenumbers").hide();
299         }
300     </script>
301 [% END %]
302
303 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]