Merge remote-tracking branch 'origin/new/bug_8408'
[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             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 //]]>
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 id="cat_z3950_search" class="cat">
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 |html %]" /></li>
95         <li><label for="isbn">ISBN: </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="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn %]" /></li>
104         <li> <label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
105                  <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
106                  <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li></ol>
107     </fieldset>
108     <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
109     <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
110             </div>
111 </div>
112 <div class="yui-g">
113 <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>
114
115     [% FOREACH serverloo IN serverloop %]
116         <p> 
117             [% IF ( serverloo.checked ) %]
118                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" checked="checked" />
119             [% ELSE %]
120                 <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" />
121             [% END %]
122             <label for="z3950_[% serverloo.id %]">[% serverloo.name %]</label>  
123
124         </p>
125     [% END %]
126         </div>
127     <fieldset class="action"><input type="submit"  class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset>
128     </form>
129
130
131 [% ELSE %]
132     <h2>Results</h2>
133     [% IF ( breeding_loop ) %]
134     <table id="resultst">
135 <thead>    <tr>
136         <th>Server</th>
137         <th>Title</th>
138         <th>Author</th>
139         <th>Date</th>
140         <th>Edition</th>
141         <th>ISBN</th>
142         <th>LCCN</th>
143         <th colspan="2">Preview</th>
144                 <th>&nbsp;</th>
145     </tr></thead>
146     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
147         [% IF ( breeding_loo.breedingid ) %]
148
149             <tr id="row[% breeding_loo.breedingid %]">
150             <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>
151             <td>[% breeding_loo.title |html %]</td>
152             <td>[% breeding_loo.author %]</td>
153             <td>[% breeding_loo.date %]</td>
154             <td>[% breeding_loo.edition %]</td>
155             <td>[% breeding_loo.isbn %]</td>
156             <td>[% breeding_loo.lccn %]</td>
157             <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td>
158             <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>
159             <td><a href="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a></td> 
160         </tr>
161         [% END %]
162     [% END %]</tbody>
163 </table>
164 <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>
165     [% ELSE %]
166         [% IF ( errconn ) %]
167             <div class="dialog alert">
168                 <ul>
169                 [% FOREACH errcon IN errconn %]
170                     [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li>
171                     [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li>[% END %]
172                 [% END %]
173                 </ul>
174             </div>
175          [% END %]
176    <div class="dialog message">Nothing found.</div>
177         <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>
178     [% END %]
179
180
181 [% END %]
182
183         </div>
184 </div>
185 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
186
187 </body>
188 </html>
189