Bug 13352: On editing, prices should not be formatted
[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         $(".deletefund-disabled").on("click", function(e){
230             e.preventDefault();
231             alert("This fund has children. It cannot be deleted.");
232         });
233     });
234 //]]>
235 </script>
236 [% END %]
237
238 </head>
239 <body id="admin_aqbudgets" class="admin">
240 [% INCLUDE 'header.inc' %]
241 [% INCLUDE 'budgets-admin-search.inc' %]
242
243 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
244     <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 %]
245     [% IF op == 'add_form' %]
246       <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 %]
247     [% END %]
248     [% IF op == 'delete_confirm' %]
249       <a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a> &rsaquo; Delete fund?
250     [% END %]
251 </div>
252
253 <div id="doc3" class="yui-t2">
254 <div id="bd">
255 <div id="yui-main">
256 <div class="yui-b" id="content">
257
258
259 [% UNLESS op == 'delete_confirm' %][% INCLUDE 'budgets-admin-toolbar.inc' %][% END %]
260
261 [% IF (error_not_authorised_to_modify) %]
262     <div class="error">
263         <p>You are not authorized to modify this fund</p>
264     </div>
265 [% END %]
266
267 [% IF op == 'list' %]
268
269 <h1>
270   [% IF budget_period_id %]
271     Funds for '[% budget_period_description %]'
272   [% ELSE %]
273     All funds
274   [% END %]
275 </h1>
276
277 [% INCLUDE 'budgets-active-currency.inc' %]
278
279 [% IF budgets %]
280
281 <table id="budgeth" class="group">
282     [% UNLESS budget_period_id %]
283       <caption>
284         <span class="actions"><a href="#" id="expand_all">Expand all</a>
285         | <a href="#" id="collapse_all">Collapse all</a>
286         | <a href="#" id="hide_inactive">Hide inactive budgets</a>
287         | <a href="#" id="show_inactive">Show inactive budgets</a></span>
288       </caption>
289     [% END %]
290     <thead>
291         <tr>
292             <th>Active</th>
293             <th>Budget period description</th>
294             <th>Fund code</th>
295             <th>Fund name</th>
296             <th>Base-level allocated</th>
297             <th>Base-level ordered</th>
298             <th>Total ordered</th>
299             <th>Base-level spent</th>
300             <th>Total spent</th>
301             <th>Base-level available</th>
302             <th>Total available</th>
303             <th>Actions</th>
304         </tr>
305     </thead>
306     <tfoot>
307     <tr>
308     <th></th>
309     <th></th>
310     <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF budget_period_total %][% budget_period_total | $Price %][% END %]  </th>
311     <th nowrap="nowrap" class="data"> [% period_alloc_total | $Price %]</th>
312     <th></th>
313     <th class="data">[% ordered_total | $Price %]</th>
314     <th></th>
315     <th class="data">[% spent_total | $Price %]</th>
316     <th></th>
317     <th class="data">[% available_total | $Price %]</th>
318     <th></th>
319     </tr>
320     </tfoot>
321     <tbody>
322     [% FOREACH budget IN budgets %]
323     [% IF budget.budget_parent_id %]
324       <tr data-tt-id="[% budget.budget_id %]" data-tt-parent-id="[% budget.budget_parent_id %]">
325     [% ELSE %]
326       <tr data-tt-id="[% budget.budget_id %]">
327     [% END %]
328     <td>[% budget.budget_period_active %]</td>
329     <td>Budget [% budget.budget_period_description %] [id=[% budget.budget_period_id %]][% UNLESS budget.budget_period_active %] (inactive)[% END %]</td>
330     <td>[% budget.budget_code %]</td>
331     <td>[% budget.budget_name %]</td>
332     <td class="data">
333       [% IF budget.budget_parent_id %]
334         <span class="child_fund_amount">[% budget.budget_amount | $Price %]</span>
335       [% ELSE %]
336         <span class="total_amount">[% budget.budget_amount | $Price %]</span>
337       [% END %]
338     </td>
339     <td class="data">
340       [% IF budget.budget_parent_id %]
341         <span class="child_fund_amount">[% budget.budget_ordered | $Price %]</span>
342       [% ELSE %]
343         <span class="total_amount">[% budget.budget_ordered | $Price %]</span>
344       [% END %]
345     </td>
346     <td class="data">
347       [% IF budget.budget_parent_id %]
348         <span class="child_fund_amount">[% budget.total_ordered | $Price %]</span>
349       [% ELSE %]
350         <span class="total_amount">[% budget.total_ordered | $Price %]</span>
351       [% END %]
352     </td>
353     <td class="data">
354       [% IF budget.budget_parent_id %]
355         <span class="child_fund_amount">[% budget.budget_spent | $Price %]</span>
356       [% ELSE %]
357         <span class="total_amount">[% budget.budget_spent | $Price %]</span>
358       [% END %]
359     </td>
360     <td class="data">
361       [% IF budget.budget_parent_id %]
362         <span class="child_fund_amount">[% budget.total_spent | $Price %]</span>
363       [% ELSE %]
364         <span class="total_amount">[% budget.total_spent | $Price %]</span>
365       [% END %]
366     </td>
367
368
369     [% BLOCK colorcellvalue %]
370         [% IF parent %]
371             [% IF (value > 0) %]
372                 <span class="child_fund_amount" style="color: green;">
373             [% ELSIF (value < 0) %]
374                 <span class="child_fund_amount" style="color: red;">
375             [% ELSE %]
376                 <span class="child_fund_amount">
377             [% END %]
378          [% ELSE %]
379             [% IF (value > 0) %]
380                 <span class="total_amount" style="color: green;">
381             [% ELSIF (value < 0) %]
382                 <span class="total_amount" style="color: red;">
383             [% ELSE %]
384                 <span class="totalamount">
385             [% END %]
386         [% END %]
387             [% value | $Price %]
388         </span>
389     [% END %]
390     <td class="data">
391         [% INCLUDE colorcellvalue value=budget.budget_remaining parent=budget.budget_parent_id %]
392     </td>
393     <td class="data">
394         [% INCLUDE colorcellvalue value=budget.total_remaining parent=budget.budget_parent_id %]
395     </td>
396     [% IF ( budget.budget_lock ) %]
397         <td> <span></span> </td>
398     [% ELSE %]
399         <td>
400             <div class="dropdown dropup">
401                 <a class="btn btn-mini dropdown-toggle" id="budgetactions[% budget.budget_id %]_[% budget.budget_period_id %]" role="button" data-toggle="dropdown" href="#">
402                    Actions <b class="caret"></b>
403                 </a>
404                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="budgetactions[% budget.budget_id %]_[% budget.budget_period_id %]">
405                     <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>
406                     [% IF budget.budget_has_children %]
407                         <li class="disabled"><a href="#" class="deletefund-disabled" data-toggle="tooltip" data-placement="left" title="This fund has children">Delete</a></li>
408                     [% ELSE %]
409                         <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>
410                     [% END %]
411                     <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>
412                 </ul>
413             </div>
414         </td>
415     [% END %]
416     </tr>
417     [% END %]
418     </tbody>
419 </table>
420
421 [% ELSE %]
422     No fund found
423 [% END %]
424
425 [% END %] <!-- list -->
426
427 <!-- ********************************************************************************************** -->
428 <!-- create add/mod entry form -->
429 [% IF op == 'add_form' && !error_not_authorised_to_modify %]
430 <form action="/cgi-bin/koha/admin/aqbudgets.pl" name="Aform" method="post">
431     <fieldset class="rows">
432     <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
433     [% IF ( budget_period_description ) %]
434         [% budget_name %] for Budget '[% budget_period_description %]'
435     [% END %]
436     </legend>
437
438     <input type="hidden" name="op" value="add_validate" />
439     <input type="hidden" name="checked" value="0" />
440     <ol>
441     [% IF ( budget_parent_id ) %]
442     <li>
443         <span class="label">Fund parent: </span>
444         [% budget_parent_name %]
445         [% budget_parent_id %] - [% budget_parent_name %]
446         <input type="hidden" name="budget_parent_id" value="[% budget_parent_id %]" />
447     </li>
448     [% END %]
449     <li>
450     <label class="required"  for="budget_code">Fund code: </label>
451     <input type="text" name="budget_code" id="budget_code" value="[% budget_code %]" size="30" />
452     </li>
453
454     <li>
455     <label class="required" for="budget_name">Fund name: </label>
456     <input type="text" name="budget_name" id="budget_name" value="[% budget_name %]" size="60" />
457     </li>
458
459     <li>
460     <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
461     <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount | $Price on_editing => 1 %]" size="8" />
462     </li>
463
464     <li>
465       <label for="budget_encumb">Warning at (%): </label>
466       <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb | $Price on_editing => 1 %]" size="10" />
467       <span class="hint">0 to disable</span>
468     </li>
469
470     <li>
471       <label for="budget_expend">Warning at (amount): </label>
472       <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend | $Price on_editing => 1 %]" size="10" />
473       <span class="hint">0 to disable</span>
474     </li>
475
476     <li>
477         <span class="label">Owner: </span>
478         <span  id="budget_owner_name">
479         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% budget_owner_id %]">
480             [% budget_owner_name %]
481         </a>
482         </span>
483         <input type="hidden" name="budget_owner_id" id="budget_owner_id"
484             value="[% budget_owner_id %]" />
485
486         <!-- FIXME: hardcoded button positions :/ -->
487         <input type="button" id="edit_owner" value="Edit owner"
488             onclick="ownerPopup(); return false;" />
489         <input type="button" id="remove_owner" value="Remove owner"
490             onclick="ownerRemove(); return false;" />
491     </li>
492
493     [% IF budget_has_children %]
494         <li class="radio">
495             <label>
496                 <input type="checkbox" id="set_owner_to_children" name="set_owner_to_children" value="1" />
497                 Update all child funds with this owner
498             </label>
499             <span class="hint">Selecting this option will overwrite existing fund owners, if any</span>
500         </li>
501     [% END %]
502
503     <li>
504         <span class="label">Users:</span>
505         <ul style="float:left;" id="budget_users">
506             [% FOREACH user IN budget_users %]
507                 <li id="user_[% user.borrowernumber %]">
508                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% user.borrowernumber %]">
509                         [% user.firstname %] [% user.surname %]
510                     </a>
511                     [<a style="cursor:pointer"
512                     onclick="del_user([% user.borrowernumber %])">Remove</a>]
513                 </li>
514             [% END %]
515             <li id="add_user_button">
516                 <input type="button" onclick="userPopup()" value="Add users" />
517             </li>
518         </ul>
519         <input type="hidden" name="budget_users_ids" id="budget_users_id" value="[% budget_users_ids %]" />
520     <li>
521     <label for="budget_branchcode">Library: </label>
522     <select name="budget_branchcode" id="budget_branchcode">
523     <option value=""></option>
524     [% FOREACH branchloop_selec IN branchloop_select %]
525         [% 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>
526     [% END %]
527     </select>
528     </li>
529
530     <li>
531     <label for="budget_permission">Restrict access to: </label>
532     <select name="budget_permission" id="budget_permission">
533         [% IF ( budget_perm_0 ) %]
534             <option value="0" selected="selected">
535         [% ELSE %]
536             <option value="0">
537         [% END %]
538             None
539         </option>
540
541         [% IF ( budget_perm_1 ) %]
542             <option value="1" selected="selected">
543         [% ELSE %]
544             <option value="1">
545         [% END %]
546             Owner
547         </option>
548
549         [% IF ( budget_perm_3) %]
550             <option value="3" selected="selected">
551         [% ELSE %]
552             <option value="3">
553         [% END %]
554             Owner and users
555         </option>
556
557         [% IF ( budget_perm_2 ) %]
558             <option value="2" selected="selected">
559         [% ELSE %]
560             <option value="2">
561         [% END %]
562             Owner, users and library
563         </option>
564     </select>
565     </li>
566
567     <li>
568     <label for="budget_notes">Notes: </label>
569     <textarea name="budget_notes" id="budget_notes"  cols="80" rows="6">[% budget_notes %]</textarea>
570     </li>
571
572     <li>
573     <label  style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
574         <select name="sort1_authcat" id="authorised_value_category1">
575             <option value=""></option>
576             [% FOREACH authorised_value_categories IN authorised_value_categories1 %]
577                 [% IF ( authorised_value_categories.selected ) %]
578                     <option value="[% authorised_value_categories.category %]" selected="selected">
579                         [% authorised_value_categories.category %]
580                     </option>
581                 [% ELSE %]
582                     <option value="[% authorised_value_categories.category %]">
583                         [% authorised_value_categories.category %]
584                     </option>
585                 [% END %]
586             [% END %]
587         </select>
588     </li>
589     <li>
590     <label  style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
591         <select name="sort2_authcat" id="authorised_value_category2">
592             <option value=""></option>
593             [% FOREACH authorised_value_categories IN authorised_value_categories2 %]
594                 [% IF ( authorised_value_categories.selected ) %]
595                     <option value="[% authorised_value_categories.category %]" selected="selected">
596                         [% authorised_value_categories.category %]
597                     </option>
598                 [% ELSE %]
599                     <option value="[% authorised_value_categories.category %]">
600                         [% authorised_value_categories.category %]
601                     </option>
602                 [% END %]
603             [% END %]
604         </select>
605     </li>
606     </ol>
607
608     [% IF ( budget_id ) %]
609         <input type="hidden" name="budget_id" value="[% budget_id %]" />
610     [% END %]
611     </fieldset>
612
613     <fieldset class="action">
614         <input type="submit" value="Submit" onclick="Check(this.form); return false;" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a>
615         <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
616     </fieldset>
617 </form>
618
619 [% END %] <!-- add_form -->
620
621 [% IF op == 'delete_confirm' %]
622 <div class="dialog alert"> <h3>Delete fund [% budget_name %]?</h3>
623 If you delete this fund, all orders linked to this fund will be deleted!
624 <table>
625     <tr>
626     <th scope="row">Fund amount:</th>
627     <td>[% budget_amount | $Price %]</td>
628     </tr>
629 </table>
630
631 <form action="/cgi-bin/koha/admin/aqbudgets.pl" method="post">
632     <input type="hidden" name="op" value="delete_confirmed" />
633     <input type="hidden" name="budget_id" value="[% budget_id %]" />
634     <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
635     <input type="submit" value="Delete" class="approve" />
636 </form>
637
638 <form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
639     <input type="submit" class="deny" value="Cancel" />
640 </form>
641 </div>
642 [% END %]
643
644 </div>
645 </div>
646 <div class="yui-b">
647 [% IF op == 'list' %]
648   <form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
649     <a href="#" id="filterbutton">Filters</a>
650     <fieldset class="brief" id="fundfilters">
651     <h4>Fund filters</h4>
652         <ol>
653         <li>
654             <label for="filter_budgetbranch2">Library: </label>
655             <select name="filter_budgetbranch" id="filter_budgetbranch2" style="width:10em;">
656                 <option value=""></option>
657                 [% FOREACH branchloo IN branchloop %]
658                 [% UNLESS ( branchloo.selected ) %]<option value="[% branchloo.value %]">
659                 [% ELSE %]<option value="[% branchloo.value %]" selected="selected">[% END %]
660                 [% branchloo.branchname %]</option>
661                 [% END %]
662             </select>
663         </li>
664         <li class="radio">
665
666         <label for="show_mine">Show my funds only</label>
667             [% IF ( show_mine ) %]
668                 <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
669             [% ELSE %]
670                 <input type="checkbox" id="show_mine"  name="show_mine" value="1" />
671         [% END %]
672         </li>
673
674         [% IF periods %]
675           <li>
676             <label for="periods">Budget:</label>
677             <select id="periods" name="budget_period_id">
678               <option value="">All budgets</option>
679               [% FOR period IN periods %]
680                 [% IF budget_period_id && period.budget_period_id == budget_period_id %]
681                   <option value="[% period.budget_period_id %]" selected="selected">[% period.budget_period_description %]</option>
682                 [% ELSE %]
683                   <option value="[% period.budget_period_id %]">[% period.budget_period_description %]</option>
684                 [% END %]
685               [% END %]
686             </select>
687           </li>
688         [% END %]
689         </ol>
690
691         <input type="hidden" name="op" value="list" />
692         <input type="submit" class="submit" name="filter" value="Go" />
693     </fieldset>
694 </form>[% END %]
695 [% INCLUDE 'acquisitions-menu.inc' %]
696 </div>
697 </div>
698 [% INCLUDE 'intranet-bottom.inc' %]