Bug 21526: uri escape TT variables when used in 'a href'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / serials_stats.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Reports &rsaquo; Serials subscriptions stats</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 <style>
10         .sql {display: none;}
11 </style>
12 [% Asset.css("css/datatables.css") | $raw %]
13 </head>
14
15 <body id="rep_serials_stats" class="rep">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'cat-search.inc' %]
18
19 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> &rsaquo; Serials subscriptions stats</div>
20
21 <div class="main container-fluid">
22     <div class="row">
23         <div class="col-sm-10 col-sm-push-2">
24             <main>
25
26         <h1>Serials subscriptions</h1>
27 [% IF ( do_it ) %]
28         <table id="resulttable">
29                 <thead>
30                         <tr>
31                                 <th>Vendor</th>
32                                 <th>Title</th>
33                                 <th>Subscription id</th>
34                                 <th>Branch</th>
35                 <th>Call number</th>
36                 <th>Subscription begin</th>
37                 <th>Subscription end</th>
38                 <th>Expired? / Closed?</th>
39                         </tr>
40                 </thead>
41                 <tbody>
42                         <tr>
43                                 [% FOREACH data IN datas %]
44                     <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% data.aqbooksellerid | uri %]">[% data.name | html %]</a></td>
45                     <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% data.subscriptionid | uri %]">[% data.title | html %]</a></td>
46                                         <td>[% data.subscriptionid | html %]</td>
47                     <td>[% Branches.GetName( data.branchcode ) | html %]</td>
48                                         <td>[% data.callnumber | html %]</td>
49                     <td><span title="[% data.startdate | html %]">[% data.startdate | $KohaDates %]</span></td>
50                     <td><span title="[% data.enddate | html %]">[% data.enddate | $KohaDates %]</span></td>
51                     <td>
52                         [% IF data.closed %]
53                             Closed
54                         [% ELSIF data.expired %]
55                             Expired
56                         [% END %]
57                     </td>
58                                 </tr>
59                                 [% END %]
60                         </tr>
61                 </tbody>
62         </table>
63
64 [% ELSE %]
65         <form method="post" action="/cgi-bin/koha/reports/serials_stats.pl">
66
67         <fieldset class="rows">
68                 <ol>
69                         <li>
70
71                                 <label for="bookseller">
72                                         Vendor:
73                             </label>
74                                 <select name="bookseller" id="bookseller">
75                     <option value="">Any vendor</option>
76                                 [% FOREACH bookseller IN booksellers %]
77                                                 <option value="[% bookseller.aqbooksellerid | html %]">[% bookseller.name | html %]</option>
78                                         [% END %]
79                             </select>
80                         </li><li>
81                 <label for="branchcode">
82                                         Library:
83                         </label>
84                         <select name="branchcode"  id="branchcode">
85                                 <option value="">Any library</option>
86                 [% PROCESS options_for_libraries libraries => Branches.all() %]
87                         </select>
88
89                     </li>
90                     <li>
91                         <label for="expired">Include expired subscriptions: </label>
92                 <input type="checkbox" name="expired" id="expired" />
93                     </li>
94                 </ol>
95         </fieldset>
96
97
98         <fieldset class="rows">
99         <legend>Output</legend>
100     <ol>
101         <li>
102             <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
103         </li>
104         <li>
105             <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
106             <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
107             <label class="inline" for="MIME">Into an application:</label>
108             <select name="MIME" id="MIME" size="1">
109             [% FOREACH value IN CGIextChoice %]
110                 <option value="[% value | html %]">[% value | html %]</option>
111             [% END %]
112             </select>
113             <select name="sep" id="sep" size="1">
114             [% FOREACH value IN CGIsepChoice.values.sort() %]
115               [% IF ( value == CGIsepChoice.default ) %]
116                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
117               [% ELSE %]
118                 <option value="[% value | html %]">[% value | html %]</option>
119               [% END %]
120             [% END %]
121             </select>
122         </li>
123     </ol>
124         </fieldset>
125
126         <fieldset class="action">
127         <input type="submit" value="Submit" />
128         <input type="hidden" name="report_name" value="[% report_name | html %]" />
129         <input type="hidden" name="do_it" value="1" />
130         </fieldset>
131         </form>
132 [% END %]
133
134             </main>
135         </div> <!-- /.col-sm-10.col-sm-push-2 -->
136
137         <div class="col-sm-2 col-sm-pull-10">
138             <aside>
139                 [% INCLUDE 'reports-menu.inc' %]
140             </aside>
141         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
142      </div> <!-- /.row -->
143
144 [% MACRO jsinclude BLOCK %]
145 [% INCLUDE 'datatables.inc' %]
146     <script>
147         $(document).ready(function() {
148             $("#resulttable").dataTable($.extend(true, {}, dataTablesDefaults, {
149                 "sDom": 't',
150                 "bPaginate": false,
151                 "aoColumns": [
152                     null,{ "sType": "anti-the" },null,null,null,{ "sType": "title-string" },{ "sType": "title-string" },null
153                 ],
154             }));
155         });
156     </script>
157 [% END %]
158
159 [% INCLUDE 'intranet-bottom.inc' %]