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