template => $template_file,
variables => $::form,
return => 'file_name',
+ variable_content_types => {
+ body => 'html',
+ },
);
my $pdf_file_name;
sub _display {
my ($self, %params) = @_;
+ $::request->{layout}->use_javascript("${_}.js") for qw(ckeditor/ckeditor ckeditor/adapters/jquery);
+
my $letter = $self->letter;
$params{title} ||= t8('Edit Letter');
-# This file has been auto-generated only because it didn't exist.
-# Feel free to modify it at will; it will not be overwritten automatically.
-
package SL::DB::Letter;
use strict;
+use SL::DB::Helper::AttrHTML;
use SL::DB::MetaSetup::Letter;
use SL::DB::Manager::Letter;
__PACKAGE__->meta->initialize;
+__PACKAGE__->attr_html('body');
+
sub new_from_draft {
my ($class, $draft) = @_;
-# This file has been auto-generated only because it didn't exist.
-# Feel free to modify it at will; it will not be overwritten automatically.
-
package SL::DB::LetterDraft;
use strict;
+use SL::DB::Helper::AttrHTML;
use SL::DB::MetaSetup::LetterDraft;
__PACKAGE__->meta->initialize;
+__PACKAGE__->attr_html('body');
+
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
__PACKAGE__->meta->make_manager_class;
--- /dev/null
+# @tag: use_html_in_letter
+# @description: Briefe: HTML für Body nutzen können
+# @depends: letter letter_draft
+package SL::DBUpgrade2::use_html_in_letter;
+
+use strict;
+use utf8;
+
+use SL::DBUtils;
+
+use parent qw(SL::DBUpgrade2::Base);
+
+sub run {
+ my ($self) = @_;
+
+ $self->convert_column_to_html($_, 'body') for qw(letter letter_draft);
+
+ return 1;
+}
+
+1;
<tr>
<tr>
<th align=right>[% 'Body' | $T8 %]</th>
- <td><textarea name='letter.body' style='width:100%' rows=20>[% letter.body | html %]</textarea></td>
+ <td>[% L.textarea_tag('letter.body_as_restricted_html', letter.body_as_restricted_html, style='width:100%', rows=20, class="texteditor") %]</td>
</tr>
<tr height=10></tr>
<th align=right>[% 'Internal Notes' | $T8 %]</th>