Bug 13618: Remove html filters at the intranet
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / z3950_auth_search.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Z39.50 search results</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
5 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7 <script type="text/javascript">
8 //<![CDATA[
9 function Import(Breeding,AuthType,authid) {
10     opener.document.location="../authorities/authorities.pl?breedingid="+Breeding+"&authtypecode="+AuthType+"&authid="+authid;
11     window.close();
12     return false;
13 }
14
15 function closemenu(){
16     $(".linktools").hide();
17     $("tr").removeClass("selected");
18 }
19
20 $(document).ready(function(){
21     $("#CheckAll").click(function(){
22         $(".checkboxed").checkCheckboxes();
23         return false;
24     });
25     $("#CheckNone").click(function(){
26         $(".checkboxed").unCheckCheckboxes();
27         return false;
28     });
29     $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
30         "sDom": 't',
31         "aoColumnDefs": [
32             { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false },
33         ],
34         "aaSorting": [[ 1, "asc" ]],
35         "bPaginate": false
36     }));
37         /* Inline edit/delete links */
38         $("td").click(function(event){
39             var $tgt = $(event.target);
40             var row = $(this).parent();
41             $(".linktools").hide();
42             $("tr").removeClass("selected");
43             row.addClass("selected");
44             if($tgt.is("a")||$tgt.is(":nth-child(4)")||$tgt.is(":nth-child(5)")){
45                 //Don't show inline links for cells containing links of their own.
46             } else {
47                 var position = $(this).offset();
48                 var top = position.top+5;
49                 var left = position.left+5;
50                 $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
51             }
52         });
53     $("form[name='f']").submit(function(){
54         if ($('input[type=checkbox]').filter(':checked').length == 0) {
55             alert(_("Please choose at least one Z39.50 target"));
56             return false;
57         } else
58             return true;
59     });
60     $("#resetZ3950Search").click(function(e) {
61         e.preventDefault();
62         $("form[name='f']").find("input[type=text]").val("");
63     });
64     $(".previewMARC").on("click", function(e){
65         e.preventDefault();
66         var ltitle = $(this).text();
67         var page = $(this).attr("href");
68         $("#marcPreviewLabel").text(ltitle);
69         $("#marcPreview .modal-body").load(page + " pre");
70         $('#marcPreview').modal({show:true});
71     });
72     $("#marcPreview").on("hidden", function(){
73         $("#marcPreviewLabel").html("");
74         $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
75     });
76 });
77
78 [% IF ( total_pages ) %]
79 function validate_goto_page(){
80     var page = $('#goto_page').val();
81     if(isNaN(page)) {
82         alert(_("The page entered is not a number."));
83         return false;
84     }
85     else if(page < 1 || page > [% total_pages %] ) {
86         alert(_("The page should be a number between 1 and %s.").format([% total_pages %]));
87         return false;
88     }
89     else {
90         return true;
91     }
92 }
93 [% END %]
94
95 //]]>
96 </script>
97 <style type="text/css">
98 .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;}
99 .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
100 .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;}
101 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; } #marcPreview { width : 90%; margin-left : -45%; top: 5%; } .modal-body { max-height: 380px; } .modal-header { padding: 0 14px; } @media (max-width: 767px) { #marcPreview { margin: 0; width : auto; } }
102 </style>
103
104     [% IF ( opsearch ) %]
105         <style type="text/css">
106         #custom-doc { width:53em;*width:51.72em;min-width:689px; margin:auto; text-align:left; }
107         </style>
108         </head>
109         <body id="cat_z3950_auth_search" class="cat">
110         <div id="custom-doc" class="yui-t7">
111     [% ELSE %]
112         </head>
113         <body id="cat_z3950_search" class="cat" style="padding:.5em;">
114         <div>
115     [% END %]
116     <div id="bd">
117     [% IF ( opsearch ) %]
118         <h2>Z39.50 Authority search points</h2>
119         <form method="post" action="z3950_auth_search.pl" name="f" class="checkboxed">
120         <input type="hidden" name="op" id="op" value="do_search" />
121         <input type="hidden" name="authid" value="[% authid %]" />
122         <div class="yui-g">
123             <div class="yui-u first">
124                 <fieldset class="rows">
125                 <ol>
126                     <li><label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li>
127                     <li><label for="nameany">Name (any): </label> <input type="text" id="nameany" name="nameany" value="" /></li>
128                     <li><label for="authorany">Author (any): </label> <input type="text" id="authorany" name="authorany" value="" /></li>
129                     <li><label for="authorpersonal">Author (personal): </label> <input type="text" id="authorpersonal" name="authorpersonal" value="[% authorpersonal %]" /></li>
130                     <li><label for="authorcorp">Author (corporate): </label> <input type="text" id="authorcorp" name="authorcorp" value="[% authorcorp %]" /></li>
131                     <li><label for="authormeetingcon">Author (meeting/conference): </label> <input type="text" id="authormeetingcon" name="authormeetingcon" value="[% authormeetingcon %]" /></li>
132                 </ol>
133                 </fieldset>
134             </div>
135             <div class="yui-u">
136                 <fieldset class="rows">
137                 <ol>
138                     <li><label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
139                     <li><label for="subjectsubdiv">Subject sub-division: </label> <input type="text" id="subjectsubdiv" name="subjectsubdiv" value="" /></li>
140                     <li><label for="title">Title (any): </label> <input type="text" id="title"  name="title" value="[% title %]" /></li>
141                     <li><label for="uniformtitle">Title (uniform): </label> <input type="text" id="uniformtitle"  name="uniformtitle" value="[% uniformtitle %]" /></li>
142                 </ol>
143                 <p><a id="resetZ3950Search" href="#">Clear search form</a></p>
144                 </fieldset>
145             </div>
146             <div class="yui-g">
147                 <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>
148                 <div id="z3950_search_targets_auth">
149                 [% FOREACH serverloo IN serverloop %]
150                     <p>
151                     [% IF ( serverloo.checked ) %]
152                         <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" checked="checked" />
153                     [% ELSE %]
154                         <input type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" />
155                     [% END %]
156                     <label for="z3950_[% serverloo.id %]">[% serverloo.servername %]</label>
157                     </p>
158                 [% END %]
159                 </div>
160             </div>
161         <fieldset class="action"><input type="submit"  class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset>
162         </form>
163 [% ELSE %]
164     <h2>Results for Authority Records</h2>
165     [% IF ( breeding_loop ) %]
166     <table id="resultst">
167 <thead>    <tr>
168         <th>Server</th>
169         <th>Heading</th>
170         <th>Authority Type</th>
171         <th>MARC</th>
172         <!-- <th>Card</th> -->
173         <th>&nbsp;</th>
174     </tr></thead>
175     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
176         [% IF ( breeding_loo.breedingid ) %]
177         <tr id="row[% breeding_loo.breedingid %]">
178             <td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewMARC">Preview MARC</a> <a href="#" onclick="Import([% breeding_loo.breedingid %],'[% breeding_loo.heading_code %]','[% breeding_loo.authid %]'); return false">Import</a><a href="#" onclick="closemenu();return false;" title="Close this menu"> X </a></div> </td>
179             <td>[% breeding_loo.heading %]</td>
180             <td>[% breeding_loo.heading_code %]</td>
181             <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewMARC">MARC</a></td>
182             <!-- <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> -->
183             <td><a href="#" onclick="Import([% breeding_loo.breedingid %],'[% breeding_loo.heading_code %]','[% breeding_loo.authid %]'); return false">Import</a></td>
184         </tr>
185         [% END %]
186     [% END %]</tbody>
187 </table>
188
189     <div id="marcPreview" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
190         <div class="modal-header">
191             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
192             <h3 id="marcPreviewLabel">MARC preview</h3>
193         </div>
194         <div class="modal-body">
195             <div id="loading"> <img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> Loading </div>
196         </div>
197     </div>
198
199     <form method="post" action="z3950_auth_search.pl" id="page_form" name="page_form" class="checkboxed">
200         <input type="hidden" name="op" id="op" value="do_search" />
201         <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
202         <input type="hidden" id="nameany"  name="nameany" value="[% nameany %]" />
203         <input type="hidden" id="authorany"  name="authorany" value="[% authorany %]" />
204         <input type="hidden" id="authorcorp"  name="authorcorp" value="[% authorcorp %]" />
205         <input type="hidden" id="authorpersonal"  name="authorpersonal" value="[% authorpersonal %]" />
206         <input type="hidden" id="authormeetingcon"  name="authormeetingcon" value="[% authormeetingcon %]" />
207         <input type="hidden" id="title"  name="title" value="[% title %]" />
208         <input type="hidden" id="uniformtitle"  name="uniformtitle" value="[% uniformtitle %]" />
209         <input type="hidden" id="subject" name="subject" value="[% subject %]" />
210         <input type="hidden" id="subjectsubdiv" name="subjectsubdiv" value="[% subjectsubdiv %]" />
211         <input type="hidden" id="heading"  name="heading" value="[% heading %]" />
212         <input type="hidden" id="srchany" name="srchany" value="[% srchany %]" />
213         <input type="hidden" name="authid" value="[% authid %]" />
214
215         [% FOREACH server IN servers %]
216         <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
217         [% END %]
218
219         [% IF ( show_prevbutton ) %]
220             <input type="button" name="changepage_prev" value="Previous page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
221         [% END %]
222         Page [% current_page %] / [% total_pages %]
223         [% IF ( show_nextbutton ) %]
224             <input type="button" name="changepage_next" value="Next page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
225         [% END %]
226         <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" />
227     </form>
228
229 <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_auth_search.pl"><input type="hidden" name="authid" value="[% authid %]" /><input type="submit" value="Try another search"/></form></p>
230     [% ELSE %]
231         [% IF ( errconn ) %]
232             <div class="dialog alert">
233                 <ul>
234                 [% FOREACH errcon IN errconn %]
235                     [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li>
236                     [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li>[% END %]
237                 [% END %]
238                 </ul>
239             </div>
240          [% END %]
241    <div class="dialog message">Nothing found.</div>
242     <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_auth_search.pl"><input type="hidden" name="authid" value="[% authid %]" /><input type="submit" value="Try another search"/></form></p>
243     [% END %]
244
245 [% END %]
246 </div>
247 </div>
248
249 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
250
251 </body>
252 </html>