From fac6523b3cb00add7a3557b62a363aa95f23eea7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 5 Oct 2023 15:18:33 +0000 Subject: [PATCH] Bug 34404: Fix inconsistencies in Budgets and funds page titles, breadcrumbs, and headers This patch fixes some inconsistencies in the budget and fund administration templates, making sure the page title, breadcrumb navigation, and page headers are consistent with each other. Other changes: Bootstrap tooltips have been enabled in a few places where the markup showed intent for the tooltips to be active but where the JS was not being initiated. Some translation imrovements have been added where budget planning strings could be improved with context: 'by months' -> '[% tp("Budget planning", "by months") | html %]' To test, apply the patch and go to Administration -> Budgets. Test each of these cases: - Budgets list - New budget - Edit budget - Duplicate budget - Close budget - Close a budget with and without unreceived orders. - Delete budget - Test the delete button on a budget which has funds attached to confirm that the menu item is disabled and a tooltip shows with an explanation. - Delete a budget which has no funds attached. - Add fund - Test the add fund button on a budget which is locked. The menu item should be disabled and it should show a tooltip, "Budget is locked." - Test the add fund page for a budget which is not locked. - Click the name of a budget with funds attached to see the funds view - In this view, if the budget is locked, the "New" toolbar menu should have a disabled "New fund" item with a Bootstrap tooltip. - While viewing the funds on a budget, test the "Planning" button to confirm that the view of each planning type. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/includes/budget_planning.inc | 15 ++-- .../prog/en/modules/admin/aqbudgetperiods.tt | 82 ++++++++++-------- .../prog/en/modules/admin/aqbudgets.tt | 86 +++++++++++++------ .../prog/en/modules/admin/aqplan.tt | 16 ++-- 4 files changed, 126 insertions(+), 73 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/budget_planning.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/budget_planning.inc index e502eb3af4..48160ebb20 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/budget_planning.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/budget_planning.inc @@ -1,8 +1,9 @@ [% PROCESS 'i18n.inc' %] -[%- BLOCK planning -%] - [%- SWITCH plan -%] - [%- CASE 'MONTHS' -%][% t('by months') | html %] - [%- CASE 'BRANCHES' -%][% t('by libraries') | html %] - [%- CASE 'ITEMTYPES' -%][% t('by item types') | html %] - [%- END -%] -[%- END -%] +[% BLOCK planning %] +[% SWITCH plan %] +[% CASE 'MONTHS' %][% tpx("Budget planning", "Planning for '{fund}' by months", { fund = budget_period_description }) | html %] +[% CASE 'ITEMTYPES' %][% tpx("Budget planning", "Planning for '{fund}' by item types", { fund = budget_period_description }) | html %] +[% CASE 'BRANCHES' %][% tpx("Budget planning", "Planning for '{fund}' by library", { fund = budget_period_description }) | html %] +[% CASE %][% tpx("Budget planning", "Planning for '{fund}' by {type}", { fund = budget_period_description, type = type }) | html %] +[% END %] +[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt index 84e44e25a0..200be090a3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -28,9 +28,15 @@
  • Close
  • -
  • - Add fund -
  • + [% IF ( block_budget.budget_period_locked ) %] +
  • + Add fund +
  • + [% ELSE %] +
  • + Add fund +
  • + [% END %] [% END -%] @@ -44,25 +50,26 @@ [% FILTER collapse %] [% IF ( add_form ) %] [% IF ( budget_period_id ) %] - [% tx("Modify budget {budget_period_description}", { budget_period_description = budget_period_description }) | html %] + [% tx("Modify budget '{budget_period_description}'", { budget_period_description = budget_period_description }) | html %] [% ELSE %] - [% t("Add budget") | html %] + [% t("New budget") | html %] [% END %] › [% END %] [% IF ( duplicate_form ) %] [% t("Duplicate budget") | html %] › [% END %] [% IF ( delete_confirm ) %] - [% tx("Delete budget '{budget_period_description}'?", { budget_period_description = budget_period_description }) | html %] › - [% END %] - [% IF ( delete_confirmed ) %] - [% t("Data deleted") | html %] › + [% IF ( total || funds_exist ) %] + [% tx("Cannot delete budget '{budget_period_description}'", { budget_period_description = budget_period_description }) | html %] › + [% ELSE %] + [% tx("Confirm deletion of budget '{budget_period_description}'", { budget_period_description = budget_period_description }) | html %] › + [% END %] [% END %] [% IF close_form %] - [% tx("Close budget {budget_period_description}", { budget_period_description = budget_period_description }) | html %] › + [% tx("Close budget '{budget_period_description}'", { budget_period_description = budget_period_description }) | html %] › [% END %] [% IF closed %] - [% tx("Budget {budget_period_description} closed", { budget_period_description = budget_period_description }) | html %] › + [% tx("Budget '{budget_period_description}' closed", { budget_period_description = budget_period_description }) | html %] › [% END %] [% t("Budgets") | html %] › [% t("Administration") | html %] › @@ -84,7 +91,7 @@ [% IF ( else ) %] [% WRAPPER breadcrumb_item bc_active= 1 %] - <span>Budgets administration</span> + <span>Budgets</span> [% END %] [% ELSE %] [% WRAPPER breadcrumb_item %] @@ -95,11 +102,11 @@ [% IF ( add_form ) %] [% IF ( budget_period_id ) %] [% WRAPPER breadcrumb_item bc_active= 1 %] - <span>Modify budget '[% budget_period_description | html %]'</span> + [% tx("Modify budget '{budget_period_description}'", { budget_period_description = budget_period_description }) | html %] [% END %] [% ELSE %] [% WRAPPER breadcrumb_item bc_active= 1 %] - <span>Add budget</span> + <span>New budget</span> [% END %] [% END %] [% END %] @@ -107,11 +114,11 @@ [% IF ( delete_confirm ) %] [% IF ( total || funds_exist ) %] [% WRAPPER breadcrumb_item bc_active= 1 %] - <span>Cannot delete budget '[% budget_period_description | html %]'</span> + [% tx("Cannot delete budget '{budget_period_description}'", { budget_period_description = budget_period_description }) | html %] [% END %] [% ELSE %] [% WRAPPER breadcrumb_item bc_active= 1 %] - <span>Delete budget '[% budget_period_description | html %]'?</span> + [% tx("Confirm deletion of budget '{budget_period_description}'", { budget_period_description = budget_period_description }) | html %] [% END %] [% END %] [% END %] @@ -124,13 +131,13 @@ [% IF close_form %] [% WRAPPER breadcrumb_item bc_active= 1 %] - <span>Close budget [% budget_period_description | html %]</span> + [% tx("Close budget '{budget_period_description}'", { budget_period_description = budget_period_description }) | html %] [% END %] [% END %] [% IF closed %] [% WRAPPER breadcrumb_item bc_active= 1 %] - <span>Budget [% budget_period_description | html %] closed</span> + [% tx("Budget '{budget_period_description}' closed", { budget_period_description = budget_period_description }) | html %] [% END %] [% END %] [% END #/ WRAPPER breadcrumbs %] @@ -212,9 +219,9 @@ <!-- add or modify a budget period --> [% IF ( budget_period_id ) %] - <h1>Modify budget <em>[% budget_period_description | html %]</em></h1> + <h1>[% tx("Modify budget '{budget_period_description}'", { budget_period_description = budget_period_description }) | html %]</h1> [% ELSE %] - <h1>Add budget</h1> + <h1>New budget</h1> [% END %] <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" id="add_modify_budget" name="f" method="post"> <fieldset class="rows"> @@ -294,15 +301,15 @@ [% IF ( total ) %] <div class="dialog message"> <h1>Cannot delete budget</h1> - <p><strong>This record is used [% total | html %] times</strong> - . Deletion is not possible.</p> + <p><strong>This record is used [% total | html %] times</strong>. + Deletion is not possible.</p> [% ELSIF ( funds_exist ) %] <div class="dialog message"> <h1>Cannot delete budget</h1> <p>This budget has funds attached. You must delete all attached funds before you can delete this budget.</p> [% ELSE %] <div class="dialog alert"> - <h1>Delete budget '[% budget_period_description | html %]'?</h1> + <h1>[% tx("Confirm deletion of budget '{budget_period_description}'?", { budget_period_description = budget_period_description }) | html %]</h1> <!-- ############################################################# --> <!-- "delete" and "cancel" buttons --> @@ -322,15 +329,20 @@ [% END %] [% IF close_form %] -<h1>Close budget [% budget_period_description | html %]</h1> - [% IF budget_periods.size == 0 %] - <span>You cannot move funds of this budget, there is no active budget. - Please create a new active budget and retry.</span> - <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a> - [% ELSIF number_of_unreceived_orders == 0 %] - <span>There are no unreceived orders for this budget.</span> - <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a> - [% ELSE %] +<h1>[% tx("Close budget '{budget_period_description}'", { budget_period_description = budget_period_description }) | html %]</h1> + [% IF budget_periods.size == 0 %] + <div class="dialog alert"> + <p>You cannot move funds of this budget, there is no active budget.</p> + <p>Please create a new active budget and retry.</p> + <a class="btn btn-default" href="/cgi-bin/koha/admin/aqbudgetperiods.pl"><i class="fa fa-fw fa-arrow-left"></i> Return to budgets</a> + </div> + [% ELSIF number_of_unreceived_orders == 0 %] + <div class="dialog message"> + <h2>Cannot close budget</h2> + <p>There are no unreceived orders for this budget.</p> + <a class="btn btn-default" href="/cgi-bin/koha/admin/aqbudgetperiods.pl"><i class="fa fa-fw fa-arrow-left"></i> Return to budgets</a> + </div> + [% ELSE %] <div class="page-section"> <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 | uri %]">[% budget_period_description | html %]</a>: @@ -382,7 +394,7 @@ </div><!-- /.page-section --> [% END %] [% ELSIF closed %] - <h1>Budget [% budget_period_description | html %] closed</h1> + <h1>[% tx("Budget '{budget_period_description}' closed", { budget_period_description = budget_period_description }) | html %]</h1> <div class="page-section"> <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> @@ -436,7 +448,7 @@ <!-- DEFAULT display budget periods list --> [% IF ( else ) %] - <h1>Budgets administration</h1> + <h1>Budgets</h1> [% IF ( failed_delete_funds_exist ) %] <div class="dialog message">Failed to delete budget because funds exist.</div> @@ -549,6 +561,8 @@ $("#budgetsTabs li:eq([% tab | html %]) a").tab("show"); [% END %] + $('[data-toggle="tooltip"]').tooltip(); + $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, { "aoColumnDefs": [ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt index fb1d387c16..cd26269a47 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt @@ -16,10 +16,25 @@ [% t("Modify fund") | html %] [% END %] [% ELSE %] - [% t("Add fund") | html %] + [% IF ( budget_parent_name ) %] + [% tx("Add fund to '{fund_parent}'", {fund_parent = budget_parent_name}) %] + [% ELSE %] + [% t("New fund") | html %] + [% END %] [% END %] › [% END %] + [% IF op == 'list' || op == 'add_form' %] + [% IF budget_period_id %] + [% tx("Funds for budget '{budget}'", { budget = budget_period_description }) %] + [% ELSE %] + [% t("Funds") | html %] + [% END %] › + [% END %] + [% IF op == 'delete_confirm' %] + [% tx("Confirm deletion of fund '{fund}'", {fund = budget_name}) %] › + [% END %] [% t("Funds") | html %] › + [% t("Budgets") | html %] › [% t("Administration") | html %] › [% t("Koha") | html %] [% END %] @@ -43,31 +58,43 @@ [% IF op == 'list' %] [% IF budget_period_id %] + [% WRAPPER breadcrumb_item %] + Funds + [% END %] [% WRAPPER breadcrumb_item bc_active= 1 %] - Funds for '[% budget_period_description | html %]' + [% tx("Funds for budget '{budget}'", { budget = budget_period_description }) %] [% END %] [% ELSE %] [% WRAPPER breadcrumb_item bc_active= 1 %] - All funds + Funds [% END %] [% END %] [% END %] [% IF op == 'add_form' %] [% WRAPPER breadcrumb_item %] - Funds + Funds + [% END %] + [% IF ( budget_period_id ) %] + [% WRAPPER breadcrumb_item %] + [% tx("Funds for '{budget}'", { budget = budget_period_description }) %] + [% END %] [% END %] [% IF ( budget_id ) %] [% WRAPPER breadcrumb_item bc_active= 1 %] [% IF ( budget_name ) %] - Modify fund '[% budget_name | html %]' + [% tx("Modify fund '{fund_name}'", { fund_name = budget_name }) | html %] [% ELSE %] Modify fund [% END %] [% END %] [% ELSE %] [% WRAPPER breadcrumb_item bc_active= 1 %] - Add fund + [% IF ( budget_parent_name ) %] + [% tx("Add fund to '{fund_parent}'", {fund_parent = budget_parent_name}) %] + [% ELSE %] + New fund + [% END %] [% END %] [% END %] [% END %] @@ -77,7 +104,7 @@ Funds [% END %] [% WRAPPER breadcrumb_item bc_active= 1 %] - Delete fund? + [% tx("Confirm deletion of fund '{fund}'", {fund = budget_name}) %] [% END %] [% END %] [% END #/ WRAPPER breadcrumbs %] @@ -99,11 +126,11 @@ [% IF op == 'list' %]

    - [% IF budget_period_id %] - Funds for '[% budget_period_description | html %]' - [% ELSE %] - All funds - [% END %] + [% IF budget_period_id %] + [% tx("Funds for budget '{budget}'", {budget = budget_period_description}) %] + [% ELSE %] + Funds + [% END %]

    [% INCLUDE 'budgets-active-currency.inc' %] @@ -241,7 +268,7 @@ [% ELSE %] -

    No fund found

    +
    No fund found
    [% END %] [% END %] @@ -250,13 +277,23 @@ [% IF op == 'add_form' && !error_not_authorised_to_modify %]
    +

    + [% IF ( budget_id ) %] + [% IF ( budget_period_description ) %] + [% tx("Modify fund '{fund_name}' for budget '{budget}'", { fund_name = budget_name, budget = budget_period_description }) | html %] + [% ELSE %] + [% tx("Modify fund '{fund_name}'", { fund_name = budget_name }) | html %] + [% END %] + [% ELSE %] + [% IF ( budget_parent_name ) %] + [% tx("Add fund to '{fund_parent}'", {fund_parent = budget_parent_name}) %] + [% ELSE %] + [% t("New fund") | html %] + [% END %] + [% END %] +

    -

    [% IF ( budget_id ) %]Modify fund[% ELSE %]Add fund[% END %] - [% IF ( budget_period_description ) %] - [% budget_name | html %] for budget '[% budget_period_description | html %]' - [% END %] -

    -
    + Fund details @@ -318,7 +355,7 @@
  • Selecting this option will overwrite existing fund owners, if any
  • @@ -420,8 +457,8 @@ [% IF op == 'delete_confirm' %]
    -

    Delete fund [% budget_name | html %]?

    - If you delete this fund, all orders linked to this fund will be deleted! +

    [% tx("Confirm deletion of fund '{fund}'?", {fund = budget_name}) %]

    +

    If you delete this fund, all orders linked to this fund will be deleted!

    @@ -661,8 +698,6 @@ [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %] [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt index 25613238a5..981e969d81 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt @@ -6,7 +6,7 @@ [% INCLUDE 'doc-head-open.inc' %] [% PROCESS 'budget_planning.inc' %] [% FILTER collapse %] - [% tx("Planning for {fund} ", { fund = budget_period_description }) | html %][% PROCESS planning plan=authcat %] › + [% PROCESS planning plan=authcat %] › [% t("Funds") | html %] › [% t("Budgets") | html %] › [% t("Administration") | html %] › @@ -33,7 +33,7 @@ <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]">Funds</a> [% END %] [% WRAPPER breadcrumb_item bc_active= 1 %] - <span>Planning</span> + [% PROCESS planning plan=authcat %] [% END %] [% END #/ WRAPPER breadcrumbs %] [% END #/ WRAPPER sub-header.inc %] @@ -46,7 +46,7 @@ [% 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> +<h1>[% PROCESS planning plan=authcat %]</h1> <input type="hidden" name="authcat" value="[% authcat | html %]" /> <!-- Budget Lines --> @@ -207,10 +207,10 @@ <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> +[% CASE 'MONTHS' %][% tp("Budget planning", "by months") | html %] +[% CASE 'ITEMTYPES' %][% tp("Budget planning", "by item types") | html %] +[% CASE 'BRANCHES' %][% tp("Budget planning", "by libraries") | html %] +[% CASE %][% tpx("Budget planning", "by {type}", {type = type}) | html %] [% END %] [% END %] <ol> @@ -338,6 +338,8 @@ $("#budget_est_"+budget_id).text($("#budget_tot_"+budget_id).prev().text()); $("#budget_est_"+budget_id).css("color","green"); }); + + $('[data-toggle="tooltip"]').tooltip(); }); </script> [% END %] -- 2.39.5
    Fund amount: