From: Moritz Bunkus
Date: Tue, 4 Nov 2014 10:26:28 +0000 (+0100)
Subject: Pflichtenhefte: vordef Textblöcke auch bei Abschnitten verwenden können
X-Git-Tag: release-3.2.0beta~268
X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c88705d8a32b5f1fabb0d14239fa486ed683a403;p=kivitendo-erp.git
Pflichtenhefte: vordef Textblöcke auch bei Abschnitten verwenden können
---
diff --git a/SL/Controller/RequirementSpecItem.pm b/SL/Controller/RequirementSpecItem.pm
index 44a260219..c8119be35 100644
--- a/SL/Controller/RequirementSpecItem.pm
+++ b/SL/Controller/RequirementSpecItem.pm
@@ -14,6 +14,7 @@ use SL::Controller::Helper::RequirementSpec;
use SL::DB::RequirementSpec;
use SL::DB::RequirementSpecComplexity;
use SL::DB::RequirementSpecItem;
+use SL::DB::RequirementSpecPredefinedText;
use SL::DB::RequirementSpecRisk;
use SL::Helper::Flash;
use SL::JSON;
@@ -22,7 +23,7 @@ use SL::Locale::String;
use Rose::Object::MakeMethods::Generic
(
scalar => [ qw(item visible_item visible_section clicked_item sections) ],
- 'scalar --get_set_init' => [ qw(complexities risks js) ],
+ 'scalar --get_set_init' => [ qw(complexities risks js predefined_texts) ],
);
__PACKAGE__->run_before('check_auth');
@@ -528,6 +529,10 @@ sub init_risks {
return SL::DB::Manager::RequirementSpecRisk->get_all_sorted;
}
+sub init_predefined_texts {
+ return SL::DB::Manager::RequirementSpecPredefinedText->get_all_sorted(where => [ useable_for_sections => 1 ]);
+}
+
sub init_js {
my ($self) = @_;
$self->js(SL::ClientJS->new);
diff --git a/templates/webpages/requirement_spec_item/_section_form.html b/templates/webpages/requirement_spec_item/_section_form.html
index 9f65c9aea..93d75bed8 100644
--- a/templates/webpages/requirement_spec_item/_section_form.html
+++ b/templates/webpages/requirement_spec_item/_section_form.html
@@ -25,6 +25,14 @@
[% L.input_tag(id_base _ '.title', SELF.item.title, style=style) %]
+ [%- IF SELF.predefined_texts.size %]
+
+ [%- LxERP.t8("Pre-defined Texts") %]:
+ [%- L.select_tag(id_base _ '_predefined_text_block', SELF.predefined_texts, title_key='description', style=style) %]
+ [%- LxERP.t8("Insert") %]
+
+ [%- END %]
+
[%- LxERP.t8("Description") %]:
[% 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') %]
@@ -34,4 +42,12 @@
[% L.ajax_submit_tag('controller.pl?action=RequirementSpecItem/ajax_' _ (SELF.item.id ? 'update' : 'create'), '#' _ id_base _ '_form', LxERP.t8('Save')) %]
[%- LxERP.t8("Cancel") %]
+
+[%- IF SELF.predefined_texts.size %]
+
+[%- END %]
diff --git a/templates/webpages/requirement_spec_text_block/_form.html b/templates/webpages/requirement_spec_text_block/_form.html
index 897647880..545ba19ee 100644
--- a/templates/webpages/requirement_spec_text_block/_form.html
+++ b/templates/webpages/requirement_spec_text_block/_form.html
@@ -1,4 +1,4 @@
-[%- USE LxERP -%][%- USE L -%][%- USE HTML -%][%- USE JavaScript -%][% SET style="width: 500px" %]
+[%- USE LxERP -%][%- USE L -%][%- USE HTML -%][% SET style="width: 500px" %]
[% DEFAULT id_base = 'edit_text_block_' _ SELF.text_block.id %]