+[% USE raw %]
+[% USE Asset %]
[% USE KohaDates %]
[% USE Price %]
-
+[% SET footerjs = 1 %]
[%- BLOCK action_menu %]
<div class="dropdown">
- <a class="btn btn-mini dropdown-toggle" id="budgetmenu_[% block_budget_id %]" role="button" data-toggle="dropdown" href="#">
+ <a class="btn btn-default btn-xs dropdown-toggle" id="budgetmenu_[% block_budget.budget_period_id | html %]" role="button" data-toggle="dropdown" href="#">
Actions <b class="caret"></b>
</a>
- <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="budgetmenu_[% block_budget_id %]">
- <li>
- <a href="[% script_name %]?op=add_form&budget_period_id=[% block_budget_id |html %]"><i class="fa fa-pencil"></i> Edit</a>
- </li>
+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="budgetmenu_[% block_budget.budget_period_id | html %]">
<li>
- <a href="[% script_name %]?op=delete_confirm&budget_period_id=[% block_budget_id %]"><i class="fa fa-remove"></i> Delete</a>
+ <a href="[% script_name | url %]?op=add_form&budget_period_id=[% block_budget.budget_period_id | uri %]"><i class="fa fa-pencil"></i> Edit</a>
</li>
+ [% IF block_budget.count %]
+ <li class="disabled">
+ <a data-toggle="tooltip" data-placement="left" title="[% block_budget.count | html %] fund(s) are attached to this budget. You must delete all attached funds before deleting this budget." href="#"><i class="fa fa-trash"></i> Delete</a>
+ </li>
+ [% ELSE %]
+ <li>
+ <a href="[% script_name | url %]?op=delete_confirm&budget_period_id=[% block_budget.budget_period_id | uri %]"><i class="fa fa-trash"></i> Delete</a>
+ </li>
+ [% END %]
<li>
- <a href="[% script_name %]?op=duplicate_form&budget_period_id=[% block_budget_id %]"><i class="fa fa-copy"></i> Duplicate</a>
+ <a href="[% script_name | url %]?op=duplicate_form&budget_period_id=[% block_budget.budget_period_id | uri %]"><i class="fa fa-copy"></i> Duplicate</a>
</li>
<li>
- <a href="[% script_name %]?op=close_form&budget_period_id=[% block_budget_id %]"><i class="fa fa-remove-sign"></i> Close</a>
+ <a href="[% script_name | url %]?op=close_form&budget_period_id=[% block_budget.budget_period_id | uri %]"><i class="fa fa-times-circle"></i> Close</a>
</li>
<li>
- <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% block_budget_id %]"><i class="fa fa-plus"></i> Add fund</a>
+ <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% block_budget.budget_period_id | uri %]"><i class="fa fa-plus"></i> Add fund</a>
</li>
</ul>
</div>
[% END -%]
[% INCLUDE 'doc-head-open.inc' %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'doc-head-close.inc' %]
-[% INCLUDE 'calendar.inc' %]
-[% INCLUDE 'datatables.inc' %]
+[% Asset.css("css/datatables.css") | $raw %]
[% IF close_form %]
- <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
+ [% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %]
[% END %]
-<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 (!(isNotNull(f.budget_period_description,1))){
- _alertString += "\n- " + _("Budget description missing");
- }
-
- 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);
- }
- }
-
- $(document).ready(function() {
- var tabs = $('#budgetsTabs').tabs();
- [% IF ( tab ) %]
- tabs.tabs("option", "active", [% tab %]);
- [% END %]
- $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
- "sDom": 't',
- "aaSorting": [],
- "aoColumnDefs": [
- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
- { "sType": "title-string", "aTargets" : [ "title-string" ] }
- ],
- "bPaginate": false,
- 'bAutoWidth': false
- } ) );
-
- [% IF close_form %]
- $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
- sDom: "t"
- }));
- $("#move_form").submit(function(){
- var budget_from = "[% budget_period_description %]";
- var budget_to = $("#to_budget_period_id").find("option:selected").html();
- var alert_message = _("You have chosen to move all unreceived orders from '%s' to '%s'.").format(budget_from, budget_to);
- alert_message += "\n" + _("This action cannot be reversed. Do you wish to continue?");
- return confirm ( alert_message );
- });
- [% END %]
- [% IF closed %]
- var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, {
- // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
- "fnDrawCallback": function ( oSettings ) {
- if ( oSettings.aiDisplay.length == 0 )
- {
- return;
- }
-
- var nTrs = $('#closed_report tbody tr');
- var iColspan = nTrs[1].getElementsByTagName('td').length;
- var sLastGroup = "";
- for ( var i=0 ; i<nTrs.length ; i++ )
- {
- var iDisplayIndex = oSettings._iDisplayStart + i;
- var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0];
- if ( sGroup != sLastGroup )
- {
- var nGroup = document.createElement( 'tr' );
- var nCell = document.createElement( 'td' );
- nCell.colSpan = iColspan;
- nCell.className = "group";
- nCell.innerHTML = sGroup;
- nGroup.appendChild( nCell );
- nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
- sLastGroup = sGroup;
- }
- }
- },
- "aoColumnDefs": [
- { "bVisible": false, "aTargets": [ 0, 1 ] },
- { "bSortable": false, "aTargets": ["_all"] }
- ],
- 'bSort': true,
- 'aaSortingFixed': [[ 1, 'asc' ]],
- 'bPaginate': false,
- "bAutoWidth": false
- }));
- [% END %]
- });
-</script>
<title>
Koha › Administration › Budgets
[% IF ( add_form ) %]›
[% IF ( budget_period_id ) %]
- Modify budget [% budget_period_description %]
+ Modify budget [% budget_period_description | html %]
[% ELSE %]
Add budget
[% END %]
[% END %]
[% IF ( duplicate_form ) %]› Duplicate budget[% END %]
[% IF ( delete_confirm ) %]›
- Delete budget '[% budget_period_description %]'?
+ Delete budget '[% budget_period_description | html %]'?
[% END %]
[% IF ( delete_confirmed ) %]›
Data deleted
[% END %]
[% IF close_form %]›
- Close budget [% budget_period_description %]
+ Close budget [% budget_period_description | html %]
[% END %]
[% IF closed %]›
- Budget [% budget_period_description %] closed
+ Budget [% budget_period_description | html %] closed
[% END %]
</title>
[% IF ( add_form ) %]
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
[% IF ( budget_period_id ) %]
- <span>Modify budget '[% budget_period_description %]'</span>
+ <span>Modify budget '[% budget_period_description | html %]'</span>
[% ELSE %]
<span>Add budget</span>
[% END %]
[% END %]
[% IF ( delete_confirm ) %]
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
- [% IF ( total ) %]
- <span>Cannot delete budget '[% budget_period_description %]'</span>
+ [% IF ( total || funds_exist ) %]
+ <span>Cannot delete budget '[% budget_period_description | html %]'</span>
[% ELSE %]
- <span>Delete budget '[% budget_period_description %]'?</span>
+ <span>Delete budget '[% budget_period_description | html %]'?</span>
[% END %]
[% END %]
[% IF ( duplicate_form ) %]
[% END %]
[% IF close_form %]
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
- <span>Close budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a></span>
+ <span>Close budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]">[% budget_period_description | html %]</a></span>
[% END %]
[% IF closed %]
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> ›
- <span>Budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a> closed</span>
+ <span>Budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]">[% budget_period_description | html %]</a> closed</span>
[% END %]
[% IF ( else ) %]
<span>Budgets administration</span>
[% END %]
</div>
-<div id="doc3" class="yui-t2">
-<div id="bd">
-<div id="yui-main">
-<div class="yui-b">
+<div class="main container-fluid">
+ <div class="row">
+ <div class="col-sm-10 col-sm-push-2">
+ <main>
-[% UNLESS close_form OR closed%]
+[% UNLESS close_form OR closed OR duplicate_form %]
[% INCLUDE 'budgets-admin-toolbar.inc' %]
[% END %]
[% IF ( duplicate_form ) %]
<h3>Duplicate budget</h3>
-<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
+<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" id="add_modify_budget" 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 %]" />
+ <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
<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>
+ <span class="required">Required</span>
+ <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>
+ <span class="required">Required</span>
+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li>
<label class="required" for="budget_period_description">Description</label>
- <input type="text" id="budget_period_description" name="budget_period_description" value="[% budgetperiod.budget_period_description %]" />
+ <input type="text" id="budget_period_description" name="budget_period_description" value="[% budgetperiod.budget_period_description | html %]" />
+ <span class="required">Required</span>
+ </li>
+
+ <li>
+ <label for="amount_change_percentage">Change amounts by</label>
+ <input type="text" id="amount_change_percentage" name="amount_change_percentage" /> %
+ <div class="hint">(can be positive or negative)</div>
+ </li>
+
+ <li>
+ <label for="amount_change_round_increment">If amounts changed, round to a multiple of</label>
+ <input type="text" id="amount_change_round_increment" name="amount_change_round_increment" />
+ <div class="hint">(amounts will be rounded down)</div>
</li>
<li>
</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>
+ <input type="submit" value="Save" />
+ <a class="cancel" href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | html %]">Cancel</a>
</fieldset>
</form>
<!-- add or modify a budget period -->
[% IF ( budget_period_id ) %]
- <h3>Modify budget <i>[% budget_period_description %]</i></h3>
+ <h3>Modify budget <i>[% budget_period_description | html %]</i></h3>
[% ELSE %]
<h3>Add budget</h3>
[% END %]
-<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
+<form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" id="add_modify_budget" 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 %]" />
+ <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
<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>
+ <span class="required">Required</span>
+ <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>
+ <span class="required">Required</span>
+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li>
<!-- ############################## -->
<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 %]" />
+ size="48" maxlength="80" value="[% budget_period_description | html %]" />
+ <span class="required">Required</span>
</li>
<li>
<!-- ############################## -->
<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 | $Price on_editing => 1 %]" />
+ size="10" maxlength="80" value="[% budget_period_total | $Price on_editing => 1 | html %]" />
</li>
<li>
<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 %]
+ <input type="submit" value="Save" />
+ [% IF ( budget_period_id ) %]
+ <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]" class="cancel">Cancel</a>
+ [% ELSE %]
+ <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl" class="cancel">Cancel</a>
+ [% END %]
</fieldset>
</form>
[% IF ( total ) %]
<div class="dialog message">
<h3>Cannot delete budget</h3>
- <p><strong>This record is used [% total %] times</strong>
+ <p><strong>This record is used [% total | html %] times</strong>
. Deletion is not possible.</p>
+ [% ELSIF ( funds_exist ) %]
+ <div class="dialog message">
+ <h3>Cannot delete budget</h3>
+ <p>This budget has funds attached. You must delete all attached funds before you can delete this budget.</p>
[% ELSE %]
<div class="dialog alert">
- <h3>Delete budget '[% budget_period_description %]'?</h3>
- [% END %]
+ <h3>Delete budget '[% budget_period_description | html %]'?</h3>
<!-- ############################################################# -->
<!-- "delete" and "cancel" buttons -->
<!-- ############################################################# -->
- <form action="[% script_name %]" method="post">
+ <form action="[% script_name | html %]" 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" />
+ <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
+ <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
</form>
-
- <form action="[% script_name %]" method="post">
- <input type="submit" class="deny" value="Cancel" />
+ <form action="[% script_name | html %]" method="post">
+ <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
</form>
+ [% END %]
</div>
[% END %]
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
[% ELSE %]
<h3>The unreceived orders from the following funds will be moved</h3>
- Fund list of budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>:
+ Fund list of budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]">[% budget_period_description | html %]</a>:
<table id="budgeth">
<thead>
<tr>
<tbody>
[% FOREACH budget IN budgets_to_move %]
<tr>
- <td>[% budget.budget_id %]</td>
- <td>[% budget.budget_code_indent %]</td>
- <td>[% budget.budget_name %]</td>
- <td>[% budget.unreceived_orders.size %]</td>
+ <td>[% budget.budget_id | html %]</td>
+ <td>[% budget.budget_code_indent | html %]</td>
+ <td>[% budget.budget_name | html %]</td>
+ <td>[% budget.unreceived_orders.size | html %]</td>
</tr>
[% END %]
</tbody>
<select name="to_budget_period_id" id="to_budget_period_id" required="required">
<option value=""></option>
[% FOR budget_period IN budget_periods %]
- <option value="[% budget_period.budget_period_id %]">[% budget_period.budget_period_description %]</option>
+ <option value="[% budget_period.budget_period_id | html %]">[% budget_period.budget_period_description | html %]</option>
[% END %]
</select>
</li>
</fieldset>
<fieldset class="action">
<input type="hidden" name="op" value="close_confirmed" />
- <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
+ <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
<input type="submit" value="Move unreceived orders" />
<a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Cancel</a>
</fieldset>
</form>
[% END %]
[% ELSIF closed %]
- <h3>Report after moving unreceived orders from budget [% from_budget_period.budget_period_description %] ([% from_budget_period.budget_period_startdate | $KohaDates %] - [% from_budget_period.budget_period_enddate | $KohaDates %]) to [% to_budget_period.budget_period_description %] ([% to_budget_period.budget_period_startdate | $KohaDates %] - [% to_budget_period.budget_period_enddate | $KohaDates%])</h3>
+ <h3>Report after moving unreceived orders from budget [% from_budget_period.budget_period_description | html %] ([% from_budget_period.budget_period_startdate | $KohaDates %] - [% from_budget_period.budget_period_enddate | $KohaDates %]) to [% to_budget_period.budget_period_description | html %] ([% to_budget_period.budget_period_startdate | $KohaDates %] - [% to_budget_period.budget_period_enddate | $KohaDates%])</h3>
<table id="closed_report">
<thead>
[% IF r.orders_moved.size > 0 %]
[% FOR order IN r.orders_moved %]
<tr>
- <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %]) Amount=[% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
- <td>[% order.basketname %]</td>
- <td>[% order.ordernumber %]</td>
+ <td>[% r.budget.budget_name | html %] (id=[% r.budget.budget_id | html %]) Amount=[% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
+ <td>[% order.basketname | html %]</td>
+ <td>[% order.ordernumber | html %]</td>
<td>Moved!</td>
</tr>
[% END %]
[% ELSE %]
<tr>
- <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %])</td>
+ <td>[% r.budget.budget_name | html %] (id=[% r.budget.budget_id | html %])</td>
<td></td>
<td></td>
<td>There were no unreceived orders for this fund.</td>
[% ELSE %]
[% IF r.error == 'budget_code_not_exists' %]
<tr>
- <td>[% r.budget.budget_id %] [% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
+ <td>[% r.budget.budget_id | html %] [% r.budget.budget_amount | $Price %][% IF r.unspent_moved %] ([% r.unspent_moved | $Price %] remaining has been moved)[% END %]</td>
<td></td>
<td></td>
<td>This fund code does not exist in the destination budget.</td>
[% IF ( else ) %]
<h2>Budgets administration</h2>
+ [% IF ( failed_delete_funds_exist ) %]
+ <div class="dialog message">Failed to delete budget because funds exist.</div>
+ [% END %]
+
[% INCLUDE 'budgets-active-currency.inc' %]
<div id="budgetsTabs" class="toptabs">
<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><span title="[% period_active.budget_period_startdate %]">[% period_active.budget_period_startdate | $KohaDates %]</span></td>
- <td><span title="[% period_active.budget_period_enddate %]">[% period_active.budget_period_enddate | $KohaDates %]</span></td>
+ <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_active.budget_period_id | uri %]" title="View funds for [% period_active.budget_period_description | html %]">[% period_active.budget_period_description | html %]</a></td>
+ <td><span title="[% period_active.budget_period_startdate | html %]">[% period_active.budget_period_startdate | $KohaDates %]</span></td>
+ <td><span title="[% period_active.budget_period_enddate | html %]">[% period_active.budget_period_enddate | $KohaDates %]</span></td>
<td>
[% IF ( period_active.budget_period_locked ) %]
<span style="color:green;">Locked</span>
</td>
<td class="data">[% period_active.budget_period_total | $Price %]</td>
<td>
- [% PROCESS action_menu block_budget_id=period_active.budget_period_id %]
+ [% PROCESS action_menu block_budget=period_active %]
</td>
</tr>
[% END %]
[% ELSE %]
No active budgets
[% END %]
- <div class="paginationBar">[% active_pagination_bar %]</div>
</div>
<div id="inactive">
[% IF ( period_inactive_loop ) %]
<tbody>
[% FOREACH period_loo IN period_inactive_loop %]
<tr>
- <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><span title="[% period_loo.budget_period_startdate %]">[% period_loo.budget_period_startdate | $KohaDates %]</span></td>
- <td><span title="[% period_loo.budget_period_enddate %]">[% period_loo.budget_period_enddate | $KohaDates %]</span></td>
+ <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_loo.budget_period_id | uri %]" title="View funds for [% period_loo.budget_period_description | html %]">[% period_loo.budget_period_description | html %]</a></td>
+ <td><span title="[% period_loo.budget_period_startdate | html %]">[% period_loo.budget_period_startdate | $KohaDates %]</span></td>
+ <td><span title="[% period_loo.budget_period_enddate | html %]">[% period_loo.budget_period_enddate | $KohaDates %]</span></td>
<td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span> [% ELSE %][% END %] </td>
<td class="data">[% period_loo.budget_period_total | $Price %]</td>
<td>
- [% PROCESS action_menu block_budget_id=period_loo.budget_period_id %]
+ [% PROCESS action_menu block_budget=period_loo %]
</td>
</tr>
[% END %]
[% ELSE %]
No inactive budgets
[% END %]
- <div class="pages">[% inactive_pagination_bar %]</div>
</div>
</div>
[% END %]
+ </main>
+ </div> <!-- /.col-sm-10.col-sm-push-2 -->
-</div>
-</div>
-<div class="yui-b">
-[% INCLUDE 'acquisitions-menu.inc' %]
-</div>
-</div>
+ <div class="col-sm-2 col-sm-pull-10">
+ <aside>
+ [% INCLUDE 'acquisitions-menu.inc' %]
+ </aside>
+ </div> <!-- /.col-sm-2.col-sm-pull-10 -->
+ </div> <!-- /.row -->
+[% MACRO jsinclude BLOCK %]
+ [% INCLUDE 'calendar.inc' %]
+ [% INCLUDE 'datatables.inc' %]
+ [% IF close_form %]
+ [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
+ [% END %]
+ [% Asset.js("js/acq.js") | $raw %]
+ <script>
+ $(document).ready(function() {
+ var tabs = $('#budgetsTabs').tabs();
+ [% IF ( tab ) %]
+ tabs.tabs("option", "active", [% tab | html %]);
+ [% END %]
+ $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
+ "aoColumnDefs": [
+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+ { "sType": "title-string", "aTargets" : [ "title-string" ] }
+ ],
+ "sPaginationType": "four_button",
+ 'bAutoWidth': false
+ } ) );
+
+ [% IF close_form %]
+ $("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
+ sDom: "t"
+ }));
+ $("#move_form").submit(function(){
+ var budget_from = "[% budget_period_description | html %]";
+ var budget_to = $("#to_budget_period_id").find("option:selected").html();
+ var alert_message = _("You have chosen to move all unreceived orders from '%s' to '%s'.").format(budget_from, budget_to);
+ alert_message += "\n" + _("This action cannot be reversed. Do you wish to continue?");
+ return confirm ( alert_message );
+ });
+ [% END %]
+ [% IF closed %]
+ var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, {
+ // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
+ "fnDrawCallback": function ( oSettings ) {
+ if ( oSettings.aiDisplay.length == 0 )
+ {
+ return;
+ }
+
+ var nTrs = $('#closed_report tbody tr');
+ var iColspan = nTrs[1].getElementsByTagName('td').length;
+ var sLastGroup = "";
+ for ( var i=0 ; i<nTrs.length ; i++ )
+ {
+ var iDisplayIndex = oSettings._iDisplayStart + i;
+ var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0];
+ if ( sGroup != sLastGroup )
+ {
+ var nGroup = document.createElement( 'tr' );
+ var nCell = document.createElement( 'td' );
+ nCell.colSpan = iColspan;
+ nCell.className = "group";
+ nCell.innerHTML = sGroup;
+ nGroup.appendChild( nCell );
+ nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
+ sLastGroup = sGroup;
+ }
+ }
+ },
+ "aoColumnDefs": [
+ { "bVisible": false, "aTargets": [ 0, 1 ] },
+ { "bSortable": false, "aTargets": ["_all"] }
+ ],
+ 'bSort': true,
+ 'aaSortingFixed': [[ 1, 'asc' ]],
+ "bAutoWidth": false,
+ "sPaginationType": "full_numbers"
+ }));
+ [% END %]
+ $("#add_modify_budget").validate({
+ rules: {
+ budget_period_startdate: "required",
+ budget_period_enddate: {
+ required: true,
+ date_on_or_after: "#from"
+ },
+ budget_period_description: "required",
+ budget_period_total: {
+ number: true
+ }
+ },
+ messages: {
+ budget_period_enddate: {
+ date_on_or_after: _("Budget end date must be on or after budget start date")
+ }
+ }
+ });
+ });
+ </script>
+[% END %]
[% INCLUDE 'intranet-bottom.inc' %]