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