From 9b13e062757f938b0c9bfc2e6a159e222ae41bec Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Mon, 12 Dec 2016 16:11:08 +0000 Subject: [PATCH] Bug 15503 [QA Followup] - Use Koha::AuthorisedValues and fetch notforloan values. Signed-off-by: Benjamin Daeuber Signed-off-by: Kyle M Hall Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall --- acqui/addorderiso2709.pl | 11 ++++++++--- .../prog/en/modules/acqui/addorderiso2709.tt | 12 +++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 042258cfb8..ce57113c7e 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -467,8 +467,9 @@ sub import_biblios_list { my @list = (); my $item_error = 0; - my $ccodes = GetKohaAuthorisedValues("items.ccode"); - my $locations = GetKohaAuthorisedValues("items.location"); + my $ccodes = { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.ccode' } ) }; + my $locations = { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) }; + my $notforloans = { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.notforloan' } ) }; # location list my @locations; foreach (sort keys %$locations) { @@ -478,7 +479,10 @@ sub import_biblios_list { foreach (sort {$ccodes->{$a} cmp $ccodes->{$b}} keys %$ccodes) { push @ccodes, { code => $_, description => $ccodes->{$_} }; } - + my @notforloans; + foreach (sort {$notforloans->{$a} cmp $notforloans->{$b}} keys %$notforloans) { + push @notforloans, { code => $_, description => $notforloans->{$_} }; + } my $biblio_count = 0; foreach my $biblio (@$biblios) { @@ -607,6 +611,7 @@ sub import_biblios_list { locationloop => \@locations, itypeloop => \@itypes, ccodeloop => \@ccodes, + notforloanloop => \@notforloans, ); batch_info($template, $batch); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt index e718028620..1a11bdc55e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -370,7 +370,17 @@ -
  • +
  • + +