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