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