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