Owen Leonard
1b3b942409
Labels which precede a text input or select typically have a colon before them: Name: [____] This patch cleans up templates where labels in this context lack a colon. Exceptions to this rule include radio buttons, checkboxes, and labels inside tables. To test, view the affected pages and confirm that labels look consistent. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Patch adds more consistency. Work for translators could be made easier using CSS instead of whitespace after colon. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
416 lines
16 KiB
Text
416 lines
16 KiB
Text
[% USE KohaDates %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% INCLUDE 'calendar.inc' %]
|
|
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
|
|
[% INCLUDE 'datatables-strings.inc' %]
|
|
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
|
|
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
|
|
<script type="text/javascript">
|
|
// #################################################################################
|
|
// Javascript
|
|
// #################################################################################
|
|
function CheckDuplicateForm(f){
|
|
var ok=1;
|
|
var _alertString="";
|
|
var alertString="";
|
|
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(_alertString.length==0){
|
|
f.submit();
|
|
} else {
|
|
alertString += _("Form not submitted because of the following problem(s)");
|
|
alertString += "\n-----------------------------------------\n";
|
|
alertString += _alertString;
|
|
alert(alertString);
|
|
}
|
|
}
|
|
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);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[% IF ( dateformat == 'metric' ) %]
|
|
dt_add_type_uk_date();
|
|
[% END %]
|
|
$(document).ready(function() {
|
|
var tabs = $('#budgetsTabs').tabs();
|
|
[% IF ( tab ) %]
|
|
tabs.tabs('select', [% tab %]);
|
|
[% END %]
|
|
$("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"aoColumnDefs": [
|
|
{
|
|
[% IF ( dateformat == 'metric' ) %]
|
|
"aTargets": [ 1, 2 ], "sType": "uk_date",
|
|
[% END %]
|
|
"bSortable": false, 'aTargets':['_all'],
|
|
},
|
|
],
|
|
"sPaginationType": "four_button",
|
|
"bAutoWidth": false,
|
|
"bPaginate": false,
|
|
"bInfo": false,
|
|
"bFilter": false,
|
|
} ) );
|
|
});
|
|
</script>
|
|
|
|
<title>
|
|
Koha › Administration › Budgets
|
|
|
|
[% IF ( add_form ) %]›
|
|
[% IF ( budget_period_id ) %]
|
|
Modify budget'[% budget_period_id %]'
|
|
[% ELSE %]
|
|
Add budget
|
|
[% END %]
|
|
[% END %]
|
|
[% IF ( duplicate_form ) %]› Duplicate budget[% END %]
|
|
[% IF ( delete_confirm ) %]›
|
|
Delete budget '[% budget_period_description %]'?
|
|
[% END %]
|
|
[% IF ( delete_confirmed ) %]›
|
|
Data deleted
|
|
[% END %]
|
|
</title>
|
|
|
|
|
|
</head>
|
|
|
|
<body id="admin_aqbudgetperiods" class="admin">
|
|
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE '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 -->
|
|
<!-- ####################################### -->
|
|
[% IF ( add_form ) %]
|
|
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budget</a> ›
|
|
[% IF ( budget_period_id ) %]
|
|
Modify budget [% budget_period_description %]
|
|
|
|
[% ELSE %]
|
|
Add budget
|
|
[% END %]
|
|
[% END %]
|
|
|
|
<!-- delete a budget period -->
|
|
<!-- ################################ -->
|
|
[% IF ( delete_confirm ) %]
|
|
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
|
|
[% IF ( total ) %]
|
|
Cannot delete budget '[% budget_period_description %]'
|
|
[% ELSE %]
|
|
Delete budget '[% budget_period_description %]'?
|
|
[% END %]
|
|
[% END %]
|
|
<!-- duplicate a budget -->
|
|
[% IF ( duplicate_form ) %]
|
|
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> › Duplicate budget
|
|
[% END %]
|
|
<!-- display budget periods list -->
|
|
<!-- ########################################## -->
|
|
[% IF ( else ) %]
|
|
Budgets administration
|
|
[% END %]
|
|
</div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
|
|
[% INCLUDE 'budgets-admin-toolbar.inc' %]
|
|
|
|
[% IF ( duplicate_form ) %]
|
|
<h3>Duplicate budget</h3>
|
|
<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
|
|
<fieldset class="rows">
|
|
<input type="hidden" name="op" value="duplicate_budget" />
|
|
<input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
|
|
|
|
<ol>
|
|
|
|
<li>
|
|
<label class="required" for="from">Start date: </label>
|
|
<input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
|
|
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
|
|
</li>
|
|
<li>
|
|
|
|
<label class="required" for="to">End date: </label>
|
|
<input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
|
|
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
|
|
</li>
|
|
|
|
</ol>
|
|
</fieldset>
|
|
|
|
<fieldset class="action">
|
|
<input type="button" value="Save Changes" onclick="CheckDuplicateForm(this.form)" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">Cancel</a>
|
|
</fieldset>
|
|
|
|
</form>
|
|
|
|
[% END %]
|
|
|
|
[% IF ( add_form ) %]
|
|
<!-- add or modify a budget period -->
|
|
|
|
[% IF ( budget_period_id ) %]
|
|
<h3>Modify budget</h3>
|
|
[% ELSE %]
|
|
<h3>Add budget</h3>
|
|
[% END %]
|
|
<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="budget_period_id" value="[% budget_period_id %]" />
|
|
<ol>
|
|
<li>
|
|
<label class="required" for="from">Start date: </label>
|
|
<input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
|
|
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
|
|
</li>
|
|
<li>
|
|
|
|
<label class="required" for="to">End date: </label>
|
|
<input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
|
|
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
|
|
</li>
|
|
|
|
<li>
|
|
<!-- DESCRIPTION -->
|
|
<!-- ############################## -->
|
|
<label class="required" for="budget_period_description">Description: </label>
|
|
<input type="text" id="budget_period_description" name="budget_period_description"
|
|
size="48" maxlength="80" value="[% 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="[% budget_period_total %]" />
|
|
</li>
|
|
|
|
<li>
|
|
<!-- ACTIVE -->
|
|
<!-- ############################## -->
|
|
<label for="budget_period_active">Make budget active: </label>
|
|
[% IF ( budget_period_active ) %]<input type="checkbox" checked="checked" id="budget_period_active" name="budget_period_active" value="1" />[% ELSE %] <input type="checkbox" id="budget_period_active" name="budget_period_active" value="1"/> [% END %]
|
|
</li>
|
|
|
|
<li>
|
|
<!-- LOCK -->
|
|
<!-- ############################## -->
|
|
<label for="budget_period_locked">Lock budget: </label>
|
|
[% IF ( budget_period_locked ) %]<input type="checkbox" checked="checked" id="budget_period_locked" name="budget_period_locked" value="1" />[% ELSE %] <input type="checkbox" id="budget_period_locked" name="budget_period_locked" value="1"/> [% END %]
|
|
</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" /> -->
|
|
[% IF ( budget_period_id ) %]<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]" class="cancel">Cancel</a>[% END %]
|
|
</fieldset>
|
|
|
|
</form>
|
|
|
|
[% END %]
|
|
|
|
<!-- ####################################################################### -->
|
|
<!-- delete a budget period -->
|
|
<!-- ####################################################################### -->
|
|
|
|
[% IF ( delete_confirm ) %]
|
|
[% IF ( total ) %]
|
|
<div class="dialog message">
|
|
<h3>Cannot delete budget</h3>
|
|
<p><strong>This record is used [% total %] times</strong>
|
|
. Deletion is not possible.</p>
|
|
[% ELSE %]
|
|
<div class="dialog alert">
|
|
<h3>Delete budget '[% budget_period_description %]'?</h3>
|
|
[% END %]
|
|
|
|
<!-- ############################################################# -->
|
|
<!-- "delete" and "cancel" buttons -->
|
|
<!-- ############################################################# -->
|
|
|
|
<form action="[% script_name %]" method="post">
|
|
<input type="hidden" name="op" value="delete_confirmed" />
|
|
<input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
|
|
<input type="submit" class="approve" value="Delete" />
|
|
</form>
|
|
|
|
<form action="[% script_name %]" method="post">
|
|
<input type="submit" class="deny" value="Cancel" />
|
|
</form>
|
|
|
|
</div>
|
|
[% END %]
|
|
<!-- DEFAULT display budget periods list -->
|
|
[% IF ( else ) %]
|
|
<h2>Budgets administration</h2>
|
|
|
|
[% INCLUDE 'budgets-active-currency.inc' %]
|
|
|
|
<div id="budgetsTabs" class="toptabs">
|
|
<ul>
|
|
<li><a href="#active">Active budgets</a></li>
|
|
<li><a href="#inactive">Inactive budgets</a></li>
|
|
</ul>
|
|
|
|
<div id="active">
|
|
[% IF ( period_active_loop ) %]
|
|
<table id="activeperiodst">
|
|
<thead>
|
|
<tr>
|
|
<th>Budget name</th>
|
|
<th>Start date</th>
|
|
<th>End date</th>
|
|
<th>Locked</th>
|
|
<th>Total</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH period_active IN period_active_loop %]
|
|
<tr>
|
|
<td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_active.budget_period_id %]" title="View funds for [% period_active.budget_period_description %]">[% period_active.budget_period_description %]</a></td>
|
|
<td>[% period_active.budget_period_startdate | $KohaDates %]</td>
|
|
<td>[% period_active.budget_period_enddate | $KohaDates %]</td>
|
|
<td>
|
|
[% IF ( period_active.budget_period_locked ) %]
|
|
<span style="color:green;">Locked</span>
|
|
[% END %]
|
|
</td>
|
|
<td align='right'>[% period_active.budget_period_total %]</td>
|
|
<td>
|
|
<a href="[% script_name %]?op=add_form&budget_period_id=[% period_active.budget_period_id |html %]">Edit</a>
|
|
<a href="[% script_name %]?op=delete_confirm&budget_period_id=[% period_active.budget_period_id %]">Delete</a>
|
|
<a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% period_active.budget_period_id %]">Add fund</a>
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% ELSE %]
|
|
No active budgets
|
|
[% END %]
|
|
<div class="paginationBar">[% active_pagination_bar %]</div>
|
|
</div>
|
|
<div id="inactive">
|
|
[% IF ( period_inactive_loop ) %]
|
|
<table id="inactiveperiodst">
|
|
<thead>
|
|
<tr>
|
|
<th>Budget name</th>
|
|
<th>Start date</th>
|
|
<th>End date</th>
|
|
<th>Locked</th>
|
|
<th>Total</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH period_loo IN period_inactive_loop %]
|
|
[% IF ( loop.odd ) %]
|
|
<tr>
|
|
[% ELSE %]
|
|
<tr class="highlight">
|
|
[% END %]
|
|
<td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_loo.budget_period_id %]" title="View funds for [% period_loo.budget_period_description %]">[% period_loo.budget_period_description %]</a></td>
|
|
<td>[% period_loo.budget_period_startdate | $KohaDates %]</td>
|
|
<td>[% period_loo.budget_period_enddate | $KohaDates %]</td>
|
|
<td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span> [% ELSE %][% END %] </td>
|
|
<td align='right'>[% period_loo.budget_period_total %]</td>
|
|
<td>
|
|
<a href="[% period_loo.script_name %]?op=add_form&budget_period_id=[% period_loo.budget_period_id |html %]">Edit</a>
|
|
<a href="[% period_loo.script_name %]?op=delete_confirm&budget_period_id=[% period_loo.budget_period_id %]">Delete</a>
|
|
<a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% period_loo.budget_period_id %]">Add fund</a>
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% ELSE %]
|
|
No inactive budgets
|
|
[% END %]
|
|
<div class="pages">[% inactive_pagination_bar %]</div>
|
|
</div>
|
|
</div>
|
|
[% END %]
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
[% INCLUDE 'acquisitions-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|