From 2fa09665e45576906d115a30017b57f5a25597fa Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 20 Jul 2021 14:49:48 +0200 Subject: [PATCH] Bug 27526: Remove uneeded call to TransformMarcToKoha And also clean some imports. --- cataloguing/additem.pl | 9 +-------- .../prog/en/modules/cataloguing/additem.tt | 20 +++++++++---------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 9150ad2b785..0212b0d4c72 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -25,17 +25,13 @@ use CGI qw ( -utf8 ); use C4::Auth qw( get_template_and_user haspermission ); use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); use C4::Biblio qw( - GetAuthorisedValueDesc GetFrameworkCode GetMarcBiblio GetMarcFromKohaField GetMarcStructure IsMarcStructureInternal ModBiblio - TransformHtmlToXml - TransformMarcToKoha ); -use C4::Items qw( AddItemFromMarc ModItemFromMarc ); use C4::Context; use C4::Circulation qw( LostItem ); use C4::Koha qw( GetAuthorisedValues ); @@ -411,7 +407,6 @@ my $record = GetMarcBiblio({ biblionumber => $biblionumber }); output_and_exit_if_error( $input, $cookie, $template, { module => 'cataloguing', record => $record } ); -my $oldrecord = TransformMarcToKoha($record); my $current_item; my $nextop="additem"; my @errors; # store errors found while checking data BEFORE saving item. @@ -900,9 +895,7 @@ foreach my $tag ( keys %{$tagslib} ) { # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. $template->param( - biblionumber => $biblionumber, - title => $oldrecord->{title}, - author => $oldrecord->{author}, + biblio => $biblio, items => \@items, item_header_loop => \@header_value_loop, subfields => \@subfields, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index 7cd183a1fba..a8ea679d4ac 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -5,7 +5,7 @@ [% USE KohaDates %] [% USE TablesSettings %] [% INCLUDE 'doc-head-open.inc' %] -Items › [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) › Cataloging › Koha +Items › [% biblio.title | html %] [% IF ( author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %]) › Cataloging › Koha [% INCLUDE 'doc-head-close.inc' %] [% Asset.css("css/addbiblio.css") | $raw %] [% INCLUDE 'datatables.inc' %] @@ -34,7 +34,7 @@ Cataloging
  • - Edit [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) + Edit [% biblio.title | html %] [% IF ( author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])
  • @@ -49,14 +49,14 @@
    [% INCLUDE 'blocking_errors.inc' %] -

    Items for [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])

    +

    Items for [% biblio.title | html %] [% IF ( author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])

    [% IF ( barcode_not_unique ) %]
    Error saving item: Barcode must be unique.
    [% END %] [% IF ( no_next_barcode ) %]
    Error saving items: Unable to automatically determine values for barcodes. No item has been inserted.
    [% END %] [% IF ( book_on_loan ) %]
    Cannot delete: item is checked out.
    [% END %] [% IF ( book_reserved ) %]
    Cannot delete: item has a waiting hold.
    [% END %] [% IF ( not_same_branch ) %]
    Cannot delete: The items do not belong to your library.
    [% END %] -[% IF ( linked_analytics ) %]
    [% END %] +[% IF ( linked_analytics ) %]
    Cannot delete: item has linked analytics..
    [% END %] [% IF last_item_for_hold %]
    Cannot delete: Last item for bibliographic record with biblio-level hold on it.
    [% END %]
    @@ -105,10 +105,10 @@