Bug 24156: move ColumnsSettings to TablesSettings
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / z3950_search.tt
blob78e31de6bcc6e09265a26e1030f50c0dc5d494b8
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% USE Koha %]
5 [% USE TablesSettings %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Z39.50/SRU search results</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 <style>
10     #dataPreview { width : 90%; top: 5%; } .modal-body { max-height: 380px; } .modal-header { padding: 0 14px; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }
11 </style>
12 </head>
14 <body id="cat_z3950_search" class="cat">
15     <div class="container-fluid">
16         [% IF ( opsearch ) %]
17             <h2>Z39.50/SRU search</h2>
18             <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
19                 <div class="row">
20                     <div class="col-xs-6">
21                         <input type="hidden" name="op" id="op" value="do_search" />
22                         <fieldset class="rows">
23                             <ol>
24                                 <li>
25                                     <label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" class="focus" />
26                                 </li>
27                                 <li>
28                                     <label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn | html %]" /></li>
29                                 <li>
30                                     <label for="title">Title: </label> <input type="text" id="title"  name="title" value="[% title | html %]" /></li>
31                                 <li>
32                                     <label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author | html %]" /></li>
33                                 <li>
34                                     <label for="publicationyear">Publication year: </label> <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear | html %]" /></li>
35                                 <li>
36                                     <label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
37                                 <li>
38                                     <label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li>
39                                 <li>
40                                     <label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
41                                 <li>
42                                     <label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
43                                 <li>
44                                     <label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
45                                 <li>
46                                     <label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li>
47                                 <li>
48                                     <a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a>
49                                 </li>
50                             </ol>
51                             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
52                             <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
53                         </fieldset> <!-- /.rows -->
54                     </div> <!-- /.col-xs-6 -->
56                     <div class="col-xs-6">
57                         <h2>Search targets</h2>
58                         <div id="z3950_search_targets">
59                             <span class="z3950checks">
60                                 <span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> |
61                                 <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span>
62                             </span>
63                             [% FOREACH serverloo IN serverloop %]
64                                 <p>
65                                     [% IF ( serverloo.checked ) %]
66                                         <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" checked="checked" />
67                                     [% ELSE %]
68                                         <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" />
69                                     [% END %]
70                                     <label for="z3950_[% serverloo.id | html %]">[% serverloo.servername | html %]</label>
71                                 </p>
72                             [% END %]
73                         </div> <!-- /#z3950_search_targets -->
74                     </div> <!-- /.col-xs-6 -->
75                 </div> <!-- /.row -->
77                 <nav class="navbar navbar-default navbar-fixed-bottom">
78                     <div class="container-fluid">
79                         <fieldset class="action"><input type="submit"  class="submit" value="Search" /> <a class="cancel close" href="#">Cancel</a></fieldset>
80                     </div>
81                 </nav>
82             </form> <!-- /.checkboxed -->
84         [% ELSE # IF opsearch %]
86             <div class="row">
87                 <div class="col-xs-12">
88                     <h2>Results</h2>
89                     <p>
90                         You searched for:
91                         [% IF ( title ) %]<em>Title: </em><span class="term">[% title | html %]</span> [% END %]
92                         [% IF ( author ) %]<em>Author: </em><span class="term">[% author | html %]</span> [% END %]
93                         [% IF ( publicationyear ) %]<em>Publication year: </em><span class="term">[% publicationyear | html %]</span> [% END %]
94                         [% IF ( isbn ) %]<em>ISBN: </em><span class="term">[% isbn | html %]</span> [% END %]
95                         [% IF ( issn ) %]<em>ISSN: </em><span class="term">[% issn | html %]</span> [% END %]
96                         [% IF ( lccall ) %]<em>LC call number: </em><span class="term">[% lccall | html %]</span> [% END %]
97                         [% IF ( subject ) %]<em>Subject heading: </em><span class="term">[% subject | html %]</span> [% END %]
98                         [% IF ( controlnumber ) %]<em>Control no: </em><span class="term">[% controlnumber | html %]</span> [% END %]
99                         [% IF ( dewey ) %]<em>Dewey: </em><span class="term">[% dewey | html %]</span> [%END %]
100                         [% IF ( srchany ) %]<em>Raw (any): </em><span class="term">[% srchany | html %]</span> [% END %]
101                         [% IF ( stdid ) %]<em>Standard ID: </em><span class="term">[% stdid | html %]</span> [% END %]
102                     </p>
103                     [% IF ( errconn ) %]
104                         <div class="dialog alert">
105                             <ul>
106                             [% FOREACH errcon IN errconn %]
107                                 [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server | html %]</li>
108                                 [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server | html %]</li>
109                                 [% ELSIF errcon.error.match( '^XSLTH' ) %]<li>[% errcon.server | html %] record [% errcon.seq | html %]: [% PROCESS 'xslt-handler.inc' code=errcon.error %]</li>
110                                 [% ELSE %]<li>[% errcon.server | html %] record [% errcon.seq | html %]: [% errcon.error | html %]</li>
111                                 [% END %]
112                             [% END %]
113                             </ul>
114                         </div>
115                     [% END %]
117                     [% IF ( breeding_loop ) %]
118                         <table id="resultst">
119                             <thead>
120                                 <tr>
121                                     <th>Server</th>
122                                     <th>Title</th>
123                                     <th>Author</th>
124                                     <th>Date</th>
125                                     <th>Edition</th>
126                                     <th>ISBN</th>
127                                     <th>LCCN</th>
128                                     [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
129                                         <th>Additional fields</th>
130                                     [% END %]
131                                     <th class="noExport">Actions</th>
132                                 </tr>
133                             </thead>
134                             <tbody>
135                                 [% FOREACH breeding_loo IN breeding_loop %]
136                                     [% IF ( breeding_loo.breedingid ) %]
137                                         <tr id="row[% breeding_loo.breedingid | html %]">
138                                             <td>[% breeding_loo.server | html %]</td>
139                                             <td>[% breeding_loo.title | html %]</td>
140                                             <td>[% breeding_loo.author | html %]</td>
141                                             <td>[% breeding_loo.date | html %]</td>
142                                             <td>[% breeding_loo.edition | html %]</td>
143                                             <td>[% breeding_loo.isbn | html %]</td>
144                                             <td>[% breeding_loo.lccn | html %]</td>
145                                             [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
146                                                 <td>
147                                                    <dl>
148                                                       [% FOREACH addnumberfield IN breeding_loo.addnumberfields %]
149                                                         [% FOREACH string IN breeding_loo.$addnumberfield %]
150                                                             <dt>[% addnumberfield | html %]:</dt>
151                                                             <dd>[% string | html %]</dd>
152                                                         [% END %]
153                                                       [% END %]
154                                                    </dl>
155                                                 </td>
156                                             [% END %]
157                                             <td class="actions">
158                                                 <div class="btn-group dropup">
159                                                     <a class="btn btn-default btn-xs dropdown-toggle" id="cataloguesearchactions[% breeding_loo.breedingid | html %]" role="button" data-toggle="dropdown" href="#">
160                                                       Actions <b class="caret"></b>
161                                                     </a>
162                                                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="cataloguesearchactions[% breeding_loo.breedingid | html %]">
163                                                         <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid | uri %]" title="MARC" class="previewData"><i class="fa fa-eye"></i> MARC preview</a></li>
164                                                         <li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid | uri %]" title="Card" class="previewData"><i class="fa fa-eye"></i> Card preview</a></li>
165                                                         <li><a href="#" class="import_record" data-breedingid="[% breeding_loo.breedingid | html %]" data-biblionumber="[% breeding_loo.biblionumber | html %]" data-frameworkcode="[% frameworkcode | uri %]"><i class="fa fa-download"></i> Import</a></li>
166                                                     </ul>
167                                                 </div>
168                                             </td>
169                                         </tr>
170                                     [% END %]
171                                 [% END %]
172                             </tbody>
173                         </table> <!-- /#resultst -->
175                         <div id="dataPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
176                             <div class="modal-dialog">
177                                 <div class="modal-content">
178                                     <div class="modal-header">
179                                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
180                                         <h3 id="dataPreviewLabel">Preview</h3>
181                                     </div>
182                                     <div class="modal-body">
183                                         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
184                                     </div>
185                                 </div>
186                             </div>
187                         </div>
189                         <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
190                             <input type="hidden" name="op" id="op" value="do_search" />
191                             <input type="hidden" name="current_page" id="current_page" value="[% current_page | html %]" />
192                             <input type="hidden" id="title"  name="title" value="[% title | html %]" />
193                             <input type="hidden" id="isbn" name="isbn" value="[% isbn | html %]" />
194                             <input type="hidden" id="lccall" name="lccall" value="[% lccall | html %]" />
195                             <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber | html %]" />
196                             <input type="hidden" id="srchany" name="srchany" value="[% srchany | html %]" />
197                             <input type="hidden" id="author" name="author" value="[% author | html %]" />
198                             <input type="hidden" id="publicationyear" name="publicationyear" value="[% publicationyear | html %]" />
199                             <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
200                             <input type="hidden" id="dewey" name="dewey" value="[% dewey | html %]" />
201                             <input type="hidden" id="stdid" name="stdid" value="[% stdid | html %]" />
202                             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
203                             <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
205                             [% FOREACH server IN servers %]
206                                 <input type="hidden" name="id" id="z3950_[% server.id | html %]" value="[% server.id | html %]" />
207                             [% END %]
209                             [% IF ( show_prevbutton ) %]
210                                 <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page | html %]" />
211                             [% END %]
212                             <span id="result_pagenumbers">Showing page [% current_page | html %] of [% total_pages | html %]</span>
213                             [% IF ( show_nextbutton ) %]
214                                 <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page | html %]" />
215                             [% END %]
216                             <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page | html %]" size="4" type="text" /><input type="submit" name="changepage_goto" value="Go" />
217                         </form> <!-- /#page_form -->
219                     [% ELSE %]
220                         <div class="dialog message">Nothing found.</div>
221                     [% END  # /IF breeding_loop %]
223                     <form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl">
224                         <p>
225                             <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
226                             <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]"/>
227                             <input type="submit" value="Try another search"/>
228                         </p>
229                     </form>
230                 </div> <!-- /.col-xs-12 -->
231             </div> <!-- /.row -->
232         [% END # /IF opsearch %]
234         [% IF ( numberpending ) %]
235             <h3 align="center">Still [% numberpending | html %] servers to search</h3>
236         [% END %]
238 [% MACRO jsinclude BLOCK %]
239     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
240     [% Asset.js("js/z3950_search.js") | $raw %]
241     [% INCLUDE 'datatables.inc' %]
242     [% INCLUDE 'columns_settings.inc' %]
243     <script>
244         $(document).ready(function(){
245             var columns_settings = [% TablesSettings.GetColumns( 'cataloguing', 'z3950_search', 'resultst', 'json' ) | $raw %];
246             var thetable = KohaTable("resultst", {
247                 "aoColumnDefs": [
248                     { "targets": [ "NoSort" ],"sortable": false,"searchable": false },
249                     { "aTargets": [ 1 ], "sType": "nsb-nse" },
250                 ],
251                 "aaSorting": [[ 1, "asc" ]],
252                 "bPaginate": false
253             }, columns_settings );
254         });
256         function columnsInit(){
257             $(".dataTables_info").text( $("#result_pagenumbers").text() );
258             $("#result_pagenumbers").hide();
259         }
260     </script>
261     [% INCLUDE 'z3950_search.inc' %]
262 [% END %]
264 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]