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