| 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 |  | 52 | use C4::Creators qw( | 
            
              |  |  | 53 |     get_text_justification_types | 
            
              | 54 |     get_unit_values | 
            
              | 55 | ); | 
        
          | 53 | use Koha::Notice::Templates; | 56 | use Koha::Notice::Templates; | 
        
          | 54 | use Koha::Patron::Attribute::Types; | 57 | use Koha::Patron::Attribute::Types; | 
        
          | 55 |  | 58 |  | 
  
    | Lines 228-233
          sub add_form {
      
      
        Link Here | 
        
          | 228 |                 content    => $letter->{content} // '', | 231 |                 content    => $letter->{content} // '', | 
        
          | 229 |                 tt_error   => $letter->{tt_error}, | 232 |                 tt_error   => $letter->{tt_error}, | 
        
          | 230 |             }; | 233 |             }; | 
            
              |  |  | 234 |             $letters{ $lang }{params} = $letter; | 
        
          | 231 |         } | 235 |         } | 
        
          | 232 |     } | 236 |     } | 
        
          | 233 |     else { | 237 |     else { | 
  
    | Lines 299-304
          sub add_form {
      
      
        Link Here | 
        
          | 299 |         SQLfieldnames => $field_selection, | 303 |         SQLfieldnames => $field_selection, | 
        
          | 300 |         branchcode => $branchcode, | 304 |         branchcode => $branchcode, | 
        
          | 301 |         preview_is_available => $preview_is_available, | 305 |         preview_is_available => $preview_is_available, | 
            
              |  |  | 306 |         text_justification_types => get_text_justification_types(), | 
            
              | 307 |         units => get_unit_values(), | 
        
          | 302 |     ); | 308 |     ); | 
        
          | 303 |     return; | 309 |     return; | 
        
          | 304 | } | 310 | } | 
  
    | Lines 310-321
          sub add_validate {
      
      
        Link Here | 
        
          | 310 |     my $oldmodule     = $input->param('oldmodule'); | 316 |     my $oldmodule     = $input->param('oldmodule'); | 
        
          | 311 |     my $code          = $input->param('code'); | 317 |     my $code          = $input->param('code'); | 
        
          | 312 |     my $name          = $input->param('name'); | 318 |     my $name          = $input->param('name'); | 
            
              |  |  | 319 |     my $text_justify  = $input->param('text_justify'); | 
            
              | 320 |     my $font_size     = $input->param('font_size'); | 
            
              | 321 |     my $units         = $input->param('units'); | 
            
              | 322 |     my $notice_width  = $input->param('notice_width'); | 
            
              | 323 |     my $top_margin    = $input->param('top_margin'); | 
            
              | 324 |     my $left_margin   = $input->param('left_margin'); | 
            
              | 325 |     my $format_all    = $input->param('format_all'); | 
        
          | 313 |     my @mtt           = $input->multi_param('message_transport_type'); | 326 |     my @mtt           = $input->multi_param('message_transport_type'); | 
        
          | 314 |     my @title         = $input->multi_param('title'); | 327 |     my @title         = $input->multi_param('title'); | 
        
          | 315 |     my @content       = $input->multi_param('content'); | 328 |     my @content       = $input->multi_param('content'); | 
        
          | 316 |     my @lang          = $input->multi_param('lang'); | 329 |     my @lang          = $input->multi_param('lang'); | 
        
          | 317 |     for my $mtt ( @mtt ) { | 330 |     for my $mtt ( @mtt ) { | 
        
          | 318 |         my $lang = shift @lang; | 331 |         my $lang = shift @lang; | 
            
              |  |  | 332 |         if ( $format_all ) { | 
            
              | 333 |             my @letters = Koha::Notice::Templates->search({ lang => $lang })->as_list; | 
            
              | 334 |             foreach my $letter ( @letters ) { | 
            
              | 335 |                 $letter->set( | 
            
              | 336 |                     { | 
            
              | 337 |                         text_justify  => $text_justify, | 
            
              | 338 |                         font_size  => $font_size, | 
            
              | 339 |                         units      => $units, | 
            
              | 340 |                         notice_width  => $notice_width, | 
            
              | 341 |                         top_margin    => $top_margin, | 
            
              | 342 |                         left_margin   => $left_margin, | 
            
              | 343 |                     } | 
            
              | 344 |                 )->store; | 
            
              | 345 |             } | 
            
              | 346 |         } | 
        
          | 319 |         my $is_html = $input->param("is_html_$mtt\_$lang"); | 347 |         my $is_html = $input->param("is_html_$mtt\_$lang"); | 
        
          | 320 |         my $title   = shift @title; | 348 |         my $title   = shift @title; | 
        
          | 321 |         my $content = shift @content; | 349 |         my $content = shift @content; | 
  
    | Lines 348-354
          sub add_validate {
      
      
        Link Here | 
        
          | 348 |                     is_html    => $is_html || 0, | 376 |                     is_html    => $is_html || 0, | 
        
          | 349 |                     title      => $title, | 377 |                     title      => $title, | 
        
          | 350 |                     content    => $content, | 378 |                     content    => $content, | 
          
            
              | 351 |                     lang       => $lang | 379 |                     lang       => $lang, | 
            
              |  |  | 380 |                     text_justify  => $text_justify, | 
            
              | 381 |                     font_size  => $font_size, | 
            
              | 382 |                     units      => $units, | 
            
              | 383 |                     notice_width  => $notice_width, | 
            
              | 384 |                     top_margin    => $top_margin, | 
            
              | 385 |                     left_margin   => $left_margin, | 
        
          | 352 |                 } | 386 |                 } | 
        
          | 353 |             )->store; | 387 |             )->store; | 
        
          | 354 |  | 388 |  | 
  
    | Lines 363-369
          sub add_validate {
      
      
        Link Here | 
        
          | 363 |                     title                  => $title, | 397 |                     title                  => $title, | 
        
          | 364 |                     content                => $content, | 398 |                     content                => $content, | 
        
          | 365 |                     message_transport_type => $mtt, | 399 |                     message_transport_type => $mtt, | 
          
            
              | 366 |                     lang                   => $lang | 400 |                     lang                   => $lang, | 
            
              |  |  | 401 |                     text_justify  => $text_justify, | 
            
              | 402 |                     font_size  => $font_size, | 
            
              | 403 |                     units      => $units, | 
            
              | 404 |                     notice_width  => $notice_width, | 
            
              | 405 |                     top_margin    => $top_margin, | 
            
              | 406 |                     left_margin   => $left_margin, | 
        
          | 367 |                 } | 407 |                 } | 
        
          | 368 |             )->store; | 408 |             )->store; | 
        
          | 369 |             logaction( 'NOTICES', 'CREATE', $letter->id, $letter->content, | 409 |             logaction( 'NOTICES', 'CREATE', $letter->id, $letter->content, | 
            
              | 370 | -  |  |  |