Lines 159-168
sub add_form {
Link Here
|
159 |
# So we can only sent the first one to the template. |
159 |
# So we can only sent the first one to the template. |
160 |
for my $mtt ( @$message_transport_types ) { |
160 |
for my $mtt ( @$message_transport_types ) { |
161 |
# The letter_name |
161 |
# The letter_name |
162 |
if ( $first_flag and $letters->{$mtt}{name} ) { |
162 |
if ( $first_flag) { |
163 |
$template->param( |
163 |
if ($letters->{$mtt}{name}) { |
164 |
letter_name=> $letters->{$mtt}{name}, |
164 |
$template->param( |
165 |
); |
165 |
letter_name=> $letters->{$mtt}{name}, |
|
|
166 |
); |
167 |
} |
168 |
if ($letters->{$mtt}{fee}) { |
169 |
$template->param( |
170 |
fee => $letters->{$mtt}{fee}, |
171 |
); |
172 |
} |
166 |
$first_flag = 0; |
173 |
$first_flag = 0; |
167 |
} |
174 |
} |
168 |
|
175 |
|
Lines 249-257
sub add_validate {
Link Here
|
249 |
my $oldmodule = $input->param('oldmodule'); |
256 |
my $oldmodule = $input->param('oldmodule'); |
250 |
my $code = $input->param('code'); |
257 |
my $code = $input->param('code'); |
251 |
my $name = $input->param('name'); |
258 |
my $name = $input->param('name'); |
|
|
259 |
my $fee = $input->param('fee'); |
252 |
my @mtt = $input->param('message_transport_type'); |
260 |
my @mtt = $input->param('message_transport_type'); |
253 |
my @title = $input->param('title'); |
261 |
my @title = $input->param('title'); |
254 |
my @content = $input->param('content'); |
262 |
my @content = $input->param('content'); |
|
|
263 |
|
264 |
my $insertfee = $fee; |
265 |
if (defined($fee) and $fee eq ''){ |
266 |
$insertfee = undef; |
267 |
} |
268 |
|
255 |
for my $mtt ( @mtt ) { |
269 |
for my $mtt ( @mtt ) { |
256 |
my $is_html = $input->param("is_html_$mtt"); |
270 |
my $is_html = $input->param("is_html_$mtt"); |
257 |
my $title = shift @title; |
271 |
my $title = shift @title; |
Lines 269-290
sub add_validate {
Link Here
|
269 |
next; |
283 |
next; |
270 |
} |
284 |
} |
271 |
elsif ( $letter and $letter->{message_transport_type} eq $mtt ) { |
285 |
elsif ( $letter and $letter->{message_transport_type} eq $mtt ) { |
272 |
$dbh->do( |
286 |
if (defined($fee)){ |
273 |
q{ |
287 |
$dbh->do(q{UPDATE letter SET branchcode = ?, module = ?, name = ?, is_html = ?, title = ?, content = ?, fee = ? |
274 |
UPDATE letter |
288 |
WHERE branchcode = ? AND module = ? AND code = ? AND message_transport_type = ?}, undef, |
275 |
SET branchcode = ?, module = ?, name = ?, is_html = ?, title = ?, content = ? |
289 |
$branchcode, $module, $name, $is_html || 0, $title, $content, $insertfee, $branchcode, $oldmodule, $code, $mtt); |
276 |
WHERE branchcode = ? AND module = ? AND code = ? AND message_transport_type = ? |
290 |
} else { |
277 |
}, |
291 |
$dbh->do(q{UPDATE letter SET branchcode = ?, module = ?, name = ?, is_html = ?, title = ?, content = ? |
278 |
undef, |
292 |
WHERE branchcode = ? AND module = ? AND code = ? AND message_transport_type = ?}, undef, |
279 |
$branchcode, $module, $name, $is_html || 0, $title, $content, |
293 |
$branchcode, $module, $name, $is_html || 0, $title, $content, $branchcode, $oldmodule, $code, $mtt); |
280 |
$branchcode, $oldmodule, $code, $mtt |
294 |
} |
281 |
); |
|
|
282 |
} else { |
295 |
} else { |
283 |
$dbh->do( |
296 |
if (defined($fee) and $fee != ''){ |
284 |
q{INSERT INTO letter (branchcode,module,code,name,is_html,title,content,message_transport_type) VALUES (?,?,?,?,?,?,?,?)}, |
297 |
$dbh->do(q{INSERT INTO letter (branchcode,module,code,name,is_html,title,content,message_transport_type, fee) VALUES (?,?,?,?,?,?,?,?,?)},undef, |
285 |
undef, |
298 |
$branchcode, $module, $code, $name, $is_html || 0, $title, $content, $mtt, $fee); |
286 |
$branchcode, $module, $code, $name, $is_html || 0, $title, $content, $mtt |
299 |
} else { |
287 |
); |
300 |
$dbh->do(q{INSERT INTO letter (branchcode,module,code,name,is_html,title,content,message_transport_type) VALUES (?,?,?,?,?,?,?,?)},undef, |
|
|
301 |
$branchcode, $module, $code, $name, $is_html || 0, $title, $content, $mtt); |
302 |
} |
288 |
} |
303 |
} |
289 |
} |
304 |
} |
290 |
# set up default display |
305 |
# set up default display |
291 |
- |
|
|