(bug #4522) fix plugin unimarc 210$c
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Tue, 18 May 2010 08:02:38 +0000 (10:02 +0200)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 24 May 2010 18:55:43 +0000 (06:55 +1200)
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 <gmcharlt@gmail.com>
cataloguing/value_builder/unimarc_field_210c.pl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tmpl

index 6779999..431011b 100755 (executable)
@@ -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&amp;authtypecode=EDITORS&and_or=$and_or&amp;marclist=$marclist&amp;operator=$operator&amp;orderby=$orderby&amp;excluding=$excluding&amp;".join("&amp;",map {"value=".$_} @value)."&amp;op=do_search&amp;type=intranet&amp;index=$index";
-        warn "$link ,".getnbpages($total, $resultsperpage);
+
         $template->param(result => $results) if $results;
         $template->param('index' => $query->param('index'));
         $template->param(startfrom=> $startfrom,
index bde1feb..c2d19c7 100644 (file)
@@ -3,7 +3,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>UNIMARC_Field 125b builder</title>
+<title>UNIMARC_Field 210c builder</title>
 </head>
 <body>