d399ff3494
This big patch, fix xhtml code, and user interface. It Delete the term of budget period and use it as "Root Budget". It add improvment on UI, adding tooltip, and table tree.
327 lines
13 KiB
Cheetah
327 lines
13 KiB
Cheetah
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
|
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
|
<!-- TMPL_INCLUDE NAME="calendar.inc" -->
|
|
|
|
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/js/acq.js"></script>
|
|
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
|
|
<script type="text/javascript">
|
|
// #################################################################################
|
|
// Javascript
|
|
// #################################################################################
|
|
function Check(f) {
|
|
var ok=1;
|
|
var _alertString="";
|
|
var alertString2;
|
|
|
|
if (!(isNotNull(f.budget_period_startdate,1))) {
|
|
_alertString += "\n- " + _("Start date missing");
|
|
}
|
|
|
|
if (!(isNotNull(f.budget_period_enddate,1))) {
|
|
_alertString += "\n- " + _("End date missing");
|
|
}
|
|
|
|
if ( f.budget_period_startdate > f.budget_period_enddate ) {
|
|
_alertString += "\n- " + _("Start date must be before end date");
|
|
}
|
|
|
|
if (!(isNotNull(f.budget_period_description,1))) {
|
|
_alertString += "\n- " + _("Description missing");
|
|
}
|
|
|
|
if (!(isNum(f.budget_period_total))) {
|
|
_alertString += "\n- " + _("Amount must be a valid number, or empty");
|
|
}
|
|
|
|
/*
|
|
checkBudgetTotal(f) {
|
|
}
|
|
*/
|
|
|
|
if (_alertString.length==0) {
|
|
f.submit();
|
|
} else {
|
|
alertString2 = _("Form not submitted because of the following problem(s)");
|
|
alertString2 += "\n------------------------------------------------------------------------------------\n";
|
|
alertString2 += _alertString;
|
|
alert(alertString2);
|
|
}
|
|
}
|
|
$(document).ready(function() {
|
|
$("#periodsh").tablesorter({
|
|
widgets : ['zebra'],
|
|
sortList: [[0,0]]
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<title>
|
|
Koha › Administration › Budget periods
|
|
|
|
<!-- TMPL_IF name="add_form" -->›
|
|
<!-- TMPL_IF name="budget_period_id" -->
|
|
Modify root budget'<!-- TMPL_VAR name="budget_period_id" -->'
|
|
<!-- TMPL_ELSE -->
|
|
Add root budget
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF -->
|
|
|
|
<!-- TMPL_IF name="delete_confirm" -->›
|
|
Delete root budget '<!-- TMPL_VAR name="budget_period_description" -->'?
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF name="delete_confirmed" -->›
|
|
Data Deleted
|
|
<!-- /TMPL_IF -->
|
|
</title>
|
|
|
|
|
|
<head></head>
|
|
|
|
<body>
|
|
|
|
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
|
<!-- TMPL_INCLUDE NAME="budgets-admin-search.inc" -->
|
|
|
|
<!-- ################################################################################# -->
|
|
<!-- BREADCRUMBS -->
|
|
<!-- ################################################################################# -->
|
|
|
|
<div id="breadcrumbs">
|
|
<a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
|
|
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> ›
|
|
|
|
<!-- add or modify a budget period -->
|
|
<!-- ####################################### -->
|
|
<!-- TMPL_IF name="add_form" -->
|
|
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budget periods</a> ›
|
|
<!-- TMPL_IF name="budget_period_id" -->
|
|
Modify root budget <!-- TMPL_VAR name="budget_period_description" -->
|
|
|
|
<!-- TMPL_ELSE -->
|
|
Add root budget
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF -->
|
|
|
|
<!-- delete a budget period -->
|
|
<!-- ################################ -->
|
|
<!-- TMPL_IF name="delete_confirm" -->
|
|
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Root budgets</a> ›
|
|
<!-- TMPL_IF name="total" -->
|
|
Cannot Delete root budget '<!-- TMPL_VAR name="budget_period_description" -->'
|
|
<!-- TMPL_ELSE -->
|
|
Delete root budget '<!-- TMPL_VAR name="budget_period_description" -->'?
|
|
<!-- /TMPL_IF -->
|
|
<!-- /TMPL_IF -->
|
|
|
|
<!-- display budget periods list -->
|
|
<!-- ########################################## -->
|
|
<!-- TMPL_IF name="else" -->
|
|
Budget periods administration
|
|
<!-- /TMPL_IF -->
|
|
</div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
|
|
<!-- TMPL_INCLUDE NAME="budgets-admin.inc" -->
|
|
|
|
<!-- TMPL_IF name="add_form" -->
|
|
<!-- add or modify a budget period -->
|
|
<!--TMPL_IF Name="duplicates"--><!--TMPL_INCLUDE Name="duplicates.inc"--><!--/TMPL_IF-->
|
|
<!-- TMPL_IF name="budget_period_id" -->
|
|
<h3>Modify root budget</h3>
|
|
<!-- TMPL_ELSE -->
|
|
<h3>Add root budget</h3>
|
|
<!-- /TMPL_IF -->
|
|
<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
|
|
<fieldset class="rows">
|
|
<!-- ################################################################################# -->
|
|
<!-- display information about the budget period that must be added or modified -->
|
|
<!-- ################################################################################# -->
|
|
<input type="hidden" name="op" value="add_validate" />
|
|
<input type="hidden" name="confirm_not_duplicate" value="<!--TMPL_VAR Name="confirm_not_duplicate"-->" />
|
|
<input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR name="budget_period_id" -->" />
|
|
<ol>
|
|
<li>
|
|
<label for="datefrom">Start date</label>
|
|
<input type="text" size="10" id="budget_period_startdate" name="budget_period_startdate" value="<!-- TMPL_VAR NAME="budget_period_startdate" -->" />
|
|
<img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" border="0" id="openCalendarFrom" style="cursor: pointer;" valign="top" />
|
|
<script type="text/javascript">
|
|
Calendar.setup({
|
|
inputField : "budget_period_startdate",
|
|
ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
|
|
button : "openCalendarFrom",
|
|
align : "Tl",
|
|
singleClick : false
|
|
});
|
|
</script>
|
|
</li>
|
|
<li>
|
|
|
|
<label for="budget_period_enddate">End date</label>
|
|
</th>
|
|
<td>
|
|
<input type="text" size="10" id="budget_period_enddate" name="budget_period_enddate" value="<!-- TMPL_VAR NAME="budget_period_enddate" -->" />
|
|
<img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" border="0" id="openCalendarTo" style="cursor: pointer;" valign="top" />
|
|
|
|
<script type="text/javascript">
|
|
Calendar.setup({
|
|
inputField : "budget_period_enddate",
|
|
ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
|
|
button : "openCalendarTo",
|
|
align : "Tl",
|
|
});
|
|
</script>
|
|
</li>
|
|
|
|
<li>
|
|
<!-- DESCRIPTION -->
|
|
<!-- ############################## -->
|
|
<label for="budget_period_description">Description</label>
|
|
<input type="text" id="budget_period_description" name="budget_period_description"
|
|
size="48" maxlength="80" value="<!-- TMPL_VAR name="budget_period_description" -->" />
|
|
</li>
|
|
|
|
<li>
|
|
<!-- TOTAL -->
|
|
<!-- ############################## -->
|
|
<label for="budget_period_total">Total amount</label>
|
|
<input type="text" id="budget_period_total" name="budget_period_total"
|
|
size="10" maxlength="80" value="<!-- TMPL_VAR name="budget_period_total" -->" />
|
|
</li>
|
|
|
|
<li>
|
|
<!-- ACTIVE -->
|
|
<!-- ############################## -->
|
|
<label for="budget_period_active">Make Budget Active</label>
|
|
<!-- TMPL_IF NAME="budget_period_active" --><input type="checkbox" checked="checked" id="budget_period_active" name="budget_period_active" value="1" checked /><!--TMPL_ELSE--> <input type="checkbox" id="budget_period_active" name="budget_period_active" value="1"/> <!--/TMPL_IF-->
|
|
</li>
|
|
|
|
<li>
|
|
<!-- LOCK -->
|
|
<!-- ############################## -->
|
|
<label for="budget_period_locked">Lock Budget</label>
|
|
<!-- TMPL_IF NAME="budget_period_locked" --><input type="checkbox" checked="checked" id="budget_period_locked" name="budget_period_locked" value="1" /><!--TMPL_ELSE--> <input type="checkbox" id="budget_period_locked" name="budget_period_locked" value="1"/> <!--/TMPL_IF-->
|
|
</li>
|
|
</ol>
|
|
</fieldset>
|
|
|
|
<fieldset class="action">
|
|
<!-- "save changes" button -->
|
|
<!-- ###################################### -->
|
|
<input type="button" value="Save Changes" onclick="Check(this.form)" />
|
|
<!-- <input type="submit" value="Save Changes" /> -->
|
|
<!-- <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl" class="cancel">Cancel</a> -->
|
|
</fieldset>
|
|
|
|
</form>
|
|
|
|
<!-- /TMPL_IF -->
|
|
|
|
<!-- ####################################################################### -->
|
|
<!-- delete a budget period -->
|
|
<!-- ####################################################################### -->
|
|
|
|
<!-- TMPL_IF name="delete_confirm" -->
|
|
<!-- TMPL_IF name="total" -->
|
|
<div class="dialog message">
|
|
<h3>Cannot delete root budget</h3>
|
|
<p><strong>This record is used <!-- TMPL_VAR name="total" --> times</strong>
|
|
. Deletion is not possible.</p>
|
|
<!-- TMPL_ELSE -->
|
|
<div class="dialog alert">
|
|
<h3>Delete root budget '<!-- TMPL_VAR name="budget_period_description" -->'?</h3>
|
|
<!-- /TMPL_IF -->
|
|
|
|
<!-- ###################################################################### -->
|
|
<!-- display information about the budget period that must be deleted -->
|
|
<!-- ###################################################################### -->
|
|
|
|
<table>
|
|
<tr>
|
|
<th scope="row">Start date</th>
|
|
<td><!-- TMPL_VAR name="budget_period_startdate" --></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th scope="row">End date</th>
|
|
<td><!-- TMPL_VAR name="budget_period_enddate" --></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<th scope="row">Total amount</th>
|
|
<td><!-- TMPL_VAR name="budget_period_total" --></td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
<!-- ############################################################# -->
|
|
<!-- "delete" and "quit" buttons -->
|
|
<!-- ############################################################# -->
|
|
|
|
<form action="<!-- TMPL_VAR name="script_name" -->" method="post">
|
|
<input type="hidden" name="op" value="delete_confirmed" />
|
|
<input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR name="budget_period_id" -->" />
|
|
<input type="submit" class="approve" value="Delete" />
|
|
</form>
|
|
|
|
<form action="<!-- TMPL_VAR name="script_name" -->" method="post">
|
|
<input type="submit" class="deny" value="Quit" />
|
|
</form>
|
|
|
|
</div>
|
|
<!-- /TMPL_IF -->
|
|
<!-- DEFAULT display budget periods list -->
|
|
<!-- TMPL_IF name="else" -->
|
|
<h2>Root budgets administration</h2>
|
|
<!-- TMPL_IF name="cur" --><b>Currency = <!-- TMPL_VAR name="cur" --></b><!-- /TMPL_IF -->
|
|
<table id="periodsh">
|
|
<thead>
|
|
<tr>
|
|
<th>Root Budget Name</th>
|
|
<th>Start Date</th>
|
|
<th>End Date</th>
|
|
<th>Active</th>
|
|
<th>Locked</th>
|
|
<th>Total</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<!-- TMPL_LOOP name="period_loop" -->
|
|
<!-- TMPL_IF NAME="__odd__" -->
|
|
<tr>
|
|
<!-- TMPL_ELSE -->
|
|
<tr class="highlight">
|
|
<!-- /TMPL_IF -->
|
|
<td><!-- TMPL_VAR name="budget_period_description" --></td>
|
|
<td><!-- TMPL_VAR name="budget_period_startdate" --></td>
|
|
<td><!-- TMPL_VAR name="budget_period_enddate" --></td>
|
|
<td> <font COLOR="#00FF00"> <!-- TMPL_IF name="budget_period_active" -->✓<!-- /TMPL_IF --> </font> </td>
|
|
<td> <font COLOR="red"> <!-- TMPL_IF name="budget_period_locked" -->X<!-- /TMPL_IF --> </font> </td>
|
|
<td align='right'><!-- TMPL_VAR NAME="budget_period_total" --></td>
|
|
<td>
|
|
<a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&budget_period_id=<!-- TMPL_VAR name="budget_period_id" escape="HTML" -->">Edit</a>
|
|
<a href="<!-- TMPL_VAR name="script_name"-->?op=delete_confirm&budget_period_id=<!-- TMPL_VAR name="budget_period_id" -->">Delete</a>
|
|
<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=<!-- TMPL_VAR name="budget_period_id" -->">Budgets</a>
|
|
<a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->">Add Budget</a>
|
|
</td>
|
|
</tr>
|
|
<!-- /TMPL_LOOP -->
|
|
<!-- TMPL_UNLESS NAME="period_loop" -->
|
|
<tr><td colspan="7">No root budget</td></tr>
|
|
<!-- /TMPL_UNLESS -->
|
|
</tbody>
|
|
</table>
|
|
<div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
|
|
<!-- /TMPL_IF -->
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
<!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
|
|
</div>
|
|
</div>
|
|
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
|