Bug 7469: put focus on 1st field of creation form instead of search box (Acquisition)
[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 [% INCLUDE 'greybox.inc' %]
4 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% INCLUDE 'datatables.inc' %]
7
8 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9 <script type="text/javascript">
10 //<![CDATA[
11     $(document).ready(function(){
12
13     var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
14         "aoColumnDefs": [
15             { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
16         ],
17         "bPaginate": false
18     } ) );
19
20     $("#CheckAll").click(function(){
21         $(".checkboxed").checkCheckboxes();
22         return false;
23     });
24     $("#CheckNone").click(function(){
25         $(".checkboxed").unCheckCheckboxes();
26         return false;
27     });
28
29     $("#closemenu").click(function(e){
30         $(".linktools").hide();
31         $("tr").removeClass("selected");
32     });
33
34         /* Inline edit/delete links */
35         $("td").click(function(event){
36             var $tgt = $(event.target);
37             $(".linktools").hide();
38             $("tr").removeClass("selected");
39             if($tgt.is("a")||$tgt.is(":nth-child(5)")||$tgt.is(":nth-child(6)")||$tgt.is(":nth-child(7)")||$tgt.is(":nth-child(8)")){
40                 return true;
41             } else {
42                 var position = $(this).offset();
43                 var top = position.top+5;
44                 var left = position.left+5;
45                 $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
46             }
47             var row = $(this).parent();
48             row.addClass("selected");
49         });
50 });
51
52 [% IF ( total_pages ) %]
53 function validate_goto_page(){
54     var page = $('#goto_page').val();
55     if(isNaN(page)) {
56         alert(_("The page entered is not a number."));
57         return false;
58     }
59     else if(page < 1 || page > [% total_pages %] ) {
60         alert(_("The page should be a number between 1 and ") + [% total_pages %] + ".");
61         return false;
62     }
63     else {
64         return true;
65     }
66 }
67 [% END %]
68
69 //]]>
70 </script>
71 <style type="text/css">
72 .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;}
73 .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
74 .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;}
75 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent !important; }
76 </style>
77 </head>
78 <body id="acq_z3950_search" class="acq">
79 [% INCLUDE 'header.inc' %]
80 [% INCLUDE 'acquisitions-search.inc' %]
81
82 <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>
83
84 <div id="doc3" class="yui-t7">
85       <div id="bd">
86           [% IF ( opsearch ) %]
87 <h2>Order from external source</h2>
88     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
89     <input type="hidden" name="op" id="op" value="do_search" />
90         <div class="yui-g">
91     <div class="yui-u first">
92             <fieldset class="rows">
93          <ol><li><label for="searchtitle">Title: </label> <input type="text" id="searchtitle"  name="title" value="[% title |html %]" class="focus" /></li>
94                  <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
95          <li><label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
96          <li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
97 </ol>
98                 </fieldset>
99             </div>
100     <div class="yui-u">
101     <fieldset class="rows">
102         <ol>
103         <li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author %]" /></li>
104          <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn %]" /></li>
105          <li> <label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
106                  <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li></ol></fieldset>
107              <fieldset class="rows" >
108                  <ol>
109                      <li>
110                          <label for="frameworkcode" >Select used MARC framework:</label>
111                          <select id="frameworkcode" name="frameworkcode" >
112                              <option value="">Default</option>
113                          [% FOREACH frameworkcodeloo IN frameworkcodeloop %]
114                              [% IF ( frameworkcodeloo.active ) %]
115                                  <option value="[% frameworkcodeloo.value %]" selected="selected" >[% frameworkcodeloo.frameworktext %]</option>
116                              [% ELSE %]
117                                  <option value="[% frameworkcodeloo.value %]" >[% frameworkcodeloo.frameworktext %]</option>
118                              [% END %]
119                          [% END %]
120                          </select>
121                      </li>
122                  </ol>
123              </fieldset>
124     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
125     <input type="hidden" name="basketno" value="[% basketno %]" />
126     <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
127             </div>
128 </div>
129 <div class="yui-g">
130 <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>
131
132     [% FOREACH serverloo IN serverloop %]
133         <p>
134             [% IF ( serverloo.checked ) %]
135                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" checked="checked" />
136             [% ELSE %]
137                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" />
138             [% END %]
139             <label for="z3950_[% serverloo.id %]">[% serverloo.name %] [[% serverloo.host %]]</label>
140
141         </p>
142     [% END %]
143     <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>
144     </div>
145     </form>
146
147
148 [% ELSE %]
149     <h2>Search results</h2>
150     [% IF ( breeding_loop ) %]
151     <table id="resultst">
152 <thead>    <tr>
153         <th>Server</th>
154         <th>Title</th>
155         <th>Author</th>
156         <th>ISBN</th>
157         <th>LCCN</th>
158         <th>Preview</th>
159                 <th>&nbsp;</th>
160     </tr></thead>
161     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
162         [% IF ( breeding_loo.breedingid ) %]
163
164         [% IF ( breeding_loo.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
165             <td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" rel="gb_page_center[600,500]">Preview MARC</a> <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid %]" rel="gb_page_center[600,500]">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>
166             <td>[% breeding_loo.title |html %]</td>
167             <td>[% breeding_loo.author %]</td>
168             <td>[% breeding_loo.isbn %]</td>
169             <td>[% breeding_loo.lccn %]</td>
170             <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid %]" title="Card" rel="gb_page_center[600,500]">Card</a></td>
171                         <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>
172
173         </tr>
174         [% END %]
175     [% END %]</tbody>
176 </table>
177
178     <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
179         <input type="hidden" name="op" id="op" value="do_search" />
180         <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
181         <input type="hidden" id="searchtitle"  name="title" value="[% title |html %]" />
182         <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
183         <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
184         <input type="hidden" id="author" name="author" value="[% author %]" />
185         <input type="hidden" id="subject" name="subject" value="[% subject %]" />
186         <input type="hidden" id="dewey" name="dewey" value="[% dewey %]" />
187         <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
188         <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
189         <input type="hidden" name="controlnumber" value="[% controlnumber %]" />
190         <input type="hidden" name="basketno" value="[% basketno %]" />
191         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
192
193         [% FOREACH server IN servers %]
194         <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
195         [% END %]
196
197         [% IF ( show_prevbutton ) %]
198             <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
199         [% END %]
200         Page [% current_page %] / [% total_pages %]
201         [% IF ( show_nextbutton ) %]
202             <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
203         [% END %]
204         <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" />
205     </form>
206
207     [% ELSE %]
208         [% IF ( emptyserverlist ) %]
209             <div class="dialog alert">You didn't select any Z39.50 target.</div>
210         [% ELSE %]
211             [% IF ( errconn ) %]
212                 <div class="dialog alert">
213                     <ul>
214                     [% FOREACH errcon IN errconn %]
215                         <li>Connection failed to [% errcon.server %]</li>
216                     [% END %]
217                     </ul>
218                 </div>
219             [% END %]
220         [% END %]
221         <div class="dialog message">Nothing found. <a href="javascript: history.back()">Try another search</a>.</div>
222     [% END %]
223
224
225 [% END %]
226
227         </div>
228 </div>
229 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
230
231 </body>
232 </html>
233