Lines 179-184
sub add_form {
Link Here
|
179 |
name => $letter->{name}, |
179 |
name => $letter->{name}, |
180 |
title => $letter->{title}, |
180 |
title => $letter->{title}, |
181 |
content => $letter->{content}, |
181 |
content => $letter->{content}, |
|
|
182 |
module => $module, |
182 |
$module => 1, |
183 |
$module => 1, |
183 |
SQLfieldname => $field_selection, |
184 |
SQLfieldname => $field_selection, |
184 |
); |
185 |
); |
Lines 186-203
sub add_form {
Link Here
|
186 |
} |
187 |
} |
187 |
|
188 |
|
188 |
sub add_validate { |
189 |
sub add_validate { |
189 |
my $dbh = C4::Context->dbh; |
190 |
my $dbh = C4::Context->dbh; |
190 |
my $module = $input->param('module'); |
191 |
my $module = $input->param('module'); |
191 |
my $code = $input->param('code'); |
192 |
my $oldmodule = $input->param('oldmodule'); |
192 |
my $name = $input->param('name'); |
193 |
my $code = $input->param('code'); |
193 |
my $title = $input->param('title'); |
194 |
my $name = $input->param('name'); |
194 |
my $content = $input->param('content'); |
195 |
my $title = $input->param('title'); |
195 |
if (letter_exists($module, $code)) { |
196 |
my $content = $input->param('content'); |
|
|
197 |
if (letter_exists($oldmodule, $code)) { |
196 |
$dbh->do( |
198 |
$dbh->do( |
197 |
q{UPDATE letter SET module = ?, code = ?, name = ?, title = ?, content = ? WHERE module = ? AND code = ?}, |
199 |
q{UPDATE letter SET module = ?, code = ?, name = ?, title = ?, content = ? WHERE module = ? AND code = ?}, |
198 |
undef, |
200 |
undef, |
199 |
$module, $code, $name, $title, $content, |
201 |
$module, $code, $name, $title, $content, |
200 |
$module, $code |
202 |
$oldmodule, $code |
201 |
); |
203 |
); |
202 |
} else { |
204 |
} else { |
203 |
$dbh->do( |
205 |
$dbh->do( |
204 |
- |
|
|