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