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 <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2023-10-02 18:41:15 +00:00 committed by Tomas Cohen Arazi
parent 6b65547401
commit db5642410b
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
4 changed files with 81 additions and 74 deletions

View file

@ -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,

View file

@ -6,14 +6,18 @@
<title>[% 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 %] &rsaquo;
[% ELSIF op == 'delete_confirm' %]
[% tx("Delete framework for {framework} ({frameworkcode})?", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] &rsaquo;
[% IF ( biblios_use_this_framework ) %]
[% tx("Framework cannot be deleted", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] &rsaquo;
[% ELSE %]
[% tx("Confirm deletion of framework '{framework}' ({frameworkcode})", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %] &rsaquo;
[% END %]
[% END %]
[% t("MARC frameworks") | html %] &rsaquo;
[% t("MARC bibliographic frameworks") | html %] &rsaquo;
[% t("Administration") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
@ -33,29 +37,33 @@
[% IF op == 'add_form' %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
<a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC bibliographic frameworks</a>
[% END %]
[% IF framework %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Modify framework text</span>
[% tx("Modify framework '{framework}' ({frameworkcode})", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %]
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Add framework</span>
<span>New framework</span>
[% END %]
[% END %]
[% ELSIF op == 'delete_confirm' %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
<a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC bibliographic frameworks</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Delete framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])?</span>
[% 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 %]
<span>MARC frameworks</span>
<span>MARC bibliographic frameworks</span>
[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
@ -98,7 +106,13 @@
[% END %]
[% IF op == 'add_form' %]
<h1>[% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]</h1>
<h1>
[% IF framework %]
[% tx("Modify framework '{framework}' ({frameworkcode})", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %]
[% ELSE %]
<span>New framework</span>
[% END %]
</h1>
<form action="/cgi-bin/koha/admin/biblio_framework.pl" name="Aform" method="post" class="validated">
<input type="hidden" name="op" value="add_validate" />
<fieldset class="rows">
@ -139,7 +153,7 @@
<button type="submit"><i class="fa fa-fw fa-arrow-left"></i> Return to frameworks</button>
</form>
[% ELSE %]
<h1>Delete framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])?</h1>
<h1>[% tx("Confirm deletion of framework '{framework}' ({frameworkcode})?", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %]</h1>
<form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="post">
<input type="hidden" name="op" value="delete_confirmed" />
<input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
@ -153,7 +167,7 @@
[% END %]
[% IF op == 'list' %]
<h1>MARC frameworks</h1>
<h1>MARC bibliographic frameworks</h1>
<div class="page-section">
<table id="table_biblio_frameworks">
<thead>

View file

@ -5,28 +5,27 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% IF ( add_form ) %]
[% IF ( use_heading_flags_p ) %]
[% IF ( heading_edit_subfields_p ) %]
[% t("Edit MARC subfields constraints") | html %] &rsaquo;
[% t("MARC subfield structure") | html %]
[% END %]
[% ELSE %]
[% action | html %] &rsaquo;
[% t("MARC subfield structure") | html %]
[% END %]
[% t("Edit subfields constraints") | html %] &rsaquo;
[% END %]
[% IF ( delete_confirm ) %]
Confirm deletion of subfield [% tagsubfield | html %] &rsaquo;
[% t("MARC subfield structure") | html %]
[% tx("Confirm deletion of subfield '{subfield}'", {subfield = mss.tagsubfield }) | html %] &rsaquo;
[% END %]
[% IF ( delete_confirmed ) %]
[% t("Subfield deleted") | html %] &rsaquo;
[% t("MARC subfield structure") | html %]
[% IF ( add_form || delete_confirm || else ) %]
[% tx("Tag {tag}", { tag = tagfield}) | html %] &rsaquo;
[% END %]
[% IF ( else ) %]
[% t("MARC subfield structure") | html %]
[% IF ( frameworkcode ) %]
[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])
[% ELSE %]
[% t("Default framework") | html %]
[% END %] &rsaquo;
[% t("MARC bibliographic frameworks") | html %] &rsaquo;
[% t("Administration") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
@ -44,50 +43,39 @@
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
[% END %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
<a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC bibliographic frameworks</a>
[% END %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode | uri %]&amp;searchfield=[% tagfield | uri %]">
[% IF ( frameworkcode ) %]
<span>[% frameworkcode | html %] framework structure</span>
[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])
[% ELSE %]
<span>Default framework structure</span>
<span>Default framework</span>
[% END %]
</a>
[% END %]
[% IF ( add_form ) %]
[% IF ( use_heading_flags_p ) %]
[% IF ( heading_edit_subfields_p ) %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] subfield structure</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Edit subfields constraints</span>
[% END %]
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] Subfield structure</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% action | html %]
[% END %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">[% tx("Tag {tag}", { tag = tagfield}) | html %]</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Edit subfields constraints</span>
[% END %]
[% END %]
[% IF ( delete_confirm ) %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% mss.tagfield | uri %]&amp;frameworkcode=[% mss.frameworkcode | uri %]">Tag [% mss.tagfield | html %] Subfield structure</a>
<a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% mss.tagfield | uri %]&amp;frameworkcode=[% mss.frameworkcode | uri %]">[% tx("Tag {tag}", { tag = tagfield}) | html %]</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Confirm deletion of subfield [% mss.tagsubfield | html %]</span>
[% tx("Confirm deletion of subfield '{subfield}'?", {subfield = mss.tagsubfield }) | html %]
[% END %]
[% END %]
[% IF ( else ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Tag [% tagfield | html %] Subfield structure</span>
<span>[% tx("Tag {tag} subfield structure", { tag = tagfield}) | html %]</span>
[% END %]
[% END %]
[% END #/ WRAPPER breadcrumbs %]
@ -100,11 +88,7 @@
[% IF ( add_form ) %]
<h1>
[% IF ( use_heading_flags_p ) %]
[% IF ( heading_edit_subfields_p ) %]<span>Tag</span> [% tagfield | html %] <span>Subfield constraints</span>[% END %]
[% ELSE %]
[% action | html %]
[% END %]
[% tx("Tag {tag} subfield constraints", { tag = tagfield}) | html %]
</h1>
<div class="hint">You can drag and drop the subfield tabs to change the order.</div>
@ -331,7 +315,7 @@
[% IF ( delete_confirm ) %]
<div class="dialog alert">
<h1>Confirm deletion of subfield [% mss.tagsubfield | html %]?</h1>
<h1>[% tx("Confirm deletion of subfield '{subfield}'?", {subfield = mss.tagsubfield }) | html %]</h1>
<p>Subfield: [% mss.tagsubfield | html %]</p>
<p>Description: [% mss.liblibrarian | html_entity %]</p>
@ -354,7 +338,7 @@
[% IF ( else ) %]
[% IF ( frameworkcode ) %]
<h1>MARC subfield structure admin for [% tagfield | html %] (framework [% frameworkcode | html %])</h1>
<h1>[% tx("Tag {tag} subfield structure (framework {frameworkcode})", { tag = tagfield, frameworkcode = frameworkcode }) | html %]</h1>
[% ELSE %]
<h1>MARC subfield structure admin for [% tagfield | html %] (default framework)</h1>
[% END %]

View file

@ -7,7 +7,7 @@
<title>[% 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 %] &rsaquo;
@ -18,7 +18,8 @@
[% IF ( delete_confirmed ) %]
[% t("Data deleted") | html %] &rsaquo;
[% END %]
[% t("MARC frameworks") | html %] &rsaquo;
[% framework.frameworktext | html %] ([% framework.frameworkcode | html %]) &rsaquo;
[% t("MARC bibliographic frameworks") | html %] &rsaquo;
[% t("Administration") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
@ -36,7 +37,7 @@
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
[% END %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
<a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC bibliographic frameworks</a>
[% END %]
[% IF ( add_form ) %]
@ -45,15 +46,15 @@
[% IF framework %]
<span>[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span>
[% ELSE %]
<span>Default MARC framework</span>
<span>Default MARC bibliographic framework</span>
[% END%]
</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1%]
[% IF heading_add_tag_p %]
<span>Add tag [% searchfield | html %]</span>
[% tx("New tag {searchfield}", { searchfield = searchfield }) | html %]
[% ELSE %]
<span>Modify tag [% searchfield | html %]</span>
[% tx("Modify tag {searchfield}", { searchfield = searchfield }) | html %]
[% END %]
[% END %]
@ -62,7 +63,7 @@
[% IF framework %]
<span>[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span>
[% ELSE %]
<span>Default MARC framework</span>
<span>Default MARC bibliographic framework</span>
[% END %]
[% END %]
@ -72,12 +73,12 @@
[% IF framework %]
<span>[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span>
[% ELSE %]
<span>Default MARC framework</span>
<span>Default MARC bibliographic framework</span>
[% END %]
</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1%]
<span>Confirm deletion of tag [% searchfield | html %]</span>
[% tx("Confirm deletion of tag {searchfield}", { searchfield = searchfield }) | html %]
[% END %]
[% ELSIF ( delete_confirmed ) %]
@ -86,7 +87,7 @@
[% IF framework %]
<span>[% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</span>
[% ELSE %]
<span>Default MARC framework</span>
<span>Default MARC bibliographic framework</span>
[% END %]
</a>
[% END %]
@ -105,12 +106,15 @@
[% IF ( else ) %]
<div id="toolbar" class="btn-toolbar">
<a class="btn btn-default" id="addtag" href="/cgi-bin/koha/admin/marctagstructure.pl?op=add_form&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-plus"></i> New tag</a>
<a class="btn btn-default" href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form&amp;frameworkcode=[% loo.frameworkcode | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit framework</a>
</div>[% END %]
[% IF framework %]
<h1>MARC Framework for [% framework.frameworktext | html %] ([% framework.frameworkcode | html %])</h1>
<h1>
[% tx("MARC bibliographic framework '{framework}' ({frameworkcode})", { framework = framework.frameworktext, frameworkcode = framework.frameworkcode }) | html %]
</h1>
[% ELSE %]
<h1>MARC Framework for default MARC framework</h1>
<h1>Default MARC bibliographic framework</h1>
[% END %]
[% IF ( add_form ) %]
@ -120,9 +124,10 @@
<fieldset class="rows">
<legend>
[% IF heading_add_tag_p %]
<span>Add tag</span>
<span>New tag</span>
[% ELSE %]
<span>Modify tag</span> <input type="hidden" name="modif" value="1" />[% searchfield | html %]
[% tx("Modify tag {searchfield}", { searchfield = searchfield }) | html %]
<input type="hidden" name="modif" value="1" />
[% END %]
</legend>
<input type="hidden" name="op" value="add_validate" />
@ -185,7 +190,7 @@
[% IF ( delete_confirm ) %]
<div class="dialog alert">
<h3>Confirm deletion of tag <span class="ex">'[% searchfield | html %]'</span>?</h3>
<h3>[% tx("Confirm deletion of tag {searchfield}?", { searchfield = searchfield }) | html %]</h3>
<p>Tag: [% searchfield | html %]</p>
<p>Description: [% liblibrarian | html %]</p>
<form action="[% script_name | html %]" method="post">