- elsif ( index( $module, "issues" ) > 0 ) { # FIXME: imprecise comparison
- $sth2 = $dbh->prepare("SHOW COLUMNS from aqbooksellers");
- $sth2->execute;
- push @SQLfieldname, { 'value' => "", 'text' => '---BOOKSELLERS---' };
- while ( ( my $field ) = $sth2->fetchrow_array ) {
- push @SQLfieldname, {
- 'value' => "aqbooksellers." . $field,
- 'text' => "aqbooksellers." . $field
- };
- }
- $sth2 = $dbh->prepare("SHOW COLUMNS from serial");
- $sth2->execute;
- push @SQLfieldname, { 'value' => "", 'text' => '---SERIALS---' };
- while ( ( my $field ) = $sth2->fetchrow_array ) {
- push @SQLfieldname, { 'value' => "serial." . $field, 'text' => "serial." . $field };
- }
- $sth2 = $dbh->prepare("SHOW COLUMNS from subscription");
- $sth2->execute;
- push @SQLfieldname, { 'value' => "", 'text' => '---SUBSCRIPTION---' };
- while ( ( my $field ) = $sth2->fetchrow_array ) {
- push @SQLfieldname, {
- 'value' => "subscription." . $field,
- 'text' => "subscription." . $field
- };
- }
- push @SQLfieldname, { 'value' => "", 'text' => '---Biblio---' };
- foreach(qw(title author serial)) {
- push @SQLfieldname, { 'value' => "biblio.$_", 'text' => ucfirst($_) };
- }
+ push @{$field_selection}, add_fields('branches');
+ if ($module eq 'reserves') {
+ push @{$field_selection}, add_fields('borrowers', 'reserves', 'biblio', 'items');