Bug 39825: Add a direct link to items tag in MARC bibliographic framework page

In MARC bibliographic framework page, add a direct link to items tag (952 in MARC21 and 995 in UNIMARC) can be very useful.
Currently one needs to search for the tag, then click on actions, then click on "View subfields".

Test plan :
1) Go to Administration > MARC bibliographic framework
2) View any framework MARC structure
3) You see in tools bar new button "View items tag (952)"
4) Click on it, you see this tag subfields

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Fridolin Somers 2025-05-05 10:12:30 +02:00 committed by Lucas Gass
parent 96bb1ec97d
commit d8c6286b1c
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 12 additions and 3 deletions

View File

@ -18,11 +18,12 @@
# along with Koha; if not, see <https://www.gnu.org/licenses>. # along with Koha; if not, see <https://www.gnu.org/licenses>.
use Modern::Perl; use Modern::Perl;
use CGI qw ( -utf8 ); use CGI qw ( -utf8 );
use C4::Auth qw( get_template_and_user );
use C4::Auth qw( get_template_and_user );
use C4::Biblio qw( GetMarcFromKohaField );
use C4::Context; use C4::Context;
use C4::Output qw( output_html_with_http_headers ); use C4::Output qw( output_html_with_http_headers );
use C4::Context;
use Koha::Caches; use Koha::Caches;
use Koha::AuthorisedValues; use Koha::AuthorisedValues;
@ -230,6 +231,9 @@ if ( $op eq 'add_form' ) {
} }
} }
my ( $items_tag, $items_subtag ) = GetMarcFromKohaField('items.itemnumber');
$template->param( items_tag => $items_tag );
# here, $op can be unset or set to "cud-framework_create_confirm". # here, $op can be unset or set to "cud-framework_create_confirm".
if ( $searchfield ne '' ) { if ( $searchfield ne '' ) {
$template->param( searchfield => $searchfield ); $template->param( searchfield => $searchfield );

View File

@ -97,6 +97,11 @@
[% IF framework %] [% IF framework %]
<a class="btn btn-default" href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit framework</a> <a class="btn btn-default" href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form&amp;frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit framework</a>
[% END %] [% END %]
[% IF items_tag %]
<a class="btn btn-default" id="itemstag" href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% items_tag | uri %]&frameworkcode=[% framework.frameworkcode | uri %]"
><i class="fa-solid fa-eye" aria-hidden="true"></i> View items tag ([% items_tag | html %])</a
>
[% END %]
</div> </div>
[% END %] [% END %]