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