Merge branch 'bug_9647' into 3.12-master
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / z3950_search.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Z39.50 search results</title>
3 [% INCLUDE 'greybox.inc' %]
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
6 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
7 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
8 [% INCLUDE 'datatables-strings.inc' %]
9 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
10 <script type="text/javascript">
11 //<![CDATA[
12 function Import(GetThisOne,biblionumber) {
13     opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode %]&breedingid="+GetThisOne;
14     window.close();
15     return false;
16 }
17
18 function closemenu(){
19     $(".linktools").hide();
20     $("tr").removeClass("selected");
21 }
22
23 $(document).ready(function(){
24     $("#CheckAll").click(function(){
25         $(".checkboxed").checkCheckboxes();
26         return false;
27     });
28     $("#CheckNone").click(function(){
29         $(".checkboxed").unCheckCheckboxes();
30         return false;
31     });
32     $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
33         "sDom": 't',
34         "aoColumnDefs": [
35             { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false },
36         ],
37         "aaSorting": [[ 1, "asc" ]],
38         "bPaginate": false
39     }));
40         /* Inline edit/delete links */
41         $("td").click(function(event){
42             var $tgt = $(event.target);
43             var row = $(this).parent();
44             $(".linktools").hide();
45             $("tr").removeClass("selected");
46             row.addClass("selected");
47             if($tgt.is("a")||$tgt.is(":nth-child(7)")||$tgt.is(":nth-child(8)")||$tgt.is(":nth-child(9)")||$tgt.is(":nth-child(10)")){
48                 return true;
49             } else {
50                 var position = $(this).offset();
51                 var top = position.top+5;
52                 var left = position.left+5;
53                 $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
54             }
55         });
56     $("form[name='f']").submit(function(){
57         if ($('input[type=checkbox]').filter(':checked').length == 0) {
58             alert(_("Please choose at least one Z39.50 target"));
59             return false;
60         } else
61             return true;
62     });
63 });
64
65 [% IF ( total_pages ) %]
66 function validate_goto_page(){
67     var page = $('#goto_page').val();
68     if(isNaN(page)) {
69         alert(_("The page entered is not a number."));
70         return false;
71     }
72     else if(page < 1 || page > [% total_pages %] ) {
73         alert(_("The page should be a number between 1 and ") + [% total_pages %] + ".");
74         return false;
75     }
76     else {
77         return true;
78     }
79 }
80 [% END %]
81
82 //]]>
83 </script>
84 <style type="text/css">
85 .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;}
86 .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
87 .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;}
88 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }
89 </style>
90       [% IF ( opsearch ) %]
91    <style type="text/css">
92            #custom-doc { width:53em;*width:51.72em;min-width:689px; margin:auto; text-align:left; }
93    </style>
94 </head>
95 <body id="cat_z3950_search" class="cat">
96
97 <div id="custom-doc" class="yui-t7">
98 [% ELSE %]
99 </head>
100 <body style="padding:.5em;">
101 <div>
102 [% END %]
103       <div id="bd">
104           [% IF ( opsearch ) %]
105 <h2>Z39.50 search points</h2>
106     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
107     <input type="hidden" name="op" id="op" value="do_search" />
108         <div class="yui-g">
109     <div class="yui-u first">
110             <fieldset class="rows"> 
111         <ol><li><label for="title">Title: </label> <input type="text" id="title"  name="title" value="[% title |html %]" /></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="srchany">Raw (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li></ol>
116                 </fieldset>
117             </div>
118     <div class="yui-u">
119         <fieldset class="rows">          <ol><li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author %]" /><!--  <label for="Keyword">Keyword</label> <input type="text" name="keyword" value="" /> --></li>
120         <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn %]" /></li>
121         <li> <label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
122                  <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
123                  <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li></ol>
124     </fieldset>
125     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
126     <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
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 %]</label>  
140
141         </p>
142     [% END %]
143         </div>
144     <fieldset class="action"><input type="submit"  class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset>
145     </form>
146
147
148 [% ELSE %]
149     <h2>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>Date</th>
157         <th>Edition</th>
158         <th>ISBN</th>
159         <th>LCCN</th>
160         <th>MARC</th>
161         <th>Card</th>
162                 <th>&nbsp;</th>
163     </tr></thead>
164     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
165         [% IF ( breeding_loo.breedingid ) %]
166
167             <tr id="row[% breeding_loo.breedingid %]">
168             <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="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a><a href="#" onclick="closemenu();return false;" title="Close this menu"> X </a></div> </td>
169             <td>[% breeding_loo.title |html %]</td>
170             <td>[% breeding_loo.author %]</td>
171             <td>[% breeding_loo.date %]</td>
172             <td>[% breeding_loo.edition %]</td>
173             <td>[% breeding_loo.isbn %]</td>
174             <td>[% breeding_loo.lccn %]</td>
175             <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td>
176             <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
177             <td><a href="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a></td> 
178         </tr>
179         [% END %]
180     [% END %]</tbody>
181 </table>
182
183     <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
184         <input type="hidden" name="op" id="op" value="do_search" />
185         <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
186         <input type="hidden" id="title"  name="title" value="[% title %]" />
187         <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
188         <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
189         <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber %]" />
190         <input type="hidden" id="srchany" name="srchany" value="[% srchany %]" />
191         <input type="hidden" id="author" name="author" value="[% author %]" />
192         <input type="hidden" id="subject" name="subject" value="[% subject %]" />
193         <input type="hidden" id="dewey" name="dewey" value="[% dewey %]" />
194         <input type="hidden" id="stdid" name="stdid" value="[% stdid %]" />
195         <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
196         <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
197
198         [% FOREACH server IN servers %]
199         <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
200         [% END %]
201
202         [% IF ( show_prevbutton ) %]
203             <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
204         [% END %]
205         Page [% current_page %] / [% total_pages %]
206         [% IF ( show_nextbutton ) %]
207             <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
208         [% END %]
209         <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" />
210     </form>
211
212 <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl"><input type="hidden" name="biblionumber" value="[% biblionumber %]"/><input type="hidden" name="frameworkcode" value="[% frameworkcode %]"/><input type="submit" value="Try Another Search"/></form></p>
213     [% ELSE %]
214         [% IF ( errconn ) %]
215             <div class="dialog alert">
216                 <ul>
217                 [% FOREACH errcon IN errconn %]
218                     [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li>
219                     [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li>[% END %]
220                 [% END %]
221                 </ul>
222             </div>
223          [% END %]
224    <div class="dialog message">Nothing found.</div>
225         <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl"><input type="hidden" name="biblionumber" value="[% biblionumber %]"/><input type="hidden" name="frameworkcode" value="[% frameworkcode %]"/><input type="submit" value="Try Another Search"/></form></p>
226     [% END %]
227
228
229 [% END %]
230
231         </div>
232 </div>
233 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
234
235 </body>
236 </html>
237