Bug 21318: Add control number as an option to search authority using Z39.50
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / z3950_auth_search.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 [% IF ( opsearch ) %]
6     <title>Koha &rsaquo; Z39.50 authority search points</title>
7 [% ELSE %]
8     <title>Koha &rsaquo; Z39.50 authority search results</title>
9     [% END %]
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% Asset.css("css/datatables.css") | $raw %]
12 <style type="text/css">
13     #marcPreview { width : 90%; top: 5%; } .modal-body { max-height: 380px; } .modal-header { padding: 0 14px; } @media (max-width: 767px) { #marcPreview { margin: 0; width : auto; } }
14 </style>
15
16 <body id="cat_z3950_auth_search" class="cat">
17     <div class="container-fluid">
18
19     [% IF ( opsearch ) %]
20         <h2>Z39.50 authority search points</h2>
21         <form method="post" action="z3950_auth_search.pl" name="f" class="checkboxed">
22         <input type="hidden" name="op" id="op" value="do_search" />
23         <input type="hidden" name="authid" value="[% authid | html %]" />
24             <div class="row">
25             <div class="col-xs-6">
26                 <fieldset class="rows">
27                 <ol>
28                     <li><label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li>
29                     <li><label for="controlnumber">Control number: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
30                     <li><label for="nameany">Name (any): </label> <input type="text" id="nameany" name="nameany" value="" /></li>
31                     <li><label for="authorany">Author (any): </label> <input type="text" id="authorany" name="authorany" value="" /></li>
32                     <li><label for="authorpersonal">Author (personal): </label> <input type="text" id="authorpersonal" name="authorpersonal" value="[% authorpersonal | html %]" /></li>
33                     <li><label for="authorcorp">Author (corporate): </label> <input type="text" id="authorcorp" name="authorcorp" value="[% authorcorp | html %]" /></li>
34                     <li><label for="authormeetingcon">Author (meeting / conference): </label> <input type="text" id="authormeetingcon" name="authormeetingcon" value="[% authormeetingcon | html %]" /></li>
35                 </ol>
36                 </fieldset>
37             </div>
38             <div class="col-xs-6">
39                 <div class="row">
40                     <fieldset class="rows">
41                     <ol>
42                         <li><label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
43                         <li><label for="subjectsubdiv">Subject sub-division: </label> <input type="text" id="subjectsubdiv" name="subjectsubdiv" value="" /></li>
44                         <li><label for="title">Title (any): </label> <input type="text" id="title"  name="title" value="[% title | html %]" /></li>
45                         <li><label for="uniformtitle">Title (uniform): </label> <input type="text" id="uniformtitle"  name="uniformtitle" value="[% uniformtitle | html %]" /></li>
46                         <li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li>
47                     </ol>
48                     </fieldset>
49                 </div>
50
51                 <div class="row">
52                     <h2>Search targets</h2>
53                     <div id="z3950_search_targets_auth">
54                         <span class="z3950checks"><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></span>
55                     [% FOREACH serverloo IN serverloop %]
56                         <p>
57                         [% IF ( serverloo.checked ) %]
58                             <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" checked="checked" />
59                         [% ELSE %]
60                             <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" />
61                         [% END %]
62                         <label for="z3950_[% serverloo.id | html %]">[% serverloo.servername | html %]</label>
63                         </p>
64                     [% END %]
65                     </div>
66                 </div>
67             </div>
68             </div>
69             <nav class="navbar navbar-default navbar-fixed-bottom">
70                 <div class="container-fluid">
71                      <fieldset class="action"><input type="submit"  class="submit" value="Search" /> <a class="cancel close" href="#">Cancel</a></fieldset>
72                 </div>
73             </nav>
74         </form>
75 [% ELSE %]
76     <h2>Results for authority records</h2>
77     [% IF ( breeding_loop ) %]
78     <table id="resultst">
79 <thead>    <tr>
80         <th>Server</th>
81         <th>Heading</th>
82         <th>Authority Type</th>
83         <th>Actions</th>
84     </tr></thead>
85     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
86         [% IF ( breeding_loo.breedingid ) %]
87         <tr id="row[% breeding_loo.breedingid | html %]">
88             <td>[% breeding_loo.server | html %]</td>
89             <td>[% breeding_loo.heading | html %]</td>
90             <td>[% breeding_loo.heading_code | html %]</td>
91             <td class="actions">
92                 <div class="dropdown">
93                     <a class="btn btn-default btn-xs dropdown-toggle" id="cataloguesearchactions[% breeding_loo.breedingid | html %]" role="button" data-toggle="dropdown" href="#">
94                       Actions <b class="caret"></b>
95                     </a>
96                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="cataloguesearchactions[% breeding_loo.breedingid | html %]">
97                         <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid | html %]" class="previewMARC"><i class="fa fa-eye"></i> MARC preview</a></li>
98                         <li><a href="#" class="import_record" data-breedingid="[% breeding_loo.breedingid | html %]" data-heading_code="[% breeding_loo.heading_code | html %]" data-authid="[% breeding_loo.authid | html %]"><i class="fa fa-download"></i> Import</a></li>
99                     </ul>
100                 </div>
101             </td>
102         </tr>
103         [% END %]
104     [% END %]</tbody>
105 </table>
106
107     <div id="marcPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
108         <div class="modal-dialog">
109         <div class="modal-content">
110         <div class="modal-header">
111             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
112             <h3 id="marcPreviewLabel">MARC preview</h3>
113         </div>
114         <div class="modal-body">
115             <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
116         </div>
117         </div>
118         </div>
119     </div>
120
121     <form method="post" action="z3950_auth_search.pl" id="page_form" name="page_form" class="checkboxed">
122         <input type="hidden" name="op" id="op" value="do_search" />
123         <input type="hidden" name="current_page" id="current_page" value="[% current_page | html %]" />
124         <input type="hidden" id="nameany"  name="nameany" value="[% nameany | html %]" />
125         <input type="hidden" id="authorany"  name="authorany" value="[% authorany | html %]" />
126         <input type="hidden" id="authorcorp"  name="authorcorp" value="[% authorcorp | html %]" />
127         <input type="hidden" id="authorpersonal"  name="authorpersonal" value="[% authorpersonal | html %]" />
128         <input type="hidden" id="authormeetingcon"  name="authormeetingcon" value="[% authormeetingcon | html %]" />
129         <input type="hidden" id="title"  name="title" value="[% title | html %]" />
130         <input type="hidden" id="uniformtitle"  name="uniformtitle" value="[% uniformtitle | html %]" />
131         <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
132         <input type="hidden" id="subjectsubdiv" name="subjectsubdiv" value="[% subjectsubdiv | html %]" />
133         <input type="hidden" id="heading"  name="heading" value="[% heading | html %]" />
134         <input type="hidden" id="srchany" name="srchany" value="[% srchany | html %]" />
135         <input type="hidden" name="authid" value="[% authid | html %]" />
136
137         [% FOREACH server IN servers %]
138         <input type="hidden" name="id" id="z3950_[% server.id | html %]" value="[% server.id | html %]" />
139         [% END %]
140
141         [% IF ( show_prevbutton ) %]
142             <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page | html %]" />
143         [% END %]
144         Page [% current_page | html %] / [% total_pages | html %]
145         [% IF ( show_nextbutton ) %]
146             <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page | html %]" />
147         [% END %]
148         <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page | html %]" size="4" /><input type="submit" name="changepage_goto" value="Go" />
149     </form>
150
151 <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_auth_search.pl"><input type="hidden" name="authid" value="[% authid | html %]" /><input type="submit" value="Try another search"/></form></p>
152     [% ELSE %]
153         [% IF ( errconn ) %]
154             <div class="dialog alert">
155                 <ul>
156                 [% FOREACH errcon IN errconn %]
157                     [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server | html %]</li>
158                     [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server | html %]</li>[% END %]
159                 [% END %]
160                 </ul>
161             </div>
162          [% END %]
163    <div class="dialog message">Nothing found.</div>
164     <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_auth_search.pl"><input type="hidden" name="authid" value="[% authid | html %]" /><input type="submit" value="Try another search"/></form></p>
165     [% END %]
166
167 [% END %]
168
169 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending | html %] servers to search</h3>[% END %]
170
171 [% MACRO jsinclude BLOCK %]
172     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
173     [% INCLUDE 'datatables.inc' %]
174     <script type="text/javascript">
175         $(document).ready(function(){
176
177             $(".dropdown").on("hidden.bs.dropdown", function(){
178                 // Reset menu styles so that a click on the
179                 // original dropdown button toggle works correctly
180                 $(".dropdown").css("position","absolute");
181                 $(".dropdown-menu").css({
182                     "top" : "100%",
183                     "left" : "auto",
184                     "right" : 0
185                 });
186             });
187
188             $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
189                 "sDom": 't',
190                 "aoColumnDefs": [
191                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
192                 ],
193                 "aaSorting": [[ 1, "asc" ]],
194                 "bPaginate": false
195             }));
196
197             /* Display actions menu anywhere the table is clicked */
198             $("td").click(function(event){
199                 var tgt = $(event.target);
200                 var row = $(this).parent();
201                 var rowid = row.attr("id");
202                 $("tr").removeClass("highlighted-row");
203                 row.addClass("highlighted-row");
204                 $(".dropdown").removeClass("open");
205                 if(tgt.is("a")||tgt.is(":nth-child(8)")){
206                     // Don't show inline links for cells containing links of their own.
207                 } else {
208                     event.stopPropagation();
209                     var dropdown = $(".dropdown", row);
210                     dropdown.addClass("open");
211                     var position = $(this).offset();
212                     var top = position.top + 5;
213                     var left = position.left + 5;
214                     dropdown.css("position","unset");
215                     $(".dropdown-menu", row).css({
216                         "top" : top,
217                         "left" : left,
218                         "right" : "unset"
219                     });
220
221                }
222             });
223
224         });
225     </script>
226     [% INCLUDE 'z3950_search.inc' %]
227     [% Asset.js("js/z3950_search.js") | $raw %]
228 [% END %]
229
230 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]