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 "sPaginationType": "four_button"
196 $("#budgeth").treeTable();
199 $("#filterbutton").click(function() {
200 $("#fundfilters").slideToggle(0);
208 <body id="admin_aqbudgets" class="admin">
209 [% INCLUDE 'header.inc' %]
210 [% INCLUDE 'budgets-admin-search.inc' %]
212 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
213 <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 ) %]
214 <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 ) %]
215 <a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a> › Delete fund?[% END %]</div>
217 <div id="doc3" class="yui-t2">
220 <div class="yui-b" id="content">
223 [% UNLESS ( delete_confirm ) %][% INCLUDE 'budgets-admin-toolbar.inc' %][% END %]
225 [% IF (error_not_authorised_to_modify) %]
227 <p>You are not authorized to modify this fund</p>
233 <h1>Funds for '[% budget_period_description %]'</h1>
235 [% INCLUDE 'budgets-active-currency.inc' %]
244 <th>Base-level allocated</th>
245 <th>Base-level ordered</th>
246 <th>Total ordered</th>
247 <th>Base-level spent</th>
249 <th>Base-level available</th>
250 <th>Total available</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>
260 <th class="data">[% ordered_total %]</th>
262 <th class="data">[% spent_total %]</th>
264 <th class="tooltipcontent"></th>
265 <th class="data">[% available_total %]</th>
270 [% FOREACH budge IN budget %]
271 [% IF ( budge.toggle ) %]
272 <tr id="node-[% budge.budget_id %]" class="highlight[% IF ( budge.budget_parent_id ) %] child-of-node-[% budge.budget_parent_id %][% END %] tooltiped">
274 <tr id="node-[% budge.budget_id %]" class="tooltiped [% IF ( budge.budget_parent_id ) %] child-of-node-[% budge.budget_parent_id %][% END %]">
277 <td>[% budge.budget_code_indent %]</td>
278 <td>[% budge.budget_name %]</td>
279 <td class="data">[% budge.budget_amount %] </td>
280 <td class="data">[% budge.budget_ordered %]</td>
281 <td class="data">[% budge.total_ordered %]</td>
282 <td class="data">[% budge.budget_spent %] </td>
283 <td class="data">[% budge.total_spent %]</td>
285 [% BLOCK colorcellvalue %]
287 <span style="color: green;">
288 [% ELSIF (value < 0) %]
289 <span style="color: red;">
297 [% INCLUDE colorcellvalue value=budge.budget_remaining text=budge.budget_remaining_display %]
300 [% INCLUDE colorcellvalue value=budge.total_remaining text=budge.total_remaining_display %]
303 <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 %]
304 [% IF ( budge.budget_branchcode ) %]<br /><strong>Library: </strong>[% budge.budget_branchcode %][% END %]
305 [% IF ( budge.budget_notes ) %]<br /><strong>Notes: </strong>[% budge.budget_notes %][% END %]
306 [% IF ( budge.budget_hierarchy ) %]
307 <ul class="budget_hierarchy">[% FOREACH budget_hierarch IN budge.budget_hierarchy %]
308 [% IF ( budget_hierarch.element_id ) %]
309 <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>
311 <li><strong>[% budget_hierarch.element_name %] : </strong></li>
316 [% IF ( budge.budget_lock ) %]
317 <td> <span style="color: gray;"> Edit Delete </span> </td>
320 <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>
321 <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>
322 <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>
334 [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
335 [% END %] <!-- else -->
337 <!-- ********************************************************************************************** -->
338 <!-- create add/mod entry form -->
339 [% IF ( add_form && !error_not_authorised_to_modify ) %]
340 <form action="/cgi-bin/koha/admin/aqbudgets.pl" name="Aform" method="post">
341 <fieldset class="rows">
342 <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
343 [% IF ( budget_period_description ) %]
344 [% budget_name %] for Budget '[% budget_period_description %]'
348 <input type="hidden" name="op" value="add_validate" />
349 <input type="hidden" name="checked" value="0" />
351 [% IF ( budget_parent_id ) %]
353 <span class="label">Fund parent: </span>
354 [% budget_parent_name %]
355 [% budget_parent_id %] - [% budget_parent_name %]
356 <input type="hidden" name="budget_parent_id" value="[% budget_parent_id %]" />
360 <label class="required" for="budget_code">Fund code: </label>
361 <input type="text" name="budget_code" id="budget_code" value="[% budget_code %]" size="30" />
365 <label class="required" for="budget_name">Fund name: </label>
366 <input type="text" name="budget_name" id="budget_name" value="[% budget_name %]" size="60" />
370 <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
371 <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount %]" size="8" />
375 <label for="budget_encumb">Warning at (%): </label>
376 <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb %]" size="10" />
377 <span style="color:grey">0 to disable</span>
381 <label for="budget_expend">Warning at (amount): </label>
382 <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 %]" />
383 <span style="color:grey">0 to disable</span>
387 <span class="label">Owner: </span>
388 <span id="budget_owner_name">
389 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% budget_owner_id %]">
390 [% budget_owner_name %]
393 <input type="hidden" name="budget_owner_id" id="budget_owner_id"
394 value="[% budget_owner_id %]" />
396 <!-- FIXME: hardcoded button positions :/ -->
397 <input type="button" id="edit_owner" value="Edit owner"
398 onclick="ownerPopup(); return false;" />
399 <input type="button" id="remove_owner" value="Remove owner"
400 onclick="ownerRemove(); return false;" />
404 <span class="label">Users:</span>
405 <ul style="float:left;" id="budget_users">
406 [% FOREACH user IN budget_users %]
407 <li id="user_[% user.borrowernumber %]">
408 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% user.borrowernumber %]">
409 [% user.firstname %] [% user.surname %]
411 [<a style="cursor:pointer"
412 onclick="del_user([% user.borrowernumber %])">Remove</a>]
415 <li id="add_user_button">
416 <input type="button" onclick="userPopup()" value="Add users" />
419 <input type="hidden" name="budget_users_ids" id="budget_users_id" value="[% budget_users_ids %]" />
421 <label for="budget_branchcode">Library: </label>
422 <select name="budget_branchcode" id="budget_branchcode">
423 <option value=""></option>
424 [% FOREACH branchloop_selec IN branchloop_select %]
425 [% 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>
431 <label for="budget_permission">Restrict access to: </label>
432 <select name="budget_permission" id="budget_permission">
433 [% IF ( budget_perm_0 ) %]
434 <option value="0" selected="selected">
441 [% IF ( budget_perm_1 ) %]
442 <option value="1" selected="selected">
449 [% IF ( budget_perm_3) %]
450 <option value="3" selected="selected">
457 [% IF ( budget_perm_2 ) %]
458 <option value="2" selected="selected">
462 Owner, users and library
468 <label for="budget_notes">Notes: </label>
469 <textarea name="budget_notes" id="budget_notes" cols="80" rows="6">[% budget_notes %]</textarea>
473 <label style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
474 <select name="sort1_authcat" id="authorised_value_category1">
475 <option value=""></option>
476 [% FOREACH authorised_value_categories IN authorised_value_categories1 %]
477 [% IF ( authorised_value_categories.selected ) %]
478 <option value="[% authorised_value_categories.category %]" selected="selected">
479 [% authorised_value_categories.category %]
482 <option value="[% authorised_value_categories.category %]">
483 [% authorised_value_categories.category %]
490 <label style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
491 <select name="sort2_authcat" id="authorised_value_category2">
492 <option value=""></option>
493 [% FOREACH authorised_value_categories IN authorised_value_categories2 %]
494 [% IF ( authorised_value_categories.selected ) %]
495 <option value="[% authorised_value_categories.category %]" selected="selected">
496 [% authorised_value_categories.category %]
499 <option value="[% authorised_value_categories.category %]">
500 [% authorised_value_categories.category %]
508 [% IF ( budget_id ) %]
509 <input type="hidden" name="budget_id" value="[% budget_id %]" />
513 <fieldset class="action">
514 <input type="submit" value="Submit" onclick="Check(this.form); return false;" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a>
515 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
519 [% END %] <!-- add_form -->
521 [% IF ( delete_confirm ) %]
522 <div class="dialog alert"> <h3>Delete fund [% budget_name %]?</h3>
525 <th scope="row">Fund amount:</th>
526 <td>[% budget_amount %]</td>
530 <form action="[% action %]" method="post">
531 <input type="hidden" name="op" value="delete_confirmed" />
532 <input type="hidden" name="budget_id" value="[% budget_id %]" />
533 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
534 <input type="submit" value="Delete" class="approve" />
537 <form action="[% action %]" method="get">
538 <input type="submit" class="deny" value="Cancel" />
546 [% IF ( else ) %]<form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
547 <a href="#" id="filterbutton">Filters</a>
548 <fieldset class="brief" id="fundfilters">
549 <h4>Fund filters</h4>
552 <label for="filter_budgetbranch2">Library: </label>
553 <select name="filter_budgetbranch" id="filter_budgetbranch2" style="width:10em;">
554 <option value=""></option>
555 [% FOREACH branchloo IN branchloop %]
556 [% UNLESS ( branchloo.selected ) %]<option value="[% branchloo.value %]">
557 [% ELSE %]<option value="[% branchloo.value %]" selected="selected">[% END %]
558 [% branchloo.branchname %]</option>
564 <label for="show_mine">Show my funds only</label>
565 [% IF ( show_mine ) %]
566 <input type="checkbox" id="show_mine" name="show_mine" value="1" checked="checked" />
568 <input type="checkbox" id="show_mine" name="show_mine" value="1" />
573 <input type="hidden" name="show" value="1" />
574 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
575 <input type="submit" class="submit" name="filter" value="Go" />
578 [% INCLUDE 'acquisitions-menu.inc' %]
581 [% INCLUDE 'intranet-bottom.inc' %]