Bug 10792: fix sorting of funds table on acquisitions home page
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / acqui-home.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Acquisitions</title>
3 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'datatables.inc' %]
6 <script type="text/javascript">
7 //<![CDATA[
8
9 dt_overwrite_html_sorting_localeCompare();
10
11 $(document).ready(function() {
12
13     var inactive = $(".b_inactive,.bu_active");
14     var active = $(".bu_inactive");
15     inactive.hide();
16     active.show();
17
18     $('#showallbudgets').click(function() {
19         if ( $('#showallbudgets:checked').val() !== undefined) {
20             inactive.show();
21             active.hide();
22         }
23         else {
24             inactive.hide();
25             active.show();
26         }
27     });
28     var srlt = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, {
29         "aoColumns": [
30             null,
31             null,
32             null,
33             null,
34             null,
35             { "sType": "title-numeric" },
36             { "sType": "title-numeric" },
37             { "sType": "title-numeric" },
38             { "sType": "title-numeric" }
39         ],
40         'sDom': 't',
41         'bPaginate': false,
42         'bFilter': false,
43         'bInfo': false
44     } ) );
45 });
46 //]]>
47 </script>
48
49 </head>
50 <body id="acq_acqui-home" class="acq">
51 [% INCLUDE 'header.inc' %]
52 [% INCLUDE 'acquisitions-search.inc' %]
53
54 <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; </div>
55
56 <div id="doc3" class="yui-t2">
57
58 <div id="bd">
59     <div id="yui-main">
60     <div class="yui-b">
61
62 [% INCLUDE 'acquisitions-toolbar.inc' %]
63
64 <h1>Acquisitions</h1>
65     [% UNLESS ( loop_budget ) %]
66         [% IF ( CAN_user_acquisition_period_manage ) %]
67         <div class="dialog alert">You must <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">define a budget</a> in Administration</div>
68         [% ELSE %]
69         <div class="dialog alert">Your administrator must define a budget in Administration</div>
70         [% END %]
71     [% END %]
72 <div class="yui-g">
73 <div class="yui-u first">
74 <div id="acqui_acqui_home_order">
75     <fieldset>
76         <legend>Manage orders</legend>
77         <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="post">
78             <p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" />
79             <input type="submit" value="Search" />
80             </p>
81         </form>
82     </fieldset>
83 </div>
84 </div>
85
86 [% IF ( suggestion && suggestions_count ) %]
87 <div class="yui-u">
88     <div id="acqui_acqui_home_suggestions">
89         <fieldset>
90         <legend>Pending suggestions</legend>
91             <p>[% suggestions_count %] suggestions waiting. <a href="/cgi-bin/koha/suggestion/suggestion.pl">Manage suggestions</a>.</p>
92         </fieldset>
93     </div>
94 </div>
95 [% END %]
96
97 </div>
98
99 [% IF ( loop_budget ) %]
100
101             <h3>All available funds[% IF ( branchname ) %] for [% branchname %] library[% END %]</h3>
102
103     <!-- <a href="/cgi-bin/koha/admin/aqbookfund.pl" title="[ Manage funds ]">[ Manage ]</a>
104     <a href="/cgi-bin/koha/admin/budgetperiods.pl">manage budgets</a><br><br>  -->
105
106
107
108     <div id="BudgetsAndFunds">
109     <p><label for="showallbudgets">Show active and inactive:</label> <input type="checkbox" id="showallbudgets" /></p>
110     <table id="accounts">
111         <thead>
112         <tr>
113             <th>Fund</th>
114             <th>Fund name</th>
115             <th class="b_inactive">Active</th>
116             <th>Owner</th>
117             <th>Library</th>
118             <th>Amount</th>
119             <th>Ordered</th>
120             <th>Spent</th>
121             <th>Avail</th>
122         </tr>
123         </thead>
124         <tfoot id="funds_total">
125         <tr>
126             <th>Total</th>
127             <th>&nbsp;</th>
128             <th class="b_inactive">&nbsp;</th>
129             <th>&nbsp;</th>
130             <th>&nbsp;</th>
131             <th class="data"><span class="bu_active">[% total %]</span><span class="bu_inactive" >[% total_active %]</span></th>
132             <th class="data"><span class="bu_active">[% totordered %]</span><span class="bu_inactive" >[% totordered_active %]</span></th>
133             <th class="data"><span class="bu_active">[% totspent %]</span><span class="bu_inactive" >[% totspent_active %]</span></th>
134             <th class="data"><span class="bu_active">[% totavail %]</span><span class="bu_inactive" >[% totavail_active %]</span></th>
135         </tr>
136         </tfoot>
137         <tbody>
138         [% FOREACH loop_budge IN loop_budget %]
139         [% IF ( loop_budge.budget_period_active ) %]
140             <tr>
141                 <td>
142                     [% IF ( CAN_user_acquisition_budget_manage ) %]
143                         <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id %]">[% loop_budge.budget_code %]</a>
144                     [% ELSE %]
145                         [% loop_budge.budget_code %]
146                     [% END %]
147                 </td>
148                 <td>[% loop_budge.budget_name %]</td>
149                 <td class="b_inactive">Active</td>
150                 <td>[% IF ( loop_budge.budget_owner_borrowernumber ) %]
151                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loop_budge.budget_owner_borrowernumber %]">[% loop_budge.budget_owner_surname %], [% loop_budge.budget_owner_firstname %]</a>
152                     [% ELSE %]
153                         &nbsp;
154                     [% END %]
155                 </td>
156                 <td>[% loop_budge.budget_branchname %]</td>
157                 <td class="data"><span title="[% loop_budge.budget_amount %]">[% loop_budge.formatted_budget_amount %]</span></td>
158                 <td class="data"><span title="[% loop_budge.budget_ordered %]"><a href="ordered.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_ordered %]</a></span></td>
159                 <td class="data"><span title="[% loop_budge.budget_spent %]"><a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_spent %]</span></a></td>
160                 <td class="data"><span title="[% loop_budge.budget_avail %]">[% loop_budge.formatted_budget_avail %]</td>
161             </tr>
162         [% ELSE %]
163             <tr class="b_inactive">
164                 <td>
165                     [% IF ( CAN_user_acquisition_budget_manage ) %]
166                         <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id %]">[% loop_budge.budget_code %]</a>
167                     [% ELSE %]
168                         [% loop_budge.budget_code %]
169                     [% END %]
170                 </td>
171                 <td>[% loop_budge.budget_name %]</td>
172                 <td class="b_inactive">Inactive</td>
173                 <td>[% IF ( loop_budge.budget_owner_borrowernumber ) %]
174                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loop_budge.budget_owner_borrowernumber %]">[% loop_budge.budget_owner_surname %], [% loop_budge.budget_owner_firstname %]</a>
175                     [% ELSE %]
176                         &nbsp;
177                     [% END %]
178                 </td>
179                 <td>[% loop_budge.budget_branchname %]</td>
180                 <td class="data"><span title="[% loop_budge.budget_amount %]">[% loop_budge.formatted_budget_amount %]</span></td>
181                 <td class="data"><span title="[% loop_budge.budget_ordered %]"><a href="ordered.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_ordered %]</a></span></td>
182                 <td class="data"><span title="[% loop_budge.budget_spent %]"><a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_spent %]</span></a></td>
183                 <td class="data"><span title="[% loop_budge.budget_avail %]">[% loop_budge.formatted_budget_avail %]</td>
184             </tr>
185         [% END %]
186         [% END %]
187         </tbody>
188     </table>
189     </div>
190     [% END %]
191
192 </div>
193 </div>
194 <div class="yui-b">
195 [% INCLUDE 'acquisitions-menu.inc' %]
196 </div>
197 </div>
198 [% INCLUDE 'intranet-bottom.inc' %]