Bug 7741: Added Clearing Capability to the Z39.50 Search fields
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / z3950_search.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Z39.50/SRU search results</title>
3 [% INCLUDE 'greybox.inc' %]
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
6 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
7 [% INCLUDE 'datatables.inc' %]
8 <script type="text/javascript">
9 //<![CDATA[
10 function Import(GetThisOne,biblionumber) {
11     opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode %]&breedingid="+GetThisOne;
12     window.close();
13     return false;
14 }
15
16 function closemenu(){
17     $(".linktools").hide();
18     $("tr").removeClass("selected");
19 }
20
21 $(document).ready(function(){
22     $("#CheckAll").click(function(){
23         $(".checkboxed").checkCheckboxes();
24         return false;
25     });
26     $("#CheckNone").click(function(){
27         $(".checkboxed").unCheckCheckboxes();
28         return false;
29     });
30     $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
31         "sDom": 't',
32         "aoColumnDefs": [
33             { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false },
34             { "aTargets": [ 1 ], "sType": "nsb-nse" },
35         ],
36         "aaSorting": [[ 1, "asc" ]],
37         "bPaginate": false
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(8)")||$tgt.is(":nth-child(9)")||$tgt.is(":nth-child(10)")){
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     $("form[name='f']").submit(function(){
56         if ($('input[type=checkbox]').filter(':checked').length == 0) {
57             alert(_("Please choose at least one external target"));
58             return false;
59         } else
60             return true;
61     });
62     $("#resetZ3950Search").click(function() {
63        $("form[name='f']").find("input[type=text]").val("");
64     });
65 });
66
67 [% IF ( total_pages ) %]
68 function validate_goto_page(){
69     var page = $('#goto_page').val();
70     if(isNaN(page)) {
71         alert(_("The page entered is not a number."));
72         return false;
73     }
74     else if(page < 1 || page > [% total_pages %] ) {
75         alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
76         return false;
77     }
78     else {
79         return true;
80     }
81 }
82 [% END %]
83
84 //]]>
85 </script>
86 <style type="text/css">
87 .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;}
88 .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
89 .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;}
90 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }
91 </style>
92       [% IF ( opsearch ) %]
93    <style type="text/css">
94            #custom-doc { width:53em;*width:51.72em;min-width:689px; margin:auto; text-align:left; }
95    </style>
96 </head>
97 <body id="cat_z3950_search" class="cat">
98
99 <div id="custom-doc" class="yui-t7">
100 [% ELSE %]
101 </head>
102 <body style="padding:.5em;">
103 <div>
104 [% END %]
105       <div id="bd">
106           [% IF ( opsearch ) %]
107 <h2>Z39.50/SRU search <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="clearsearch"><a id="resetZ3950Search" href="#">Clear Search Form</a></span></span></h2>
108     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
109     <input type="hidden" name="op" id="op" value="do_search" />
110         <div class="yui-g">
111     <div class="yui-u first">
112             <fieldset class="rows"> 
113         <ol>
114         <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
115         <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn %]" /></li>
116         <li><label for="title">Title: </label> <input type="text" id="title"  name="title" value="[% title |html %]" /></li>
117         <li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author %]" /></li>
118         <li><label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
119         <li><label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li>
120         <li><label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
121         <li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" 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>
124         </ol>
125     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
126     <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
127     </div>
128     <div class="yui-g">
129       <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>
130       <div id="z3950_search_targets">
131     [% FOREACH serverloo IN serverloop %]
132         <p> 
133             [% IF ( serverloo.checked ) %]
134                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" checked="checked" />
135             [% ELSE %]
136                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" />
137             [% END %]
138             <label for="z3950_[% serverloo.id %]">[% serverloo.servername %]</label>
139
140         </p>
141     [% END %]
142       </div>
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     <p>You searched for:
151         [% IF ( title ) %]<em>Title: </em><span class=term>[% title %]</span> [% END %]
152         [% IF ( author ) %]<em>Author: </em><span class=term>[% author %]</span> [% END %]
153         [% IF ( isbn ) %]<em>ISBN: </em><span class=term>[% isbn %]</span> [% END %]
154         [% IF ( issn ) %]<em>ISSN: </em><span class=term>[% issn %]</span> [% END %]
155         [% IF ( lccall ) %]<em>LC call number: </em><span class=term>[% lccall %]</span> [% END %]
156         [% IF ( subject ) %]<em>Subject heading: </em><span class=term>[% subject %]</span> [% END %]
157         [% IF ( controlnumber ) %]<em>Control no: </em><span class=term>[% controlnumber %]</span> [% END %]
158         [% IF ( dewey ) %]<em>Dewey: </em><span class=term>[% dewey %]</span> [%END %]
159         [% IF ( srchany ) %]<em>Raw (any): </em><span class=term>[% srchany %]</span> [% END %]
160         [% IF ( stdid ) %]<em>Standard ID: </em><span class=term>[% stdid %]</span> [% END %]
161     </p>
162     [% IF ( errconn ) %]
163             <div class="dialog alert">
164                 <ul>
165                 [% FOREACH errcon IN errconn %]
166                     [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li>
167                     [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li>
168                     [% ELSIF ( errcon.error == 'xslt_err' ) %]<li>[% errcon.server %]: Warning: XSLT error on search result [% errcon.seq %]</li>
169                     [% ELSE %]<li>[% errcon.server %] record [% errcon.seq %]: [% errcon.error %]</li>
170                     [% END %]
171                 [% END %]
172                 </ul>
173             </div>
174     [% END %]
175
176     [% IF ( breeding_loop ) %]
177     <table id="resultst">
178 <thead>    <tr>
179         <th>Server</th>
180         <th>Title</th>
181         <th>Author</th>
182         <th>Date</th>
183         <th>Edition</th>
184         <th>ISBN</th>
185         <th>LCCN</th>
186         <th>MARC</th>
187         <th>Card</th>
188                 <th>&nbsp;</th>
189     </tr></thead>
190     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
191         [% IF ( breeding_loo.breedingid ) %]
192
193             <tr id="row[% breeding_loo.breedingid %]">
194             <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>
195             <td>[% breeding_loo.title |html %]</td>
196             <td>[% breeding_loo.author %]</td>
197             <td>[% breeding_loo.date %]</td>
198             <td>[% breeding_loo.edition %]</td>
199             <td>[% breeding_loo.isbn %]</td>
200             <td>[% breeding_loo.lccn %]</td>
201             <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td>
202             <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>
203             <td><a href="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a></td> 
204         </tr>
205         [% END %]
206     [% END %]</tbody>
207 </table>
208
209     <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
210         <input type="hidden" name="op" id="op" value="do_search" />
211         <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
212         <input type="hidden" id="title"  name="title" value="[% title %]" />
213         <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
214         <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
215         <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber %]" />
216         <input type="hidden" id="srchany" name="srchany" value="[% srchany %]" />
217         <input type="hidden" id="author" name="author" value="[% author %]" />
218         <input type="hidden" id="subject" name="subject" value="[% subject %]" />
219         <input type="hidden" id="dewey" name="dewey" value="[% dewey %]" />
220         <input type="hidden" id="stdid" name="stdid" value="[% stdid %]" />
221         <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
222         <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
223
224         [% FOREACH server IN servers %]
225         <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
226         [% END %]
227
228         [% IF ( show_prevbutton ) %]
229             <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
230         [% END %]
231         Page [% current_page %] / [% total_pages %]
232         [% IF ( show_nextbutton ) %]
233             <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
234         [% END %]
235         <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" />
236     </form>
237
238     [% ELSE %]
239         <div class="dialog message">Nothing found.</div>
240     [% END %]
241 <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>
242
243 [% END %]
244
245         </div>
246 </div>
247 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
248
249 </body>
250 </html>
251