- if ($isbn_found) {
- my $sth = $dbh->prepare(
- "SELECT auth_subfield_table.authid,subfieldvalue
- FROM auth_subfield_table
- LEFT JOIN auth_header ON auth_subfield_table.authid = auth_header.authid
- WHERE authtypecode='EDITORS'
- AND tag='200'
- AND subfieldcode='a'
- AND subfieldvalue=?"
- );
- my $sth2 =
- $dbh->prepare(
- "SELECT subfieldvalue
- FROM auth_subfield_table
- WHERE tag='200'
- AND subfieldcode='c'
- AND authid=?
- ORDER BY subfieldvalue"
- );
- my @splited = split //, $isbn_found;
- my $isbn_rebuild = '';
- foreach my $x (@splited) {
- $isbn_rebuild .= $x;
- $sth->execute($isbn_rebuild);
- my ($authid) = $sth->fetchrow;
- $sth2->execute($authid);
- while ( my ($line) = $sth2->fetchrow ) {
- push @collections, $line;
- }
- }
- }
- else {
- my $sth = $dbh->prepare(
- "SELECT auth_subfield_table.authid,subfieldvalue
- FROM auth_subfield_table
- LEFT JOIN auth_header ON auth_subfield_table.authid = auth_header.authid
- WHERE authtypecode='EDITORS'
- AND tag='200'
- AND subfieldcode='b'
- AND subfieldvalue=?"
- );
- my $sth2 =
- $dbh->prepare(
- "SELECT subfieldvalue
- FROM auth_subfield_table
- WHERE tag='200'
- AND subfieldcode='c'
- AND authid=?
- ORDER BY subfieldvalue"
- );
- $sth->execute($editor_found);
- my ($authid) = $sth->fetchrow;
- $sth2->execute($authid);
- while ( my ($line) = $sth2->fetchrow ) {
- push @collections, $line;
+
+ my @value = ($editor_found,"","");
+ my @tags = ("mainentry","","");
+ my @and_or = ('and','','');
+ my @operator = ('is','','');
+ my @excluding = ('','','');
+
+
+ my ($results,$total) = SearchAuthorities( \@tags,\@and_or,
+ \@excluding, \@operator, \@value,
+ 0, 20,"EDITORS", "HeadingAsc");
+ foreach my $editor (@$results){
+ my $authority = GetAuthority($editor->{authid});
+ foreach my $col ($authority->subfield('200','c')){
+ push @collections, $col;