- if (index($module,"acquisition")>0){
- my $sth2=$dbh->prepare("SHOW COLUMNS from aqbooksellers");
- $sth2->execute;
- my %line = ('value' => "", 'text' => '---BOOKSELLERS---');
- push @SQLfieldname, \%line;
- while ((my $field) = $sth2->fetchrow_array) {
- my %line = ('value' => "aqbooksellers.".$field, 'text' => "aqbooksellers.".$field);
- push @SQLfieldname, \%line;
- }
- my $sth2=$dbh->prepare("SHOW COLUMNS from aqorders");
- $sth2->execute;
- my %line = ('value' => "", 'text' => '---ORDERS---');
- push @SQLfieldname, \%line;
- while ((my $field) = $sth2->fetchrow_array) {
- my %line = ('value' => "aqorders.".$field, 'text' => "aqorders.".$field);
- push @SQLfieldname, \%line;
- }
- # add issues specific tables
- }elsif (index($module,"issues")>0){
- my $sth2=$dbh->prepare("SHOW COLUMNS from aqbooksellers");
- $sth2->execute;
- my %line = ('value' => "", 'text' => '---BOOKSELLERS---');
- push @SQLfieldname, \%line;
- while ((my $field) = $sth2->fetchrow_array) {
- my %line = ('value' => "aqbooksellers.".$field, 'text' => "aqbooksellers.".$field);
- push @SQLfieldname, \%line;
- }
- my $sth2=$dbh->prepare("SHOW COLUMNS from serial");
- $sth2->execute;
- my %line = ('value' => "", 'text' => '---SERIALS---');
- push @SQLfieldname, \%line;
- while ((my $field) = $sth2->fetchrow_array) {
- my %line = ('value' => "serial.".$field, 'text' => "serial.".$field);
- push @SQLfieldname, \%line;
- }
- my $sth2=$dbh->prepare("SHOW COLUMNS from subscription");
- $sth2->execute;
- my %line = ('value' => "", 'text' => '---SUBSCRIPTION---');
- push @SQLfieldname, \%line;
- while ((my $field) = $sth2->fetchrow_array) {
- my %line = ('value' => "subscription.".$field, 'text' => "subscription.".$field);
- push @SQLfieldname, \%line;
- }
- # add biblio specific tables.
- } else {
- my $sth2=$dbh->prepare("SHOW COLUMNS from biblio");
- $sth2->execute;
- my %line = ('value' => "", 'text' => '---BIBLIO---');
+ if ( index( $module, "acquisition" ) > 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 aqorders");
+ $sth2->execute;
+ push @SQLfieldname, { 'value' => "", 'text' => '---ORDERS---' };
+ while ( ( my $field ) = $sth2->fetchrow_array ) {
+ push @SQLfieldname, {
+ 'value' => "aqorders." . $field,
+ 'text' => "aqorders." . $field
+ };
+ }