push @{$field_selection}, add_fields('biblio','biblioitems'),
{value => q{}, text => '---ITEMS---' },
{value => 'items.content', text => 'items.content'},
- add_fields('borrowers');
+ add_fields('issues','borrowers');
}
$template->param(
name => $letter->{name},
title => $letter->{title},
content => $letter->{content},
+ module => $module,
$module => 1,
SQLfieldname => $field_selection,
);
}
sub add_validate {
- my $dbh = C4::Context->dbh;
- my $module = $input->param('module');
- my $code = $input->param('code');
- my $name = $input->param('name');
- my $title = $input->param('title');
- my $content = $input->param('content');
- if (letter_exists($module, $code)) {
+ my $dbh = C4::Context->dbh;
+ my $module = $input->param('module');
+ my $oldmodule = $input->param('oldmodule');
+ my $code = $input->param('code');
+ my $name = $input->param('name');
+ my $title = $input->param('title');
+ my $content = $input->param('content');
+ if (letter_exists($oldmodule, $code)) {
$dbh->do(
q{UPDATE letter SET module = ?, code = ?, name = ?, title = ?, content = ? WHERE module = ? AND code = ?},
undef,
$module, $code, $name, $title, $content,
- $module, $code
+ $oldmodule, $code
);
} else {
$dbh->do(
my $table_prefix = $table . q|.|;
my $rows = C4::Context->dbh->selectall_arrayref($sql, { Slice => {} });
for my $row (@{$rows}) {
+ 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
push @fields, {
value => $table_prefix . $row->{Field},
text => $table_prefix . $row->{Field},