Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / z3950_search.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]Order from external source &rsaquo; Search results[% END %]</title>
6 [% Asset.css("css/datatables.css") | $raw %]
7 [% INCLUDE 'doc-head-close.inc' %]
8 <style type="text/css">
9 .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;}
10 .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;}
11 .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;}
12 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent !important; } #dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }
13 </style>
14 </head>
15
16 <body id="acq_z3950_search" class="acq">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'acquisitions-search.inc' %]
19
20 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% name | html %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | uri %]">Basket [% basketno | html %]</a> &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]<a href="/cgi-bin/koha/acqui/z3950_search.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Order from external source</a> &rsaquo; Search results[% END %]</div>
21
22 <div class="main container-fluid">
23     <form method="post" action="z3950_search.pl" name="f" class="checkboxed">
24     <div class="row">
25       [% IF ( opsearch ) %]
26     <div class="col-sm-6">
27     <h2>Order from external source</h2>
28     <input type="hidden" name="op" id="op" value="do_search" />
29             <fieldset class="rows">
30          <ol>
31              <li><label for="searchtitle">Title: </label> <input type="text" id="searchtitle"  name="title" value="[% title | html %]" class="focus" /></li>
32              <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn | html %]" /></li>
33              <li><label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
34              <li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
35              <li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author | html %]" /></li>
36              <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn | html %]" /></li>
37              <li><label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
38              <li><label for="srchany">Keyword (any): </label> <input type="text" id="srchany" name="srchany" value="" /></li>
39              <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li>
40              <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li>
41              <li><label for="frameworkcode" >Select MARC framework:</label>
42              <select id="frameworkcode" name="frameworkcode" >
43              <option value="">Default</option>
44                  [% FOREACH framework IN frameworks %]
45                     <option value="[% framework.frameworkcode | html %]" >[% framework.frameworktext | html %]</option>
46                  [% END %]
47               </select>
48               </li>
49               <li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li>
50          </ol>
51     </fieldset>
52     <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
53     <input type="hidden" name="basketno" value="[% basketno | html %]" />
54     <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
55             </div>
56 <div class="col-sm-6">
57 <h2>Search targets</h2>
58     <div id="z3950_search_targets_acq">
59         <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>
60     [% FOREACH serverloo IN serverloop %]
61         <p>
62             [% IF ( serverloo.checked ) %]
63                 <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" checked="checked" />
64             [% ELSE %]
65                 <input type="checkbox" name="id" id="z3950_[% serverloo.id | html %]" value="[% serverloo.id | html %]" />
66             [% END %]
67             <label for="z3950_[% serverloo.id | html %]">[% serverloo.servername | html %] [[% serverloo.host | html %]]</label>
68
69         </p>
70     [% END %]
71     </div>
72   </div>
73 </div>
74
75 <div class="row">
76     <div class="col-md-12">
77     <fieldset class="action"><input type="submit"  class="submit" value="Search" /> <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Cancel</a></fieldset>
78 </div>
79 </form>
80 </div>
81
82
83 [% ELSE %]
84     <div class="col-md-12">
85     <h2>Search results</h2>
86
87     <p>You searched for:
88         [% IF ( title ) %]<em>Title: </em><span class=term>[% title | html %]</span> [% END %]
89         [% IF ( author ) %]<em>Author: </em><span class=term>[% author | html %]</span> [% END %]
90         [% IF ( isbn ) %]<em>ISBN: </em><span class=term>[% isbn | html %]</span> [% END %]
91         [% IF ( issn ) %]<em>ISSN: </em><span class=term>[% issn | html %]</span> [% END %]
92         [% IF ( lccall ) %]<em>LC call number: </em><span class=term>[% lccall | html %]</span> [% END %]
93         [% IF ( subject ) %]<em>Subject heading: </em><span class=term>[% subject | html %]</span> [% END %]
94         [% IF ( controlnumber ) %]<em>Control no: </em><span class=term>[% controlnumber | html %]</span> [% END %]
95         [% IF ( dewey ) %]<em>Dewey: </em><span class=term>[% dewey | html %]</span> [%END %]
96     </p>
97
98     [% IF ( breeding_loop ) %]
99     <table id="resultst">
100 <thead>    <tr>
101         <th>Server</th>
102         <th>Title</th>
103         <th>Author</th>
104         <th>ISBN</th>
105         <th>LCCN</th>
106         <th>Preview</th>
107                 <th>&nbsp;</th>
108     </tr></thead>
109     <tbody>[% FOREACH breeding_loo IN breeding_loop %]
110         [% IF ( breeding_loo.breedingid ) %]
111
112         <tr>
113             <td>[% breeding_loo.server | html %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid | html %]" class="previewData">Preview MARC</a> <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid | html %]" class="previewData">Preview card</a> <a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode | uri  %]&amp;breedingid=[% breeding_loo.breedingid | html %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Order</a> <a href="#" id="closemenu" title="Close this menu"> X </a></div></td>
114             <td>[% breeding_loo.title | html %]</td>
115             <td>[% breeding_loo.author | html %]</td>
116             <td>[% breeding_loo.isbn | html %]</td>
117             <td>[% breeding_loo.lccn | html %]</td>
118             <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid | html %]" title="MARC" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% breeding_loo.breedingid | html %]" title="Card" class="previewData">Card</a></td>
119             <td><a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode | uri %]&amp;breedingid=[% breeding_loo.breedingid | html %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]">Order</a></td>
120
121         </tr>
122         [% END %]
123     [% END %]</tbody>
124 </table>
125
126
127     <div id="dataPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
128         <div class="modal-dialog">
129         <div class="modal-content">
130         <div class="modal-header">
131             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
132             <h3 id="dataPreviewLabel">MARC preview</h3>
133         </div>
134         <div class="modal-body">
135             <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
136         </div>
137         <div class="modal-footer">
138             <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
139         </div>
140         </div>
141         </div>
142     </div>
143
144     <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
145         <input type="hidden" name="op" id="op" value="do_search" />
146         <input type="hidden" name="current_page" id="current_page" value="[% current_page | html %]" />
147         <input type="hidden" id="searchtitle"  name="title" value="[% title | html %]" />
148         <input type="hidden" id="isbn" name="isbn" value="[% isbn | html %]" />
149         <input type="hidden" id="lccall" name="lccall" value="[% lccall | html %]" />
150         <input type="hidden" id="author" name="author" value="[% author | html %]" />
151         <input type="hidden" id="subject" name="subject" value="[% subject | html %]" />
152         <input type="hidden" id="dewey" name="dewey" value="[% dewey | html %]" />
153         <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
154         <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
155         <input type="hidden" name="controlnumber" value="[% controlnumber | html %]" />
156         <input type="hidden" name="basketno" value="[% basketno | html %]" />
157         <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
158
159         [% FOREACH server IN servers %]
160         <input type="hidden" name="id" id="z3950_[% server.id | html %]" value="[% server.id | html %]" />
161         [% END %]
162
163         [% IF ( show_prevbutton ) %]
164             <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page | html %]" />
165         [% END %]
166         Page [% current_page | html %] / [% total_pages | html %]
167         [% IF ( show_nextbutton ) %]
168             <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page | html %]" />
169         [% END %]
170         <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" />
171     </form>
172
173     [% ELSE %]
174         [% IF ( emptyserverlist ) %]
175             <div class="dialog alert">You didn't select any external target.</div>
176         [% ELSE %]
177             [% IF ( errconn ) %]
178                 <div class="dialog alert">
179                     <ul>
180                     [% FOREACH errcon IN errconn %]
181                         <li>Connection failed to [% errcon.server | html %]</li>
182                     [% END %]
183                     </ul>
184                 </div>
185             [% END %]
186         [% END %]
187         <div class="dialog message">Nothing found. <a href="javascript: history.back()">Try another search</a>.</div>
188     [% END %]
189 </div>
190
191 [% END %]
192
193 [% IF ( numberpending ) %]<h3 align="center">Still [% numberpending | html %] servers to search</h3>[% END %]
194
195 [% MACRO jsinclude BLOCK %]
196     [% Asset.js("js/acquisitions-menu.js") | $raw %]
197     [% INCLUDE 'datatables.inc' %]
198     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
199     <script type="text/javascript">
200         $(document).ready(function(){
201             var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
202                 "aoColumnDefs": [
203                     { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
204                     { "aTargets": [ 1 ], "sType": "nsb-nse" },
205                 ],
206                 "aaSorting": [[ 1, "asc" ]],
207                 "bPaginate": false
208             }));
209             /* Inline edit/delete links */
210             $("td").click(function(event){
211                 var $tgt = $(event.target);
212                 var row = $(this).parent();
213                 $(".linktools").hide();
214                 $("tr").removeClass("selected");
215                 row.addClass("selected");
216                 if($tgt.is("a")||$tgt.is(":nth-child(6)")||$tgt.is(":nth-child(7)")){
217                     //Don't show inline links for cells containing links of their own.
218                 } else {
219                     var position = $(this).offset();
220                     var top = position.top+5;
221                     var left = position.left+5;
222                     $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left);
223                 }
224             });
225         });
226     </script>
227     [% INCLUDE 'z3950_search.inc' %]
228     [% Asset.js("js/z3950_search.js") | $raw %]
229 [% END %]
230
231 [% INCLUDE 'intranet-bottom.inc' %]