Bug 34395: Fix inconsistencies in Authority types page titles, breadcrumbs, and header

This patch fixes some inconsistencies in the authority
types administration page, making sure the page title, breadcrumb
navigation, and page headers are consistent with each other.

Test each page to confirm that page title, heading, and breadcrumbs are
consistent:

- Administration -> Authority types
  - New authority type
  - Edit authority type
  - Delete an authority type which is not used
  - Delete an authority type which is in use
  - Authority type MARC structure
    - New tag
    - Edit tag
    - Delete tag
    - View subfields
    - Edit subfields

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2023-08-25 15:00:20 +00:00 committed by Tomas Cohen Arazi
parent 094441d3f6
commit 6a22310dd4
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
3 changed files with 112 additions and 78 deletions

View file

@ -4,10 +4,28 @@
[% SET footerjs = 1 %] [% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %] [% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %] <title>[% FILTER collapse %]
[% t("Authority MARC subfield structure") | html %] &rsaquo; [% IF ( add_form ) %]
[% t("Edit subfields constraints") | html %] &rsaquo;
[% END %]
[% IF ( delete_confirm ) %]
[% tx("Confirm deletion of subfield '{subfield}'", {subfield = ass.tagsubfield }) | html %] &rsaquo;
[% END %]
[% IF ( add_form || delete_confirm || else ) %]
[% tx("Tag {tag}", { tag = tagfield}) | html %] &rsaquo;
[% END %]
[% IF ( authtypecode ) %]
[% tx("'{authtypecode}' framework", { authtypecode = authtypecode }) | html %]
[% ELSE %]
[% t("Default framework") | html %]
[% END %] &rsaquo;
[% t("Authority types") | html %] &rsaquo;
[% t("Administration") | html %] &rsaquo; [% t("Administration") | html %] &rsaquo;
[% t("Koha") | html %] [% t("Koha") | html %]
[% END %]</title> [% END %]</title>
[% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'doc-head-close.inc' %]
</head> </head>
@ -30,7 +48,7 @@
[% IF ( authtypecode ) %] [% IF ( authtypecode ) %]
[% WRAPPER breadcrumb_item %] [% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri%]">[% authtypecode | html %] framework</a> <a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri%]">[% tx("'{authtypecode}' framework", { authtypecode = authtypecode }) | html %]</a>
[% END %] [% END %]
[% ELSE %] [% ELSE %]
[% WRAPPER breadcrumb_item %] [% WRAPPER breadcrumb_item %]
@ -40,17 +58,17 @@
[% IF ( else ) %] [% IF ( else ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %] [% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Authority MARC subfield structure for [% tagfield | html %]</span> [% tx("Tag {tag}", { tag = tagfield}) | html %]
[% END %] [% END %]
[% ELSE %] [% ELSE %]
[% WRAPPER breadcrumb_item %] [% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;tagsubfield=[% tagsubfield | uri %]&amp;authtypecode=[% authtypecode |uri %]">Authority MARC subfield structure for [% tagfield | html %]</a> <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;tagsubfield=[% tagsubfield | uri %]&amp;authtypecode=[% authtypecode |uri %]">[% tx("Tag {tag}", { tag = tagfield}) | html %]</a>
[% END %] [% END %]
[% END %] [% END %]
[% IF ( delete_confirm ) %] [% IF ( delete_confirm ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %] [% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Confirm deletion of subfield [% tagsubfield | html %]?</span> [% tx("Confirm deletion of subfield '{tagsubfield}'", { tagsubfield = ass.tagsubfield }) | html %]
[% END %] [% END %]
[% END %] [% END %]
@ -58,7 +76,7 @@
[% IF ( use_heading_flags_p ) %] [% IF ( use_heading_flags_p ) %]
[% IF ( heading_edit_subfields_p ) %] [% IF ( heading_edit_subfields_p ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %] [% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Edit MARC subfields constraints</span> <span>Edit subfields constraints</span>
[% END %] [% END %]
[% END %] [% END %]
[% ELSE %] [% ELSE %]
@ -282,7 +300,7 @@
[% IF ( delete_confirm ) %] [% IF ( delete_confirm ) %]
<div class="dialog alert"> <div class="dialog alert">
<h1>Delete subfield <span class="ex">'[% ass.tagsubfield | html %]'?</span></h1> <h1>Confirm deletion of subfield <span class="ex">'[% ass.tagsubfield | html %]'?</span></h1>
<form action="[% delete_link | html %]" method="post"> <form action="[% delete_link | html %]" method="post">
<input type="hidden" name="op" value="delete_confirmed" /> <input type="hidden" name="op" value="delete_confirmed" />
<table> <table>

View file

@ -6,44 +6,25 @@
[% INCLUDE 'doc-head-open.inc' %] [% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %] <title>[% FILTER collapse %]
[% IF ( add_form ) %] [% IF ( add_form ) %]
[% IF ( use_heading_flags_p ) %] [% IF ( heading_modify_tag_p ) %]
[% IF ( heading_modify_tag_p ) %] [% tx("Modify tag '{searchfield}'", { searchfield = searchfield }) | html %] &rsaquo;
[% t("Modify tag ") | html %] &rsaquo; [% END %]
[% IF ( authtypecode ) %] [% IF ( heading_add_tag_p ) %]
[% tx("{authtypecode} framework", { authtypecode = authtypecode }) | html %] [% t("New tag") | html %] &rsaquo;
[% ELSE %]
[% t("Default framework") | html %]
[% END %] &rsaquo;
[% END %]
[% IF ( heading_add_tag_p ) %]
[% t("New tag") | html %] &rsaquo;
[% IF ( authtypecode ) %]
[% tx("{authtypecode} framework", { authtypecode = authtypecode }) | html %]
[% ELSE %]
[% t("Default framework") | html %]
[% END %] &rsaquo;
[% END %]
[% ELSE %]
[% action | html %] &rsaquo;
[% END %] [% END %]
[% END %] [% END %]
[% IF ( delete_confirm ) %] [% IF ( delete_confirm ) %]
[% t("Confirm deletion") | html %] &rsaquo; [% tx("Confirm deletion of tag '{searchfield}'", { searchfield = searchfield }) | html %] &rsaquo;
[% IF ( authtypecode ) %]
[% tx("{authtypecode} framework", { authtypecode = authtypecode }) | html %]
[% ELSE %]
[% t("Default framework") | html %]
[% END %] &rsaquo;
[% END %] [% END %]
[% IF ( delete_confirmed ) %] [% IF ( delete_confirmed ) %]
[% t("Data deleted") | html %] &rsaquo; [% t("Data deleted") | html %] &rsaquo;
[% IF ( authtypecode ) %]
[% tx("{authtypecode} framework", { authtypecode = authtypecode }) | html %]
[% ELSE %]
[% t("Default framework") | html %]
[% END %] &rsaquo;
[% END %] [% END %]
[% t("Authority MARC framework") | html %] &rsaquo; [% IF ( authtypecode ) %]
[% tx("'{authtypecode}' framework", { authtypecode = authtypecode }) | html %]
[% ELSE %]
[% t("Default framework") | html %]
[% END %] &rsaquo;
[% t("Authority types") | html %] &rsaquo;
[% t("Administration") | html %] &rsaquo; [% t("Administration") | html %] &rsaquo;
[% t("Koha") | html %] [% t("Koha") | html %]
[% END %]</title> [% END %]</title>
@ -68,7 +49,7 @@
[% IF ( add_form || delete_confirm || delete_confirmed ) %] [% IF ( add_form || delete_confirm || delete_confirmed ) %]
[% IF ( authtypecode ) %] [% IF ( authtypecode ) %]
[% WRAPPER breadcrumb_item %] [% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri %]">[% authtypecode | html %] Framework</a> <a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri %]">[% tx("'{authtypecode}' framework", { authtypecode = authtypecode }) | html %]</a>
[% END %] [% END %]
[% ELSE %] [% ELSE %]
[% WRAPPER breadcrumb_item %] [% WRAPPER breadcrumb_item %]
@ -81,7 +62,7 @@
[% IF ( use_heading_flags_p ) %] [% IF ( use_heading_flags_p ) %]
[% IF ( heading_modify_tag_p ) %] [% IF ( heading_modify_tag_p ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %] [% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Modify tag</span> [% tx("Modify tag {searchfield}", { searchfield = searchfield }) | html %]
[% END %] [% END %]
[% END %] [% END %]
@ -100,7 +81,7 @@
[% ELSE %] [% ELSE %]
[% IF ( delete_confirm ) %] [% IF ( delete_confirm ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %] [% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Confirm deletion</span> [% tx("Confirm deletion of tag '{searchfield}'", { searchfield = searchfield }) | html %]
[% END %] [% END %]
[% ELSE %] [% ELSE %]
[% IF ( delete_confirmed ) %] [% IF ( delete_confirmed ) %]
@ -110,7 +91,7 @@
[% ELSE %] [% ELSE %]
[% IF ( authtypecode ) %] [% IF ( authtypecode ) %]
[% WRAPPER breadcrumb_item bc_active= 1 %] [% WRAPPER breadcrumb_item bc_active= 1 %]
[% authtypecode | html %] Framework [% tx("{authtypecode} framework", { authtypecode = authtypecode }) | html %]
[% END %] [% END %]
[% ELSE %] [% ELSE %]
[% WRAPPER breadcrumb_item bc_active= 1 %] [% WRAPPER breadcrumb_item bc_active= 1 %]
@ -129,14 +110,27 @@
<div class="col-sm-10 col-sm-push-2"> <div class="col-sm-10 col-sm-push-2">
<main> <main>
<h1>Authority MARC framework for [% IF ( authtypecode ) %][% authtypecode | html %][% ELSE %]default framework[% END %]</h1> [% IF ( else ) %]
<div id="toolbar" class="btn-toolbar">
<div class="btn-group"><a class="btn btn-default" id="newtag" href="/cgi-bin/koha/admin/auth_tag_structure.pl?op=add_form&amp;authtypecode=[% authtypecode | uri %]"><i class="fa fa-plus"></i> New tag</a></div>
<a class="btn btn-default" id="edit_authtype" href="/cgi-bin/koha/admin/authtypes.pl?op=add_form&authtypecode=[% authtypecode | uri %]"><i class="fa fa-pencil"></i> Edit authority type</a>
</div>
[% END %]
<h1>
[% IF ( authtypecode ) %]
[% tx("Authority MARC framework for '{authtypecode}'", { authtypecode = authtypecode }) | html %]
[% ELSE %]
[% t("Default authority MARC framework") | html %]
[% END %]
</h1>
[% IF ( add_form ) %] [% IF ( add_form ) %]
<h2> <h2>
[% IF ( heading_modify_tag_p ) %] [% IF ( heading_modify_tag_p ) %]
<span>Modify tag</span> [% tx("Modify tag '{searchfield}'", { searchfield = searchfield }) | html %]
[% END %] [% END %]
[% IF ( heading_add_tag_p ) %] [% IF ( heading_add_tag_p ) %]
<span>New tag</span> <span>New tag</span>
@ -196,7 +190,7 @@
[% IF ( delete_confirm ) %] [% IF ( delete_confirm ) %]
<div class="dialog alert"> <div class="dialog alert">
<h3>Confirm deletion</h3> <h3>[% tx("Confirm deletion of tag '{searchfield}'", { searchfield = searchfield }) | html %]</h3>
<form action="[% script_name | html %]" method="post"> <form action="[% script_name | html %]" method="post">
<table> <table>
<tr><th scope="row">Tag: </th><td>[% searchfield | html %] [% liblibrarian | html %]</td></tr> <tr><th scope="row">Tag: </th><td>[% searchfield | html %] [% liblibrarian | html %]</td></tr>
@ -243,24 +237,24 @@
[% IF ( else ) %] [% IF ( else ) %]
<div id="toolbar" class="btn-toolbar">
<div class="btn-group"><a class="btn btn-default" id="newtag" href="/cgi-bin/koha/admin/auth_tag_structure.pl?op=add_form&amp;authtypecode=[% authtypecode | uri %]"><i class="fa fa-plus"></i> New tag</a></div>
</div>
<h2>Select an authority framework</h2>
<form action="[% script_name | html %]" method="post"> <form action="[% script_name | html %]" method="post">
<select name="authtypecode"> <fieldset>
[% FOREACH authority_type IN authority_types%] <label for="searchfield"><strong>Search for tag:</strong></label>
[% IF authority_type.authtypecode == authtypecode%] <input type="text" id="searchfield" name="searchfield" size="4" value="[% searchfield | html %]" />
<option value="[% authority_type.authtypecode | html %]" selected="selected">[% authority_type.authtypetext | html %]</option> <label for="authtypecode"><strong>In framework:</strong> </label>
[% ELSE %] <select id="authtypecode" name="authtypecode">
<option value="[% authority_type.authtypecode | html %]">[% authority_type.authtypetext | html %]</option> [% FOREACH authority_type IN authority_types%]
[% END %] [% IF authority_type.authtypecode == authtypecode%]
[% END %] <option value="[% authority_type.authtypecode | html %]" selected="selected">[% authority_type.authtypetext | html %]</option>
</select> [% ELSE %]
<input type="text" name="searchfield" value="[% searchfield | html %]" /> <option value="[% authority_type.authtypecode | html %]">[% authority_type.authtypetext | html %]</option>
<input type="submit" value="OK" class="btn btn-primary" /> [% END %]
</form><br /> [% END %]
</select>
<input type="submit" class="btn btn-primary" value="Search" />
</fieldset>
</form>
<div id="pagertable_authtagstructure"> <div id="pagertable_authtagstructure">
</div> </div>

View file

@ -6,12 +6,20 @@
<title>[% FILTER collapse %] <title>[% FILTER collapse %]
[% IF op == 'add_form' %] [% IF op == 'add_form' %]
[% IF authority_type.authtypecode.defined %] [% IF authority_type.authtypecode.defined %]
[% t("Modify authority type") | html %] [% IF authority_type.authtypecode %]
[% tx("Modify authority type '{authority_type_code}'", { authority_type_code= authority_type.authtypecode }) | html %]
[% ELSE %]
[% t("Modify default authority type") | html %]
[% END %]
[% ELSE %] [% ELSE %]
[% t("New authority type") | html %] [% t("New authority type") | html %]
[% END %] &rsaquo; [% END %] &rsaquo;
[% ELSIF op == 'delete_confirm' %] [% ELSIF op == 'delete_confirm' %]
[% t("Confirm deletion of authority type") | html %] &rsaquo; [% IF authorities_using_it %]
[% t("Authority type cannot be deleted") | html %]
[% ELSE %]
[% tx("Confirm deletion of authority type '{authority_type_code}'", { authority_type_code= authority_type.authtypecode } ) | html %]
[% END %] &rsaquo;
[% END %] [% END %]
[% t("Authority types") | html %] &rsaquo; [% t("Authority types") | html %] &rsaquo;
[% t("Administration") | html %] &rsaquo; [% t("Administration") | html %] &rsaquo;
@ -44,7 +52,11 @@
[% IF op == 'add_form' %] [% IF op == 'add_form' %]
[% WRAPPER breadcrumb_item bc_active= 1 %] [% WRAPPER breadcrumb_item bc_active= 1 %]
[% IF authority_type.authtypecode.defined %] [% IF authority_type.authtypecode.defined %]
<span>Modify authority type</span> [% IF authority_type.authtypecode %]
[% tx("Modify authority type '{authority_type_code}'", { authority_type_code= authority_type.authtypecode }) | html %]
[% ELSE %]
[% t("Modify default authority type") | html %]
[% END %]
[% ELSE %] [% ELSE %]
<span>New authority type</span> <span>New authority type</span>
[% END %] [% END %]
@ -52,7 +64,11 @@
[% ELSIF op == 'delete_confirm' %] [% ELSIF op == 'delete_confirm' %]
[% WRAPPER breadcrumb_item bc_active= 1 %] [% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Confirm deletion of authority type</span> [% IF authorities_using_it %]
[% t("Authority type cannot be deleted") | html %]
[% ELSE %]
[% tx("Confirm deletion of authority type '{authority_type_code}'", { authority_type_code= authority_type.authtypecode } ) | html %]
[% END %]
[% END %] [% END %]
[% END %] [% END %]
@ -89,16 +105,19 @@
[% IF op == 'add_form' %] [% IF op == 'add_form' %]
<form action="/cgi-bin/koha/admin/authtypes.pl" name="Aform" method="post" class="validated"> <form action="/cgi-bin/koha/admin/authtypes.pl" name="Aform" method="post" class="validated">
<fieldset class="rows"> <h1>
<legend> [% IF authority_type.authtypecode.defined %]
<h1> [% IF authority_type.authtypecode %]
[% IF authority_type.authtypecode.defined %] [% tx("Modify authority type '{authority_type_code}'", { authority_type_code= authority_type.authtypecode }) | html %]
Modify authority type
[% ELSE %] [% ELSE %]
New authority type [% t("Modify default authority type") | html %]
[% END %] [% END %]
</h1> [% ELSE %]
</legend> <span>New authority type</span>
[% END %]
</h1>
<fieldset class="rows">
<legend class="sr-only">Enter authority type details</legend>
<ol> <ol>
<li> <li>
[% IF authority_type.authtypecode.defined %] [% IF authority_type.authtypecode.defined %]
@ -107,10 +126,10 @@
<input type="hidden" name="checked" value="0" /> <input type="hidden" name="checked" value="0" />
<input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />[% authority_type.authtypecode | html %] <input type="hidden" name="authtypecode" value="[% authority_type.authtypecode | html %]" />[% authority_type.authtypecode | html %]
[% ELSE %] [% ELSE %]
<div class="hint">10 characters maximum</div>
<label for="authtypecode" class="required">Authority type: </label> <label for="authtypecode" class="required">Authority type: </label>
<input id="authtypecode" type="text" class="required focus" required="required" name="authtypecode" size="20" maxlength="10" /> <input id="authtypecode" type="text" class="required focus" required="required" name="authtypecode" size="20" maxlength="10" />
<span class="required">Required</span> <span class="required">Required</span>
<div class="hint">10 characters maximum</div>
[% END %] [% END %]
</li> </li>
<li> <li>
@ -123,9 +142,9 @@
<textarea id="summary" name="summary" cols="55" rows="7">[% authority_type.summary | html %]</textarea> <textarea id="summary" name="summary" cols="55" rows="7">[% authority_type.summary | html %]</textarea>
</li> </li>
<li> <li>
<div class="hint">Note: for 'Authority field to copy', enter the authority field that should be copied from the authority record to the bibliographic record. E.g., in MARC21, field 100 in the authority record should be copied to field 100 in the bibliographic record</div>
<label for="auth_tag_to_report">Authority field to copy: </label> <label for="auth_tag_to_report">Authority field to copy: </label>
<input type="text" id="auth_tag_to_report" name="auth_tag_to_report" size="5" maxlength="3" value="[% authority_type.auth_tag_to_report | html %]" /> <input type="text" id="auth_tag_to_report" name="auth_tag_to_report" size="5" maxlength="3" value="[% authority_type.auth_tag_to_report | html %]" />
<div class="hint">Note: for 'Authority field to copy', enter the authority field that should be copied from the authority record to the bibliographic record. E.g., in MARC21, field 100 in the authority record should be copied to field 100 in the bibliographic record</div>
<input type="hidden" name="op" value="add_validate" /> <input type="hidden" name="op" value="add_validate" />
[% IF authority_type.authtypecode.defined %] [% IF authority_type.authtypecode.defined %]
<input type="hidden" name="is_a_modif" value="1" /> <input type="hidden" name="is_a_modif" value="1" />
@ -144,8 +163,11 @@
<div class="dialog alert"> <div class="dialog alert">
[% IF authorities_using_it %] [% IF authorities_using_it %]
<h1>This authority type cannot be deleted</h1> <h1>This authority type cannot be deleted</h1>
<p>This record is used <strong>[% authorities_using_it | html %]</strong> times</p> <p><strong><span class="ex">[% authority_type.authtypecode | html %]</span></strong></p>
<a class="cancel" href="/cgi-bin/koha/admin/authtypes.pl">Back to the list</a> <p>[% tnx('This authority type is used {count} time.', 'This authority type is used {count} times', authorities_using_it, { count = authorities_using_it }) %]</p>
<form action="/cgi-bin/koha/admin/authtypes.pl" method="get">
<button type="submit"><i class="fa fa-fw fa-arrow-left"></i> Return to authority types</button>
</form>
[% ELSE %] [% ELSE %]
<h1>Confirm deletion of authority structure definition for <span class="ex">'[% authority_type.authtypetext | html %]' ([% authority_type.authtypecode | html %])</span></h1> <h1>Confirm deletion of authority structure definition for <span class="ex">'[% authority_type.authtypetext | html %]' ([% authority_type.authtypecode | html %])</span></h1>
<form action="/cgi-bin/koha/admin/authtypes.pl" method="post"> <form action="/cgi-bin/koha/admin/authtypes.pl" method="post">