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