From db5642410b07d15d9956613a3119c74ec64ceafb Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 2 Oct 2023 18:41:15 +0000 Subject: [PATCH] Bug 34393: Fix inconsistencies in MARC bibliographic framework page titles, breadcrumbs, and header This patch fixes some inconsistencies in the MARC bibliographic framework administration page, making sure the page title, breadcrumb navigation, and page headers are consistent with each other. The file admin/marc_subfields_structure.pl is modified so that it provides the framework name to the template. Test each page to confirm that page title, heading, and breadcrumbs are consistent: - MARC bibliographic frameworks - New framework - Edit framework - Delete a framework which is not used - Delete a framework which is in use - Framework MARC structure - New tag - Edit tag - Delete tag - View subfields - Edit subfields Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- admin/marc_subfields_structure.pl | 6 +- .../prog/en/modules/admin/biblio_framework.tt | 40 ++++++---- .../modules/admin/marc_subfields_structure.tt | 74 ++++++++----------- .../prog/en/modules/admin/marctagstructure.tt | 35 +++++---- 4 files changed, 81 insertions(+), 74 deletions(-) diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 8fe34624fd..10f16e182f 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -27,6 +27,7 @@ use C4::Context; use Koha::Authority::Types; use Koha::AuthorisedValueCategories; use Koha::Filter::MARC::ViewPolicy; +use Koha::BiblioFrameworks; use List::MoreUtils qw( uniq ); @@ -52,11 +53,14 @@ my $cache = Koha::Caches->get_instance(); my $op = $input->param('op') || ""; $tagfield =~ s/\,//g; +my $framework = Koha::BiblioFrameworks->search({ frameworkcode => $frameworkcode })->next; + if ($op) { $template->param( script_name => $script_name, tagfield => $tagfield, frameworkcode => $frameworkcode, + framework => $framework, $op => 1 ); # we show only the TMPL_VAR names $op } @@ -65,6 +69,7 @@ else { script_name => $script_name, tagfield => $tagfield, frameworkcode => $frameworkcode, + framework => $framework, else => 1 ); # we show only the TMPL_VAR names $op } @@ -199,7 +204,6 @@ if ( $op eq 'add_form' ) { $template->param( 'use_heading_flags_p' => 1 ); $template->param( 'heading_edit_subfields_p' => 1 ); $template->param( - action => "Edit subfields", tagfield => $tagfield, tagsubfield => $tagsubfield, loop => \@loop_data, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt index 6acf1b92cf..540988a26d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt @@ -6,14 +6,18 @@ [% FILTER collapse %] [% IF op == 'add_form' %] [% IF framework %] - [% t("Modify framework text") | html %] + [% tx("Modify framework '{framework}' ({frameworkcode})", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] [% ELSE %] - [% t("Add framework") | html %] + [% t("New framework") | html %] [% END %] › [% ELSIF op == 'delete_confirm' %] - [% tx("Delete framework for {framework} ({frameworkcode})?", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] › + [% IF ( biblios_use_this_framework ) %] + [% tx("Framework cannot be deleted", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] › + [% ELSE %] + [% tx("Confirm deletion of framework '{framework}' ({frameworkcode})", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] › + [% END %] [% END %] - [% t("MARC frameworks") | html %] › + [% t("MARC bibliographic frameworks") | html %] › [% t("Administration") | html %] › [% t("Koha") | html %] [% END %] @@ -33,29 +37,33 @@ [% IF op == 'add_form' %] [% WRAPPER breadcrumb_item %] - MARC frameworks + MARC bibliographic frameworks [% END %] [% IF framework %] [% WRAPPER breadcrumb_item bc_active= 1 %] - Modify framework text + [% tx("Modify framework '{framework}' ({frameworkcode})", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] [% END %] [% ELSE %] [% WRAPPER breadcrumb_item bc_active= 1 %] - Add framework + New framework [% END %] [% END %] [% ELSIF op == 'delete_confirm' %] [% WRAPPER breadcrumb_item %] - MARC frameworks + MARC bibliographic frameworks [% END %] [% WRAPPER breadcrumb_item bc_active= 1 %] - Delete framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])? + [% IF ( biblios_use_this_framework ) %] + [% tx("Framework cannot be deleted", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] + [% ELSE %] + [% tx("Confirm deletion of framework '{framework}' ({frameworkcode})", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] + [% END %] [% END %] [% ELSE %] [% WRAPPER breadcrumb_item bc_active= 1 %] - MARC frameworks + MARC bibliographic frameworks [% END %] [% END %] [% END #/ WRAPPER breadcrumbs %] @@ -98,7 +106,13 @@ [% END %] [% IF op == 'add_form' %] -

[% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]

+

+ [% IF framework %] + [% tx("Modify framework '{framework}' ({frameworkcode})", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] + [% ELSE %] + New framework + [% END %] +

@@ -139,7 +153,7 @@ [% ELSE %] -

Delete framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])?

+

[% tx("Confirm deletion of framework '{framework}' ({frameworkcode})?", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %]

@@ -153,7 +167,7 @@ [% END %] [% IF op == 'list' %] -

MARC frameworks

+

MARC bibliographic frameworks

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt index 7414b8295f..4dbce11ad0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt @@ -5,28 +5,27 @@ [% INCLUDE 'doc-head-open.inc' %] [% FILTER collapse %] [% IF ( add_form ) %] - [% IF ( use_heading_flags_p ) %] - [% IF ( heading_edit_subfields_p ) %] - [% t("Edit MARC subfields constraints") | html %] › - [% t("MARC subfield structure") | html %] - [% END %] - [% ELSE %] - [% action | html %] › - [% t("MARC subfield structure") | html %] - [% END %] + [% t("Edit subfields constraints") | html %] › [% END %] + [% IF ( delete_confirm ) %] - Confirm deletion of subfield [% tagsubfield | html %] › - [% t("MARC subfield structure") | html %] + [% tx("Confirm deletion of subfield '{subfield}'", {subfield = mss.tagsubfield }) | html %] › [% END %] - [% IF ( delete_confirmed ) %] - [% t("Subfield deleted") | html %] › - [% t("MARC subfield structure") | html %] + + [% IF ( add_form || delete_confirm || else ) %] + [% tx("Tag {tag}", { tag = tagfield}) | html %] › [% END %] - [% IF ( else ) %] - [% t("MARC subfield structure") | html %] + + [% IF ( frameworkcode ) %] + [% framework.frameworktext | html %] ([% framework.frameworkcode | html %]) + [% ELSE %] + [% t("Default framework") | html %] [% END %] › + + [% t("MARC bibliographic frameworks") | html %] › + [% t("Administration") | html %] › + [% t("Koha") | html %] [% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -44,50 +43,39 @@ Administration [% END %] [% WRAPPER breadcrumb_item %] - MARC frameworks + MARC bibliographic frameworks [% END %] [% WRAPPER breadcrumb_item %] [% IF ( frameworkcode ) %] - [% frameworkcode | html %] framework structure + [% framework.frameworktext | html %] ([% framework.frameworkcode | html %]) [% ELSE %] - Default framework structure + Default framework [% END %] [% END %] [% IF ( add_form ) %] - [% IF ( use_heading_flags_p ) %] - [% IF ( heading_edit_subfields_p ) %] - [% WRAPPER breadcrumb_item %] - Tag [% tagfield | html %] subfield structure - [% END %] - [% WRAPPER breadcrumb_item bc_active= 1 %] - Edit subfields constraints - [% END %] - [% END %] - [% ELSE %] - [% WRAPPER breadcrumb_item %] - Tag [% tagfield | html %] Subfield structure - [% END %] - [% WRAPPER breadcrumb_item bc_active= 1 %] - [% action | html %] - [% END %] + [% WRAPPER breadcrumb_item %] + [% tx("Tag {tag}", { tag = tagfield}) | html %] + [% END %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Edit subfields constraints [% END %] [% END %] [% IF ( delete_confirm ) %] [% WRAPPER breadcrumb_item %] - Tag [% mss.tagfield | html %] Subfield structure + [% tx("Tag {tag}", { tag = tagfield}) | html %] [% END %] [% WRAPPER breadcrumb_item bc_active= 1 %] - Confirm deletion of subfield [% mss.tagsubfield | html %] + [% tx("Confirm deletion of subfield '{subfield}'?", {subfield = mss.tagsubfield }) | html %] [% END %] [% END %] [% IF ( else ) %] [% WRAPPER breadcrumb_item bc_active= 1 %] - Tag [% tagfield | html %] Subfield structure + [% tx("Tag {tag} subfield structure", { tag = tagfield}) | html %] [% END %] [% END %] [% END #/ WRAPPER breadcrumbs %] @@ -100,11 +88,7 @@ [% IF ( add_form ) %]

- [% IF ( use_heading_flags_p ) %] - [% IF ( heading_edit_subfields_p ) %]Tag [% tagfield | html %] Subfield constraints[% END %] - [% ELSE %] - [% action | html %] - [% END %] + [% tx("Tag {tag} subfield constraints", { tag = tagfield}) | html %]

You can drag and drop the subfield tabs to change the order.
@@ -331,7 +315,7 @@ [% IF ( delete_confirm ) %]
-

Confirm deletion of subfield [% mss.tagsubfield | html %]?

+

[% tx("Confirm deletion of subfield '{subfield}'?", {subfield = mss.tagsubfield }) | html %]

Subfield: [% mss.tagsubfield | html %]

Description: [% mss.liblibrarian | html_entity %]

@@ -354,7 +338,7 @@ [% IF ( else ) %] [% IF ( frameworkcode ) %] -

MARC subfield structure admin for [% tagfield | html %] (framework [% frameworkcode | html %])

+

[% tx("Tag {tag} subfield structure (framework {frameworkcode})", { tag = tagfield, frameworkcode = frameworkcode }) | html %]

[% ELSE %]

MARC subfield structure admin for [% tagfield | html %] (default framework)

[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt index 6568a2070f..f09ea32f5a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt @@ -7,7 +7,7 @@ [% FILTER collapse %] [% IF ( add_form ) %] [% IF heading_add_tag_p %] - [% tx("Add tag {searchfield}", { searchfield = searchfield }) | html %] + [% tx("New tag {searchfield}", { searchfield = searchfield }) | html %] [% ELSE %] [% tx("Modify tag {searchfield}", { searchfield = searchfield }) | html %] [% END %] › @@ -18,7 +18,8 @@ [% IF ( delete_confirmed ) %] [% t("Data deleted") | html %] › [% END %] - [% t("MARC frameworks") | html %] › + [% framework.frameworktext | html %] ([% framework.frameworkcode | html %]) › + [% t("MARC bibliographic frameworks") | html %] › [% t("Administration") | html %] › [% t("Koha") | html %] [% END %] @@ -36,7 +37,7 @@ Administration [% END %] [% WRAPPER breadcrumb_item %] - MARC frameworks + MARC bibliographic frameworks [% END %] [% IF ( add_form ) %] @@ -45,15 +46,15 @@ [% IF framework %] [% framework.frameworktext | html %] ([% framework.frameworkcode | html %]) [% ELSE %] - Default MARC framework + Default MARC bibliographic framework [% END%] [% END %] [% WRAPPER breadcrumb_item bc_active= 1%] [% IF heading_add_tag_p %] - Add tag [% searchfield | html %] + [% tx("New tag {searchfield}", { searchfield = searchfield }) | html %] [% ELSE %] - Modify tag [% searchfield | html %] + [% tx("Modify tag {searchfield}", { searchfield = searchfield }) | html %] [% END %] [% END %] @@ -62,7 +63,7 @@ [% IF framework %] [% framework.frameworktext | html %] ([% framework.frameworkcode | html %]) [% ELSE %] - Default MARC framework + Default MARC bibliographic framework [% END %] [% END %] @@ -72,12 +73,12 @@ [% IF framework %] [% framework.frameworktext | html %] ([% framework.frameworkcode | html %]) [% ELSE %] - Default MARC framework + Default MARC bibliographic framework [% END %] [% END %] [% WRAPPER breadcrumb_item bc_active= 1%] - Confirm deletion of tag [% searchfield | html %] + [% tx("Confirm deletion of tag {searchfield}", { searchfield = searchfield }) | html %] [% END %] [% ELSIF ( delete_confirmed ) %] @@ -86,7 +87,7 @@ [% IF framework %] [% framework.frameworktext | html %] ([% framework.frameworkcode | html %]) [% ELSE %] - Default MARC framework + Default MARC bibliographic framework [% END %] [% END %] @@ -105,12 +106,15 @@ [% IF ( else ) %] [% END %] [% IF framework %] -

MARC Framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])

+

+ [% tx("MARC bibliographic framework '{framework}' ({frameworkcode})", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] +

[% ELSE %] -

MARC Framework for default MARC framework

+

Default MARC bibliographic framework

[% END %] [% IF ( add_form ) %] @@ -120,9 +124,10 @@
[% IF heading_add_tag_p %] - Add tag + New tag [% ELSE %] - Modify tag [% searchfield | html %] + [% tx("Modify tag {searchfield}", { searchfield = searchfield }) | html %] + [% END %] @@ -185,7 +190,7 @@ [% IF ( delete_confirm ) %]
-

Confirm deletion of tag '[% searchfield | html %]'?

+

[% tx("Confirm deletion of tag {searchfield}?", { searchfield = searchfield }) | html %]

Tag: [% searchfield | html %]

Description: [% liblibrarian | html %]

-- 2.39.5