Bug 12019: FIX budget_owner_id node is duplicated
[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[0].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                 { "bSortable": false, "aTargets": ["_all"] }
185             ],
186             'bSort': true,
187             'aaSortingFixed': [[ 1, 'asc' ]],
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( 1, 0 ); // Show only active=1
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     [% IF budget.budget_parent_id %]
311       <tr data-tt-id="[% budget.budget_id %]" data-tt-parent-id="[% budget.budget_parent_id %]">
312     [% ELSE %]
313       <tr data-tt-id="[% budget.budget_id %]">
314     [% END %]
315     <td>[% budget.budget_period_active %]</td>
316     <td>Budget [% budget.budget_period_description %] [id=[% budget.budget_period_id %]][% UNLESS budget.budget_period_active %] (inactive)[% END %]</td>
317     <td>[% budget.budget_code_indent %]</td>
318     <td>[% budget.budget_name %]</td>
319     <td class="data">
320       [% IF budget.budget_parent_id %]
321         <span class="child_fund_amount">[% budget.budget_amount %]</span>
322       [% ELSE %]
323         [% budget.budget_amount %]
324       [% END %]
325     </td>
326     <td class="data">
327       [% IF budget.budget_parent_id %]
328         <span class="child_fund_amount">[% budget.budget_ordered %]</span>
329       [% ELSE %]
330         [% budget.budget_ordered %]
331       [% END %]
332     </td>
333     <td class="data">
334       [% IF budget.budget_parent_id %]
335         <span class="child_fund_amount">[% budget.total_ordered %]</span>
336       [% ELSE %]
337         [% budget.total_ordered %]
338       [% END %]
339     </td>
340     <td class="data">
341       [% IF budget.budget_parent_id %]
342         <span class="child_fund_amount">[% budget.budget_spent %]</span>
343       [% ELSE %]
344         [% budget.budget_spent %]
345       [% END %]
346     </td>
347     <td class="data">
348       [% IF budget.budget_parent_id %]
349         <span class="child_fund_amount">[% budget.total_spent %]</span>
350       [% ELSE %]
351         [% budget.total_spent %]
352       [% END %]
353     </td>
354
355
356     [% BLOCK colorcellvalue %]
357         [% IF parent %]
358             [% IF (value > 0) %]
359                 <span class="child_fund_amount" style="color: green;">
360             [% ELSIF (value < 0) %]
361                 <span class="child_fund_amount" style="color: red;">
362             [% ELSE %]
363                 <span class="child_fund_amount">
364             [% END %]
365          [% ELSE %]
366             [% IF (value > 0) %]
367                 <span style="color: green;">
368             [% ELSIF (value < 0) %]
369                 <span style="color: red;">
370             [% ELSE %]
371                 <span>
372             [% END %]
373         [% END %]
374             [% text %]
375         </span>
376     [% END %]
377     <td class="data">
378         [% INCLUDE colorcellvalue value=budget.budget_remaining text=budget.budget_remaining_display parent=budget.budget_parent_id %]
379     </td>
380     <td class="data">
381         [% INCLUDE colorcellvalue value=budget.total_remaining text=budget.total_remaining_display parent=budget.budget_parent_id %]
382     </td>
383     [% IF ( budget.budget_lock ) %]
384         <td> <span style="color: gray;"> Edit Delete </span> </td>
385     [% ELSE %]
386         <td>
387             <div class="dropdown dropup">
388                 <a class="btn btn-mini dropdown-toggle" id="budgetactions[% budget.budget_id %]_[% budget.budget_period_id %]" role="button" data-toggle="dropdown" href="#">
389                    Actions <b class="caret"></b>
390                 </a>
391                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="budgetactions[% budget.budget_id %]_[% budget.budget_period_id %]">
392                     <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>
393                     <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>
394                     <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>
395                 </ul>
396             </div>
397         </td>
398     [% END %]
399     </tr>
400     [% END %]
401     </tbody>
402 </table>
403
404 [% ELSE %]
405     No fund found
406 [% END %]
407
408 [% END %] <!-- list -->
409
410 <!-- ********************************************************************************************** -->
411 <!-- create add/mod entry form -->
412 [% IF op == 'add_form' && !error_not_authorised_to_modify %]
413 <form action="/cgi-bin/koha/admin/aqbudgets.pl" name="Aform" method="post">
414     <fieldset class="rows">
415     <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
416     [% IF ( budget_period_description ) %]
417         [% budget_name %] for Budget '[% budget_period_description %]'
418     [% END %]
419     </legend>
420
421     <input type="hidden" name="op" value="add_validate" />
422     <input type="hidden" name="checked" value="0" />
423     <ol>
424     [% IF ( budget_parent_id ) %]
425     <li>
426         <span class="label">Fund parent: </span>
427         [% budget_parent_name %]
428         [% budget_parent_id %] - [% budget_parent_name %]
429         <input type="hidden" name="budget_parent_id" value="[% budget_parent_id %]" />
430     </li>
431     [% END %]
432     <li>
433     <label class="required"  for="budget_code">Fund code: </label>
434     <input type="text" name="budget_code" id="budget_code" value="[% budget_code %]" size="30" />
435     </li>
436
437     <li>
438     <label class="required" for="budget_name">Fund name: </label>
439     <input type="text" name="budget_name" id="budget_name" value="[% budget_name %]" size="60" />
440     </li>
441
442     <li>
443     <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
444     <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount %]" size="8" />
445     </li>
446
447     <li>
448       <label for="budget_encumb">Warning at (%): </label>
449       <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb %]" size="10" />
450       <span style="color:grey">0 to disable</span>
451     </li>
452
453     <li>
454       <label for="budget_expend">Warning at (amount): </label>
455       <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend %]" size="10" />
456       <span style="color:grey">0 to disable</span>
457     </li>
458
459     <li>
460         <span class="label">Owner: </span>
461         <span  id="budget_owner_name">
462         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% budget_owner_id %]">
463             [% budget_owner_name %]
464         </a>
465         </span>
466         <input type="hidden" name="budget_owner_id" id="budget_owner_id"
467             value="[% budget_owner_id %]" />
468
469         <!-- FIXME: hardcoded button positions :/ -->
470         <input type="button" id="edit_owner" value="Edit owner"
471             onclick="ownerPopup(); return false;" />
472         <input type="button" id="remove_owner" value="Remove owner"
473             onclick="ownerRemove(); return false;" />
474     </li>
475
476     <li>
477         <span class="label">Users:</span>
478         <ul style="float:left;" id="budget_users">
479             [% FOREACH user IN budget_users %]
480                 <li id="user_[% user.borrowernumber %]">
481                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% user.borrowernumber %]">
482                         [% user.firstname %] [% user.surname %]
483                     </a>
484                     [<a style="cursor:pointer"
485                     onclick="del_user([% user.borrowernumber %])">Remove</a>]
486                 </li>
487             [% END %]
488             <li id="add_user_button">
489                 <input type="button" onclick="userPopup()" value="Add users" />
490             </li>
491         </ul>
492         <input type="hidden" name="budget_users_ids" id="budget_users_id" value="[% budget_users_ids %]" />
493     <li>
494     <label for="budget_branchcode">Library: </label>
495     <select name="budget_branchcode" id="budget_branchcode">
496     <option value=""></option>
497     [% FOREACH branchloop_selec IN branchloop_select %]
498         [% 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>
499     [% END %]
500     </select>
501     </li>
502
503     <li>
504     <label for="budget_permission">Restrict access to: </label>
505     <select name="budget_permission" id="budget_permission">
506         [% IF ( budget_perm_0 ) %]
507             <option value="0" selected="selected">
508         [% ELSE %]
509             <option value="0">
510         [% END %]
511             None
512         </option>
513
514         [% IF ( budget_perm_1 ) %]
515             <option value="1" selected="selected">
516         [% ELSE %]
517             <option value="1">
518         [% END %]
519             Owner
520         </option>
521
522         [% IF ( budget_perm_3) %]
523             <option value="3" selected="selected">
524         [% ELSE %]
525             <option value="3">
526         [% END %]
527             Owner and users
528         </option>
529
530         [% IF ( budget_perm_2 ) %]
531             <option value="2" selected="selected">
532         [% ELSE %]
533             <option value="2">
534         [% END %]
535             Owner, users and library
536         </option>
537     </select>
538     </li>
539
540     <li>
541     <label for="budget_notes">Notes: </label>
542     <textarea name="budget_notes" id="budget_notes"  cols="80" rows="6">[% budget_notes %]</textarea>
543     </li>
544
545     <li>
546     <label  style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
547         <select name="sort1_authcat" id="authorised_value_category1">
548             <option value=""></option>
549             [% FOREACH authorised_value_categories IN authorised_value_categories1 %]
550                 [% IF ( authorised_value_categories.selected ) %]
551                     <option value="[% authorised_value_categories.category %]" selected="selected">
552                         [% authorised_value_categories.category %]
553                     </option>
554                 [% ELSE %]
555                     <option value="[% authorised_value_categories.category %]">
556                         [% authorised_value_categories.category %]
557                     </option>
558                 [% END %]
559             [% END %]
560         </select>
561     </li>
562     <li>
563     <label  style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
564         <select name="sort2_authcat" id="authorised_value_category2">
565             <option value=""></option>
566             [% FOREACH authorised_value_categories IN authorised_value_categories2 %]
567                 [% IF ( authorised_value_categories.selected ) %]
568                     <option value="[% authorised_value_categories.category %]" selected="selected">
569                         [% authorised_value_categories.category %]
570                     </option>
571                 [% ELSE %]
572                     <option value="[% authorised_value_categories.category %]">
573                         [% authorised_value_categories.category %]
574                     </option>
575                 [% END %]
576             [% END %]
577         </select>
578     </li>
579     </ol>
580
581     [% IF ( budget_id ) %]
582         <input type="hidden" name="budget_id" value="[% budget_id %]" />
583     [% END %]
584     </fieldset>
585
586     <fieldset class="action">
587         <input type="submit" value="Submit" onclick="Check(this.form); return false;" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a>
588         <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
589     </fieldset>
590 </form>
591
592 [% END %] <!-- add_form -->
593
594 [% IF op == 'delete_confirm' %]
595 <div class="dialog alert"> <h3>Delete fund [% budget_name %]?</h3>
596 <table>
597     <tr>
598     <th scope="row">Fund amount:</th>
599     <td>[% budget_amount %]</td>
600     </tr>
601 </table>
602
603 <form action="/cgi-bin/koha/admin/aqbudgets.pl" method="post">
604     <input type="hidden" name="op" value="delete_confirmed" />
605     <input type="hidden" name="budget_id" value="[% budget_id %]" />
606     <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
607     <input type="submit" value="Delete" class="approve" />
608 </form>
609
610 <form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
611     <input type="submit" class="deny" value="Cancel" />
612 </form>
613 </div>
614 [% END %]
615
616 </div>
617 </div>
618 <div class="yui-b">
619 [% IF op == 'list' %]
620   <form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
621     <a href="#" id="filterbutton">Filters</a>
622     <fieldset class="brief" id="fundfilters">
623     <h4>Fund filters</h4>
624         <ol>
625         <li>
626             <label for="filter_budgetbranch2">Library: </label>
627             <select name="filter_budgetbranch" id="filter_budgetbranch2" style="width:10em;">
628                 <option value=""></option>
629                 [% FOREACH branchloo IN branchloop %]
630                 [% UNLESS ( branchloo.selected ) %]<option value="[% branchloo.value %]">
631                 [% ELSE %]<option value="[% branchloo.value %]" selected="selected">[% END %]
632                 [% branchloo.branchname %]</option>
633                 [% END %]
634             </select>
635         </li>
636         <li class="radio">
637
638         <label for="show_mine">Show my funds only</label>
639             [% IF ( show_mine ) %]
640                 <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
641             [% ELSE %]
642                 <input type="checkbox" id="show_mine"  name="show_mine" value="1" />
643         [% END %]
644         </li>
645
646         [% IF periods %]
647           <li>
648             <label for="periods">Budget:</label>
649             <select id="periods" name="budget_period_id">
650               <option value="">All budgets</option>
651               [% FOR period IN periods %]
652                 [% IF budget_period_id && period.budget_period_id == budget_period_id %]
653                   <option value="[% period.budget_period_id %]" selected="selected">[% period.budget_period_description %]</option>
654                 [% ELSE %]
655                   <option value="[% period.budget_period_id %]">[% period.budget_period_description %]</option>
656                 [% END %]
657               [% END %]
658             </select>
659           </li>
660         [% END %]
661         </ol>
662
663         <input type="hidden" name="op" value="list" />
664         <input type="submit" class="submit" name="filter" value="Go" />
665     </fieldset>
666 </form>[% END %]
667 [% INCLUDE 'acquisitions-menu.inc' %]
668 </div>
669 </div>
670 [% INCLUDE 'intranet-bottom.inc' %]