Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt
Owen Leonard 622581e5bf
Bug 32769: Standardize structure around action fieldsets in administration
This patch updates administration templates so that fieldsets with the
"action" class are placed outside the form's main fieldset.

To test, apply the patch and check the following pages to confirm that
the forms look correct:

- Administration
   -> Keyboard shortcuts
   -> Audio alerts
   -> Share content with Mana KB
      - When the ManaToken system preference is empty, the page should
        have two forms with updated fieldsets: the form with the "Use
        Mana KB..." field and a "Configure Mana KB" form.
      - With a ManaToken defined the second form should be one labeled
        "Mana KB token."
   -> Budgets
      - Click on a budget which has existing funds.
      - In the page toolbar click Planning -> Plan by libraries.
      - Check the forms in the sidebar.
   -> System preferences ->  OverDriveAuthName
      - Follow the link to "OverDrive library authnames table" and check
        the form on that page.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-09 10:21:24 -03:00

342 lines
15 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Price %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
[% PROCESS 'budget_planning.inc' %]
<title>Planning for [% budget_period_description | html %] [% PROCESS planning plan=authcat %] &rsaquo; Funds &rsaquo; Budgets &rsaquo; Administration &rsaquo; Koha</title>
[% INCLUDE 'doc-head-close.inc' %]
<style>td.locked { background-image: url('[% interface | html %]/[% theme | html %]/img/locked.png'); padding-left : 20px; background-repeat: no-repeat; background-position: 5px 5px; } a.control { font-size:85%;text-decoration:none; } .plan_entry { text-align: right; width:90%; }</style>
</head>
<body id="admin_aqplan" class="admin">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'budgets-admin-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol>
<li>
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
</li>
<li>
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
</li>
<li>
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a>
</li>
<li>
<a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]">Funds</a>
</li>
<li>
<a href="#" aria-current="page">Planning</a>
</li>
</ol>
</nav>
[% END %]
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
[% INCLUDE 'budgets-admin-toolbar.inc' %]
<form method="post" id="Aform" name="Aform" action="/cgi-bin/koha/admin/aqplan.pl">
<h1>Planning for [% budget_period_description | html %] [% PROCESS planning plan=authcat %]</h1>
<input type="hidden" name="authcat" value="[% authcat | html %]" />
<!-- Budget Lines -->
<div class="page-section">
[% IF ( budget_lines ) %]
[% INCLUDE 'budgets-active-currency.inc' %]
[% IF ( show_actual ) %]
<p><strong>Each cell contain both actual and estimated values.</strong></p>
[% ELSE %]
<p><strong>Cells contain estimated values only.</strong></p>
[% END %]
<p id="selections">
<strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span>
[% FOREACH authvals_ro IN authvals_row %]
<span class="selected"><label><input type="checkbox" checked="checked" id="col[% authvals_ro.colnum | html %]">[% authvals_ro.code | html %]</label></span>
[% END %]
</p>
<table id="plan">
<thead>
<tr>
<th>Fund name</th>
<th>Fund total</th>
[% FOREACH authvals_ro IN authvals_row %]
[% IF ( authvals_ro.display ) %]
<th id="col[% authvals_ro.code | html %]" class="[% authvals_ro.colnum | html %]">
[% ELSE %]
<th id="col[% authvals_ro.code | html %]" style="display:none;" class="[% authvals_ro.colnum | html %]">
[% END %]
[% authvals_ro.code | html %]</th>
[% END %]
<th class="remaining">Fund remaining</th>
<th class="noExport">Actions</th>
</tr>
</thead>
<tbody>
[% FOREACH budget_line IN budget_lines %]
<tr id="[% budget_line.budget_id | html %]">
[% IF ( budget_line.budget_lock ) %]
<td class="locked" title="Fund locked">
[% ELSE %]
<td>
[% END %]
<a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_id=[% budget_line.budget_id | uri %]&amp;budget_period_id=[% budget_period_id | uri %]">[% budget_line.budget_name | html %]</a></td>
<td><span id="[% budget_line.budget_amount | html %]">[% budget_line.budget_amount | $Price %]&nbsp;</span>
<!-- NEXT DIV ELEMENT IS USED BY JS FOR CALC-ING AUTO-FILL AND ESTIMATED AMOUNTS -->
<div style="display:none;" id="budget_tot_[% budget_line.budget_id | html %]">[% budget_line.budget_amount | html %]</div></td>
[% FOREACH line IN budget_line.lines %]
[% IF ( line.display ) %]
<td class="[% line.colnum | html %]">
[% ELSE %]
<td style="display:none;" class="[% line.colnum | html %]">
[% END %]
<table class="invis">
<tr>
[% IF show_actual %]
<td >[% line.actual_amount | html %]</td>
[% END %]
<td>
[% IF ( line.budget_lock ) %]
[% line.estimated_amount | html %]&nbsp;
<input type="hidden" style="text-align: right;" name="[% line.cell_name | html %]" value="[% line.estimated_amount | html %]" />
[% ELSE %]
<input type="text" size="6" name="[% line.cell_name | html %]" value="[% line.estimated_amount | html %]" id="budget_[% line.budget_id | html %][% line.colnum | html %]" class="plan_entry plan_entry_[% line.budget_id | html %]" />
[% END %]
</td></tr>
</table>
</td>
[% END %]
<td>
<table class="invis">
<tr>
[% IF show_actual %]
[% IF ( budget_line.act_negative ) %]
<td style="color: red;">
[% ELSIF ( budget_line.act_positive ) %]
<td style="color: green;">
[% ELSE %]
<td>
[% END %]
[% budget_line.budget_act_remain | html %]
</td>
[% END %]
[% IF ( budget_line.est_negative ) %]
<td style="color: red;" id="budget_est_[% budget_line.budget_id | html %]">
[% ELSIF ( budget_line.est_positive ) %]
<td style="color: green;" id="budget_est_[% budget_line.budget_id | html %]">
[% ELSE %]
<td id="budget_est_[% budget_line.budget_id | html %]">
[% END %]
[% budget_line.budget_est_remain | $Price %]&nbsp;
</td>
</tr>
</table>
</td>
<td class="actions">
[% UNLESS ( budget_line.budget_lock ) %]
<input type="button" class="auto_fill_row btn btn-default btn-xs" data-budget-id="[% budget_line.budget_id | html %]" value="Auto-fill row"/>
<input type="button" class="clear_fields btn btn-default btn-xs" data-budget-id="[% budget_line.budget_id | html %]" value="Clear">
[% ELSE %]
<div style="color:red;">not owned</div>
[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
<input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
[% IF ( budget_period_locked ) %]
<!-- <input STYLE="background: gray;" type="submit" value="Save" disabled="disabled"/> -->
[% ELSE %]
<input type="hidden" name="op" value="save" />
<fieldset class="action"><input type="submit" class="btn btn-primary" value="Save" /></fieldset>
[% END %]
</div> <!-- /.page-section -->
<div id="hide_div">
[% FOREACH authvals_ro IN authvals_row %]
[% UNLESS ( authvals_ro.display ) %]
<input type="hidden" value="[% authvals_ro.code | html %]" name="hide_cols"/>
[% END %]
[% END %]
</div>
</form>
[% ELSIF not budget_period_id %]
<div class="dialog alert">That budget does not exist! Please select a budget to continue.</div>
[% ELSE %]
<div class="dialog message">No funds to display for this search criteria</div>
[% END %]
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
<form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
<input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
<fieldset class="brief">
<h4>Filter</h4>
[% BLOCK planning_types %]
[% SWITCH type %]
[% CASE 'MONTHS' %]<span>by months</span>
[% CASE 'ITEMTYPES' %]<span>by item types</span>
[% CASE 'BRANCHES' %]<span>by libraries</span>
[% CASE %]<span>by [% type | html %]</span>
[% END %]
[% END %]
<ol>
<li>
<label for="authcat"> Select planning type:</label>
<select name="authcat" id="authcat">
[% FOREACH value IN authcat_dropbox.values %]
[% IF ( value == authcat_dropbox.default ) %]
<option value="[% value | html %]" selected="selected">[% PROCESS planning_types type=value %]</option>
[% ELSE %]
<option value="[% value | html %]">[% PROCESS planning_types type=value %]</option>
[% END %]
[% END %]
</select>
</li>
<li class="radio">
[% IF ( show_mine ) %]
<input type="checkbox" id="show_mine" name="show_mine" value="1" checked="checked" />
[% ELSE %]
<input type="checkbox" id="show_mine" name="show_mine" value="1" />
[% END %]
<label for="show_mine">Show my funds only</label>
</li>
<li class="radio">
[% IF ( show_active ) %]
<input type="checkbox" id="show_active" name="show_active" value="1" checked="checked" />
[% ELSE %]
<input type="checkbox" id="show_active" name="show_active" value="1" />
[% END %]
<label for="show_active">Show active funds only</label>
</li>
<li class="radio">
[% IF ( show_actual ) %]
<input type="checkbox" id="show_actual" name="show_actual" value="1" checked="checked" />
[% ELSE %]
<input type="checkbox" id="show_actual" name="show_actual" value="1" />
[% END %]
<label for="show_actual">Show actual/estimated values</label>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" name="option_submit" class="btn btn-primary" value="Submit" />
<input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
</fieldset>
</form>
[% IF ( budget_lines ) %]
<form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
<fieldset class="brief">
<h4>Export</h4>
<ol>
<li><label for="basename">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" /></li>
<li><label class="inline" for="MIME">Into an application</label>
<select name="MIME" id="MIME">
[% FOREACH value IN CGIextChoice %]
<option value="[% value | html %]">[% value | html %]</option>
[% END %]
</select>
<select name="sep" id="sep">
[% FOREACH value IN CGIsepChoice %]
<option value="[% value | html %]">[% value | html %]</option>
[% END %]
</select>
</li>
</ol>
<input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
<input type="hidden" name="authcat" value="[% authcat | html %]" />
</fieldset>
<fieldset class="action"> <input type="submit" class="btn btn-primary" value="Submit" />
<input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
<input type="hidden" name="report_name" value="[% report_name | html %]" />
<input type="hidden" name="output" value="file" /></fieldset>
</form>
[% END %]
[% INCLUDE 'acquisitions-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/acq.js") | $raw %]
<script>
jQuery.validator.addClassRules({ plan_entry: { pnumber: true } }); // require that input be a number in fields with the class 'plan_entry'
jQuery.validator.addMethod("pnumber", $.validator.methods.number, _("Please enter a valid number.") );
var zero_formatted = "[% 0 | $Price on_editing => 1 %]";
$(document).ready(function() {
$("#selections input").on("change",function(e){
var num = $(this).attr("id");
if(num == 'showall'){
showAllColumns();
e.stopPropagation();
} else if(num == 'hideall'){
hideAllColumns();
e.stopPropagation();
} else {
if($(this).prop("checked")){
showColumn(num);
} else {
hideColumn(num);
}
}
});
$(".plan_entry").on("change",function(){
calcTotalRow( this );
});
$("#Aform").validate();
$(".auto_fill_row").on("click",function(){
var budget_id = $(this).data("budget-id");
autoFillRow( budget_id );
});
$(".clear_fields").on("click",function(){
var budget_id = $(this).data("budget-id");
var edit_row = $("#"+budget_id);
$(edit_row).find("input").each(function(){
var type = $(this).attr("type");
if (type != "button" && type != "submit" ) {
$(this).val(zero_formatted);
$(this).prop('disabled', false);
}
});
$("#budget_est_"+budget_id).text($("#budget_tot_"+budget_id).prev().text());
$("#budget_est_"+budget_id).css("color","green");
});
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]