diff --git a/koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_210c.tmpl b/koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_210c.tmpl index 7ca1531a8e..3e944504ee 100644 --- a/koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_210c.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/value_builder/unimarc_field_210c.tmpl @@ -104,7 +104,7 @@ function report(index,summary) { - var regexp= /(\d* - *)(.*)/; + var regexp= /(\d* -+ *)(.*)/; var result=summary.match(regexp); opener.document.f.field_value[index].value=result[2]; self.close(); diff --git a/value_builder/unimarc_field_225a.pl b/value_builder/unimarc_field_225a.pl index 3715c128e7..e696084905 100644 --- a/value_builder/unimarc_field_225a.pl +++ b/value_builder/unimarc_field_225a.pl @@ -118,15 +118,28 @@ my ($input) = @_; # builds collection list : search isbn and editor, in parent, then load collections from bibliothesaurus table # if there is an isbn, complete search my @collections; - 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); + 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) {