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