From 5c0c400e16212b390eba9ca54bdd21a945dfe631 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. Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- cataloguing/additem.pl | 9 +------- .../prog/en/modules/cataloguing/additem.tt | 22 +++++++++---------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 4a10594dd5..e2c6e67b46 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 ); @@ -412,7 +408,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. @@ -901,9 +896,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 5c7802cfe0..b7e4b62bbb 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' %] @@ -38,7 +38,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 %])
  • @@ -53,14 +53,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 %]
    @@ -108,11 +108,11 @@