Bug 16939: Making all 'add to basket' actions buttons
[koha.git] / 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 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Z39.50/SRU search results</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% Asset.css("css/datatables.css") | $raw %]
9 <style type="text/css">
10 #dataPreview { width : 90%; top: 5%; } .modal-body { max-height: 380px; } .modal-header { padding: 0 14px; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }
11 </style>
12 </head>
13
14     <body id="cat_z3950_search" class="cat">
15     <div class="container-fluid">
16
17           [% IF ( opsearch ) %]
18 <h2>Z39.50/SRU search</h2>
19     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
20         <div class="row">
21             <div class="col-xs-6">
22     <input type="hidden" name="op" id="op" value="do_search" />
23             <fieldset class="rows"> 
24         <ol>
25         <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" class="focus" /></li>
26         <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn | html %]" /></li>
27         <li><label for="title">Title: </label> <input type="text" id="title"  name="title" value="[% title | html %]" /></li>
28         <li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author | html %]" /></li>
29         <li><label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
30         <li><label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li>
31         <li><label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
32         <li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
33         <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
34         <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li>
35         <li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li>
36         </ol>
37     <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
38     <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
39     </div>
40     <div class="col-xs-6">
41       <h2>Search targets</h2>
42       <div id="z3950_search_targets">
43         <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>
44     [% FOREACH serverloo IN serverloop %]
45         <p> 
46             [% IF ( serverloo.checked ) %]
47                 <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" checked="checked" />
48             [% ELSE %]
49                 <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" />
50             [% END %]
51             <label for="z3950_[% serverloo.id | html %]">[% serverloo.servername | html %]</label>
52
53         </p>
54     [% END %]
55             </div>
56         </div>
57     </div>
58     <nav class="navbar navbar-default navbar-fixed-bottom">
59         <div class="container-fluid">
60             <fieldset class="action"><input type="submit"  class="submit" value="Search" /> <a class="cancel close" href="#">Cancel</a></fieldset>
61         </div>
62     </nav>
63     </form>
64
65
66 [% ELSE %]
67     <div class="row">
68         <div class="col-xs-12">
69     <h2>Results</h2>
70     <p>You searched for:
71         [% IF ( title ) %]<em>Title: </em><span class="term">[% title | html %]</span> [% END %]
72         [% IF ( author ) %]<em>Author: </em><span class="term">[% author | html %]</span> [% END %]
73         [% IF ( isbn ) %]<em>ISBN: </em><span class="term">[% isbn | html %]</span> [% END %]
74         [% IF ( issn ) %]<em>ISSN: </em><span class="term">[% issn | html %]</span> [% END %]
75         [% IF ( lccall ) %]<em>LC call number: </em><span class="term">[% lccall | html %]</span> [% END %]
76         [% IF ( subject ) %]<em>Subject heading: </em><span class="term">[% subject | html %]</span> [% END %]
77         [% IF ( controlnumber ) %]<em>Control no: </em><span class="term">[% controlnumber | html %]</span> [% END %]
78         [% IF ( dewey ) %]<em>Dewey: </em><span class="term">[% dewey | html %]</span> [%END %]
79         [% IF ( srchany ) %]<em>Raw (any): </em><span class="term">[% srchany | html %]</span> [% END %]
80         [% IF ( stdid ) %]<em>Standard ID: </em><span class="term">[% stdid | html %]</span> [% END %]
81     </p>
82     [% IF ( errconn ) %]
83             <div class="dialog alert">
84                 <ul>
85                 [% FOREACH errcon IN errconn %]
86                     [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server | html %]</li>
87                     [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server | html %]</li>
88                     [% ELSIF errcon.error.match( '^XSLTH' ) %]<li>[% errcon.server | html %] record [% errcon.seq | html %]: [% PROCESS 'xslt-handler.inc' code=errcon.error %]</li>
89                     [% ELSE %]<li>[% errcon.server | html %] record [% errcon.seq | html %]: [% errcon.error | html %]</li>
90                     [% END %]
91                 [% END %]
92                 </ul>
93             </div>
94     [% END %]
95
96     [% IF ( breeding_loop ) %]
97     <table id="resultst">
98 <thead>    <tr>
99         <th>Server</th>
100         <th>Title</th>
101         <th>Author</th>
102         <th>Date</th>
103         <th>Edition</th>
104         <th>ISBN</th>
105         <th>LCCN</th>
106         [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
107         <th>Additional fields</th>
108         [% END %]
109         <th>Actions</th>
110     </tr></thead>
111     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
112         [% IF ( breeding_loo.breedingid ) %]
113
114             <tr id="row[% breeding_loo.breedingid | html %]">
115             <td>[% breeding_loo.server | html %]</td>
116             <td>[% breeding_loo.title | html %]</td>
117             <td>[% breeding_loo.author | html %]</td>
118             <td>[% breeding_loo.date | html %]</td>
119             <td>[% breeding_loo.edition | html %]</td>
120             <td>[% breeding_loo.isbn | html %]</td>
121             <td>[% breeding_loo.lccn | html %]</td>
122             [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
123             <td>
124                <dl>
125                   [% FOREACH addnumberfield IN breeding_loo.addnumberfields %]
126                     [% FOREACH string IN breeding_loo.$addnumberfield %]
127                         <dt>[% addnumberfield | html %]:</dt>
128                         <dd>[% string | html %]</dd>
129                     [% END %]
130                   [% END %]
131                </dl>
132             </td>
133             [% END %]
134             <td>
135                 <div class="dropdown">
136                     <a class="btn btn-default btn-xs dropdown-toggle" id="cataloguesearchactions[% breeding_loo.breedingid | html %]" role="button" data-toggle="dropdown" href="#">
137                       Actions <b class="caret"></b>
138                     </a>
139                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="cataloguesearchactions[% breeding_loo.breedingid | html %]">
140                         <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 preview</a></li>
141                         <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 preview</a></li>
142                         <li><a href="#" class="import_record" data-breedingid="[% breeding_loo.breedingid | html %]" data-biblionumber="[% breeding_loo.biblionumber | html %]" data-frameworkcode="[% frameworkcode | uri %]"><i class="fa fa-download"></i> Import</a></li>
143                     </ul>
144                 </div>
145             </td>
146         </tr>
147         [% END %]
148     [% END %]</tbody>
149 </table>
150
151 <div id="dataPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
152     <div class="modal-dialog">
153     <div class="modal-content">
154     <div class="modal-header">
155         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
156         <h3 id="dataPreviewLabel">Preview</h3>
157     </div>
158     <div class="modal-body">
159         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
160     </div>
161     </div>
162     </div>
163 </div>
164
165
166     <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
167         <input type="hidden" name="op" id="op" value="do_search" />
168         <input type="hidden" name="current_page" id="current_page" value="[% current_page | html %]" />
169         <input type="hidden" id="title"  name="title" value="[% title | html %]" />
170         <input type="hidden" id="isbn" name="isbn" value="[% isbn | html %]" />
171         <input type="hidden" id="lccall" name="lccall" value="[% lccall | html %]" />
172         <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" />
173         <input type="hidden" id="srchany" name="srchany" value="[% srchany | html %]" />
174         <input type="hidden" id="author" name="author" value="[% author | html %]" />
175         <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
176         <input type="hidden" id="dewey" name="dewey" value="[% dewey | html %]" />
177         <input type="hidden" id="stdid" name="stdid" value="[% stdid | html %]" />
178         <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
179         <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
180
181         [% FOREACH server IN servers %]
182         <input type="hidden" name="id" id="z3950_[% server.id | html %]" value="[% server.id | html %]" />
183         [% END %]
184
185         [% IF ( show_prevbutton ) %]
186             <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page | html %]" />
187         [% END %]
188         Page [% current_page | html %] / [% total_pages | html %]
189         [% IF ( show_nextbutton ) %]
190             <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page | html %]" />
191         [% END %]
192         <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" />
193     </form>
194
195     [% ELSE %]
196         <div class="dialog message">Nothing found.</div>
197     [% END %]
198 <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl"><input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/><input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]"/><input type="submit" value="Try another search"/></form></p>
199
200 [% END %]
201
202 </div>
203 </div>
204 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending | html %] servers to search</h3>[% END %]
205
206 [% MACRO jsinclude BLOCK %]
207     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
208     [% Asset.js("js/z3950_search.js") | $raw %]
209     [% INCLUDE 'datatables.inc' %]
210     <script type="text/javascript">
211         $(document).ready(function(){
212
213             $(".dropdown").on("hidden.bs.dropdown", function(){
214                 // Reset menu styles so that a click on the
215                 // original dropdown button toggle works correctly
216                 $(".dropdown").css("position","absolute");
217                 $(".dropdown-menu").css({
218                     "top" : "100%",
219                     "left" : "auto",
220                     "right" : 0
221                 });
222             });
223
224             $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
225                 "sDom": 't',
226                 "aoColumnDefs": [
227                     { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false },
228                     { "aTargets": [ 1 ], "sType": "nsb-nse" },
229                 ],
230                 "aaSorting": [[ 1, "asc" ]],
231                 "bPaginate": false
232             }));
233
234             /* Display actions menu anywhere the table is clicked */
235             $("td").click(function(event){
236                 var tgt = $(event.target);
237                 var row = $(this).parent();
238                 var rowid = row.attr("id");
239                 $("tr").removeClass("highlighted-row");
240                 row.addClass("highlighted-row");
241                 $(".dropdown").removeClass("open");
242                 if(tgt.is("a")||tgt.is(":nth-child(8)")){
243                     // Don't show inline links for cells containing links of their own.
244                 } else {
245                     event.stopPropagation();
246                     var dropdown = $(".dropdown", row);
247                     dropdown.addClass("open");
248                     var position = $(this).offset();
249                     var top = position.top + 5;
250                     var left = position.left + 5;
251                     dropdown.css("position","unset");
252                     $(".dropdown-menu", row).css({
253                         "top" : top,
254                         "left" : left,
255                         "right" : "unset"
256                     });
257
258                }
259             });
260         });
261     </script>
262     [% INCLUDE 'z3950_search.inc' %]
263 [% END %]
264
265 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]