Bug 6380 - Z39.50 Cataloging Search needs a way to try search again, even if results...
[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 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7 <script type="text/javascript">
8 //<![CDATA[
9 function Import(GetThisOne,biblionumber) {
10     opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode %]&breedingid="+GetThisOne;
11     window.close();
12     return false;
13 }
14 $.tablesorter.addParser({
15     id: 'articles', 
16     is: function(s) {return false;  }, 
17     format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
18     type: 'text' 
19 });
20
21 function closemenu(){
22     $(".linktools").hide();
23     $("tr").removeClass("selected");
24 }
25
26 $(document).ready(function(){
27     $("#CheckAll").click(function(){
28         $(".checkboxed").checkCheckboxes();
29         return false;
30     });
31     $("#CheckNone").click(function(){
32         $(".checkboxed").unCheckCheckboxes();
33         return false;
34     });
35     $("#resultst").tablesorter({
36         sortList: [[1,0]],
37         headers: { 1: { sorter: 'articles' },7: { sorter: false },8: { sorter: false } },
38         widgets: ['zebra']
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             if($tgt.is("a")||$tgt.is(":nth-child(7)")||$tgt.is(":nth-child(8)")||$tgt.is(":nth-child(9)")||$tgt.is(":nth-child(10)")){
47                 return true;
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             row.addClass("selected");
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 //]]>
66 </script>
67 <style type="text/css">
68 .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;}
69 .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
70 .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;}
71 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }
72 </style>
73       [% IF ( opsearch ) %]
74    <style type="text/css">
75            #custom-doc { width:53em;*width:51.72em;min-width:689px; margin:auto; text-align:left; }
76    </style>
77 </head>
78 <body>
79
80 <div id="custom-doc" class="yui-t7">
81 [% ELSE %]
82 </head>
83 <body style="padding:.5em;">
84 <div>
85 [% END %]
86       <div id="bd">
87           [% IF ( opsearch ) %]
88 <h2>Z39.50 Search Points</h2>
89     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
90     <input type="hidden" name="op" id="op" value="do_search" />
91         <div class="yui-g">
92     <div class="yui-u first">
93             <fieldset class="rows"> 
94                  <ol><li><label for="title">Title: </label> <input type="text" id="title"  name="title" value="[% title %]" /></li>
95                  <li><label for="isbn">ISBN/ISSN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
96                  <li><label for="lccall">LC Call Number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
97                  <li><label for="controlnumber">Control No.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
98                  <li><label for="srchany">Raw (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li></ol>
99                 </fieldset>
100             </div>
101     <div class="yui-u">
102         <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>
103                  <li> <label for="subject">Subject Heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
104                  <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
105                  <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li></ol>
106     </fieldset>
107     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
108     <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
109             </div>
110 </div>
111 <div class="yui-g">
112 <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>
113
114     [% FOREACH serverloo IN serverloop %]
115         <p> 
116             [% IF ( serverloo.checked ) %]
117                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" checked="checked" />
118             [% ELSE %]
119                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" />
120             [% END %]
121             <label for="z3950_[% serverloo.id %]">[% serverloo.name %]</label>  
122
123         </p>
124     [% END %]
125         </div>
126     <fieldset class="action"><input type="submit"  class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset>
127     </form>
128
129
130 [% ELSE %]
131     <h2>Results</h2>
132     [% IF ( breeding_loop ) %]
133     <table id="resultst">
134 <thead>    <tr>
135         <th>Server</th>
136         <th>Title</th>
137         <th>Author</th>
138         <th>Date</th>
139         <th>Edition</th>
140         <th>ISBN</th>
141         <th>LCCN</th>
142         <th colspan="2">Preview</th>
143                 <th>&nbsp;</th>
144     </tr></thead>
145     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
146         [% IF ( breeding_loo.breedingid ) %]
147
148             <tr id="row[% breeding_loo.breedingid %]">
149                 <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 %],0); return false">Import</a><a href="#" onclick="closemenu();return false;" title="Close this menu"> X </a></div> </td>
150             <td>[% breeding_loo.title |html %]</td>
151             <td>[% breeding_loo.author %]</td>
152             <td>[% breeding_loo.date %]</td>
153             <td>[% breeding_loo.edition %]</td>
154             <td>[% breeding_loo.isbn %]</td>
155             <td>[% breeding_loo.lccn %]</td>
156             <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td>
157             <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>
158             <td><a href="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a></td> 
159         </tr>
160         [% END %]
161     [% END %]</tbody>
162 </table>
163 <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>
164     [% ELSE %]
165         [% IF ( emptyserverlist ) %]
166             You didn't select any Z39.50 target.
167         [% ELSE %]
168             [% FOREACH errcon IN errconn %]
169                 Connection failed to [% errcon.server %]
170             [% END %]
171         [% END %]
172         <p>Nothing found.</p>
173         <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>
174     [% END %]
175
176
177 [% END %]
178
179         </div>
180 </div>
181 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
182
183 </body>
184 </html>
185