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