Lines 49-55
use C4::Context;
Link Here
|
49 |
use C4::Output qw( output_html_with_http_headers ); |
49 |
use C4::Output qw( output_html_with_http_headers ); |
50 |
use C4::Letters qw( GetMessageTransportTypes ); |
50 |
use C4::Letters qw( GetMessageTransportTypes ); |
51 |
use C4::Log qw( logaction ); |
51 |
use C4::Log qw( logaction ); |
52 |
|
|
|
53 |
use Koha::Notice::Templates; |
52 |
use Koha::Notice::Templates; |
54 |
use Koha::Patron::Attribute::Types; |
53 |
use Koha::Patron::Attribute::Types; |
55 |
|
54 |
|
Lines 228-233
sub add_form {
Link Here
|
228 |
content => $letter->{content} // '', |
227 |
content => $letter->{content} // '', |
229 |
tt_error => $letter->{tt_error}, |
228 |
tt_error => $letter->{tt_error}, |
230 |
}; |
229 |
}; |
|
|
230 |
$letters{ $lang }{params} = $letter; |
231 |
} |
231 |
} |
232 |
} |
232 |
} |
233 |
else { |
233 |
else { |
Lines 307-318
sub add_validate {
Link Here
|
307 |
my $oldmodule = $input->param('oldmodule'); |
307 |
my $oldmodule = $input->param('oldmodule'); |
308 |
my $code = $input->param('code'); |
308 |
my $code = $input->param('code'); |
309 |
my $name = $input->param('name'); |
309 |
my $name = $input->param('name'); |
|
|
310 |
my $text_justify = $input->param('text_justify'); |
311 |
my $font_size = $input->param('font_size'); |
312 |
my $units = $input->param('units'); |
313 |
my $notice_width = $input->param('notice_width'); |
314 |
my $top_margin = $input->param('top_margin'); |
315 |
my $left_margin = $input->param('left_margin'); |
316 |
my $format_all = $input->param('format_all'); |
310 |
my @mtt = $input->multi_param('message_transport_type'); |
317 |
my @mtt = $input->multi_param('message_transport_type'); |
311 |
my @title = $input->multi_param('title'); |
318 |
my @title = $input->multi_param('title'); |
312 |
my @content = $input->multi_param('content'); |
319 |
my @content = $input->multi_param('content'); |
313 |
my @lang = $input->multi_param('lang'); |
320 |
my @lang = $input->multi_param('lang'); |
314 |
for my $mtt ( @mtt ) { |
321 |
for my $mtt ( @mtt ) { |
315 |
my $lang = shift @lang; |
322 |
my $lang = shift @lang; |
|
|
323 |
if ( $format_all ) { |
324 |
my @letters = Koha::Notice::Templates->search({ lang => $lang })->as_list; |
325 |
foreach my $letter ( @letters ) { |
326 |
$letter->set( |
327 |
{ |
328 |
text_justify => $text_justify, |
329 |
font_size => $font_size, |
330 |
units => $units, |
331 |
notice_width => $notice_width, |
332 |
top_margin => $top_margin, |
333 |
left_margin => $left_margin, |
334 |
} |
335 |
)->store; |
336 |
} |
337 |
} |
316 |
my $is_html = $input->param("is_html_$mtt\_$lang"); |
338 |
my $is_html = $input->param("is_html_$mtt\_$lang"); |
317 |
my $title = shift @title; |
339 |
my $title = shift @title; |
318 |
my $content = shift @content; |
340 |
my $content = shift @content; |
Lines 345-351
sub add_validate {
Link Here
|
345 |
is_html => $is_html || 0, |
367 |
is_html => $is_html || 0, |
346 |
title => $title, |
368 |
title => $title, |
347 |
content => $content, |
369 |
content => $content, |
348 |
lang => $lang |
370 |
lang => $lang, |
|
|
371 |
text_justify => $text_justify, |
372 |
font_size => $font_size, |
373 |
units => $units, |
374 |
notice_width => $notice_width, |
375 |
top_margin => $top_margin, |
376 |
left_margin => $left_margin, |
349 |
} |
377 |
} |
350 |
)->store; |
378 |
)->store; |
351 |
|
379 |
|
Lines 360-366
sub add_validate {
Link Here
|
360 |
title => $title, |
388 |
title => $title, |
361 |
content => $content, |
389 |
content => $content, |
362 |
message_transport_type => $mtt, |
390 |
message_transport_type => $mtt, |
363 |
lang => $lang |
391 |
lang => $lang, |
|
|
392 |
text_justify => $text_justify, |
393 |
font_size => $font_size, |
394 |
units => $units, |
395 |
notice_width => $notice_width, |
396 |
top_margin => $top_margin, |
397 |
left_margin => $left_margin, |
364 |
} |
398 |
} |
365 |
)->store; |
399 |
)->store; |
366 |
logaction( 'NOTICES', 'CREATE', $letter->id, $letter->content, |
400 |
logaction( 'NOTICES', 'CREATE', $letter->id, $letter->content, |
367 |
- |
|
|