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