Bug 12988: Update table footer with the visible rows - budgets
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqbudgets.tt
1 [% USE Price %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Administration &rsaquo; Funds[% IF op == 'add_form' %] &rsaquo; [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript">
6 //<![CDATA[
7 var MSG_BUDGET_PARENT_ALLOCATION = "- " + _("Fund amount exceeds parent allocation") + "\n";
8 var MSG_BUDGET_PERIOD_ALLOCATION = "- " + _("Fund amount exceeds period allocation") + "\n";
9 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") + "\n";
10 //]]>
11 </script>
12
13 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
14 [% IF op == 'add_form' %]
15 <script type="text/javascript">
16 //<![CDATA[
17
18     function userPopup() {
19         window.open("/cgi-bin/koha/admin/aqbudget_user_search.pl?type=user",
20             'PatronPopup',
21             'width=740,height=450,location=yes,toolbar=no,'
22             + 'scrollbars=yes,resize=yes'
23         );
24     }
25
26     function ownerPopup() {
27         window.open("/cgi-bin/koha/admin/aqbudget_user_search.pl?type=owner",
28             'PatronPopup',
29             'width=740,height=450,location=yes,toolbar=no,'
30             + 'scrollbars=yes,resize=yes'
31         );
32     }
33
34     function edit_owner(borrowernumber, surname, firstname) {
35         $('#budget_owner_name').empty();
36         $('#budget_owner_id').val('');
37         if (borrowernumber) {
38             var ownerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
39                 + '?borrowernumber=' + borrowernumber + '">'
40                 + firstname + ' ' + surname + '</a>';
41             $('#budget_owner_name').html(ownerlink);
42             $('#budget_owner_id').val(borrowernumber);
43         }
44     }
45
46     function ownerRemove() {
47         edit_owner(0);
48     }
49
50     function add_user(borrowernumber, surname, firstname) {
51         var ids = $("#budget_users_id").val().split(':');
52         if(borrowernumber && ids.indexOf(borrowernumber) == -1) {
53             var li = '<li id="user_' + borrowernumber + '">'
54                 + '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber='
55                 + borrowernumber + '">' + firstname + ' ' + surname
56                 + '</a> [<a style="cursor:pointer"'
57                 + 'onclick="del_user(' + borrowernumber +')">Remove</a>]</li>';
58             $(li).insertBefore("li#add_user_button");
59             ids.push(borrowernumber);
60             $("#budget_users_id").val(ids.join(':'));
61         } else {
62             return -1;
63         }
64         return 0;
65     }
66
67     function del_user(borrowernumber) {
68         var ids = $("#budget_users_id").val().split(':');
69         if (borrowernumber) {
70             var idx = ids.indexOf(borrowernumber+'');
71             if (idx != -1) {
72                 ids.splice(idx, 1);
73                 $("#budget_users_id").val(ids.join(':'));
74                 $("li#user_" + borrowernumber).remove();
75             }
76         }
77     }
78
79     function Check(f) {
80         var ok=1;
81         var _alertString="";
82         var alertString2;
83
84         if (!(isNotNull(f.budget_code,1))) {
85             _alertString += _("- Budget code cannot be blank") + "\n";
86         }
87
88         if (!(isNotNull(f.budget_name,1))) {
89             _alertString += _("- Budget name cannot be blank") + "\n";
90         }
91
92         if (!(isNotNull(f.budget_amount,1))) {
93             _alertString += _("- Budget amount cannot be blank") + "\n";
94         }
95
96         var budgetId;
97         if   (typeof(f.budget_id ) != "undefined")  {
98             budgetId = f.budget_id.value
99         }
100
101         var newBudgetParent;
102
103 //  hack to test if selected parent_id in scrolling-list...
104 //  if value == 'undef' its got a selected_parent :/
105         if(f.budget_parent_id){
106             var chkAdd   =  f.budget_parent_id.value ;
107             if  (     typeof(chkAdd ) != "undefined") {
108                 newBudgetParent  =  f.budget_parent_id.value
109             } else {
110                 newBudgetParent  =  f.budget_parent_id.item(0).value
111             }
112
113             if   (budgetId  > 0)  {  ; //its a mod ...
114                 // if parent == curent-budget, fail...
115                 if ( newBudgetParent  ==  budgetId     ) {
116                         _alertString += _("- Budget parent is current budget") + "\n";
117                 }
118
119                 else if (newBudgetParent) {
120                     var result = checkBudgetParent(  budgetId , newBudgetParent   );
121                     if (result) {
122                         _alertString += result;
123                     }
124                 }
125             }
126         }
127
128          // else do lookup
129         var budgetTotal = Math.abs(f.budget_amount.value);
130         var result =   budgetExceedsParent  (budgetTotal, budgetId, newBudgetParent, f.budget_period_id.value)
131         if (result) {
132             _alertString += result;
133         }
134
135         if (_alertString.length==0) {
136             document.Aform.submit();
137         } else {
138             alertString2 = _("Form not submitted because of the following problem(s)");
139             alertString2 += "\n------------------------------------------------------------------------------------\n\n";
140             alertString2 += _alertString;
141             alert(alertString2);
142         }
143     }
144 //]]>
145 </script>
146 [% ELSIF op == 'list' %]
147     <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
148     [% INCLUDE 'datatables.inc' %]
149     <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
150     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
151
152 <script type="text/javascript">
153 //<![CDATA[
154     //
155     $(document).ready(function() {
156
157
158         var oTable = $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
159             "fnDrawCallback": function ( oSettings ) {
160                 if ( oSettings.aiDisplay.length == 0 )
161                 {
162                     return;
163                 }
164
165                 var nTrs = $('#budgeth tbody tr');
166                 var iColspan = nTrs[0].getElementsByTagName('td').length;
167                 var sLastGroup = "";
168                 for ( var i=0 ; i<nTrs.length ; i++ )
169                 {
170                     var iDisplayIndex = oSettings._iDisplayStart + i;
171                     var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1];
172                     if ( sGroup != sLastGroup )
173                     {
174                         var nGroup = document.createElement( 'tr' );
175                         var nCell = document.createElement( 'td' );
176                         nCell.colSpan = iColspan;
177                         nCell.className = "group";
178                         nCell.innerHTML = sGroup;
179                         nGroup.appendChild( nCell );
180                         nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
181                         sLastGroup = sGroup;
182                     }
183                 }
184             },
185             "footerCallback": function ( row, data, start, end, display ) {
186                 var api = this.api(), data;
187                 footer_column_sum( api, [ 4, 6, 8, 10 ], 2 );
188             },
189             "aoColumnDefs": [
190                 { "bVisible": false, "aTargets": [ 0, 1 ] },
191                 { "bSortable": false, "aTargets": ["_all"] }
192             ],
193             'bSort': true,
194             'aaSortingFixed': [[ 1, 'asc' ]],
195             'bPaginate': false,
196             "bAutoWidth": false
197         }));
198
199         $(oTable).treetable({
200             expandable: true
201         });
202         $(oTable).treetable('expandAll');
203         $("#expand_all").click(function(e){
204             e.preventDefault();
205             $(oTable).treetable('expandAll');
206         });
207         $("#collapse_all").click(function(e){
208             e.preventDefault();
209             $(oTable).treetable('collapseAll');
210         });
211
212         [% UNLESS budget_period_id %]
213           $("#hide_inactive").click(function(e){
214             e.preventDefault();
215             oTable.fnFilter( 1, 0 ); // Show only active=1
216           });
217           $("#show_inactive").click(function(e){
218             e.preventDefault();
219             oTable.fnFilter( '', 0 );
220           });
221           $("#hide_inactive").click();
222         [% END %]
223         oTable.fnAddFilters("filter", 750);
224
225         $("#filterbutton").click(function() {
226             $("#fundfilters").slideToggle(0);
227         });
228     });
229 //]]>
230 </script>
231 [% END %]
232
233 </head>
234 <body id="admin_aqbudgets" class="admin">
235 [% INCLUDE 'header.inc' %]
236 [% INCLUDE 'budgets-admin-search.inc' %]
237
238 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
239     <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo; [% IF op == 'list' %][% IF budget_period_id %]Funds for '[% budget_period_description %]'[% ELSE %]All funds[% END %][% END %]
240     [% IF op == 'add_form' %]
241       <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">Funds</a> &rsaquo; [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund[% END %]
242     [% END %]
243     [% IF op == 'delete_confirm' %]
244       <a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a> &rsaquo; Delete fund?
245     [% END %]
246 </div>
247
248 <div id="doc3" class="yui-t2">
249 <div id="bd">
250 <div id="yui-main">
251 <div class="yui-b" id="content">
252
253
254 [% UNLESS op == 'delete_confirm' %][% INCLUDE 'budgets-admin-toolbar.inc' %][% END %]
255
256 [% IF (error_not_authorised_to_modify) %]
257     <div class="error">
258         <p>You are not authorized to modify this fund</p>
259     </div>
260 [% END %]
261
262 [% IF op == 'list' %]
263
264 <h1>
265   [% IF budget_period_id %]
266     Funds for '[% budget_period_description %]'
267   [% ELSE %]
268     All funds
269   [% END %]
270 </h1>
271
272 [% INCLUDE 'budgets-active-currency.inc' %]
273
274 [% IF budgets %]
275
276 <table id="budgeth">
277     [% UNLESS budget_period_id %]
278       <caption>
279         <span class="actions"><a href="#" id="expand_all">Expand all</a>
280         | <a href="#" id="collapse_all">Collapse all</a>
281         | <a href="#" id="hide_inactive">Hide inactive budgets</a>
282         | <a href="#" id="show_inactive">Show inactive budgets</a></span>
283       </caption>
284     [% END %]
285     <thead>
286         <tr>
287             <th>Active</th>
288             <th>Budget period description</th>
289             <th>Fund code</th>
290             <th>Fund name</th>
291             <th>Base-level allocated</th>
292             <th>Base-level ordered</th>
293             <th>Total ordered</th>
294             <th>Base-level spent</th>
295             <th>Total spent</th>
296             <th>Base-level available</th>
297             <th>Total available</th>
298             <th>Actions</th>
299         </tr>
300     </thead>
301     <tfoot>
302     <tr>
303     <th></th>
304     <th></th>
305     <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF budget_period_total %][% budget_period_total | $Price %][% END %]  </th>
306     <th nowrap="nowrap" class="data"> [% period_alloc_total | $Price %]</th>
307     <th></th>
308     <th class="data">[% ordered_total | $Price %]</th>
309     <th></th>
310     <th class="data">[% spent_total | $Price %]</th>
311     <th></th>
312     <th class="data">[% available_total | $Price %]</th>
313     <th></th>
314     </tr>
315     </tfoot>
316     <tbody>
317     [% FOREACH budget IN budgets %]
318     [% IF budget.budget_parent_id %]
319       <tr data-tt-id="[% budget.budget_id %]" data-tt-parent-id="[% budget.budget_parent_id %]">
320     [% ELSE %]
321       <tr data-tt-id="[% budget.budget_id %]">
322     [% END %]
323     <td>[% budget.budget_period_active %]</td>
324     <td>Budget [% budget.budget_period_description %] [id=[% budget.budget_period_id %]][% UNLESS budget.budget_period_active %] (inactive)[% END %]</td>
325     <td>[% budget.budget_code %]</td>
326     <td>[% budget.budget_name %]</td>
327     <td class="data">
328       [% IF budget.budget_parent_id %]
329         <span class="child_fund_amount">[% budget.budget_amount | $Price %]</span>
330       [% ELSE %]
331         <span class="total_amount">[% budget.budget_amount | $Price %]</span>
332       [% END %]
333     </td>
334     <td class="data">
335       [% IF budget.budget_parent_id %]
336         <span class="child_fund_amount">[% budget.budget_ordered | $Price %]</span>
337       [% ELSE %]
338         <span class="total_amount">[% budget.budget_ordered | $Price %]</span>
339       [% END %]
340     </td>
341     <td class="data">
342       [% IF budget.budget_parent_id %]
343         <span class="child_fund_amount">[% budget.total_ordered | $Price %]</span>
344       [% ELSE %]
345         <span class="total_amount">[% budget.total_ordered | $Price %]</span>
346       [% END %]
347     </td>
348     <td class="data">
349       [% IF budget.budget_parent_id %]
350         <span class="child_fund_amount">[% budget.budget_spent | $Price %]</span>
351       [% ELSE %]
352         <span class="total_amount">[% budget.budget_spent | $Price %]</span>
353       [% END %]
354     </td>
355     <td class="data">
356       [% IF budget.budget_parent_id %]
357         <span class="child_fund_amount">[% budget.total_spent | $Price %]</span>
358       [% ELSE %]
359         <span class="total_amount">[% budget.total_spent | $Price %]</span>
360       [% END %]
361     </td>
362
363
364     [% BLOCK colorcellvalue %]
365         [% IF parent %]
366             [% IF (value > 0) %]
367                 <span class="child_fund_amount" style="color: green;">
368             [% ELSIF (value < 0) %]
369                 <span class="child_fund_amount" style="color: red;">
370             [% ELSE %]
371                 <span class="child_fund_amount">
372             [% END %]
373          [% ELSE %]
374             [% IF (value > 0) %]
375                 <span class="total_amount" style="color: green;">
376             [% ELSIF (value < 0) %]
377                 <span class="total_amount" style="color: red;">
378             [% ELSE %]
379                 <span class="totalamount">
380             [% END %]
381         [% END %]
382             [% value | $Price %]
383         </span>
384     [% END %]
385     <td class="data">
386         [% INCLUDE colorcellvalue value=budget.budget_remaining parent=budget.budget_parent_id %]
387     </td>
388     <td class="data">
389         [% INCLUDE colorcellvalue value=budget.total_remaining parent=budget.budget_parent_id %]
390     </td>
391     [% IF ( budget.budget_lock ) %]
392         <td> <span></span> </td>
393     [% ELSE %]
394         <td>
395             <div class="dropdown dropup">
396                 <a class="btn btn-mini dropdown-toggle" id="budgetactions[% budget.budget_id %]_[% budget.budget_period_id %]" role="button" data-toggle="dropdown" href="#">
397                    Actions <b class="caret"></b>
398                 </a>
399                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="budgetactions[% budget.budget_id %]_[% budget.budget_period_id %]">
400                     <li><a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_id=[% budget.budget_id %]&amp;budget_period_id=[% budget.budget_period_id %]" >Edit</a></li>
401                     <li><a href="/cgi-bin/koha/admin/aqbudgets.pl?op=delete_confirm&amp;budget_id=[% budget.budget_id %]&amp;budget_period_id=[% budget.budget_period_id %]">Delete</a></li>
402                     <li><a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_parent_id=[% budget.budget_id %]&amp;budget_period_id=[% budget.budget_period_id %]">Add child fund</a></li>
403                 </ul>
404             </div>
405         </td>
406     [% END %]
407     </tr>
408     [% END %]
409     </tbody>
410 </table>
411
412 [% ELSE %]
413     No fund found
414 [% END %]
415
416 [% END %] <!-- list -->
417
418 <!-- ********************************************************************************************** -->
419 <!-- create add/mod entry form -->
420 [% IF op == 'add_form' && !error_not_authorised_to_modify %]
421 <form action="/cgi-bin/koha/admin/aqbudgets.pl" name="Aform" method="post">
422     <fieldset class="rows">
423     <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
424     [% IF ( budget_period_description ) %]
425         [% budget_name %] for Budget '[% budget_period_description %]'
426     [% END %]
427     </legend>
428
429     <input type="hidden" name="op" value="add_validate" />
430     <input type="hidden" name="checked" value="0" />
431     <ol>
432     [% IF ( budget_parent_id ) %]
433     <li>
434         <span class="label">Fund parent: </span>
435         [% budget_parent_name %]
436         [% budget_parent_id %] - [% budget_parent_name %]
437         <input type="hidden" name="budget_parent_id" value="[% budget_parent_id %]" />
438     </li>
439     [% END %]
440     <li>
441     <label class="required"  for="budget_code">Fund code: </label>
442     <input type="text" name="budget_code" id="budget_code" value="[% budget_code %]" size="30" />
443     </li>
444
445     <li>
446     <label class="required" for="budget_name">Fund name: </label>
447     <input type="text" name="budget_name" id="budget_name" value="[% budget_name %]" size="60" />
448     </li>
449
450     <li>
451     <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
452     <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount %]" size="8" />
453     </li>
454
455     <li>
456       <label for="budget_encumb">Warning at (%): </label>
457       <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb %]" size="10" />
458       <span class="hint">0 to disable</span>
459     </li>
460
461     <li>
462       <label for="budget_expend">Warning at (amount): </label>
463       <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend %]" size="10" />
464       <span class="hint">0 to disable</span>
465     </li>
466
467     <li>
468         <span class="label">Owner: </span>
469         <span  id="budget_owner_name">
470         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% budget_owner_id %]">
471             [% budget_owner_name %]
472         </a>
473         </span>
474         <input type="hidden" name="budget_owner_id" id="budget_owner_id"
475             value="[% budget_owner_id %]" />
476
477         <!-- FIXME: hardcoded button positions :/ -->
478         <input type="button" id="edit_owner" value="Edit owner"
479             onclick="ownerPopup(); return false;" />
480         <input type="button" id="remove_owner" value="Remove owner"
481             onclick="ownerRemove(); return false;" />
482     </li>
483
484     [% IF budget_has_children %]
485         <li class="radio">
486             <label>
487                 <input type="checkbox" id="set_owner_to_children" name="set_owner_to_children" value="1" />
488                 Update all child funds with this owner
489             </label>
490             <span class="hint">Selecting this option will overwrite existing fund owners, if any</span>
491         </li>
492     [% END %]
493
494     <li>
495         <span class="label">Users:</span>
496         <ul style="float:left;" id="budget_users">
497             [% FOREACH user IN budget_users %]
498                 <li id="user_[% user.borrowernumber %]">
499                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% user.borrowernumber %]">
500                         [% user.firstname %] [% user.surname %]
501                     </a>
502                     [<a style="cursor:pointer"
503                     onclick="del_user([% user.borrowernumber %])">Remove</a>]
504                 </li>
505             [% END %]
506             <li id="add_user_button">
507                 <input type="button" onclick="userPopup()" value="Add users" />
508             </li>
509         </ul>
510         <input type="hidden" name="budget_users_ids" id="budget_users_id" value="[% budget_users_ids %]" />
511     <li>
512     <label for="budget_branchcode">Library: </label>
513     <select name="budget_branchcode" id="budget_branchcode">
514     <option value=""></option>
515     [% FOREACH branchloop_selec IN branchloop_select %]
516         [% UNLESS ( branchloop_selec.selected ) %] <option value="[% branchloop_selec.value %]" > [% ELSE %] <option value="[% branchloop_selec.value %]" selected="selected"> [% END %] [% branchloop_selec.value %]-[% branchloop_selec.branchname %]</option>
517     [% END %]
518     </select>
519     </li>
520
521     <li>
522     <label for="budget_permission">Restrict access to: </label>
523     <select name="budget_permission" id="budget_permission">
524         [% IF ( budget_perm_0 ) %]
525             <option value="0" selected="selected">
526         [% ELSE %]
527             <option value="0">
528         [% END %]
529             None
530         </option>
531
532         [% IF ( budget_perm_1 ) %]
533             <option value="1" selected="selected">
534         [% ELSE %]
535             <option value="1">
536         [% END %]
537             Owner
538         </option>
539
540         [% IF ( budget_perm_3) %]
541             <option value="3" selected="selected">
542         [% ELSE %]
543             <option value="3">
544         [% END %]
545             Owner and users
546         </option>
547
548         [% IF ( budget_perm_2 ) %]
549             <option value="2" selected="selected">
550         [% ELSE %]
551             <option value="2">
552         [% END %]
553             Owner, users and library
554         </option>
555     </select>
556     </li>
557
558     <li>
559     <label for="budget_notes">Notes: </label>
560     <textarea name="budget_notes" id="budget_notes"  cols="80" rows="6">[% budget_notes %]</textarea>
561     </li>
562
563     <li>
564     <label  style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
565         <select name="sort1_authcat" id="authorised_value_category1">
566             <option value=""></option>
567             [% FOREACH authorised_value_categories IN authorised_value_categories1 %]
568                 [% IF ( authorised_value_categories.selected ) %]
569                     <option value="[% authorised_value_categories.category %]" selected="selected">
570                         [% authorised_value_categories.category %]
571                     </option>
572                 [% ELSE %]
573                     <option value="[% authorised_value_categories.category %]">
574                         [% authorised_value_categories.category %]
575                     </option>
576                 [% END %]
577             [% END %]
578         </select>
579     </li>
580     <li>
581     <label  style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
582         <select name="sort2_authcat" id="authorised_value_category2">
583             <option value=""></option>
584             [% FOREACH authorised_value_categories IN authorised_value_categories2 %]
585                 [% IF ( authorised_value_categories.selected ) %]
586                     <option value="[% authorised_value_categories.category %]" selected="selected">
587                         [% authorised_value_categories.category %]
588                     </option>
589                 [% ELSE %]
590                     <option value="[% authorised_value_categories.category %]">
591                         [% authorised_value_categories.category %]
592                     </option>
593                 [% END %]
594             [% END %]
595         </select>
596     </li>
597     </ol>
598
599     [% IF ( budget_id ) %]
600         <input type="hidden" name="budget_id" value="[% budget_id %]" />
601     [% END %]
602     </fieldset>
603
604     <fieldset class="action">
605         <input type="submit" value="Submit" onclick="Check(this.form); return false;" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a>
606         <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
607     </fieldset>
608 </form>
609
610 [% END %] <!-- add_form -->
611
612 [% IF op == 'delete_confirm' %]
613 <div class="dialog alert"> <h3>Delete fund [% budget_name %]?</h3>
614 <table>
615     <tr>
616     <th scope="row">Fund amount:</th>
617     <td>[% budget_amount | $Price %]</td>
618     </tr>
619 </table>
620
621 <form action="/cgi-bin/koha/admin/aqbudgets.pl" method="post">
622     <input type="hidden" name="op" value="delete_confirmed" />
623     <input type="hidden" name="budget_id" value="[% budget_id %]" />
624     <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
625     <input type="submit" value="Delete" class="approve" />
626 </form>
627
628 <form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
629     <input type="submit" class="deny" value="Cancel" />
630 </form>
631 </div>
632 [% END %]
633
634 </div>
635 </div>
636 <div class="yui-b">
637 [% IF op == 'list' %]
638   <form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
639     <a href="#" id="filterbutton">Filters</a>
640     <fieldset class="brief" id="fundfilters">
641     <h4>Fund filters</h4>
642         <ol>
643         <li>
644             <label for="filter_budgetbranch2">Library: </label>
645             <select name="filter_budgetbranch" id="filter_budgetbranch2" style="width:10em;">
646                 <option value=""></option>
647                 [% FOREACH branchloo IN branchloop %]
648                 [% UNLESS ( branchloo.selected ) %]<option value="[% branchloo.value %]">
649                 [% ELSE %]<option value="[% branchloo.value %]" selected="selected">[% END %]
650                 [% branchloo.branchname %]</option>
651                 [% END %]
652             </select>
653         </li>
654         <li class="radio">
655
656         <label for="show_mine">Show my funds only</label>
657             [% IF ( show_mine ) %]
658                 <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
659             [% ELSE %]
660                 <input type="checkbox" id="show_mine"  name="show_mine" value="1" />
661         [% END %]
662         </li>
663
664         [% IF periods %]
665           <li>
666             <label for="periods">Budget:</label>
667             <select id="periods" name="budget_period_id">
668               <option value="">All budgets</option>
669               [% FOR period IN periods %]
670                 [% IF budget_period_id && period.budget_period_id == budget_period_id %]
671                   <option value="[% period.budget_period_id %]" selected="selected">[% period.budget_period_description %]</option>
672                 [% ELSE %]
673                   <option value="[% period.budget_period_id %]">[% period.budget_period_description %]</option>
674                 [% END %]
675               [% END %]
676             </select>
677           </li>
678         [% END %]
679         </ol>
680
681         <input type="hidden" name="op" value="list" />
682         <input type="submit" class="submit" name="filter" value="Go" />
683     </fieldset>
684 </form>[% END %]
685 [% INCLUDE 'acquisitions-menu.inc' %]
686 </div>
687 </div>
688 [% INCLUDE 'intranet-bottom.inc' %]