Bug 32072: Consistent classes for primary buttons: Cataloging
[srvgit] / 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"></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-remove"></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"><input type="submit" class="btn btn-primary" value="Search" /> <a class="cancel close" href="#">Cancel</a></fieldset>
112                     </div>
113                 </nav>
114             </form> <!-- /.checkboxed -->
115
116         [% ELSE # IF opsearch %]
117
118             <div class="row">
119                 <div class="col-xs-12">
120                     <h1>Results</h1>
121                     <p>
122                         You searched for:
123                         [% IF ( title ) %]<em>Title: </em><span class="term">[% title | html %]</span> [% END %]
124                         [% IF ( author ) %]<em>Author: </em><span class="term">[% author | html %]</span> [% END %]
125                         [% IF ( publicationyear ) %]<em>Publication year: </em><span class="term">[% publicationyear | html %]</span> [% END %]
126                         [% IF ( isbn ) %]<em>ISBN: </em><span class="term">[% isbn | html %]</span> [% END %]
127                         [% IF ( issn ) %]<em>ISSN: </em><span class="term">[% issn | html %]</span> [% END %]
128                         [% IF ( lccall ) %]<em>LC call number: </em><span class="term">[% lccall | html %]</span> [% END %]
129                         [% IF ( subject ) %]<em>Subject heading: </em><span class="term">[% subject | html %]</span> [% END %]
130                         [% IF ( controlnumber ) %]<em>Control no: </em><span class="term">[% controlnumber | html %]</span> [% END %]
131                         [% IF ( dewey ) %]<em>Dewey: </em><span class="term">[% dewey | html %]</span> [%END %]
132                         [% IF ( srchany ) %]<em>Raw (any): </em><span class="term">[% srchany | html %]</span> [% END %]
133                         [% IF ( stdid ) %]<em>Standard ID: </em><span class="term">[% stdid | html %]</span> [% END %]
134                     </p>
135                     [% IF ( errconn ) %]
136                         <div class="dialog alert">
137                             <ul>
138                             [% FOREACH errcon IN errconn %]
139                                 [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server | html %]</li>
140                                 [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server | html %]</li>
141                                 [% ELSIF errcon.error.match( '^XSLTH' ) %]<li>[% errcon.server | html %] record [% errcon.seq | html %]: [% PROCESS 'xslt-handler.inc' code=errcon.error %]</li>
142                                 [% ELSE %]<li>[% errcon.server | html %] record [% errcon.seq | html %]: [% errcon.error | html %]</li>
143                                 [% END %]
144                             [% END %]
145                             </ul>
146                         </div>
147                     [% END %]
148
149                     [% IF ( breeding_loop ) %]
150                         <table id="resultst">
151                             <thead>
152                                 <tr>
153                                     <th>Server</th>
154                                     <th>Title</th>
155                                     <th>Author</th>
156                                     <th>Year</th>
157                                     <th>Edition</th>
158                                     <th>ISBN</th>
159                                     <th>LCCN</th>
160                                     [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
161                                         <th>Additional fields</th>
162                                     [% END %]
163                                     <th class="noExport">Actions</th>
164                                 </tr>
165                             </thead>
166                             <tbody>
167                                 [% FOREACH breeding_loo IN breeding_loop %]
168                                     [% IF ( breeding_loo.breedingid ) %]
169                                         <tr id="row[% breeding_loo.breedingid | html %]">
170                                             <td>[% breeding_loo.server | html %]</td>
171                                             <td>[% breeding_loo.title | html %]</td>
172                                             <td>[% breeding_loo.author | html %]</td>
173                                             <td>[% breeding_loo.date | html %]</td>
174                                             <td>[% breeding_loo.edition | html %]</td>
175                                             <td>[% breeding_loo.isbn | html %]</td>
176                                             <td>[% breeding_loo.lccn | html %]</td>
177                                             [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
178                                                 <td>
179                                                    <dl>
180                                                       [% FOREACH addnumberfield IN breeding_loo.addnumberfields %]
181                                                         [% FOREACH string IN breeding_loo.$addnumberfield %]
182                                                             <dt>[% addnumberfield | html %]:</dt>
183                                                             <dd>[% string | html %]</dd>
184                                                         [% END %]
185                                                       [% END %]
186                                                    </dl>
187                                                 </td>
188                                             [% END %]
189                                             <td class="actions">
190                                                 <div class="btn-group dropup">
191                                                     <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>
192                                                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="cataloguesearchactions[% breeding_loo.breedingid | html %]">
193                                                         <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 fa-eye"></i> MARC preview</a></li>
194                                                         <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 fa-eye"></i> Card preview</a></li>
195                                                         <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>
196                                                     </ul>
197                                                 </div>
198                                             </td>
199                                         </tr>
200                                     [% END %]
201                                 [% END %]
202                             </tbody>
203                         </table> <!-- /#resultst -->
204
205                         <div id="dataPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
206                             <div class="modal-dialog">
207                                 <div class="modal-content">
208                                     <div class="modal-header">
209                                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
210                                         <h3 id="dataPreviewLabel">Preview</h3>
211                                     </div>
212                                     <div class="modal-body">
213                                         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
214                                     </div>
215                                 </div>
216                             </div>
217                         </div>
218
219                         <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
220                             <input type="hidden" name="op" id="op" value="do_search" />
221                             <input type="hidden" name="current_page" id="current_page" value="[% current_page | html %]" />
222                             <input type="hidden" id="title"  name="title" value="[% title | html %]" />
223                             <input type="hidden" id="isbn" name="isbn" value="[% isbn | html %]" />
224                             <input type="hidden" id="lccall" name="lccall" value="[% lccall | html %]" />
225                             <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" />
226                             <input type="hidden" id="srchany" name="srchany" value="[% srchany | html %]" />
227                             <input type="hidden" id="author" name="author" value="[% author | html %]" />
228                             <input type="hidden" id="publicationyear" name="publicationyear" value="[% publicationyear | html %]" />
229                             <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
230                             <input type="hidden" id="dewey" name="dewey" value="[% dewey | html %]" />
231                             <input type="hidden" id="stdid" name="stdid" value="[% stdid | html %]" />
232                             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
233                             <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
234
235                             [% FOREACH server IN servers %]
236                                 <input type="hidden" name="id" id="z3950_[% server.id | html %]" value="[% server.id | html %]" />
237                             [% END %]
238
239                             [% IF ( show_prevbutton ) %]
240                                 <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page | html %]" />
241                             [% END %]
242                             <span id="result_pagenumbers">Showing page [% current_page | html %] of [% total_pages | html %]</span>
243                             [% IF ( show_nextbutton ) %]
244                                 <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page | html %]" />
245                             [% END %]
246                             <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" />
247                         </form> <!-- /#page_form -->
248
249                     [% ELSE %]
250                         <div class="dialog message">Nothing found.</div>
251                     [% END  # /IF breeding_loop %]
252
253                     <form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl">
254                         <p>
255                             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
256                             <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]"/>
257                             <input type="submit" class="btn btn-primary" value="Try another search" />
258                         </p>
259                     </form>
260                 </div> <!-- /.col-xs-12 -->
261             </div> <!-- /.row -->
262         [% END # /IF opsearch %]
263
264         [% IF ( numberpending ) %]
265             <h3 align="center">Still [% numberpending | html %] servers to search</h3>
266         [% END %]
267
268 [% MACRO jsinclude BLOCK %]
269     [% INCLUDE 'columns_settings.inc' %]
270     [% INCLUDE 'datatables.inc' %]
271     [% INCLUDE 'z3950_search.inc' %]
272     [% Asset.js("js/z3950_search.js") | $raw %]
273     <script>
274         $(document).ready(function(){
275             var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'z3950_search', 'resultst', 'json' ) | $raw %];
276             var thetable = KohaTable("resultst", {
277                 "aoColumnDefs": [
278                     { "aTargets": [ 1 ], "sType": "nsb-nse" },
279                 ],
280                 "bPaginate": false,
281                 "searching": false,
282                 "bInfo":false
283             }, table_settings );
284             InitLastAction();
285         });
286
287         function columnsInit(){
288             $(".dataTables_info").text( $("#result_pagenumbers").text() );
289             $("#result_pagenumbers").hide();
290         }
291     </script>
292 [% END %]
293
294 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]