From a5255000ef264e32ca32c273462f866b6bac9c91 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Mon, 21 Oct 2024 13:13:05 +0000 Subject: [PATCH] Bug 34355: (QA follow-up) Fix template errors This patch addresses the following issues: - Fixes a duplication of the SerialsDefaultReplyTo syspref - Re-introduces include files for overlay rules --- Koha/MarcOrder.pm | 111 ++++++++++-------- .../prog/en/includes/tools-item-action.inc | 74 ++++++------ .../prog/en/includes/tools-nomatch-action.inc | 32 ++--- .../prog/en/includes/tools-overlay-action.inc | 44 +++---- .../en/modules/admin/marc_order_accounts.tt | 80 ++----------- .../admin/preferences/acquisitions.pref | 6 - 6 files changed, 150 insertions(+), 197 deletions(-) diff --git a/Koha/MarcOrder.pm b/Koha/MarcOrder.pm index 8faa0492df1..5d90171a800 100644 --- a/Koha/MarcOrder.pm +++ b/Koha/MarcOrder.pm @@ -241,7 +241,7 @@ sub _create_basket_for_file { my $basketno = NewBasket( $vendor_id, 0, $basketname, q{}, - q{} . q{} + q{}, q{}, q{}, q{}, 0, 'ordering' ); return $basketno; @@ -608,6 +608,7 @@ sub add_items_from_import_record { }); Used by the cronjob to detect whether a file matches the account and should be processed + This method only checks the first record in the file. =cut @@ -1229,20 +1230,23 @@ sub _create_item_fields_from_syspref { my $marc_fields_to_order = $args->{marc_fields_to_order}; my $budget_id = $args->{budget_id}; - my @homebranches = (); - my @holdingbranches = (); - my @itypes = (); - my @nonpublic_notes = (); - my @public_notes = (); - my @locs = (); - my @ccodes = (); - my @notforloans = (); - my @uris = (); - my @copynos = (); - my @budget_codes = (); - my @itemprices = (); - my @replacementprices = (); - my @itemcallnumbers = (); + my @homebranches = (); + my @holdingbranches = (); + my @itypes = (); + my @nonpublic_notes = (); + my @public_notes = (); + my @locs = (); + my @ccodes = (); + my @notforloans = (); + my @uris = (); + my @copynos = (); + my @budget_codes = (); + my @itemprices = (); + my @replacementprices = (); + my @itemcallnumbers = (); + my @coded_location_qualifiers = (); + my @barcodes = (); + my @enumchrons = (); foreach my $infoset (@$marc_item_fields_to_order) { my $quantity = $infoset->{quantity} || 1; @@ -1264,48 +1268,55 @@ sub _create_item_fields_from_syspref { $item_budget_id = $budget_id; } - push @homebranches, $infoset->{homebranch}; - push @holdingbranches, $infoset->{holdingbranch}; - push @itypes, $infoset->{itype}; - push @nonpublic_notes, $infoset->{nonpublic_note}; - push @public_notes, $infoset->{public_note}; - push @locs, $infoset->{loc}; - push @ccodes, $infoset->{ccode}; - push @notforloans, $infoset->{notforloan}; - push @uris, $infoset->{uri}; - push @copynos, $infoset->{copyno}; - push @budget_codes, $item_budget_id; - push @itemprices, $infoset->{price}; - push @replacementprices, $infoset->{replacementprice}; - push @itemcallnumbers, $infoset->{itemcallnumber}; + push @homebranches, $infoset->{homebranch}; + push @holdingbranches, $infoset->{holdingbranch}; + push @itypes, $infoset->{itype}; + push @nonpublic_notes, $infoset->{nonpublic_note}; + push @public_notes, $infoset->{public_note}; + push @locs, $infoset->{loc}; + push @ccodes, $infoset->{ccode}; + push @notforloans, $infoset->{notforloan}; + push @uris, $infoset->{uri}; + push @copynos, $infoset->{copyno}; + push @budget_codes, $item_budget_id; + push @itemprices, $infoset->{price}; + push @replacementprices, $infoset->{replacementprice}; + push @itemcallnumbers, $infoset->{itemcallnumber}; + push @coded_location_qualifiers, $infoset->{coded_location_qualifier}; + push @barcodes, $infoset->{barcode}; + push @enumchrons, $infoset->{enumchron}; } } my $item_fields = { - quantity => scalar(@homebranches), - homebranches => \@homebranches, - holdingbranches => \@holdingbranches, - itypes => \@itypes, - nonpublic_notes => \@nonpublic_notes, - public_notes => \@public_notes, - locs => \@locs, - ccodes => \@ccodes, - notforloans => \@notforloans, - uris => \@uris, - copynos => \@copynos, - budget_codes => \@budget_codes, - itemprices => \@itemprices, - replacementprices => \@replacementprices, - itemcallnumbers => \@itemcallnumbers, - c_quantity => $marc_fields_to_order->{quantity}, - c_budget_code => $marc_fields_to_order->{budget_code}, - c_price => $marc_fields_to_order->{price}, - c_discount => $marc_fields_to_order->{discount}, - c_sort1 => $marc_fields_to_order->{sort1}, - c_sort2 => $marc_fields_to_order->{sort2}, + quantity => scalar(@homebranches), + homebranches => \@homebranches, + holdingbranches => \@holdingbranches, + itypes => \@itypes, + nonpublic_notes => \@nonpublic_notes, + public_notes => \@public_notes, + locs => \@locs, + ccodes => \@ccodes, + notforloans => \@notforloans, + uris => \@uris, + copynos => \@copynos, + budget_codes => \@budget_codes, + itemprices => \@itemprices, + replacementprices => \@replacementprices, + itemcallnumbers => \@itemcallnumbers, + coded_location_qualifiers => \@coded_location_qualifiers, + barcodes => \@barcodes, + enumchrons => \@enumchrons, + c_quantity => $marc_fields_to_order->{quantity}, + c_budget_code => $marc_fields_to_order->{budget_code}, + c_price => $marc_fields_to_order->{price}, + c_discount => $marc_fields_to_order->{discount}, + c_sort1 => $marc_fields_to_order->{sort1}, + c_sort2 => $marc_fields_to_order->{sort2}, }; return $item_fields; } + 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-item-action.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-item-action.inc index e58f05f551c..6007b5e8267 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-item-action.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-item-action.inc @@ -1,37 +1,41 @@ - [% IF item_action_ignore AND num_items == 0 %] - No items were found during staging - +[% IF account.item_action == 'ignore' AND num_items == 0 %] + No items were found during staging + +[% ELSE %] + [% IF ( class_name ) %] + + [% END %] + [% IF ( account.item_action == 'always_add' ) %] + + [% IF ( account.item_action == 'add_only_for_matches' ) %] + + [% IF ( account.item_action == 'add_only_for_new' ) %] + + [% IF ( account.item_action == 'replace' ) %] + + [% IF ( account.item_action == 'ignore' ) %] + + +[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-nomatch-action.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-nomatch-action.inc index 8003bb75ff9..4476bbb7f59 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-nomatch-action.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-nomatch-action.inc @@ -1,14 +1,18 @@ - +[% IF ( class_name ) %] + +[% END %] + [% IF ( account.nomatch_action == 'create_new' ) %] + + [% IF ( account.nomatch_action == 'ignore' ) %] + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-overlay-action.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-overlay-action.inc index 93188147d63..26cfca09869 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-overlay-action.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-overlay-action.inc @@ -1,20 +1,24 @@ - +[% IF ( class_name ) %] + +[% END %] + [% IF ( account.overlay_action == 'replace' ) %] + + [% IF ( account.overlay_action == 'create_new' ) %] + + [% IF ( account.overlay_action == 'ignore' ) %] + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_order_accounts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_order_accounts.tt index 11e9aef075e..2a9b8675779 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_order_accounts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_order_accounts.tt @@ -128,6 +128,7 @@ MARC Order Accounts
(Optional): If you have files from multiple vendors in the same file directory, the match field is the field in the marc record that will be checked to see if the file should be processed by this account.
+
The format for this field is the same as MARCFieldsToOrder - the field and the subfield separated by a dollar sign e.g. 245$a
  • @@ -143,17 +144,15 @@ MARC Order Accounts
  • @@ -216,43 +215,11 @@ MARC Order Accounts
  • - + [% INCLUDE 'tools-overlay-action.inc' class_name='select2' %]
  • - + [% INCLUDE 'tools-nomatch-action.inc' class_name='select2' %]
  • @@ -279,38 +246,7 @@ MARC Order Accounts
    1. - + [% INCLUDE 'tools-item-action.inc' class_name='select2' %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref index 1d3f8cb35c2..a3755acda1b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref @@ -138,12 +138,6 @@ Acquisitions: class: email - 'when sending acquisitions order and claim notices.' - '
    If left empty, it will fall back to the first defined address in the following list: library reply-to, library email, ReplytoDefault, KohaAdminEmailAddress.' - - - - Use the reply-to email address - - pref: SerialsDefaultReplyTo - class: email - - 'when sending serial claim notices.' - - '
    If left empty, it will fall back to the first defined address in the following list: Library ReplyTo, Library Email, ReplytoDefault, KohaAdminEmailAddress.' - - pref: MarcOrderingAutomation default: no -- 2.39.3 (Apple Git-146)