->hide('#column-content > *')
->appendTo($html, '#column-content')
->focus('#new_section_title')
+ ->reinit_widgets
->render($self);
}
->remove("#edit_section_form")
->insertAfter($html, '#section-header-' . $self->item->id)
->jstree->select_node('#tree', '#fb-' . $self->item->id)
- ->focus("#edit_section_title")
->val('#current_content_type', 'section')
->val('#current_content_id', $self->item->id)
+ ->reinit_widgets
+ ->focus("#edit_section_title")
->render($self);
return;
}
->insertAfter($html, $content_top_id)
->run('kivi.requirement_spec.init_function_block_keypress_events', "${id_base}_form")
->jstree->select_node('#tree', '#fb-' . $self->item->id)
- ->focus("#${id_base}_description")
->val('#current_content_type', $self->item->item_type)
->val('#current_content_id', $self->item->id)
+ ->reinit_widgets
+ ->focus("#${id_base}_description")
->render($self);
}
sub create_dependency_item {
my $self = shift;
- [ $_[0]->id, $self->presenter->truncate(join(' ', grep { $_ } ($_[1], $_[0]->fb_number, $_[0]->description))) ];
+ [ $_[0]->id, $self->presenter->truncate(join(' ', grep { $_ } ($_[1], $_[0]->fb_number, $_[0]->description_as_stripped_html))) ];
}
sub create_dependencies {
->action($params{insert_position}, $html, $params{display_reference})
->action_if($self->item->item_type eq 'sub-function-block', 'show', '#sub-function-block-container-' . $self->item->parent_id)
->run('kivi.requirement_spec.init_function_block_keypress_events', "${id_base}_form")
+ ->reinit_widgets
->focus("#${id_base}_description");
}
use SL::DB::Manager::RequirementSpecItem;
use SL::DB::Helper::ActsAsList;
use SL::DB::Helper::AttrDuration;
+use SL::DB::Helper::AttrHTML;
use SL::DB::Default;
use SL::Locale::String;
use SL::PrefixedNumber;
__PACKAGE__->configure_acts_as_list(group_by => [qw(requirement_spec_id parent_id)]);
__PACKAGE__->attr_duration(qw(time_estimation));
+__PACKAGE__->attr_html('description');
__PACKAGE__->before_save(\&_before_save_create_fb_number);
__PACKAGE__->before_save(\&_before_save_invalidate_requirement_spec_version);
sub content_excerpt {
my ($self) = @_;
- return Common::truncate($self->description // '', at => 200);
+ return Common::truncate($self->description_as_stripped_html // '', at => 200);
}
sub requirement_spec_item_tree_node_title {
my ($self, $item) = @_;
- return join(' ', map { $_ || '' } ($item->fb_number, $self->truncate($item->parent_id ? $item->description : $item->title, at => 30)));
+ return join(' ', map { $_ || '' } ($item->fb_number, $self->truncate($item->parent_id ? $item->description_as_stripped_html : $item->title, at => 30)));
}
sub requirement_spec_item_jstree_data {
[% L.hidden_tag("requirement_spec_items[+].id", item.id, id = id_prefix _ '_item_id') %]
<td style="padding-left: [%- level * 50 -%]px">
- [%- P.simple_format(item.fb_number _ ": " _ item.description) -%]
+ [%- item.fb_number _ ": " _ item.description_as_restricted_html -%]
</td>
<td>
[%- L.select_tag('requirement_spec_items[].complexity_id', SELF.complexities, id=id_prefix _ '_complexity_id_' _ item.id, title_key='description', default=item.complexity_id, style="width: 100%") %]<br>
[%- USE HTML -%][%- USE LxERP -%][%- USE P -%]
<tr class="listrow">
<td style="padding-left: [%- level * 50 -%]px">
- [%- P.simple_format(item.fb_number _ ": " _ item.description) -%]
+ [%- item.fb_number _ ": " _ item.description_as_restricted_html -%]
</td>
<td>[%- HTML.escape(item.complexity.description) -%]</td>
<td>[%- HTML.escape(item.risk.description) -%]</td>
[%- USE HTML -%][%- USE L -%]<div id="[% id_prefix %]function-block-content-top-[% requirement_spec_item.id %]">
<div class="function-block-number">[%- HTML.escape(requirement_spec_item.fb_number) -%]</div>
- [%- L.simple_format(requirement_spec_item.description) -%]
+ [%- requirement_spec_item.description_as_restricted_html -%]
</div>
[%- ELSE -%]
[%- LxERP.t8("Add sub function block") %]
[%- END -%]:<br>
- [% L.textarea_tag(id_base _ '.description', SELF.item.description, rows=8, style="width: 100%") %]
+ [% L.textarea_tag(id_base _ '.description_as_restricted_html', SELF.item.description_as_restricted_html, id=id_base _ '_description', rows=8, style="width: 100%", class='texteditor') %]
</div>
<div style="margin-top: 10px">
<p>
[%- LxERP.t8("Description") %]:<br>
- [% L.textarea_tag(id_base _ '.description', SELF.item.description, rows=8, cols=80, style=style) %]
+ [% L.textarea_tag(id_base _ '.description_as_restricted_html', SELF.item.description_as_restricted_html, id=id_base _ '_description', rows=8, cols=80, style=style, class='texteditor') %]
</p>
<p>
<div class="section-description" id="section-description">
<div class="section-description-heading">[%- LxERP.t8("Preamble") %]</div>
[% IF requirement_spec_item.description %]
- [%- L.simple_format(requirement_spec_item.description) -%]
+ [%- requirement_spec_item.description_as_restricted_html -%]
[%- ELSE %]
<span class="dimmed-text">[%- LxERP.t8("No text has been entered yet.") %]</span>
[%- END %]
[% L.hidden_tag("sections[+].id", section.id, no_id=1) %]
<td>[% HTML.escape(section.fb_number) %]</td>
<td>[% HTML.escape(section.title) %]</td>
- <td>[% HTML.escape(P.truncate(section.description)) %]</td>
+ <td>[% HTML.escape(P.truncate(section.description_as_stripped_html)) %]</td>
<td>[% P.part_picker('sections[].order_part_id', section.order_part_id, convertible_unit=SELF.h_unit_name, id='quotations_and_orders_sections_order_pard_id_' _ loop.count, style=style) %]</td>
</tr>
[% END %]
<tr class="listrow">
<td>[% HTML.escape(section.fb_number) %]</td>
<td>[% HTML.escape(section.title) %]</td>
- <td>[% HTML.escape(P.truncate(section.description)) %]</td>
+ <td>[% HTML.escape(P.truncate(section.description_as_stripped_html)) %]</td>
<td>
[% IF section.order_part %]
[% HTML.escape(section.order_part.partnumber) %] [% HTML.escape(section.order_part.description) %]
<tr class="listrow">
[% L.hidden_tag("orderitems[+].id", item.item.id, no_id=1) %]
<td>[% HTML.escape(item.item.part.partnumber) %]</td>
- <td>[% HTML.escape(item.item.description) %]</td>
+ <td>[% HTML.escape(item.item.description_as_stripped_html) %]</td>
<td align="right">[% LxERP.format_amount(item.item.qty * 1) %] [% HTML.escape(item.item.unit) %]</td>
<td align="right">[% LxERP.format_amount(item.item.qty * 1) %] [% HTML.escape(item.item.unit) %]</td>
<td>[% L.select_tag('orderitems[].section_id', sections, default=item.section.id, title_sub=\make_section_title, style=style, no_id=1, with_empty=1, empty_title=LxERP.t8('Do not modify this position')) %]</td>