Addind a reported_tag entry.
authorPaul POULAIN <paul@koha-fr.org>
Thu, 13 Dec 2007 11:20:41 +0000 (12:20 +0100)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 14 Dec 2007 15:12:37 +0000 (09:12 -0600)
the reported tag contains all subfields to report from the authority into the biblio.

NOTE : It is a feature usefull only for OpenCataloger, but OpenCataloger needs it.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/AuthoritiesMarc.pm

index e440f1d..43c663f 100644 (file)
@@ -292,10 +292,18 @@ sub SearchAuthorities {
             my $sth = $dbh->prepare($query_auth_tag);
             $sth->execute($authtypecode);
             my $auth_tag_to_report = $sth->fetchrow;
+            my $reported_tag;
+            my $mainentry = $authrecord->field($auth_tag_to_report);
+            if ($mainentry) {
+                foreach ($mainentry->subfields()) {
+                    $reported_tag .='$'.$_->[0].$_->[1];
+                }
+            }
             my %newline;
             $newline{summary} = $summary;
             $newline{authid} = $authid;
             $newline{even} = $counter % 2;
+            $newline{reported_tag} = $reported_tag;
             $counter++;
             push @finalresult, \%newline;
             }## while counter