1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title><!--TMPL_IF NAME="budget_id" -->Modify<!-- TMPL_ELSE -->Add<!-- /TMPL_IF --> Budget</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
5 <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
7 <!-- TMPL_IF name="add_form" -->
8 <script type="text/javascript">
14 function ownerRemove(f) {
15 document.getElementById('budget_owner_name').innerHTML = '';
25 if (!(isNotNull(f.budget_code,1))) {
26 _alertString += _("- Budget code missing\n");
29 if (!(isNotNull(f.budget_name,1))) {
30 _alertString += _("- Budget name missing\n");
34 if (typeof(f.budget_id ) != "undefined") {
35 budgetId = f.budget_id.value
40 // hack to test if selected parent_id in scrolling-list...
41 // if value == 'undef' its got a selected_parent :/
42 if(f.budget_parent_id){
43 var chkAdd = f.budget_parent_id.value ;
44 if ( typeof(chkAdd ) != "undefined") {
45 newBudgetParent = f.budget_parent_id.value
47 newBudgetParent = f.budget_parent_id.item(0).value
50 if (budgetId > 0) { ; //its a mod ...
51 // if parent eq curent-budget, fail...
52 if ( newBudgetParent == budgetId ) {
53 _alertString += _("- Budget parent is current budget\n");
56 else if (newBudgetParent) {
57 var result = checkBudgetParent( budgetId , newBudgetParent );
59 _alertString += result;
66 var budgetTotal = Math.abs(f.budget_amount.value);
67 var result = budgetExceedsParent (budgetTotal, budgetId, newBudgetParent, f.budget_period_id.value)
69 _alertString += result;
72 if (_alertString.length==0) {
73 document.Aform.submit();
75 alertString2 = _("Form not submitted because of the following problem(s)\n");
76 alertString2 += "------------------------------------------------------------------------------------\n\n";
77 alertString2 += _alertString;
84 <link href="<!-- TMPL_VAR NAME='themelang' -->/lib/jquery/plugins/treetable/stylesheets/jquery.treeTable.css" rel="stylesheet" type="text/css" />
86 <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
87 <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/lib/jquery/plugins/treetable/jquery.treeTable.min.js"></script>
88 <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/lib/jquery/plugins/jquery.qtip.js"></script>
90 <script type="text/javascript">
93 $(document).ready(function() {
95 $('.tooltiped').each(function (){
96 contentelem = $(this).children().filter('.tooltipcontent');
98 content: contentelem.html(),
112 tooltip: 'bottomRight'
117 $('.tooltipcontent').each(function (){
120 <!-- TMPL_IF NAME="notree" -->
121 $("#budgeth").tablesorter({
126 $("#budgeth").treeTable();
135 <!-- TMPL_INCLUDE NAME="header.inc" -->
136 <!-- TMPL_INCLUDE NAME="budgets-admin-search.inc" -->
138 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
139 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › <!-- TMPL_IF NAME="else" -->Budgets<!-- /TMPL_IF --><!-- TMPL_IF name="add_form" -->
140 <a href="/cgi-bin/koha/admin/aqbudgets.pl">Budgets</a> › <!-- TMPL_IF NAME="budget_id" -->Modify<!-- TMPL_ELSE -->Add<!-- /TMPL_IF --> Budget<!-- /TMPL_IF --> <!-- TMPL_IF name="delete_confirm" -->
141 <a href="/cgi-bin/koha/admin/aqbudgets.pl">Budgets</a> › Delete Budget?<!-- /TMPL_IF --></div>
143 <div id="doc3" class="yui-t2">
148 <!-- TMPL_INCLUDE NAME="budgets-admin.inc" -->
149 <!-- TMPL_IF name="else" -->
151 <h1>Budgets for '<!-- TMPL_VAR name="budget_period_description" -->'</h1>
152 <input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR name= 'budget_period_id' -->" />
153 <form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
155 <legend>Budget filters</legend>
158 <label for="filter_budgetbranch">Library: </label>
159 <select name="filter_budgetbranch" id="filter_budgetbranch" style="width:10em;">
160 <option value=""></option>
161 <!-- TMPL_LOOP name="branchloop" -->
162 <option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="branchname" --></option>
167 <!-- TMPL_IF NAME="show_mine" -->
168 <input type="checkbox" id="show_mine" name="show_mine" value="1" checked="checked" />
170 <input type="checkbox" id="show_mine" name="show_mine" value="1" />
172 <label for="show_mine">Show my budgets only</label>
176 <input type="hidden" name="show" value="1" >
177 <input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR NAME="budget_period_id" -->" />
178 <input type="submit" class="submit" name="filter" value="Select" />
185 <th>Budget hierarchy</th>
187 <th>Total<br />allocated</th>
188 <th>Base-level<br />allocated</th>
189 <th>Base-level<br />spent</th>
190 <th>Base-level<br />remaining</th>
191 <th class="tooltipcontent"> </th>
195 <th colspan="3">Actions</th>
199 <!-- TMPL_IF NAME="budget" -->
200 <!-- TMPL_LOOP name="budget" -->
201 <!-- TMPL_IF NAME="toggle" -->
202 <tr id="node-<!-- TMPL_VAR NAME="budget_id" -->" class="highlight<!-- TMPL_IF NAME="budget_parent_id" --> child-of-node-<!-- TMPL_VAR NAME="budget_parent_id" --><!-- /TMPL_IF --> tooltiped">
204 <tr id="node-<!-- TMPL_VAR NAME="budget_id" -->" class="tooltiped <!-- TMPL_IF NAME="budget_parent_id" --> child-of-node-<!-- TMPL_VAR NAME="budget_parent_id" --><!-- /TMPL_IF -->">
207 <td><!-- TMPL_VAR NAME="budget_code_indent" --></td>
208 <td><!-- TMPL_VAR NAME="budget_name" --></td>
209 <td align='right'><!-- TMPL_VAR NAME="budget_amount_total" --></td>
210 <td align='right'><!-- TMPL_VAR NAME="budget_amount" --> </td>
211 <td align='right'><!-- TMPL_VAR NAME="budget_spent" --> </td>
213 <!-- TMPL_IF NAME="remaining_pos" --> STYLE="color: green;" <!-- /TMPL_IF -->
214 <!-- TMPL_IF NAME="remaining_neg" --> STYLE="color: red;" <!-- /TMPL_IF --> >
215 <!-- TMPL_VAR NAME="budget_remaining" --> </td>
217 <td class="tooltipcontent">
218 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="budget_owner_id" -->"><!-- TMPL_VAR NAME="budget_owner_name" --></a>
219 <!-- TMPL_VAR NAME="budget_branchcode" -->
220 <!-- TMPL_VAR NAME="budget_notes" -->
222 <!-- TMPL_IF NAME='budget_lock'-->
223 <td colspan="3"> <span STYLE="color: gray;" > Edit Delete </span> </td>
226 <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_id=<!-- TMPL_VAR NAME="budget_id" -->&budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->" >Edit</a>
227 <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=delete_confirm&budget_id=<!-- TMPL_VAR NAME="budget_id" -->&budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->">Delete</a>
228 <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_parent_id=<!-- TMPL_VAR NAME="budget_id" -->&budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->">Add Sub-Budget</a>
234 <tr><td colspan="12">No budget found</td></tr>
239 <th colspan='2' style='text-align: left;' nowrap>Period allocated <!--TMPL_IF NAME="budget_period_total" --><!-- TMPL_VAR NAME='budget_period_total'--><!-- /TMPL_IF --> </th>
240 <th nowrap style='text-align: right;' > <!-- TMPL_VAR NAME='period_alloc_total'--></th>
241 <th nowrap style='text-align: right;'> <!-- TMPL_VAR NAME='base_alloc_total'--></th>
242 <th style='text-align: right;' ><!-- TMPL_VAR NAME='base_spent_total'--></th>
243 <th style='text-align: right;' ><!-- TMPL_VAR NAME='base_remaining_total'--></th>
244 <th class="tooltipcontent"></th>
245 <th colspan="3"></th>
250 <span><b>Currency = <!-- TMPL_VAR NAME="cur" --> <!-- TMPL_VAR NAME="cur_format" --></b></span><br>
251 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
252 <!-- /TMPL_IF --> <!-- else -->
254 <!-- ********************************************************************************************** -->
255 <!-- create add/mod entry form -->
256 <!-- TMPL_IF name="add_form" -->
258 <form action="/cgi-bin/koha/admin/aqbudgets.pl" name="Aform" method="post">
259 <fieldset class="rows">
260 <legend><!-- TMPL_IF NAME="budget_id" -->Modify<!-- TMPL_ELSE -->Add<!-- /TMPL_IF --> Budget
261 <!-- TMPL_IF NAME="budget_period_description" -->
262 <!-- TMPL_VAR NAME="budget_name" --> for period <!-- TMPL_VAR NAME="budget_period_description" -->
266 <input type="hidden" name="op" value="add_validate" />
267 <input type="hidden" name="checked" value="0" />
269 <!-- TMPL_IF NAME="budget_parent_id" -->
271 <label for="budget_parent_id">Budget Parent: </label>
272 <!-- TMPL_VAR NAME="budget_parent_name" -->
273 <input type="hidden" name="budget_parent_id" value="<!-- TMPL_VAR NAME="budget_parent_id" -->" />
277 <label style="color: red;" for="budget_code">Budget Code: </label>
278 <input type="text" name="budget_code" id="budget_code" value="<!-- TMPL_VAR NAME="budget_code" -->" size="30" />
282 <label style="color: red;" for="budget_name">Budget Name: </label>
283 <input type="text" name="budget_name" id="budget_name" value="<!-- TMPL_VAR NAME="budget_name" -->" size="60" />
286 <div class='hint'>budget amount cannot both be empty</div>
288 <label style='white-space: nowrap;' for="budget_amount">Amount: </label>
289 <input type="text" name="budget_amount" id="budget_amount" value="<!-- TMPL_VAR NAME="budget_amount" -->" size="8" />
293 <label for="">Encumbrance: </label>
294 <input type="text" name="budget_encumb" id="budget_encumb" value="<!-- TMPL_VAR NAME="budget_encumb" -->" size="8" />
298 <label for="">Expenditure: </label>
299 <input type="text" name="budget_expend" id="budget_expend" value="<!-- TMPL_VAR NAME="budget_expend" -->" size="8" />
302 <input type="hidden" name="budget_owner_id" id="budget_owner_id" value='<!-- TMPL_VAR NAME="budget_owner_id" -->' />
304 <label for="parents">Owner: </label>
305 <span id="budget_owner_name">
306 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="budget_owner_id" -->"><!-- TMPL_VAR NAME="budget_owner_name" --></a>
309 <!-- FIXME: hardcoded button positions :/ -->
310 <input style="position:absolute; left:600px;" type="button" id="patron_search" value="Edit owner" onclick="ownerPopup(); return false;" />
311 <input style="position:absolute; left:680px;" type="button" id="patron_removal" value="Remove owner" onclick="ownerRemove(this.form); return false;" />
315 <label for="branch">Library: </label>
316 <select name="budget_branchcode">
317 <option value=""></option>
318 <!-- TMPL_LOOP name="branchloop_select" -->
319 <!-- TMPL_IF name="selected" --> <option value="<!-- TMPL_VAR name="value" -->" > <!--TMPL_ELSE--> <option value="<!-- TMPL_VAR name="value" -->" selected="selected"> <!-- /TMPL_IF --> <!-- TMPL_VAR name="branchname" --></option>
325 <label for="branch">Restrict access to: </label>
326 <!-- TMPL_VAR name="budget_perm_dropbox" -->
330 <label for="">Notes: </label>
331 <textarea name="budget_notes" id="budget_notes" cols="80" rows="6" ><!-- TMPL_VAR NAME='budget_notes' --></textarea>
335 <label style='white-space: nowrap;' for="parents">Planning Category1: </label>
336 <select name="sort1_authcat" id="authorised_value_category1">
337 <option value=""></option>
338 <!-- TMPL_LOOP name="authorised_value_categories1" -->
339 <!-- TMPL_IF name="selected" -->
340 <option value="<!-- TMPL_VAR name="category" -->" selected="selected">
341 <!-- TMPL_VAR name="category" -->
344 <option value="<!-- TMPL_VAR name="category" -->">
345 <!-- TMPL_VAR name="category" -->
352 <label style='white-space: nowrap;' for="parents">Planning Category2: </label>
353 <select name="sort2_authcat" id="authorised_value_category2">
354 <option value=""></option>
355 <!-- TMPL_LOOP name="authorised_value_categories2" -->
356 <!-- TMPL_IF name="selected" -->
357 <option value="<!-- TMPL_VAR name="category" -->" selected="selected">
358 <!-- TMPL_VAR name="category" -->
361 <option value="<!-- TMPL_VAR name="category" -->">
362 <!-- TMPL_VAR name="category" -->
370 <!-- TMPL_IF NAME="budget_id" -->
371 <input type="hidden" name="budget_id" value="<!-- TMPL_VAR NAME='budget_id' -->" />
375 <fieldset class="action">
376 <input type="submit" value="Submit" onclick="javascript:Check(this.form);" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a>
377 <input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR name='budget_period_id' -->" />
381 <!-- /TMPL_IF --> <!-- add_form -->
383 <!-- TMPL_IF name="delete_confirm" -->
384 <div class="dialog alert"> <h3>Delete Budget <!-- TMPL_VAR NAME="budget_name" -->?</h3>
387 <td scope="row">Budget Amount:</td>
388 <td><!-- TMPL_VAR NAME="budget_amount" --></td>
392 <form action="<!-- TMPL_VAR NAME="action" -->" method="post">
393 <input type="hidden" name="op" value="delete_confirmed" />
394 <input type="hidden" name="budget_id" value="<!-- TMPL_VAR NAME="budget_id" -->" />
395 <input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR NAME="budget_period_id" -->" />
396 <input type="submit" value="Delete this budget" class="approve" />
399 <form action="<!-- TMPL_VAR NAME="action" -->" method="get">
400 <input type="submit" class="deny" value="No, Do Not Delete" />
408 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
411 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->