Owen Leonard
cd921163c0
- Added include, date-format.inc, which shows format, e.g. "(DD/MM/YYYY)" - Hint shows expected date format based on system preference - Removing calendar.inc include from templates which don't use it Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
408 lines
18 KiB
Cheetah
408 lines
18 KiB
Cheetah
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
|
<title>Koha › Administration › Funds<!-- TMPL_IF name="add_form" --> › <!--TMPL_IF NAME="budget_id" -->Modify Fund<!-- TMPL_IF NAME="budget_name" --> '<!-- TMPL_VAR NAME="budget_name" -->'<!-- /TMPL_IF --><!-- TMPL_ELSE -->Add Fund <!-- /TMPL_IF --><!-- /TMPL_IF --></title>
|
|
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
|
<script type="text/javascript" src="<!-- TMPL_VAR NAME="themelang" -->/js/acq.js"></script>
|
|
|
|
<!-- TMPL_IF name="add_form" -->
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
//
|
|
var actTotal ="";
|
|
|
|
function ownerRemove(f) {
|
|
document.getElementById('budget_owner_name').innerHTML = '';
|
|
}
|
|
|
|
function Check(f) {
|
|
var ok=1;
|
|
var _alertString="";
|
|
var alertString2;
|
|
|
|
// var actTotal ="";
|
|
|
|
if (!(isNotNull(f.budget_code,1))) {
|
|
_alertString += _("- Budget code cannot be blank\n");
|
|
}
|
|
|
|
if (!(isNotNull(f.budget_name,1))) {
|
|
_alertString += _("- Budget name cannot be blank\n");
|
|
}
|
|
|
|
if (!(isNotNull(f.budget_amount,1))) {
|
|
_alertString += _("- Budget amount cannot be blank\n");
|
|
}
|
|
|
|
var budgetId;
|
|
if (typeof(f.budget_id ) != "undefined") {
|
|
budgetId = f.budget_id.value
|
|
}
|
|
|
|
var newBudgetParent;
|
|
|
|
// hack to test if selected parent_id in scrolling-list...
|
|
// if value == 'undef' its got a selected_parent :/
|
|
if(f.budget_parent_id){
|
|
var chkAdd = f.budget_parent_id.value ;
|
|
if ( typeof(chkAdd ) != "undefined") {
|
|
newBudgetParent = f.budget_parent_id.value
|
|
} else {
|
|
newBudgetParent = f.budget_parent_id.item(0).value
|
|
}
|
|
|
|
if (budgetId > 0) { ; //its a mod ...
|
|
// if parent eq curent-budget, fail...
|
|
if ( newBudgetParent == budgetId ) {
|
|
_alertString += _("- Budget parent is current budget\n");
|
|
}
|
|
|
|
else if (newBudgetParent) {
|
|
var result = checkBudgetParent( budgetId , newBudgetParent );
|
|
if (result) {
|
|
_alertString += result;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// else do lookup
|
|
var budgetTotal = Math.abs(f.budget_amount.value);
|
|
var result = budgetExceedsParent (budgetTotal, budgetId, newBudgetParent, f.budget_period_id.value)
|
|
if (result) {
|
|
_alertString += result;
|
|
}
|
|
|
|
if (_alertString.length==0) {
|
|
document.Aform.submit();
|
|
} else {
|
|
alertString2 = _("Form not submitted because of the following problem(s)\n");
|
|
alertString2 += "------------------------------------------------------------------------------------\n\n";
|
|
alertString2 += _alertString;
|
|
alert(alertString2);
|
|
}
|
|
}
|
|
//]]>
|
|
</script>
|
|
<!-- TMPL_ELSE -->
|
|
<link href="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/treetable/stylesheets/jquery.treeTable.css" rel="stylesheet" type="text/css" />
|
|
|
|
<script type="text/javascript" src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
|
|
<script type="text/javascript" src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/treetable/jquery.treeTable.min.js"></script>
|
|
<script type="text/javascript" src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/jquery.qtip.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
//
|
|
$(document).ready(function() {
|
|
var tooltipcontent = $(".tooltipcontent");
|
|
tooltipcontent.hide();
|
|
|
|
$(".tooltiped td").each(function (){
|
|
contentelem = $(this).parent().children().filter(".tooltipcontent");
|
|
if(contentelem.html() != ""){
|
|
$(this).qtip({
|
|
content: contentelem.html(),
|
|
show: "mouseover",
|
|
hide: "mouseout",
|
|
style: {
|
|
name: "light",
|
|
tip: "bottomLeft",
|
|
border: {
|
|
radius: 5,
|
|
color: "#356CA1"
|
|
}
|
|
},
|
|
position: {
|
|
corner: {
|
|
target: "topRight",
|
|
tooltip: "bottomRight"
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
<!-- TMPL_IF NAME="notree" -->
|
|
$("#budgeth").tablesorter({
|
|
widgets : ['zebra'],
|
|
sortList: [[0,0]],
|
|
headers: { 7: { sorter: false }}
|
|
});
|
|
<!-- TMPL_ELSE -->
|
|
$("#budgeth").treeTable();
|
|
<!-- /TMPL_IF -->
|
|
});
|
|
//]]>
|
|
</script>
|
|
<!-- /TMPL_IF -->
|
|
|
|
</head>
|
|
<body>
|
|
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
|
<!-- TMPL_INCLUDE NAME="budgets-admin-search.inc" -->
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
|
|
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> › <!-- TMPL_IF NAME="else" -->Funds for '<!-- TMPL_VAR name="budget_period_description" -->'<!-- /TMPL_IF --><!-- TMPL_IF name="add_form" -->
|
|
<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->">Funds</a> › <!-- TMPL_IF NAME="budget_id" -->Modify fund<!-- TMPL_IF NAME="budget_name" --> '<!-- TMPL_VAR NAME="budget_name" -->'<!-- /TMPL_IF --><!-- TMPL_ELSE -->Add fund<!-- /TMPL_IF --><!-- /TMPL_IF --> <!-- TMPL_IF name="delete_confirm" -->
|
|
<a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a> › Delete fund?<!-- /TMPL_IF --></div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
|
|
<!-- TMPL_UNLESS name="delete_confirm" --><!-- TMPL_INCLUDE NAME="budgets-admin-toolbar.inc" --><!-- /TMPL_UNLESS -->
|
|
<!-- TMPL_IF name="else" -->
|
|
|
|
<!-- TMPL_UNLESS NAME="cur" --><div class="dialog alert"><h3>No active currency is defined</h3><p>Please <a href="/cgi-bin/koha/admin/currency.pl">specify an active currency</a>.</p></div><!-- /TMPL_UNLESS -->
|
|
|
|
<h1>Funds for '<!-- TMPL_VAR name="budget_period_description" -->'</h1>
|
|
<table id="budgeth">
|
|
<thead>
|
|
<tr>
|
|
<th>Fund code</th>
|
|
<th>Fund name</th>
|
|
<th>Total<br />allocated</th>
|
|
<th>Base-level<br />allocated</th>
|
|
<th>Base-level<br />spent</th>
|
|
<th>Base-level<br />remaining</th>
|
|
<th class="tooltipcontent"> </th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tfoot>
|
|
<tr>
|
|
<th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated <!--TMPL_IF NAME="budget_period_total" --><!-- TMPL_VAR NAME="budget_period_total"--><!-- /TMPL_IF --> </th>
|
|
<th nowrap="nowrap" class="data"> <!-- TMPL_VAR NAME="period_alloc_total"--></th>
|
|
<th nowrap="nowrap" class="data"> <!-- TMPL_VAR NAME="base_alloc_total"--></th>
|
|
<th class="data"><!-- TMPL_VAR NAME="base_spent_total"--></th>
|
|
<th class="data"><!-- TMPL_VAR NAME="base_remaining_total"--></th>
|
|
<th class="tooltipcontent"></th>
|
|
<th></th>
|
|
</tr>
|
|
</tfoot>
|
|
<tbody>
|
|
<!-- TMPL_IF NAME="budget" -->
|
|
<!-- TMPL_LOOP name="budget" -->
|
|
<!-- TMPL_IF NAME="toggle" -->
|
|
<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">
|
|
<!-- TMPL_ELSE -->
|
|
<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 -->">
|
|
<!-- /TMPL_IF -->
|
|
|
|
<td><!-- TMPL_VAR NAME="budget_code_indent" --></td>
|
|
<td><!-- TMPL_VAR NAME="budget_name" --></td>
|
|
<td class="data"><!-- TMPL_VAR NAME="budget_amount_total" --></td>
|
|
<td class="data"><!-- TMPL_VAR NAME="budget_amount" --> </td>
|
|
<td class="data"><!-- TMPL_VAR NAME="budget_spent" --> </td>
|
|
<td class="data"
|
|
<!-- TMPL_IF NAME="remaining_pos" --> style="color: green;" <!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="remaining_neg" --> style="color: red;" <!-- /TMPL_IF --> >
|
|
<!-- TMPL_VAR NAME="budget_remaining" --> </td>
|
|
|
|
<td class="tooltipcontent"><!-- TMPL_IF NAME="budget_owner_id" --><strong>Owner: </strong><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="budget_owner_id" -->"><!-- TMPL_VAR NAME="budget_owner_name" --></a><!-- /TMPL_IF --><!-- TMPL_IF NAME="budget_branchcode" --><br /><strong>Library: </strong><!-- TMPL_VAR NAME="budget_branchcode" --><!-- /TMPL_IF --><!-- TMPL_IF NAME="budget_notes" --><br /><strong>Notes: </strong><!-- TMPL_VAR NAME="budget_notes" --><!-- /TMPL_IF --></td>
|
|
<!-- TMPL_IF NAME="budget_lock"-->
|
|
<td> <span style="color: gray;" > Edit Delete </span> </td>
|
|
<!-- TMPL_ELSE -->
|
|
<td>
|
|
<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>
|
|
<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>
|
|
<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 Child Fund</a>
|
|
</td>
|
|
<!-- /TMPL_IF -->
|
|
</tr>
|
|
<!-- /TMPL_LOOP -->
|
|
<!-- TMPL_ELSE -->
|
|
<tr><td colspan="12">No fund found</td></tr>
|
|
<!-- /TMPL_IF -->
|
|
</tbody>
|
|
</table>
|
|
|
|
<!-- TMPL_IF name="cur" --><p><b>Currency = <!-- TMPL_VAR NAME="cur" --> <!-- TMPL_VAR NAME="cur_format" --></b></p><!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="pagination_bar" --><div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div><!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF --> <!-- else -->
|
|
|
|
<!-- ********************************************************************************************** -->
|
|
<!-- create add/mod entry form -->
|
|
<!-- TMPL_IF name="add_form" -->
|
|
|
|
<form action="/cgi-bin/koha/admin/aqbudgets.pl" name="Aform" method="post">
|
|
<fieldset class="rows">
|
|
<legend><!-- TMPL_IF NAME="budget_id" -->Modify<!-- TMPL_ELSE -->Add<!-- /TMPL_IF --> Fund
|
|
<!-- TMPL_IF NAME="budget_period_description" -->
|
|
<!-- TMPL_VAR NAME="budget_name" --> for Budget '<!-- TMPL_VAR NAME="budget_period_description" -->'
|
|
<!-- /TMPL_IF -->
|
|
</legend>
|
|
|
|
<input type="hidden" name="op" value="add_validate" />
|
|
<input type="hidden" name="checked" value="0" />
|
|
<ol>
|
|
<!-- TMPL_IF NAME="budget_parent_id" -->
|
|
<li>
|
|
<span class="label">Fund Parent: </span>
|
|
<!-- TMPL_VAR NAME="budget_parent_name" -->
|
|
<!-- TMPL_VAR NAME="budget_parent_id" --> - <!-- TMPL_VAR NAME="budget_parent_name" -->
|
|
<input type="hidden" name="budget_parent_id" value="<!-- TMPL_VAR NAME="budget_parent_id" -->" />
|
|
</li>
|
|
<!-- /TMPL_IF -->
|
|
<li>
|
|
<label class="required" for="budget_code">Fund Code: </label>
|
|
<input type="text" name="budget_code" id="budget_code" value="<!-- TMPL_VAR NAME="budget_code" -->" size="30" />
|
|
</li>
|
|
|
|
<li>
|
|
<label class="required" for="budget_name">Fund Name: </label>
|
|
<input type="text" name="budget_name" id="budget_name" value="<!-- TMPL_VAR NAME="budget_name" -->" size="60" />
|
|
</li>
|
|
|
|
<li>
|
|
<label style="white-space: nowrap;" for="budget_amount" class="required">Amount: </label>
|
|
<input type="text" name="budget_amount" id="budget_amount" value="<!-- TMPL_VAR NAME="budget_amount" -->" size="8" />
|
|
</li>
|
|
|
|
<li>
|
|
<label for="budget_encumb">Encumbrance: </label>
|
|
<input type="text" name="budget_encumb" id="budget_encumb" value="<!-- TMPL_VAR NAME="budget_encumb" -->" size="8" />
|
|
</li>
|
|
|
|
<li>
|
|
<label for="budget_expend">Expenditure: </label>
|
|
<input type="text" name="budget_expend" id="budget_expend" value="<!-- TMPL_VAR NAME="budget_expend" -->" size="8" /><input type="hidden" name="budget_owner_id" id="budget_owner_id" value="<!-- TMPL_VAR NAME="budget_owner_id" -->" />
|
|
</li>
|
|
|
|
<li>
|
|
<span class="label">Owner: </span>
|
|
<span id="budget_owner_name">
|
|
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="budget_owner_id" -->"><!-- TMPL_VAR NAME="budget_owner_name" --></a>
|
|
</span>
|
|
|
|
<!-- FIXME: hardcoded button positions :/ -->
|
|
<input style="" type="button" id="edit_owner" value="Edit owner" onclick="ownerPopup(); return false;" />
|
|
<input style="" type="button" id="remove_owner" value="Remove owner" onclick="ownerRemove(this.form); return false;" />
|
|
</li>
|
|
|
|
<li>
|
|
<label for="budget_branchcode">Library: </label>
|
|
<select name="budget_branchcode" id="budget_branchcode">
|
|
<option value=""></option>
|
|
<!-- TMPL_LOOP name="branchloop_select" -->
|
|
<!-- 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>
|
|
<!-- /TMPL_LOOP -->
|
|
</select>
|
|
</li>
|
|
|
|
<li>
|
|
<label for="budget_permission">Restrict access to: </label>
|
|
<!-- TMPL_VAR name="budget_perm_dropbox" -->
|
|
</li>
|
|
|
|
<li>
|
|
<label for="budget_notes">Notes: </label>
|
|
<textarea name="budget_notes" id="budget_notes" cols="80" rows="6"><!-- TMPL_VAR NAME="budget_notes" --></textarea>
|
|
</li>
|
|
|
|
<li>
|
|
<label style="white-space: nowrap;" for="authorised_value_category1">Planning Category1: </label>
|
|
<select name="sort1_authcat" id="authorised_value_category1">
|
|
<option value=""></option>
|
|
<!-- TMPL_LOOP name="authorised_value_categories1" -->
|
|
<!-- TMPL_IF name="selected" -->
|
|
<option value="<!-- TMPL_VAR name="category" -->" selected="selected">
|
|
<!-- TMPL_VAR name="category" -->
|
|
</option>
|
|
<!-- TMPL_ELSE -->
|
|
<option value="<!-- TMPL_VAR name="category" -->">
|
|
<!-- TMPL_VAR name="category" -->
|
|
</option>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_LOOP -->
|
|
</select>
|
|
</li>
|
|
<li>
|
|
<label style="white-space: nowrap;" for="authorised_value_category2">Planning Category2: </label>
|
|
<select name="sort2_authcat" id="authorised_value_category2">
|
|
<option value=""></option>
|
|
<!-- TMPL_LOOP name="authorised_value_categories2" -->
|
|
<!-- TMPL_IF name="selected" -->
|
|
<option value="<!-- TMPL_VAR name="category" -->" selected="selected">
|
|
<!-- TMPL_VAR name="category" -->
|
|
</option>
|
|
<!-- TMPL_ELSE -->
|
|
<option value="<!-- TMPL_VAR name="category" -->">
|
|
<!-- TMPL_VAR name="category" -->
|
|
</option>
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_LOOP -->
|
|
</select>
|
|
</li>
|
|
</ol>
|
|
|
|
<!-- TMPL_IF NAME="budget_id" -->
|
|
<input type="hidden" name="budget_id" value="<!-- TMPL_VAR NAME="budget_id" -->" />
|
|
<!-- /TMPL_IF -->
|
|
</fieldset>
|
|
|
|
<fieldset class="action">
|
|
<input type="submit" value="Submit" onclick="Check(this.form); return false;" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl">Cancel</a>
|
|
<input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR name="budget_period_id" -->" />
|
|
</fieldset>
|
|
</form>
|
|
|
|
<!-- /TMPL_IF --> <!-- add_form -->
|
|
|
|
<!-- TMPL_IF name="delete_confirm" -->
|
|
<div class="dialog alert"> <h3>Delete Fund <!-- TMPL_VAR NAME="budget_name" -->?</h3>
|
|
<table>
|
|
<tr>
|
|
<th scope="row">Fund Amount:</th>
|
|
<td><!-- TMPL_VAR NAME="budget_amount" --></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<form action="<!-- TMPL_VAR NAME="action" -->" method="post">
|
|
<input type="hidden" name="op" value="delete_confirmed" />
|
|
<input type="hidden" name="budget_id" value="<!-- TMPL_VAR NAME="budget_id" -->" />
|
|
<input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR NAME="budget_period_id" -->" />
|
|
<input type="submit" value="Delete this budget" class="approve" />
|
|
</form>
|
|
|
|
<form action="<!-- TMPL_VAR NAME="action" -->" method="get">
|
|
<input type="submit" class="deny" value="No, Do Not Delete" />
|
|
</form>
|
|
</div>
|
|
<!-- /TMPL_IF -->
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
<!-- TMPL_IF NAME="else" --><form action="/cgi-bin/koha/admin/aqbudgets.pl" method="get">
|
|
<fieldset class="brief">
|
|
<h4>Fund filters</h4>
|
|
<ol>
|
|
<li>
|
|
<label for="filter_budgetbranch2">Library: </label>
|
|
<select name="filter_budgetbranch" id="filter_budgetbranch2" style="width:10em;">
|
|
<option value=""></option>
|
|
<!-- TMPL_LOOP name="branchloop" -->
|
|
<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="branchname" --></option>
|
|
<!-- /TMPL_LOOP -->
|
|
</select>
|
|
</li>
|
|
<li class="radio">
|
|
|
|
<label for="show_mine">Show my<br /> funds only</label>
|
|
<!-- TMPL_IF NAME="show_mine" -->
|
|
<input type="checkbox" id="show_mine" name="show_mine" value="1" checked="checked" />
|
|
<!-- TMPL_ELSE -->
|
|
<input type="checkbox" id="show_mine" name="show_mine" value="1" />
|
|
<!-- /TMPL_IF -->
|
|
</li>
|
|
</ol>
|
|
|
|
<input type="hidden" name="show" value="1" />
|
|
<input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR NAME="budget_period_id" -->" />
|
|
<input type="submit" class="submit" name="filter" value="Go" />
|
|
</fieldset>
|
|
</form><!-- /TMPL_IF -->
|
|
|
|
</div>
|
|
</div>
|
|
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
|