Lines 227-233
sub add_form {
Link Here
|
227 |
my $field_selection; |
227 |
my $field_selection; |
228 |
push @{$field_selection}, add_fields('branches'); |
228 |
push @{$field_selection}, add_fields('branches'); |
229 |
if ($module eq 'reserves') { |
229 |
if ($module eq 'reserves') { |
230 |
push @{$field_selection}, add_fields('borrowers', 'reserves', 'biblio', 'biblioitems', 'items'); |
230 |
push @{$field_selection}, add_fields('borrowers', 'borrower_relationships', 'reserves', 'biblio', 'biblioitems', 'items'); |
231 |
} |
231 |
} |
232 |
elsif ( $module eq 'acquisition' ) { |
232 |
elsif ( $module eq 'acquisition' ) { |
233 |
push @{$field_selection}, add_fields('aqbooksellers', 'aqorders', 'biblio', 'items'); |
233 |
push @{$field_selection}, add_fields('aqbooksellers', 'aqorders', 'biblio', 'items'); |
Lines 239-255
sub add_form {
Link Here
|
239 |
push @{$field_selection}, add_fields('aqbooksellers', 'serial', 'subscription', 'biblio', 'biblioitems'); |
239 |
push @{$field_selection}, add_fields('aqbooksellers', 'serial', 'subscription', 'biblio', 'biblioitems'); |
240 |
} |
240 |
} |
241 |
elsif ($module eq 'serial') { |
241 |
elsif ($module eq 'serial') { |
242 |
push @{$field_selection}, add_fields('branches', 'biblio', 'biblioitems', 'borrowers', 'subscription', 'serial'); |
242 |
push @{$field_selection}, add_fields('branches', 'biblio', 'biblioitems', 'borrowers', 'borrower_relationships', 'subscription', 'serial'); |
243 |
} |
243 |
} |
244 |
elsif ($module eq 'suggestions') { |
244 |
elsif ($module eq 'suggestions') { |
245 |
push @{$field_selection}, add_fields('suggestions', 'borrowers', 'biblio'); |
245 |
push @{$field_selection}, add_fields('suggestions', 'borrowers', 'borrower_relationships', 'biblio'); |
246 |
} |
246 |
} |
247 |
else { |
247 |
else { |
248 |
push @{$field_selection}, add_fields('biblio','biblioitems'), |
248 |
push @{$field_selection}, add_fields('biblio','biblioitems'), |
249 |
add_fields('items'), |
249 |
add_fields('items'), |
250 |
{value => 'items.content', text => 'items.content'}, |
250 |
{value => 'items.content', text => 'items.content'}, |
251 |
{value => 'items.fine', text => 'items.fine'}, |
251 |
{value => 'items.fine', text => 'items.fine'}, |
252 |
add_fields('borrowers'); |
252 |
add_fields('borrowers'), |
|
|
253 |
add_fields('borrower_relationships'); |
253 |
if ($module eq 'circulation') { |
254 |
if ($module eq 'circulation') { |
254 |
push @{$field_selection}, add_fields('additional_contents', 'recalls'); |
255 |
push @{$field_selection}, add_fields('additional_contents', 'recalls'); |
255 |
|
256 |
|
Lines 496-501
sub get_columns_for {
Link Here
|
496 |
|
497 |
|
497 |
my $sql = "SHOW COLUMNS FROM $table";# TODO not db agnostic |
498 |
my $sql = "SHOW COLUMNS FROM $table";# TODO not db agnostic |
498 |
my $table_prefix = $table . q|.|; |
499 |
my $table_prefix = $table . q|.|; |
|
|
500 |
|
501 |
if($table eq 'borrower_relationships'){ |
502 |
$sql = "SHOW COLUMNS FROM borrowers";# TODO not db agnostic |
503 |
$table_prefix = 'guarantor' . q|.|; |
504 |
} |
505 |
|
499 |
my $rows = C4::Context->dbh->selectall_arrayref($sql, { Slice => {} }); |
506 |
my $rows = C4::Context->dbh->selectall_arrayref($sql, { Slice => {} }); |
500 |
for my $row (@{$rows}) { |
507 |
for my $row (@{$rows}) { |
501 |
next if $row->{'Field'} eq 'timestamp'; # this is really an irrelevant field and there may be other common fields that should be excluded from the list |
508 |
next if $row->{'Field'} eq 'timestamp'; # this is really an irrelevant field and there may be other common fields that should be excluded from the list |
502 |
- |
|
|