Bug 23302: Less clicks on Z3950 search results
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / z3950_search.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% PROCESS 'i18n.inc' %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]Order from external source &rsaquo; Search results[% END %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% USE Koha %]
9
10 <style>
11 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent !important; } #dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }
12 </style>
13 </head>
14
15 <body id="acq_z3950_search" class="acq">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'acquisitions-search.inc' %]
18
19 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% name | html %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | uri %]">Basket [% basketno | html %]</a> &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]<a href="/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Order from external source</a> &rsaquo; Search results[% END %]</div>
20
21 <div class="main container-fluid">
22       [% IF ( opsearch ) %]
23     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
24     <div class="row">
25     <div class="col-sm-6">
26     <h2>Order from external source</h2>
27     <input type="hidden" name="op" id="op" value="do_search" />
28             <fieldset class="rows">
29          <ol>
30              <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" /></li>
31              <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn | html %]" /></li>
32              <li><label for="searchtitle">Title: </label> <input type="text" id="searchtitle"  name="title" value="[% title | html %]" class="focus" /></li>
33              <li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author | html %]" /></li>
34              <li><label for="publicationyear">Publication year: </label> <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear | html %]" /></li>
35              <li><label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
36              <li><label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li>
37              <li><label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
38              <li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
39              <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
40              <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li>
41              <li><label for="frameworkcode" >Select MARC framework:</label>
42              <select id="frameworkcode" name="frameworkcode" >
43              <option value="">Default</option>
44                  [% FOREACH framework IN frameworks %]
45                     <option value="[% framework.frameworkcode | html %]" >[% framework.frameworktext | html %]</option>
46                  [% END %]
47               </select>
48               </li>
49               <li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li>
50          </ol>
51     </fieldset>
52     <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
53     <input type="hidden" name="basketno" value="[% basketno | html %]" />
54     <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
55     </div> <!-- /.col-sm-6 -->
56 <div class="col-sm-6">
57 <h2>Search targets</h2>
58     <div id="z3950_search_targets_acq">
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-remove"></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 %] [[% serverloo.host | html %]]</label>
68
69         </p>
70     [% END %]
71     </div> <!-- /#z3950_search-targets_acq -->
72   </div> <!-- /.col-sm-6 -->
73 </div> <!-- /.row -->
74
75 <div class="row">
76     <div class="col-md-12">
77     <fieldset class="action"><input type="submit"  class="submit" value="Search" /> <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Cancel</a></fieldset>
78     </div>
79 </div>
80 </form>
81
82
83 [% ELSE %]
84     <div class="row">
85     <div class="col-md-12">
86     <h2>Search results</h2>
87
88     <p>You searched for:
89         [% IF ( title ) %]<em>Title: </em><span class=term>[% title | html %]</span> [% END %]
90         [% IF ( author ) %]<em>Author: </em><span class=term>[% author | html %]</span> [% END %]
91         [% IF ( publicationyear ) %]<em>Publication year: </em><span class=term>[% publicationyear | html %]</span> [% END %]
92         [% IF ( isbn ) %]<em>ISBN: </em><span class=term>[% isbn | html %]</span> [% END %]
93         [% IF ( issn ) %]<em>ISSN: </em><span class=term>[% issn | html %]</span> [% END %]
94         [% IF ( lccall ) %]<em>LC call number: </em><span class=term>[% lccall | html %]</span> [% END %]
95         [% IF ( subject ) %]<em>Subject heading: </em><span class=term>[% subject | html %]</span> [% END %]
96         [% IF ( controlnumber ) %]<em>Control no: </em><span class=term>[% controlnumber | html %]</span> [% END %]
97         [% IF ( dewey ) %]<em>Dewey: </em><span class=term>[% dewey | html %]</span> [%END %]
98     </p>
99
100     [% IF ( breeding_loop ) %]
101     <table id="resultst">
102     <thead><tr>
103         <th>Server</th>
104         <th>Title</th>
105         <th>Author</th>
106         <th>Year</th>
107         <th>Edition</th>
108         <th>ISBN</th>
109         <th>LCCN</th>
110         [% IF ( Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' ) %]
111             <th>Additional fields</th>
112         [% END %]
113         <th>Actions</th>
114     </tr></thead>
115     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
116         [% IF ( breeding_loo.breedingid ) %]
117
118         <tr>
119             <td>[% breeding_loo.server | html %]</td>
120             <td>[% breeding_loo.title | html %]</td>
121             <td>[% breeding_loo.author | html %]</td>
122             <td>[% breeding_loo.date | html %]</td>
123             <td>[% breeding_loo.edition | html %]</td>
124             <td>[% breeding_loo.isbn | html %]</td>
125             <td>[% breeding_loo.lccn | html %]</td>
126             [% IF ( Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' ) %]
127             <td>
128                 <dl>
129                   [% FOREACH addnumberfield IN breeding_loo.addnumberfields %]
130                     [% FOREACH string IN breeding_loo.$addnumberfield %]
131                         <dt>[% addnumberfield | html %]:</dt>
132                         <dd>[% string | html %]</dd>
133                     [% END %]
134                   [% END %]
135                </dl>
136             </td>
137             [% END %]
138             <td class="actions">
139                 <div class="btn-group dropup">
140                     <a class="btn btn-default btn-xs z3950actions" href="#">MARC</a><button data-toggle="dropdown" class="btn-xs dropdown-toggle"><span class="caret"></span></button>
141                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="z3950preview[% breeding_loo.breedingid | html %]">
142                         <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid | uri %]" title="MARC" class="previewData"><i class="fa fa-eye"></i> MARC</a></li>
143                         <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid | uri %]" title="Card" class="previewData"><i class="fa fa-eye"></i> Card</a></li>
144                         <li><a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode | uri %]&amp;breedingid=[% breeding_loo.breedingid | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]" class="chosen" title="Order"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a></li>
145                     </ul>
146                 </div>
147             </td>
148         </tr>
149         [% END %]
150     [% END %]</tbody>
151 </table>
152
153
154     <div id="dataPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
155         <div class="modal-dialog">
156         <div class="modal-content">
157         <div class="modal-header">
158             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
159             <h3 id="dataPreviewLabel">MARC preview</h3>
160         </div>
161         <div class="modal-body">
162             <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
163         </div>
164         <div class="modal-footer">
165             <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
166         </div>
167         </div>
168         </div>
169     </div>
170
171     <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
172         <input type="hidden" name="op" id="op" value="do_search" />
173         <input type="hidden" name="current_page" id="current_page" value="[% current_page | html %]" />
174         <input type="hidden" id="searchtitle"  name="title" value="[% title | html %]" />
175         <input type="hidden" id="isbn" name="isbn" value="[% isbn | html %]" />
176         <input type="hidden" id="lccall" name="lccall" value="[% lccall | html %]" />
177         <input type="hidden" id="author" name="author" value="[% author | html %]" />
178         <input type="hidden" id="publicationyear" name="publicationyear" value="[% publicationyear | html %]" />
179         <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
180         <input type="hidden" id="dewey" name="dewey" value="[% dewey | html %]" />
181         <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
182         <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
183         <input type="hidden" name="controlnumber" value="[% controlnumber | html %]" />
184         <input type="hidden" name="basketno" value="[% basketno | html %]" />
185         <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
186
187         [% FOREACH server IN servers %]
188         <input type="hidden" name="id" id="z3950_[% server.id | html %]" value="[% server.id | html %]" />
189         [% END %]
190
191         [% IF ( show_prevbutton ) %]
192             <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page | html %]" />
193         [% END %]
194         Page [% current_page | html %] / [% total_pages | html %]
195         [% IF ( show_nextbutton ) %]
196             <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page | html %]" />
197         [% END %]
198         <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" value="Go" />
199     </form>
200
201     [% ELSE %]
202         [% IF ( emptyserverlist ) %]
203             <div class="dialog alert">You didn't select any external target.</div>
204         [% ELSE %]
205             [% IF ( errconn ) %]
206                 <div class="dialog alert">
207                     <ul>
208                     [% FOREACH errcon IN errconn %]
209                         <li>Connection failed to [% errcon.server | html %]</li>
210                     [% END %]
211                     </ul>
212                 </div>
213             [% END %]
214         [% END %]
215         <div class="dialog message">Nothing found. <a href="javascript: history.back()">Try another search</a>.</div>
216     [% END %]
217     </div> <!-- /.col-md-12 -->
218     </div> <!-- /.row -->
219
220 [% END %]
221
222 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending | html %] servers to search</h3>[% END %]
223
224 [% MACRO jsinclude BLOCK %]
225     [% Asset.js("js/acquisitions-menu.js") | $raw %]
226     [% INCLUDE 'datatables.inc' %]
227     [% INCLUDE 'z3950_search.inc' %]
228     [% Asset.js("js/z3950_search.js") | $raw %]
229     [% INCLUDE 'z3950_search.inc' %]
230     <script>
231         $(document).ready(function(){
232             var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
233                 "aoColumnDefs": [
234                     { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
235                     { "aTargets": [ 1 ], "sType": "nsb-nse" },
236                 ],
237                 "aaSorting": [[ 1, "asc" ]],
238                 "bPaginate": false
239             }));
240             InitLastAction();
241         });
242     </script>
243 [% END %]
244
245 [% INCLUDE 'intranet-bottom.inc' %]