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" src="[% themelang %]/js/acq.js"></script>
7 <script type="text/javascript">
10 function userPopup() {
11 window.open("/cgi-bin/koha/admin/aqbudget_user_search.pl?type=user",
13 'width=740,height=450,location=yes,toolbar=no,'
14 + 'scrollbars=yes,resize=yes'
18 function ownerPopup() {
19 window.open("/cgi-bin/koha/admin/aqbudget_user_search.pl?type=owner",
21 'width=740,height=450,location=yes,toolbar=no,'
22 + 'scrollbars=yes,resize=yes'
26 function edit_owner(borrowernumber, surname, firstname) {
27 $('#budget_owner_name').empty();
28 $('#budget_owner_id').val('');
30 var ownerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
31 + '?borrowernumber=' + borrowernumber + '">'
32 + firstname + ' ' + surname + '</a>';
33 $('#budget_owner_name').html(ownerlink);
34 $('#budget_owner_id').val(borrowernumber);
38 function ownerRemove() {
42 function add_user(borrowernumber, surname, firstname) {
43 var ids = $("#budget_users_id").val().split(':');
44 if(borrowernumber && ids.indexOf(borrowernumber) == -1) {
45 var li = '<li id="user_' + borrowernumber + '">'
46 + '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber='
47 + borrowernumber + '">' + firstname + ' ' + surname
48 + '</a> [<a style="cursor:pointer"'
49 + 'onclick="del_user(' + borrowernumber +')">Remove</a>]</li>';
50 $(li).insertBefore("li#add_user_button");
51 ids.push(borrowernumber);
52 $("#budget_users_id").val(ids.join(':'));
59 function del_user(borrowernumber) {
60 var ids = $("#budget_users_id").val().split(':');
62 var idx = ids.indexOf(borrowernumber+'');
65 $("#budget_users_id").val(ids.join(':'));
66 $("li#user_" + borrowernumber).remove();
76 if (!(isNotNull(f.budget_code,1))) {
77 _alertString += _("- Budget code cannot be blank") + "\n";
80 if (!(isNotNull(f.budget_name,1))) {
81 _alertString += _("- Budget name cannot be blank") + "\n";
84 if (!(isNotNull(f.budget_amount,1))) {
85 _alertString += _("- Budget amount cannot be blank") + "\n";
89 if (typeof(f.budget_id ) != "undefined") {
90 budgetId = f.budget_id.value
95 // hack to test if selected parent_id in scrolling-list...
96 // if value == 'undef' its got a selected_parent :/
97 if(f.budget_parent_id){
98 var chkAdd = f.budget_parent_id.value ;
99 if ( typeof(chkAdd ) != "undefined") {
100 newBudgetParent = f.budget_parent_id.value
102 newBudgetParent = f.budget_parent_id.item(0).value
105 if (budgetId > 0) { ; //its a mod ...
106 // if parent == curent-budget, fail...
107 if ( newBudgetParent == budgetId ) {
108 _alertString += _("- Budget parent is current budget") + "\n";
111 else if (newBudgetParent) {
112 var result = checkBudgetParent( budgetId , newBudgetParent );
114 _alertString += result;
121 var budgetTotal = Math.abs(f.budget_amount.value);
122 var result = budgetExceedsParent (budgetTotal, budgetId, newBudgetParent, f.budget_period_id.value)
124 _alertString += result;
127 if (_alertString.length==0) {
128 document.Aform.submit();
130 alertString2 = _("Form not submitted because of the following problem(s)");
131 alertString2 += "\n------------------------------------------------------------------------------------\n\n";
132 alertString2 += _alertString;
140 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
141 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
142 [% INCLUDE 'datatables-strings.inc' %]
143 <script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
145 <link href="[% themelang %]/lib/jquery/plugins/treetable/stylesheets/jquery.treeTable.css" rel="stylesheet" type="text/css" />
146 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/treetable/jquery.treeTable.min.js"></script>
149 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.qtip.js"></script>
151 <script type="text/javascript">
154 $(document).ready(function() {
155 var tooltipcontent = $(".tooltipcontent");
156 tooltipcontent.hide();
158 $(".tooltiped td").each(function (){
159 contentelem = $(this).parent().children().filter(".tooltipcontent");
160 if(contentelem.html() != ""){
162 content: contentelem.html(),
176 tooltip: "bottomRight"
183 $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
185 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
187 "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
188 "iDisplayLength": 20,
189 "sPaginationType": "four_button"
192 $("#budgeth").treeTable();
195 $("#filterbutton").click(function() {
196 $("#fundfilters").slideToggle(0);
204 <body id="admin_aqbudgets" class="admin">
205 [% INCLUDE 'header.inc' %]
206 [% INCLUDE 'budgets-admin-search.inc' %]
208 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
209 <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 ) %]
210 <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 ) %]
211 <a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a> › Delete fund?[% END %]</div>
213 <div id="doc3" class="yui-t2">
216 <div class="yui-b" id="content">
219 [% UNLESS ( delete_confirm ) %][% INCLUDE 'budgets-admin-toolbar.inc' %][% END %]
221 [% IF (error_not_authorised_to_modify) %]
223 <p>You are not authorised to modify this fund</p>
229 <h1>Funds for '[% budget_period_description %]'</h1>
231 [% INCLUDE 'budgets-active-currency.inc' %]
240 <th>Total<br />allocated</th>
241 <th>Base-level<br />allocated</th>
242 <th>Base-level<br />spent</th>
243 <th>Total sublevels<br />spent</th>
244 <th>Base-level<br />remaining</th>
245 <th class="tooltipcontent"> </th>
251 <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF ( budget_period_total ) %][% budget_period_total %][% END %] </th>
252 <th nowrap="nowrap" class="data"> [% period_alloc_total %]</th>
253 <th nowrap="nowrap" class="data"> [% base_alloc_total %]</th>
254 <th class="data">[% base_spent_total %]</th>
255 <th class="data">[% base_spent_total %]</th>
256 <th class="data">[% base_remaining_total %]</th>
257 <th class="tooltipcontent"></th>
262 [% FOREACH budge IN budget %]
263 [% IF ( budge.toggle ) %]
264 <tr id="node-[% budge.budget_id %]" class="highlight[% IF ( budge.budget_parent_id ) %] child-of-node-[% budge.budget_parent_id %][% END %] tooltiped">
266 <tr id="node-[% budge.budget_id %]" class="tooltiped [% IF ( budge.budget_parent_id ) %] child-of-node-[% budge.budget_parent_id %][% END %]">
269 <td>[% budge.budget_code_indent %]</td>
270 <td>[% budge.budget_name %]</td>
271 <td class="data">[% budge.budget_amount_total %]</td>
272 <td class="data">[% budge.budget_amount %] </td>
273 <td class="data">[% budge.budget_spent %] </td>
274 <td class="data">[% budge.total_levels_spent %]</td>
275 [% IF ( budge.remaining_pos ) %]
276 <td class="data" style="color: green;">
277 [% ELSIF ( budge.remaining_neg ) %]
278 <td class="data" style="color: red;">
282 [% budge.budget_remaining %] </td>
284 <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 %]
285 [% IF ( budge.budget_branchcode ) %]<br /><strong>Library: </strong>[% budge.budget_branchcode %][% END %]
286 [% IF ( budge.budget_notes ) %]<br /><strong>Notes: </strong>[% budge.budget_notes %][% END %]
287 [% IF ( budge.budget_hierarchy ) %]
288 <ul class="budget_hierarchy">[% FOREACH budget_hierarch IN budge.budget_hierarchy %]
289 [% IF ( budget_hierarch.element_id ) %]
290 <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>
292 <li><strong>[% budget_hierarch.element_name %] : </strong></li>
297 [% IF ( budge.budget_lock ) %]
298 <td> <span style="color: gray;"> Edit Delete </span> </td>
301 <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>
302 <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>
303 <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>
315 [% IF ( pagination_bar ) %]<div class="pages">[% pagination_bar %]</div>[% END %]
316 [% END %] <!-- else -->
318 <!-- ********************************************************************************************** -->
319 <!-- create add/mod entry form -->
320 [% IF ( add_form && !error_not_authorised_to_modify ) %]
321 <form action="/cgi-bin/koha/admin/aqbudgets.pl" name="Aform" method="post">
322 <fieldset class="rows">
323 <legend>[% IF ( budget_id ) %]Modify[% ELSE %]Add[% END %] Fund
324 [% IF ( budget_period_description ) %]
325 [% budget_name %] for Budget '[% budget_period_description %]'
329 <input type="hidden" name="op" value="add_validate" />
330 <input type="hidden" name="checked" value="0" />
332 [% IF ( budget_parent_id ) %]
334 <span class="label">Fund parent: </span>
335 [% budget_parent_name %]
336 [% budget_parent_id %] - [% budget_parent_name %]
337 <input type="hidden" name="budget_parent_id" value="[% budget_parent_id %]" />
341 <label class="required" for="budget_code">Fund code: </label>
342 <input type="text" name="budget_code" id="budget_code" value="[% budget_code %]" size="30" />
346 <label class="required" for="budget_name">Fund name: </label>
347 <input type="text" name="budget_name" id="budget_name" value="[% budget_name %]" size="60" />
351 <label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
352 <input type="text" name="budget_amount" id="budget_amount" value="[% budget_amount %]" size="8" />
355 <li style="display:none;">
356 <label for="budget_encumb">Encumbrance: </label>
357 <input type="text" name="budget_encumb" id="budget_encumb" value="[% budget_encumb %]" size="8" />
360 <li style="display:none;">
361 <label for="budget_expend">Expenditure: </label>
362 <input type="text" name="budget_expend" id="budget_expend" value="[% budget_expend %]" size="8" />
366 <span class="label">Owner: </span>
367 <span id="budget_owner_name">
368 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% budget_owner_id %]">
369 [% budget_owner_name %]
372 <input type="hidden" name="budget_owner_id" id="budget_owner_id"
373 value="[% budget_owner_id %]" />
375 <!-- FIXME: hardcoded button positions :/ -->
376 <input type="button" id="edit_owner" value="Edit owner"
377 onclick="ownerPopup(); return false;" />
378 <input type="button" id="remove_owner" value="Remove owner"
379 onclick="ownerRemove(); return false;" />
383 <span class="label">Users:</span>
384 <ul style="float:left;" id="budget_users">
385 [% FOREACH user IN budget_users %]
386 <li id="user_[% user.borrowernumber %]">
387 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% user.borrowernumber %]">
388 [% user.firstname %] [% user.surname %]
390 [<a style="cursor:pointer"
391 onclick="del_user([% user.borrowernumber %])">Remove</a>]
394 <li id="add_user_button">
395 <input type="button" onclick="userPopup()" value="Add users" />
398 <input type="hidden" name="budget_users_ids" id="budget_users_id" value="[% budget_users_ids %]" />
400 <label for="budget_branchcode">Library: </label>
401 <select name="budget_branchcode" id="budget_branchcode">
402 <option value=""></option>
403 [% FOREACH branchloop_selec IN branchloop_select %]
404 [% 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>
410 <label for="budget_permission">Restrict access to: </label>
411 <select name="budget_permission" id="budget_permission">
412 [% IF ( budget_perm_0 ) %]
413 <option value="0" selected="selected">
420 [% IF ( budget_perm_1 ) %]
421 <option value="1" selected="selected">
428 [% IF ( budget_perm_3) %]
429 <option value="3" selected="selected">
436 [% IF ( budget_perm_2 ) %]
437 <option value="2" selected="selected">
441 Owner, users and library
447 <label for="budget_notes">Notes: </label>
448 <textarea name="budget_notes" id="budget_notes" cols="80" rows="6">[% budget_notes %]</textarea>
452 <label style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
453 <select name="sort1_authcat" id="authorised_value_category1">
454 <option value=""></option>
455 [% FOREACH authorised_value_categories IN authorised_value_categories1 %]
456 [% IF ( authorised_value_categories.selected ) %]
457 <option value="[% authorised_value_categories.category %]" selected="selected">
458 [% authorised_value_categories.category %]
461 <option value="[% authorised_value_categories.category %]">
462 [% authorised_value_categories.category %]
469 <label style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
470 <select name="sort2_authcat" id="authorised_value_category2">
471 <option value=""></option>
472 [% FOREACH authorised_value_categories IN authorised_value_categories2 %]
473 [% IF ( authorised_value_categories.selected ) %]
474 <option value="[% authorised_value_categories.category %]" selected="selected">
475 [% authorised_value_categories.category %]
478 <option value="[% authorised_value_categories.category %]">
479 [% authorised_value_categories.category %]
487 [% IF ( budget_id ) %]
488 <input type="hidden" name="budget_id" value="[% budget_id %]" />
492 <fieldset class="action">
493 <input type="submit" value="Submit" onclick="Check(this.form); return false;" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a>
494 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
498 [% END %] <!-- add_form -->
500 [% IF ( delete_confirm ) %]
501 <div class="dialog alert"> <h3>Delete fund [% budget_name %]?</h3>
504 <th scope="row">Fund amount:</th>
505 <td>[% budget_amount %]</td>
509 <form action="[% action %]" method="post">
510 <input type="hidden" name="op" value="delete_confirmed" />
511 <input type="hidden" name="budget_id" value="[% budget_id %]" />
512 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
513 <input type="submit" value="Delete" class="approve" />
516 <form action="[% action %]" method="get">
517 <input type="submit" class="deny" value="Cancel" />
525 [% IF ( else ) %]<form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
526 <a href="#" id="filterbutton">Filters</a>
527 <fieldset class="brief" id="fundfilters">
528 <h4>Fund filters</h4>
531 <label for="filter_budgetbranch2">Library: </label>
532 <select name="filter_budgetbranch" id="filter_budgetbranch2" style="width:10em;">
533 <option value=""></option>
534 [% FOREACH branchloo IN branchloop %]
535 [% UNLESS ( branchloo.selected ) %]<option value="[% branchloo.value %]">
536 [% ELSE %]<option value="[% branchloo.value %]" selected="selected">[% END %]
537 [% branchloo.branchname %]</option>
543 <label for="show_mine">Show my funds only</label>
544 [% IF ( show_mine ) %]
545 <input type="checkbox" id="show_mine" name="show_mine" value="1" checked="checked" />
547 <input type="checkbox" id="show_mine" name="show_mine" value="1" />
552 <input type="hidden" name="show" value="1" />
553 <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
554 <input type="submit" class="submit" name="filter" value="Go" />
557 [% INCLUDE 'acquisitions-menu.inc' %]
560 [% INCLUDE 'intranet-bottom.inc' %]