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