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_PARENT_BENEATH_BUDGET = _("- New budget-parent is beneath budget\n");
11 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
14 <script type="text/javascript">
17 function userPopup() {
18 window.open("/cgi-bin/koha/admin/aqbudget_user_search.pl?type=user",
20 'width=740,height=450,location=yes,toolbar=no,'
21 + 'scrollbars=yes,resize=yes'
25 function ownerPopup() {
26 window.open("/cgi-bin/koha/admin/aqbudget_user_search.pl?type=owner",
28 'width=740,height=450,location=yes,toolbar=no,'
29 + 'scrollbars=yes,resize=yes'
33 function edit_owner(borrowernumber, surname, firstname) {
34 $('#budget_owner_name').empty();
35 $('#budget_owner_id').val('');
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);
45 function ownerRemove() {
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(':'));
66 function del_user(borrowernumber) {
67 var ids = $("#budget_users_id").val().split(':');
69 var idx = ids.indexOf(borrowernumber+'');
72 $("#budget_users_id").val(ids.join(':'));
73 $("li#user_" + borrowernumber).remove();
83 if (!(isNotNull(f.budget_code,1))) {
84 _alertString += _("- Budget code cannot be blank") + "\n";
87 if (!(isNotNull(f.budget_name,1))) {
88 _alertString += _("- Budget name cannot be blank") + "\n";
91 if (!(isNotNull(f.budget_amount,1))) {
92 _alertString += _("- Budget amount cannot be blank") + "\n";
96 if (typeof(f.budget_id ) != "undefined") {
97 budgetId = f.budget_id.value
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
109 newBudgetParent = f.budget_parent_id.item(0).value
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";
118 else if (newBudgetParent) {
119 var result = checkBudgetParent( budgetId , newBudgetParent );
121 _alertString += result;
128 var budgetTotal = Math.abs(f.budget_amount.value);
129 var result = budgetExceedsParent (budgetTotal, budgetId, newBudgetParent, f.budget_period_id.value)
131 _alertString += result;
134 if (_alertString.length==0) {
135 document.Aform.submit();
137 alertString2 = _("Form not submitted because of the following problem(s)");
138 alertString2 += "\n------------------------------------------------------------------------------------\n\n";
139 alertString2 += _alertString;
147 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
148 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
149 [% INCLUDE 'datatables-strings.inc' %]
150 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
152 <link href="[% themelang %]/lib/jquery/plugins/treetable/stylesheets/jquery.treeTable.css" rel="stylesheet" type="text/css" />
153 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/treetable/jquery.treeTable.min.js"></script>
156 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.qtip.js"></script>
158 <script type="text/javascript">
161 $(document).ready(function() {
162 var tooltipcontent = $(".tooltipcontent");
163 tooltipcontent.hide();
165 $(".tooltiped td").each(function (){
166 contentelem = $(this).parent().children().filter(".tooltipcontent");
167 if(contentelem.html() != ""){
169 content: contentelem.html(),
183 tooltip: "bottomRight"
190 $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
192 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
194 "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
195 "iDisplayLength": 20,
196 "sPaginationType": "four_button"
199 $("#budgeth").treeTable();
202 $("#filterbutton").click(function() {
203 $("#fundfilters").slideToggle(0);
211 <body id="admin_aqbudgets" class="admin">
212 [% INCLUDE 'header.inc' %]
213 [% INCLUDE 'budgets-admin-search.inc' %]
215 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
216 <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 ) %]
217 <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 ) %]
218 <a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a> › Delete fund?[% END %]</div>
220 <div id="doc3" class="yui-t2">
223 <div class="yui-b" id="content">
226 [% UNLESS ( delete_confirm ) %][% INCLUDE 'budgets-admin-toolbar.inc' %][% END %]
228 [% IF (error_not_authorised_to_modify) %]
230 <p>You are not authorized to modify this fund</p>
236 <h1>Funds for '[% budget_period_description %]'</h1>
238 [% INCLUDE 'budgets-active-currency.inc' %]
247 <th>Total<br />allocated</th>
248 <th>Base-level<br />allocated</th>
249 <th>Base-level<br />spent</th>
250 <th>Total sublevels<br />spent</th>
251 <th>Base-level<br />remaining</th>
252 <th class="tooltipcontent"> </th>
258 <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF ( budget_period_total ) %][% budget_period_total %][% END %] </th>
259 <th nowrap="nowrap" class="data"> [% period_alloc_total %]</th>
260 <th nowrap="nowrap" class="data"> [% base_alloc_total %]</th>
261 <th class="data">[% base_spent_total %]</th>
262 <th class="data">[% base_spent_total %]</th>
263 <th class="data">[% base_remaining_total %]</th>
264 <th class="tooltipcontent"></th>
269 [% FOREACH budge IN budget %]
270 [% IF ( budge.toggle ) %]
271 <tr id="node-[% budge.budget_id %]" class="highlight[% IF ( budge.budget_parent_id ) %] child-of-node-[% budge.budget_parent_id %][% END %] tooltiped">
273 <tr id="node-[% budge.budget_id %]" class="tooltiped [% IF ( budge.budget_parent_id ) %] child-of-node-[% budge.budget_parent_id %][% END %]">
276 <td>[% budge.budget_code_indent %]</td>
277 <td>[% budge.budget_name %]</td>
278 <td class="data">[% budge.budget_amount_total %]</td>
279 <td class="data">[% budge.budget_amount %] </td>
280 <td class="data">[% budge.budget_spent %] </td>
281 <td class="data">[% budge.total_levels_spent %]</td>
282 [% IF ( budge.remaining_pos ) %]
283 <td class="data" style="color: green;">
284 [% ELSIF ( budge.remaining_neg ) %]
285 <td class="data" style="color: red;">
289 [% budge.budget_remaining %] </td>
291 <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 %]
292 [% IF ( budge.budget_branchcode ) %]<br /><strong>Library: </strong>[% budge.budget_branchcode %][% END %]
293 [% IF ( budge.budget_notes ) %]<br /><strong>Notes: </strong>[% budge.budget_notes %][% END %]
294 [% IF ( budge.budget_hierarchy ) %]
295 <ul class="budget_hierarchy">[% FOREACH budget_hierarch IN budge.budget_hierarchy %]
296 [% IF ( budget_hierarch.element_id ) %]
297 <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>
299 <li><strong>[% budget_hierarch.element_name %] : </strong></li>
304 [% IF ( budge.budget_lock ) %]
305 <td> <span style="color: gray;"> Edit Delete </span> </td>
308 <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>
309 <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>
310 <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>
322 [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
323 [% END %] <!-- else -->
325 <!-- ********************************************************************************************** -->
326 <!-- create add/mod entry form -->
327 [% IF ( add_form && !error_not_authorised_to_modify ) %]
328 <form action="/cgi-bin/koha/admin/aqbudgets.pl" name="Aform" method="post">
329 <fieldset class="rows">
330 <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
331 [% IF ( budget_period_description ) %]
332 [% budget_name %] for Budget '[% budget_period_description %]'
336 <input type="hidden" name="op" value="add_validate" />
337 <input type="hidden" name="checked" value="0" />
339 [% IF ( budget_parent_id ) %]
341 <span class="label">Fund parent: </span>
342 [% budget_parent_name %]
343 [% budget_parent_id %] - [% budget_parent_name %]
344 <input type="hidden" name="budget_parent_id" value="[% budget_parent_id %]" />
348 <label class="required" for="budget_code">Fund code: </label>
349 <input type="text" name="budget_code" id="budget_code" value="[% budget_code %]" size="30" />
353 <label class="required" for="budget_name">Fund name: </label>
354 <input type="text" name="budget_name" id="budget_name" value="[% budget_name %]" size="60" />
358 <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
359 <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount %]" size="8" />
362 <li style="display:none;">
363 <label for="budget_encumb">Encumbrance: </label>
364 <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb %]" size="8" />
367 <li style="display:none;">
368 <label for="budget_expend">Expenditure: </label>
369 <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend %]" size="8" />
373 <span class="label">Owner: </span>
374 <span id="budget_owner_name">
375 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% budget_owner_id %]">
376 [% budget_owner_name %]
379 <input type="hidden" name="budget_owner_id" id="budget_owner_id"
380 value="[% budget_owner_id %]" />
382 <!-- FIXME: hardcoded button positions :/ -->
383 <input type="button" id="edit_owner" value="Edit owner"
384 onclick="ownerPopup(); return false;" />
385 <input type="button" id="remove_owner" value="Remove owner"
386 onclick="ownerRemove(); return false;" />
390 <span class="label">Users:</span>
391 <ul style="float:left;" id="budget_users">
392 [% FOREACH user IN budget_users %]
393 <li id="user_[% user.borrowernumber %]">
394 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% user.borrowernumber %]">
395 [% user.firstname %] [% user.surname %]
397 [<a style="cursor:pointer"
398 onclick="del_user([% user.borrowernumber %])">Remove</a>]
401 <li id="add_user_button">
402 <input type="button" onclick="userPopup()" value="Add users" />
405 <input type="hidden" name="budget_users_ids" id="budget_users_id" value="[% budget_users_ids %]" />
407 <label for="budget_branchcode">Library: </label>
408 <select name="budget_branchcode" id="budget_branchcode">
409 <option value=""></option>
410 [% FOREACH branchloop_selec IN branchloop_select %]
411 [% 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>
417 <label for="budget_permission">Restrict access to: </label>
418 <select name="budget_permission" id="budget_permission">
419 [% IF ( budget_perm_0 ) %]
420 <option value="0" selected="selected">
427 [% IF ( budget_perm_1 ) %]
428 <option value="1" selected="selected">
435 [% IF ( budget_perm_3) %]
436 <option value="3" selected="selected">
443 [% IF ( budget_perm_2 ) %]
444 <option value="2" selected="selected">
448 Owner, users and library
454 <label for="budget_notes">Notes: </label>
455 <textarea name="budget_notes" id="budget_notes" cols="80" rows="6">[% budget_notes %]</textarea>
459 <label style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
460 <select name="sort1_authcat" id="authorised_value_category1">
461 <option value=""></option>
462 [% FOREACH authorised_value_categories IN authorised_value_categories1 %]
463 [% IF ( authorised_value_categories.selected ) %]
464 <option value="[% authorised_value_categories.category %]" selected="selected">
465 [% authorised_value_categories.category %]
468 <option value="[% authorised_value_categories.category %]">
469 [% authorised_value_categories.category %]
476 <label style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
477 <select name="sort2_authcat" id="authorised_value_category2">
478 <option value=""></option>
479 [% FOREACH authorised_value_categories IN authorised_value_categories2 %]
480 [% IF ( authorised_value_categories.selected ) %]
481 <option value="[% authorised_value_categories.category %]" selected="selected">
482 [% authorised_value_categories.category %]
485 <option value="[% authorised_value_categories.category %]">
486 [% authorised_value_categories.category %]
494 [% IF ( budget_id ) %]
495 <input type="hidden" name="budget_id" value="[% budget_id %]" />
499 <fieldset class="action">
500 <input type="submit" value="Submit" onclick="Check(this.form); return false;" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a>
501 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
505 [% END %] <!-- add_form -->
507 [% IF ( delete_confirm ) %]
508 <div class="dialog alert"> <h3>Delete fund [% budget_name %]?</h3>
511 <th scope="row">Fund amount:</th>
512 <td>[% budget_amount %]</td>
516 <form action="[% action %]" method="post">
517 <input type="hidden" name="op" value="delete_confirmed" />
518 <input type="hidden" name="budget_id" value="[% budget_id %]" />
519 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
520 <input type="submit" value="Delete" class="approve" />
523 <form action="[% action %]" method="get">
524 <input type="submit" class="deny" value="Cancel" />
532 [% IF ( else ) %]<form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
533 <a href="#" id="filterbutton">Filters</a>
534 <fieldset class="brief" id="fundfilters">
535 <h4>Fund filters</h4>
538 <label for="filter_budgetbranch2">Library: </label>
539 <select name="filter_budgetbranch" id="filter_budgetbranch2" style="width:10em;">
540 <option value=""></option>
541 [% FOREACH branchloo IN branchloop %]
542 [% UNLESS ( branchloo.selected ) %]<option value="[% branchloo.value %]">
543 [% ELSE %]<option value="[% branchloo.value %]" selected="selected">[% END %]
544 [% branchloo.branchname %]</option>
550 <label for="show_mine">Show my funds only</label>
551 [% IF ( show_mine ) %]
552 <input type="checkbox" id="show_mine" name="show_mine" value="1" checked="checked" />
554 <input type="checkbox" id="show_mine" name="show_mine" value="1" />
559 <input type="hidden" name="show" value="1" />
560 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
561 <input type="submit" class="submit" name="filter" value="Go" />
564 [% INCLUDE 'acquisitions-menu.inc' %]
567 [% INCLUDE 'intranet-bottom.inc' %]