Bug 21526: uri escape TT variables when used in 'a href'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reports / orders_by_budget.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Price %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Reports &rsaquo; Orders by fund</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9 <body id="rep_orders_by_budget" class="rep">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'cat-search.inc' %]
12
13 [% Asset.css("css/datatables.css") | $raw %]
14 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>[% IF ( get_orders ) %] &rsaquo; <a href="/cgi-bin/koha/reports/orders_by_fund.pl">Orders by fund</a> &rsaquo; Results[% ELSE %] &rsaquo; Orders by fund[% END %]</div>
15
16 <div class="main container-fluid">
17     <div class="row">
18         <div class="col-sm-10 col-sm-push-2">
19             <main>
20
21
22 [% IF ( current_budget_name ) %]<h1>Orders for fund '[% current_budget_name | html %]'</h1>
23 [% ELSE %]<h1>Orders by fund</h1>
24 [% END %]
25
26 [% IF ( get_orders ) %]
27     <div class="results">
28         [% IF ( total ) %]
29             Orders found: [% total | html %]
30         [% ELSE %]
31             No order found
32         [% END %]
33     </div>
34
35     [% IF ( ordersloop ) %]<table id="funds">
36         <thead>
37         <tr>
38         <th>Fund</th>
39         <th>Basket</th>
40         <th>Basket name</th>
41         <th>Basket by</th>
42         <th>Title</th>
43         <th>Currency</th>
44         <th>List price</th>
45         <th>RRP</th>
46         <th>Budgeted cost</th>
47         <th>Quantity</th>
48         <th>Total RRP</th>
49         <th>Total cost</th>
50         <th>Entry date</th>
51         <th>Date received</th>
52         <th>Internal note</th>
53         <th>Vendor note</th>
54         </tr>
55         </thead>
56         <tbody>
57         [% FOREACH ordersloo IN ordersloop %]
58             [% UNLESS ( loop.odd ) %]<tr class="highlight">
59             [% ELSE %] <tr>
60             [% END %]
61             <td>[% ordersloo.budget_name | html %]</td>
62             <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% ordersloo.basketno | uri %]"> [% ordersloo.basketno | html %]</a></td>
63             <td>[% ordersloo.basketname | html %]</td>
64             <td>[% ordersloo.authorisedbyname | html %]</td>
65             <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ordersloo.biblionumber | uri %]"> [% ordersloo.title | html %]</a></td>
66             <td>[% ordersloo.currency | html %]</td>
67             <td>[% ordersloo.listprice | $Price %]</td>
68             <td>[% ordersloo.rrp | $Price %]</td>
69             <td>[% ordersloo.ecost | $Price %]</td>
70             <td>[% ordersloo.quantity | html %]</td>
71             <td>[% ordersloo.total_rrp | $Price %]</td>
72             <td>[% ordersloo.total_ecost | $Price %]</td>
73             <td>[% ordersloo.entrydate | html %]</td>
74             <td>[% ordersloo.datereceived | html %]</td>
75             <td>[% ordersloo.order_internalnote | html %]</td>
76             <td>[% ordersloo.order_vendornote | html %]</td>
77             </tr>
78         [% END %]
79         </tbody>
80         <tfoot><tr><th>TOTAL</th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th>[% total_quantity | html %]</th><th>[% total_rrp | $Price %]</th><th>[% total_ecost | $Price %]</th><th></th><th></th><th></th><th></th></tr></tfoot>
81         </table>
82     [% END %]
83     [% ELSE %]
84         <form name="f" action="/cgi-bin/koha/reports/orders_by_fund.pl" method="post">
85         <fieldset class="rows">
86         <legend>Filters</legend>
87         <ol><li><label for="budgetfilter">Fund: </label>
88         <select name="budgetfilter" id="budgetfilter">
89             <option value="">All funds</option>
90             <option value="activebudgets">All active funds</option>
91         [% FOREACH budgetsloo IN budgetsloop %]
92             [% IF ( budgetsloo.selected ) %]
93                 <option value="[% budgetsloo.value | html %]" selected="selected">
94             [% ELSE %]
95                 [% bdgclass=budgetsloo.active? "": "b_inactive" | html %]
96                     <option class="[% bdgclass | html %]" value="[% budgetsloo.value | html %]">
97             [% END %]
98             [% budgetsloo.description | html %] [% IF !budgetsloo.active %](inactive)[% END %]
99             </option>
100         [% END %]
101         </select>
102         <label for="showallbudgets" style="float:none;">&nbsp;Show inactive:</label>
103         <input type="checkbox" id="showbudgets" />
104         </li></ol>
105         </fieldset>
106
107         <fieldset class="rows">
108         <legend>Output</legend>
109         <ol><li><label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" /> </li>
110             <li><label for="outputfile">To a file:</label>
111                 <input type="radio" name="output" value="file" id="outputfile" />
112                 <label class="inline" for="basename">Named: </label>
113                 <input type="text" name="basename" id="basename" value="Export" />
114                 <label class="inline" for="MIME">Into an application </label>
115                 <select id='MIME' name='MIME' size='1'>
116                 [% FOREACH outputFormatloo IN outputFormatloop %]
117                     <option value="[% outputFormatloo | html %]">[% outputFormatloo | html %]</option>
118                 [% END %]
119                 </select>
120                 <select id='sep' name='sep' size='1'>
121                 [% FOREACH delimiterloo IN delimiterloop %]
122                     [% IF delimiterloo == delimiterPreference %]
123                         <option value="[% delimiterloo | html %]">[% delimiterloo | html %]</option>
124                     [% END %]
125                 [% END %]
126                 [% FOREACH delimiterloo IN delimiterloop %]
127                     [% IF delimiterloo != delimiterPreference %]
128                         <option value="[% delimiterloo | html %]">[% delimiterloo | html %]</option>
129                     [% END %]
130                 [% END %]
131                 </select>
132         </li></ol>
133         </fieldset>
134
135         <fieldset class="action">
136         <input type="submit" value="Submit" />
137         <input type="hidden" name="get_orders" value="1" /></fieldset>
138         </form>
139
140     [% END %]
141
142             </main>
143         </div> <!-- /.col-sm-10.col-sm-push-2 -->
144
145         <div class="col-sm-2 col-sm-pull-10">
146             <aside>
147                 [% INCLUDE 'reports-menu.inc' %]
148             </aside>
149         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
150      </div> <!-- /.row -->
151
152 [% MACRO jsinclude BLOCK %]
153     [% INCLUDE 'datatables.inc' %]
154     <script>
155         $(document).ready( function () {
156             $('#funds').DataTable($.extend(true, {}, dataTablesDefaults,{"sPaginationType": "full_numbers"}));
157
158             showallbudgets = $('#budgetfilter').html();
159             $('#budgetfilter .b_inactive').remove();
160
161             $('#showbudgets').click(function(){
162                 if ($(this).is(":checked")) {
163                     $('#budgetfilter').html(showallbudgets);
164                 } else {
165                     $('#budgetfilter .b_inactive').remove();
166                 }
167             });
168         } );
169     </script>
170
171 [% END %]
172
173 [% INCLUDE 'intranet-bottom.inc' %]