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