Bug 15318 - Use Bootstrap modal for MARC and Card preview when ordering an external...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / z3950_search.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]Order from external source &rsaquo; Search results[% END %]</title>
3 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'datatables.inc' %]
6
7 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
8 <script type="text/javascript">
9 //<![CDATA[
10     $(document).ready(function(){
11
12     var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
13         "aoColumnDefs": [
14             { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
15             { "aTargets": [ 1 ], "sType": "nsb-nse" },
16         ],
17         "aaSorting": [[ 1, "asc" ]],
18         "bPaginate": false
19     } ) );
20
21     $("#CheckAll").click(function(){
22         $(".checkboxed").checkCheckboxes();
23         return false;
24     });
25     $("#CheckNone").click(function(){
26         $(".checkboxed").unCheckCheckboxes();
27         return false;
28     });
29
30     $("#closemenu").click(function(e){
31         $(".linktools").hide();
32         $("tr").removeClass("selected");
33     });
34     $("#resetZ3950Search").click(function(e) {
35         e.preventDefault();
36         $("form[name='f']").find("input[type=text]").val("");
37     });
38
39         /* Inline edit/delete links */
40         $("td").click(function(event){
41             var $tgt = $(event.target);
42             var row = $(this).parent();
43             $(".linktools").hide();
44             $("tr").removeClass("selected");
45             row.addClass("selected");
46             if($tgt.is("a")||$tgt.is(":nth-child(6)")||$tgt.is(":nth-child(7)")){
47                 //Don't show inline links for cells containing links of their own.
48             } else {
49                 var position = $(this).offset();
50                 var top = position.top+5;
51                 var left = position.left+5;
52                 $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
53             }
54         });
55     $(".previewData").on("click", function(e){
56         e.preventDefault();
57         var ltitle = $(this).text();
58         var page = $(this).attr("href");
59         $("#dataPreviewLabel").text(ltitle);
60         $("#dataPreview .modal-body").load(page + " div");
61         $('#dataPreview').modal({show:true});
62     });
63     $("#dataPreview").on("hidden", function(){
64         $("#dataPreviewLabel").html("");
65         $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
66     });
67 });
68
69 [% IF ( total_pages ) %]
70 function validate_goto_page(){
71     var page = $('#goto_page').val();
72     if(isNaN(page)) {
73         alert(_("The page entered is not a number."));
74         return false;
75     }
76     else if(page < 1 || page > [% total_pages %] ) {
77         alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
78         return false;
79     }
80     else {
81         return true;
82     }
83 }
84 [% END %]
85
86 //]]>
87 </script>
88 <style type="text/css">
89 .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;}
90 .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
91 .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;}
92 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent !important; } #dataPreview { width : 80%; margin-left : -40%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }
93 </style>
94 </head>
95 <body id="acq_z3950_search" class="acq">
96 [% INCLUDE 'header.inc' %]
97 [% INCLUDE 'acquisitions-search.inc' %]
98
99 <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 %]">[% name %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]<a href="/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Order from external source</a> &rsaquo; Search results[% END %]</div>
100
101 <div id="doc3" class="yui-t7">
102       <div id="bd">
103           [% IF ( opsearch ) %]
104 <h2>Order from external source</h2>
105     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
106     <input type="hidden" name="op" id="op" value="do_search" />
107         <div class="yui-g">
108     <div class="yui-u first">
109             <fieldset class="rows">
110          <ol>
111              <li><label for="searchtitle">Title: </label> <input type="text" id="searchtitle"  name="title" value="[% title |html %]" class="focus" /></li>
112              <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
113              <li><label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
114              <li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
115              <li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author %]" /></li>
116              <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn %]" /></li>
117              <li><label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
118              <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
119              <li><label for="frameworkcode" >Select MARC framework:</label>
120              <select id="frameworkcode" name="frameworkcode" >
121              <option value="">Default</option>
122                  [% FOREACH frameworkcodeloo IN frameworkcodeloop %]
123                     [% IF ( frameworkcodeloo.active ) %]
124                         <option value="[% frameworkcodeloo.value %]" selected="selected" >[% frameworkcodeloo.frameworktext %]</option>
125                     [% ELSE %]
126                         <option value="[% frameworkcodeloo.value %]" >[% frameworkcodeloo.frameworktext %]</option>
127                     [% END %]
128                  [% END %]
129               </select>
130               </li>
131          </ol>
132         <p><a id="resetZ3950Search" href="#">Clear search form</a></p>
133     </fieldset>
134     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
135     <input type="hidden" name="basketno" value="[% basketno %]" />
136     <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
137             </div>
138 <div class="yui-u second">
139 <h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#">Select all</a></span><span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></span></h2>
140     <div id="z3950_search_targets_acq">
141     [% FOREACH serverloo IN serverloop %]
142         <p>
143             [% IF ( serverloo.checked ) %]
144                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" checked="checked" />
145             [% ELSE %]
146                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" />
147             [% END %]
148             <label for="z3950_[% serverloo.id %]">[% serverloo.servername %] [[% serverloo.host %]]</label>
149
150         </p>
151     [% END %]
152     </div>
153   </div>
154 </div>
155
156     <fieldset class="action"><input type="submit"  class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Cancel</a></fieldset>
157 </form>
158
159
160 [% ELSE %]
161     <h2>Search results</h2>
162
163     <p>You searched for:
164         [% IF ( title ) %]<em>Title: </em><span class=term>[% title %]</span> [% END %]
165         [% IF ( author ) %]<em>Author: </em><span class=term>[% author %]</span> [% END %]
166         [% IF ( isbn ) %]<em>ISBN: </em><span class=term>[% isbn %]</span> [% END %]
167         [% IF ( issn ) %]<em>ISSN: </em><span class=term>[% issn %]</span> [% END %]
168         [% IF ( lccall ) %]<em>LC call number: </em><span class=term>[% lccall %]</span> [% END %]
169         [% IF ( subject ) %]<em>Subject heading: </em><span class=term>[% subject %]</span> [% END %]
170         [% IF ( controlnumber ) %]<em>Control no: </em><span class=term>[% controlnumber %]</span> [% END %]
171         [% IF ( dewey ) %]<em>Dewey: </em><span class=term>[% dewey %]</span> [%END %]
172     </p>
173
174     [% IF ( breeding_loop ) %]
175     <table id="resultst">
176 <thead>    <tr>
177         <th>Server</th>
178         <th>Title</th>
179         <th>Author</th>
180         <th>ISBN</th>
181         <th>LCCN</th>
182         <th>Preview</th>
183                 <th>&nbsp;</th>
184     </tr></thead>
185     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
186         [% IF ( breeding_loo.breedingid ) %]
187
188         <tr>
189             <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 %]&amp;breedingid=[% breeding_loo.breedingid %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Order</a> <a href="#" id="closemenu" title="Close this menu"> X </a></div></td>
190             <td>[% breeding_loo.title |html %]</td>
191             <td>[% breeding_loo.author %]</td>
192             <td>[% breeding_loo.isbn %]</td>
193             <td>[% breeding_loo.lccn %]</td>
194             <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>
195                         <td><a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode %]&amp;breedingid=[% breeding_loo.breedingid %]&amp;booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Order</a></td>
196
197         </tr>
198         [% END %]
199     [% END %]</tbody>
200 </table>
201
202
203     <div id="dataPreview" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
204         <div class="modal-header">
205             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
206             <h3 id="dataPreviewLabel">MARC preview</h3>
207         </div>
208         <div class="modal-body">
209             <div id="loading"> <img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> Loading </div>
210         </div>
211         <div class="modal-footer">
212             <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
213         </div>
214     </div>
215
216     <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
217         <input type="hidden" name="op" id="op" value="do_search" />
218         <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
219         <input type="hidden" id="searchtitle"  name="title" value="[% title |html %]" />
220         <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
221         <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
222         <input type="hidden" id="author" name="author" value="[% author %]" />
223         <input type="hidden" id="subject" name="subject" value="[% subject %]" />
224         <input type="hidden" id="dewey" name="dewey" value="[% dewey %]" />
225         <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
226         <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
227         <input type="hidden" name="controlnumber" value="[% controlnumber %]" />
228         <input type="hidden" name="basketno" value="[% basketno %]" />
229         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
230
231         [% FOREACH server IN servers %]
232         <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
233         [% END %]
234
235         [% IF ( show_prevbutton ) %]
236             <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
237         [% END %]
238         Page [% current_page %] / [% total_pages %]
239         [% IF ( show_nextbutton ) %]
240             <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
241         [% END %]
242         <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" 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 %]</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
262
263 [% END %]
264
265         </div>
266 </div>
267 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
268
269 </body>
270 </html>
271