From 2b86da48a4044aed3420d4bca127de2bb62ed536 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Tue, 18 May 2010 10:02:38 +0200 Subject: [PATCH] (bug #4522) fix plugin unimarc 210$c This patch change the way to retrieve the value to insert in the record. The way it was done, was verry ugly. Signed-off-by: Galen Charlton --- cataloguing/value_builder/unimarc_field_210c.pl | 9 +++++---- .../cataloguing/value_builder/unimarc_field_210c.tmpl | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cataloguing/value_builder/unimarc_field_210c.pl b/cataloguing/value_builder/unimarc_field_210c.pl index 6779999426..431011bfb1 100755 --- a/cataloguing/value_builder/unimarc_field_210c.pl +++ b/cataloguing/value_builder/unimarc_field_210c.pl @@ -138,9 +138,10 @@ my ($input) = @_; $startfrom*$resultsperpage, $resultsperpage,$authtypecode, $orderby); # Getting the $b if it exists - foreach my $_ (@$results) { - if ($_->{reported_tag} =~ m/^\$b/) { - $_->{to_report} = substr($_->{reported_tag}, 2); + for (@$results) { + my $authority = GetAuthority($_->{authid}); + if ($authority->field('200') and $authority->subfield('200','b')) { + $_->{to_report} = $authority->subfield('200','b'); } } @@ -183,7 +184,7 @@ my ($input) = @_; $to = (($startfrom+1)*$resultsperpage); } my $link="../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_210c.pl&authtypecode=EDITORS&and_or=$and_or&marclist=$marclist&operator=$operator&orderby=$orderby&excluding=$excluding&".join("&",map {"value=".$_} @value)."&op=do_search&type=intranet&index=$index"; - warn "$link ,".getnbpages($total, $resultsperpage); + $template->param(result => $results) if $results; $template->param('index' => $query->param('index')); $template->param(startfrom=> $startfrom, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tmpl index bde1feb5d2..c2d19c7b04 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tmpl @@ -3,7 +3,7 @@ -UNIMARC_Field 125b builder +UNIMARC_Field 210c builder -- 2.39.5