1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Administration › Funds[% IF ( add_form ) %] › [% 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">
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";
12 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
15 <script type="text/javascript">
18 function userPopup() {
19 window.open("/cgi-bin/koha/admin/aqbudget_user_search.pl?type=user",
21 'width=740,height=450,location=yes,toolbar=no,'
22 + 'scrollbars=yes,resize=yes'
26 function ownerPopup() {
27 window.open("/cgi-bin/koha/admin/aqbudget_user_search.pl?type=owner",
29 'width=740,height=450,location=yes,toolbar=no,'
30 + 'scrollbars=yes,resize=yes'
34 function edit_owner(borrowernumber, surname, firstname) {
35 $('#budget_owner_name').empty();
36 $('#budget_owner_id').val('');
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);
46 function ownerRemove() {
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(':'));
67 function del_user(borrowernumber) {
68 var ids = $("#budget_users_id").val().split(':');
70 var idx = ids.indexOf(borrowernumber+'');
73 $("#budget_users_id").val(ids.join(':'));
74 $("li#user_" + borrowernumber).remove();
84 if (!(isNotNull(f.budget_code,1))) {
85 _alertString += _("- Budget code cannot be blank") + "\n";
88 if (!(isNotNull(f.budget_name,1))) {
89 _alertString += _("- Budget name cannot be blank") + "\n";
92 if (!(isNotNull(f.budget_amount,1))) {
93 _alertString += _("- Budget amount cannot be blank") + "\n";
97 if (typeof(f.budget_id ) != "undefined") {
98 budgetId = f.budget_id.value
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
110 newBudgetParent = f.budget_parent_id.item(0).value
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";
119 else if (newBudgetParent) {
120 var result = checkBudgetParent( budgetId , newBudgetParent );
122 _alertString += result;
129 var budgetTotal = Math.abs(f.budget_amount.value);
130 var result = budgetExceedsParent (budgetTotal, budgetId, newBudgetParent, f.budget_period_id.value)
132 _alertString += result;
135 if (_alertString.length==0) {
136 document.Aform.submit();
138 alertString2 = _("Form not submitted because of the following problem(s)");
139 alertString2 += "\n------------------------------------------------------------------------------------\n\n";
140 alertString2 += _alertString;
148 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
149 [% INCLUDE 'datatables.inc' %]
151 <link href="[% themelang %]/lib/jquery/plugins/treetable/stylesheets/jquery.treeTable.css" rel="stylesheet" type="text/css" />
152 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/treetable/jquery.treeTable.min.js"></script>
155 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.qtip.js"></script>
157 <script type="text/javascript">
160 $(document).ready(function() {
161 var tooltipcontent = $(".tooltipcontent");
162 tooltipcontent.hide();
164 $(".tooltiped td").each(function (){
165 contentelem = $(this).parent().children().filter(".tooltipcontent");
166 if(contentelem.html() != ""){
168 content: contentelem.html(),
182 tooltip: "bottomRight"
189 $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
191 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
193 "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
194 "iDisplayLength": 20,
195 "sPaginationType": "four_button"
198 $("#budgeth").treeTable();
201 $("#filterbutton").click(function() {
202 $("#fundfilters").slideToggle(0);
210 <body id="admin_aqbudgets" class="admin">
211 [% INCLUDE 'header.inc' %]
212 [% INCLUDE 'budgets-admin-search.inc' %]
214 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
215 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> › [% IF ( else ) %]Funds for '[% budget_period_description %]'[% END %][% IF ( add_form ) %]
216 <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">Funds</a> › [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund[% END %][% END %] [% IF ( delete_confirm ) %]
217 <a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a> › Delete fund?[% END %]</div>
219 <div id="doc3" class="yui-t2">
222 <div class="yui-b" id="content">
225 [% UNLESS ( delete_confirm ) %][% INCLUDE 'budgets-admin-toolbar.inc' %][% END %]
227 [% IF (error_not_authorised_to_modify) %]
229 <p>You are not authorized to modify this fund</p>
235 <h1>Funds for '[% budget_period_description %]'</h1>
237 [% INCLUDE 'budgets-active-currency.inc' %]
246 <th>Total<br />allocated</th>
247 <th>Base-level<br />allocated</th>
248 <th>Base-level<br />spent</th>
249 <th>Total sublevels<br />spent</th>
250 <th>Base-level<br />remaining</th>
251 <th class="tooltipcontent"> </th>
257 <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF ( budget_period_total ) %][% budget_period_total %][% END %] </th>
258 <th nowrap="nowrap" class="data"> [% period_alloc_total %]</th>
259 <th nowrap="nowrap" class="data"> [% base_alloc_total %]</th>
260 <th class="data">[% base_spent_total %]</th>
261 <th class="data">[% base_spent_total %]</th>
262 <th class="data">[% base_remaining_total %]</th>
263 <th class="tooltipcontent"></th>
268 [% FOREACH budge IN budget %]
269 [% IF ( budge.toggle ) %]
270 <tr id="node-[% budge.budget_id %]" class="highlight[% IF ( budge.budget_parent_id ) %] child-of-node-[% budge.budget_parent_id %][% END %] tooltiped">
272 <tr id="node-[% budge.budget_id %]" class="tooltiped [% IF ( budge.budget_parent_id ) %] child-of-node-[% budge.budget_parent_id %][% END %]">
275 <td>[% budge.budget_code_indent %]</td>
276 <td>[% budge.budget_name %]</td>
277 <td class="data">[% budge.budget_amount_total %]</td>
278 <td class="data">[% budge.budget_amount %] </td>
279 <td class="data">[% budge.budget_spent %] </td>
280 <td class="data">[% budge.total_levels_spent %]</td>
281 [% IF ( budge.remaining_pos ) %]
282 <td class="data" style="color: green;">
283 [% ELSIF ( budge.remaining_neg ) %]
284 <td class="data" style="color: red;">
288 [% budge.budget_remaining %] </td>
290 <td class="tooltipcontent">[% IF ( budge.budget_owner_id ) %]<strong>Owner: </strong><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% budge.budget_owner_id %]">[% budge.budget_owner_name %]</a>[% END %]
291 [% IF ( budge.budget_branchcode ) %]<br /><strong>Library: </strong>[% budge.budget_branchcode %][% END %]
292 [% IF ( budge.budget_notes ) %]<br /><strong>Notes: </strong>[% budge.budget_notes %][% END %]
293 [% IF ( budge.budget_hierarchy ) %]
294 <ul class="budget_hierarchy">[% FOREACH budget_hierarch IN budge.budget_hierarchy %]
295 [% IF ( budget_hierarch.element_id ) %]
296 <li><a href="?op=add_form&budget_id=[% budget_hierarch.element_id %]&budget_period_id=[% budget_hierarch.budget_period_id %]">[% budget_hierarch.element_name %]</a></li>
298 <li><strong>[% budget_hierarch.element_name %] : </strong></li>
303 [% IF ( budge.budget_lock ) %]
304 <td> <span style="color: gray;"> Edit Delete </span> </td>
307 <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_id=[% budge.budget_id %]&budget_period_id=[% budge.budget_period_id %]" >Edit</a>
308 <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=delete_confirm&budget_id=[% budge.budget_id %]&budget_period_id=[% budge.budget_period_id %]">Delete</a>
309 <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_parent_id=[% budge.budget_id %]&budget_period_id=[% budge.budget_period_id %]">Add child fund</a>
321 [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
322 [% END %] <!-- else -->
324 <!-- ********************************************************************************************** -->
325 <!-- create add/mod entry form -->
326 [% IF ( add_form && !error_not_authorised_to_modify ) %]
327 <form action="/cgi-bin/koha/admin/aqbudgets.pl" name="Aform" method="post">
328 <fieldset class="rows">
329 <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
330 [% IF ( budget_period_description ) %]
331 [% budget_name %] for Budget '[% budget_period_description %]'
335 <input type="hidden" name="op" value="add_validate" />
336 <input type="hidden" name="checked" value="0" />
338 [% IF ( budget_parent_id ) %]
340 <span class="label">Fund parent: </span>
341 [% budget_parent_name %]
342 [% budget_parent_id %] - [% budget_parent_name %]
343 <input type="hidden" name="budget_parent_id" value="[% budget_parent_id %]" />
347 <label class="required" for="budget_code">Fund code: </label>
348 <input type="text" name="budget_code" id="budget_code" value="[% budget_code %]" size="30" />
352 <label class="required" for="budget_name">Fund name: </label>
353 <input type="text" name="budget_name" id="budget_name" value="[% budget_name %]" size="60" />
357 <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
358 <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount %]" size="8" />
362 <label for="budget_encumb">Warning at (%): </label>
363 <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb %]" size="10" />
364 <span style="color:grey">0 to disable</span>
368 <label for="budget_expend">Warning at (amount): </label>
369 <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 %]" />
370 <span style="color:grey">0 to disable</span>
374 <span class="label">Owner: </span>
375 <span id="budget_owner_name">
376 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% budget_owner_id %]">
377 [% budget_owner_name %]
380 <input type="hidden" name="budget_owner_id" id="budget_owner_id"
381 value="[% budget_owner_id %]" />
383 <!-- FIXME: hardcoded button positions :/ -->
384 <input type="button" id="edit_owner" value="Edit owner"
385 onclick="ownerPopup(); return false;" />
386 <input type="button" id="remove_owner" value="Remove owner"
387 onclick="ownerRemove(); return false;" />
391 <span class="label">Users:</span>
392 <ul style="float:left;" id="budget_users">
393 [% FOREACH user IN budget_users %]
394 <li id="user_[% user.borrowernumber %]">
395 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% user.borrowernumber %]">
396 [% user.firstname %] [% user.surname %]
398 [<a style="cursor:pointer"
399 onclick="del_user([% user.borrowernumber %])">Remove</a>]
402 <li id="add_user_button">
403 <input type="button" onclick="userPopup()" value="Add users" />
406 <input type="hidden" name="budget_users_ids" id="budget_users_id" value="[% budget_users_ids %]" />
408 <label for="budget_branchcode">Library: </label>
409 <select name="budget_branchcode" id="budget_branchcode">
410 <option value=""></option>
411 [% FOREACH branchloop_selec IN branchloop_select %]
412 [% 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>
418 <label for="budget_permission">Restrict access to: </label>
419 <select name="budget_permission" id="budget_permission">
420 [% IF ( budget_perm_0 ) %]
421 <option value="0" selected="selected">
428 [% IF ( budget_perm_1 ) %]
429 <option value="1" selected="selected">
436 [% IF ( budget_perm_3) %]
437 <option value="3" selected="selected">
444 [% IF ( budget_perm_2 ) %]
445 <option value="2" selected="selected">
449 Owner, users and library
455 <label for="budget_notes">Notes: </label>
456 <textarea name="budget_notes" id="budget_notes" cols="80" rows="6">[% budget_notes %]</textarea>
460 <label style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
461 <select name="sort1_authcat" id="authorised_value_category1">
462 <option value=""></option>
463 [% FOREACH authorised_value_categories IN authorised_value_categories1 %]
464 [% IF ( authorised_value_categories.selected ) %]
465 <option value="[% authorised_value_categories.category %]" selected="selected">
466 [% authorised_value_categories.category %]
469 <option value="[% authorised_value_categories.category %]">
470 [% authorised_value_categories.category %]
477 <label style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
478 <select name="sort2_authcat" id="authorised_value_category2">
479 <option value=""></option>
480 [% FOREACH authorised_value_categories IN authorised_value_categories2 %]
481 [% IF ( authorised_value_categories.selected ) %]
482 <option value="[% authorised_value_categories.category %]" selected="selected">
483 [% authorised_value_categories.category %]
486 <option value="[% authorised_value_categories.category %]">
487 [% authorised_value_categories.category %]
495 [% IF ( budget_id ) %]
496 <input type="hidden" name="budget_id" value="[% budget_id %]" />
500 <fieldset class="action">
501 <input type="submit" value="Submit" onclick="Check(this.form); return false;" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a>
502 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
506 [% END %] <!-- add_form -->
508 [% IF ( delete_confirm ) %]
509 <div class="dialog alert"> <h3>Delete fund [% budget_name %]?</h3>
512 <th scope="row">Fund amount:</th>
513 <td>[% budget_amount %]</td>
517 <form action="[% action %]" method="post">
518 <input type="hidden" name="op" value="delete_confirmed" />
519 <input type="hidden" name="budget_id" value="[% budget_id %]" />
520 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
521 <input type="submit" value="Delete" class="approve" />
524 <form action="[% action %]" method="get">
525 <input type="submit" class="deny" value="Cancel" />
533 [% IF ( else ) %]<form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
534 <a href="#" id="filterbutton">Filters</a>
535 <fieldset class="brief" id="fundfilters">
536 <h4>Fund filters</h4>
539 <label for="filter_budgetbranch2">Library: </label>
540 <select name="filter_budgetbranch" id="filter_budgetbranch2" style="width:10em;">
541 <option value=""></option>
542 [% FOREACH branchloo IN branchloop %]
543 [% UNLESS ( branchloo.selected ) %]<option value="[% branchloo.value %]">
544 [% ELSE %]<option value="[% branchloo.value %]" selected="selected">[% END %]
545 [% branchloo.branchname %]</option>
551 <label for="show_mine">Show my funds only</label>
552 [% IF ( show_mine ) %]
553 <input type="checkbox" id="show_mine" name="show_mine" value="1" checked="checked" />
555 <input type="checkbox" id="show_mine" name="show_mine" value="1" />
560 <input type="hidden" name="show" value="1" />
561 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
562 <input type="submit" class="submit" name="filter" value="Go" />
565 [% INCLUDE 'acquisitions-menu.inc' %]
568 [% INCLUDE 'intranet-bottom.inc' %]