Revision 442b26e2
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/Controller/RequirementSpecItem.pm | ||
---|---|---|
7 | 7 |
use Time::HiRes (); |
8 | 8 |
|
9 | 9 |
use SL::DB::RequirementSpec; |
10 |
use SL::DB::RequirementSpecComplexity; |
|
10 | 11 |
use SL::DB::RequirementSpecItem; |
12 |
use SL::DB::RequirementSpecRisk; |
|
11 | 13 |
use SL::Helper::Flash; |
12 | 14 |
use SL::JSON; |
13 | 15 |
use SL::Locale::String; |
14 | 16 |
|
15 | 17 |
use Rose::Object::MakeMethods::Generic |
16 | 18 |
( |
17 |
scalar => [ qw(requirement_spec item visible_item visible_section) ], |
|
19 |
scalar => [ qw(requirement_spec item visible_item visible_section) ], |
|
20 |
'scalar --get_set_init' => [ qw(complexities risks) ], |
|
18 | 21 |
); |
19 | 22 |
|
20 | 23 |
# __PACKAGE__->run_before('load_requirement_spec'); |
21 |
__PACKAGE__->run_before('load_requirement_spec_item', only => [qw(dragged_and_dropped edit_section update_section)]);
|
|
24 |
__PACKAGE__->run_before('load_requirement_spec_item', only => [qw(dragged_and_dropped ajax_update ajax_edit)]);
|
|
22 | 25 |
|
23 | 26 |
# |
24 | 27 |
# actions |
... | ... | |
47 | 50 |
$self->render($js); |
48 | 51 |
} |
49 | 52 |
|
50 |
sub action_new { |
|
51 |
my ($self) = @_; |
|
52 |
|
|
53 |
eval { |
|
54 |
my $type = ($::form->{item_type} || '') =~ m/^ (?: section | (?: sub-)? function-block ) $/x ? $::form->{item_type} : die "Invalid item_type"; |
|
55 |
$self->{item} = SL::DB::RequirementSpecItem->new(requirement_spec_id => $::form->{requirement_spec_id}); |
|
56 |
my $section_form = $self->presenter->render("requirement_spec_item/_${type}_form", id => create_random_id(), title => t8('Create a new section')); |
|
57 |
|
|
58 |
$self->render(\to_json({ status => 'ok', html => $section_form }), { type => 'json' }); |
|
59 |
1; |
|
60 |
} or do { |
|
61 |
$self->render(\to_json({ status => 'failed', error => "Exception:\n" . format_exception() }), { type => 'json' }); |
|
62 |
} |
|
63 |
} |
|
64 |
|
|
65 |
sub action_create { |
|
66 |
my ($self) = @_; |
|
67 |
|
|
68 |
my $type = ($::form->{item_type} || '') =~ m/^ (?: section | (?: sub-)? function-block ) $/x ? $::form->{item_type} : die "Invalid item_type"; |
|
69 |
|
|
70 |
$self->render(\to_json({ status => 'failed', error => 'not good, not good' }), { type => 'json' }); |
|
71 |
} |
|
72 |
|
|
73 | 53 |
sub action_dragged_and_dropped { |
74 | 54 |
my ($self) = @_; |
75 | 55 |
|
76 |
$::lxdebug->dump(0, "form", $::form); |
|
77 |
|
|
78 | 56 |
my $dropped_item = SL::DB::RequirementSpecItem->new(id => $::form->{dropped_id})->load || die "No such dropped item"; |
79 | 57 |
my $position = $::form->{position} =~ m/^ (?: before | after | last ) $/x ? $::form->{position} : die "Unknown 'position' parameter"; |
80 | 58 |
|
... | ... | |
87 | 65 |
$self->render(\'', { type => 'json' }); |
88 | 66 |
} |
89 | 67 |
|
90 |
sub action_edit_section {
|
|
68 |
sub action_ajax_edit {
|
|
91 | 69 |
my ($self, %params) = @_; |
92 |
$self->render('requirement_spec_item/_section_form', { layout => 0 }); |
|
70 |
|
|
71 |
$::lxdebug->dump(0, "form", $::form); |
|
72 |
|
|
73 |
$self->init_visible_section($::form->{current_content_id}, $::form->{current_content_type}); |
|
74 |
$self->item(SL::DB::RequirementSpecItem->new(id => $::form->{id})->load); |
|
75 |
|
|
76 |
my $js = SL::ClientJS->new; |
|
77 |
|
|
78 |
die "TODO: edit section" if $self->item->get_type =~ m/section/; |
|
79 |
|
|
80 |
if (!$self->visible_section || ($self->visible_section->id != $self->item->get_section->id)) { |
|
81 |
my $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $self->item); |
|
82 |
$js->html('#column-content', $html); |
|
83 |
} |
|
84 |
|
|
85 |
if ($self->item->get_type =~ m/function-block/) { |
|
86 |
my $create_item = sub { |
|
87 |
[ $_[0]->id, $self->presenter->truncate(join(' ', grep { $_ } ($_[1], $_[0]->fb_number, $_[0]->description))) ] |
|
88 |
}; |
|
89 |
my @dependencies = |
|
90 |
map { [ $_->fb_number . ' ' . $_->title, |
|
91 |
[ map { ( $create_item->($_), |
|
92 |
map { $create_item->($_, '->') } @{ $_->sorted_children }) |
|
93 |
} @{ $_->sorted_children } ] ] |
|
94 |
} @{ $self->item->requirement_spec->sections }; |
|
95 |
|
|
96 |
my @selected_dependencies = map { $_->id } @{ $self->item->dependencies }; |
|
97 |
|
|
98 |
my $html = $self->render('requirement_spec_item/_function_block_form', { output => 0 }, DEPENDENCIES => \@dependencies, SELECTED_DEPENDENCIES => \@selected_dependencies); |
|
99 |
my $id_base = $self->item->get_type . '-' . $self->item->id; |
|
100 |
my $content_top_id = '#' . $self->item->get_type . '-content-top-' . $self->item->id; |
|
101 |
|
|
102 |
$js->hide($content_top_id) |
|
103 |
->remove("#edit_${id_base}_form") |
|
104 |
->insertAfter($html, $content_top_id) |
|
105 |
->jstree->select_node('#tree', '#fb-' . $self->item->id) |
|
106 |
->focus("#edit_${id_base}_description") |
|
107 |
->val('#current_content_type', $self->item->get_type) |
|
108 |
->val('#current_content_id', $self->item->id) |
|
109 |
->render($self); |
|
110 |
} |
|
93 | 111 |
} |
94 | 112 |
|
95 |
sub action_update_section {
|
|
113 |
sub action_ajax_update {
|
|
96 | 114 |
my ($self, %params) = @_; |
97 | 115 |
|
98 |
$self->item->update_attributes(title => $::form->{title}, description => $::form->{description}); |
|
116 |
my $js = SL::ClientJS->new; |
|
117 |
my $prefix = $::form->{form_prefix} || 'text_block'; |
|
118 |
my $attributes = $::form->{$prefix} || {}; |
|
119 |
|
|
120 |
foreach (qw(requirement_spec_id parent_id position)) { |
|
121 |
delete $attributes->{$_} if !defined $attributes->{$_}; |
|
122 |
} |
|
123 |
|
|
124 |
my @errors = $self->item->assign_attributes(%{ $attributes })->validate; |
|
125 |
return $js->error(@errors)->render($self) if @errors; |
|
126 |
|
|
127 |
$self->item->save; |
|
99 | 128 |
|
100 |
my $result = { |
|
101 |
id => $self->item->id, |
|
102 |
header_html => $self->render('requirement_spec_item/_section_header', { layout => 0, output => 0 }, requirement_spec_item => $self->item), |
|
103 |
node_name => join(' ', map { $_ || '' } ($self->item->fb_number, $self->item->title)), |
|
104 |
}; |
|
105 |
$self->render(\to_json($result), { type => 'json' }); |
|
129 |
my $id_prefix = $self->item->get_type eq 'function-block' ? '' : 'sub-'; |
|
130 |
my $html_top = $self->render('requirement_spec_item/_function_block_content_top', { output => 0 }, requirement_spec_item => $self->item, id_prefix => $id_prefix); |
|
131 |
my $html_bottom = $self->render('requirement_spec_item/_function_block_content_bottom', { output => 0 }, requirement_spec_item => $self->item, id_prefix => $id_prefix); |
|
132 |
$id_prefix .= 'function-block-content-'; |
|
133 |
|
|
134 |
SL::ClientJS->new |
|
135 |
->remove('#' . $prefix . '_form') |
|
136 |
->replaceWith('#' . $id_prefix . 'top-' . $self->item->id, $html_top) |
|
137 |
->replaceWith('#' . $id_prefix . 'bottom-' . $self->item->id, $html_bottom) |
|
138 |
->jstree->rename_node('#tree', '#fb-' . $self->item->id, $::request->presenter->requirement_spec_item_tree_node_title($self->item)) |
|
139 |
->render($self); |
|
106 | 140 |
} |
107 | 141 |
|
108 | 142 |
# |
... | ... | |
141 | 175 |
return $self->visible_section($self->visible_item->get_section); |
142 | 176 |
} |
143 | 177 |
|
178 |
sub init_complexities { |
|
179 |
my ($self) = @_; |
|
180 |
|
|
181 |
return SL::DB::Manager::RequirementSpecComplexity->get_all_sorted; |
|
182 |
} |
|
183 |
|
|
184 |
sub init_risks { |
|
185 |
my ($self) = @_; |
|
186 |
|
|
187 |
return SL::DB::Manager::RequirementSpecRisk->get_all_sorted; |
|
188 |
} |
|
189 |
|
|
144 | 190 |
1; |
SL/DB/RequirementSpecItem.pm | ||
---|---|---|
43 | 43 |
1; |
44 | 44 |
} |
45 | 45 |
|
46 |
sub validate { |
|
47 |
my ($self) = @_; |
|
48 |
|
|
49 |
my @errors; |
|
50 |
push @errors, t8('The title is missing.') if !$self->parent_id && !$self->title; |
|
51 |
|
|
52 |
return @errors; |
|
53 |
} |
|
54 |
|
|
46 | 55 |
sub sorted_children { |
47 | 56 |
my ($self) = @_; |
48 | 57 |
|
SL/Presenter/RequirementSpecItem.pm | ||
---|---|---|
5 | 5 |
use parent qw(Exporter); |
6 | 6 |
|
7 | 7 |
use Exporter qw(import); |
8 |
our @EXPORT = qw(requirement_spec_item_jstree_data requirement_spec_item_dependency_list); |
|
8 |
our @EXPORT = qw(requirement_spec_item_tree_node_title requirement_spec_item_jstree_data requirement_spec_item_dependency_list);
|
|
9 | 9 |
|
10 | 10 |
use Carp; |
11 | 11 |
|
12 |
sub requirement_spec_item_tree_node_title { |
|
13 |
my ($self, $item) = @_; |
|
14 |
|
|
15 |
return join(' ', map { $_ || '' } ($item->fb_number, $self->truncate($item->parent_id ? $item->description : $item->title, at => 30), '<' . $item->id . '>')); |
|
16 |
} |
|
17 |
|
|
12 | 18 |
sub requirement_spec_item_jstree_data { |
13 | 19 |
my ($self, $item, %params) = @_; |
14 | 20 |
|
... | ... | |
16 | 22 |
my $type = !$item->parent_id ? 'section' : 'function-block'; |
17 | 23 |
|
18 | 24 |
return { |
19 |
data => join(' ', map { $_ || '' } ($item->fb_number, $item->title, '<' . $item->id . '>')),
|
|
25 |
data => $self->requirement_spec_item_tree_node_title($item),
|
|
20 | 26 |
metadata => { id => $item->id, type => $type }, |
21 | 27 |
attr => { id => "fb-" . $item->id, href => $params{href} || '#', class => $type . '-context-menu' }, |
22 | 28 |
children => \@children, |
css/requirement_spec.css | ||
---|---|---|
56 | 56 |
color: #fff; |
57 | 57 |
background: #ccc; |
58 | 58 |
} |
59 |
|
|
60 |
.function-block-form { |
|
61 |
background: rgb(235, 235, 235); |
|
62 |
border: 1px solid rgb(0, 100, 0); |
|
63 |
} |
|
64 |
|
|
65 |
.function-block-form > div { |
|
66 |
padding: 5px; |
|
67 |
} |
js/requirement_spec.js | ||
---|---|---|
191 | 191 |
|
192 | 192 |
function standard_item_ajax_call(key, opt, other_data) { |
193 | 193 |
var data = { |
194 |
action: "RequirementSpecTextBlock/ajax_" + key,
|
|
194 |
action: "RequirementSpecItem/ajax_" + key,
|
|
195 | 195 |
requirement_spec_id: $('#requirement_spec_id').val(), |
196 | 196 |
id: find_item_id(opt.$trigger), |
197 | 197 |
current_content_type: $('#current_content_type').val(), |
198 | 198 |
current_content_id: $('#current_content_id').val() |
199 | 199 |
}; |
200 | 200 |
|
201 |
console.log("I would normally POST the following now:"); |
|
202 |
console.log(data); |
|
203 |
// $.post("controller.pl", $.extend(data, other_data || {}), eval_json_result);
|
|
201 |
// console.log("I would normally POST the following now:");
|
|
202 |
// console.log(data);
|
|
203 |
$.post("controller.pl", $.extend(data, other_data || {}), eval_json_result); |
|
204 | 204 |
|
205 | 205 |
return true; |
206 | 206 |
} |
207 | 207 |
|
208 | 208 |
function disable_edit_item_commands(key, opt) { |
209 |
return false; // find_item_id(opt.$trigger) == undefined; |
|
209 |
return find_item_id(opt.$trigger) == undefined; |
|
210 |
} |
|
211 |
|
|
212 |
function submit_edit_item_form(id_base) { |
|
213 |
var id = $('#' + id_base + '_id').val(); |
|
214 |
var url = "controller.pl?" + $('#' + id_base + '_form').serialize(); |
|
215 |
var data = { |
|
216 |
action: 'RequirementSpecItem/ajax_' + (id ? 'update' : 'create'), |
|
217 |
id: id, |
|
218 |
form_prefix: id_base |
|
219 |
}; |
|
220 |
$.post(url, data, eval_json_result); |
|
221 |
return true; |
|
222 |
} |
|
223 |
|
|
224 |
function cancel_edit_item_form(form_id_base, hidden_id_base) { |
|
225 |
var id = $('#' + form_id_base + '_id').val(); |
|
226 |
$('#' + form_id_base + '_form').remove(); |
|
227 |
if (id) |
|
228 |
$('#' + hidden_id_base + '-' + id).show(); |
|
210 | 229 |
} |
locale/de/all | ||
---|---|---|
746 | 746 |
'Description (translation for #1)' => 'Beschreibung (Übersetzung für #1)', |
747 | 747 |
'Description missing!' => 'Beschreibung fehlt.', |
748 | 748 |
'Description must not be empty!' => 'Beschreibung darf nicht leer sein', |
749 |
'Description of #1' => 'Beschreibung von #1', |
|
749 | 750 |
'Destination BIC' => 'Ziel-BIC', |
750 | 751 |
'Destination IBAN' => 'Ziel-IBAN', |
751 | 752 |
'Destination bin' => 'Ziellagerplatz', |
... | ... | |
891 | 892 |
'Edit requirement spec status' => 'Pflichtenheftstatus bearbeiten', |
892 | 893 |
'Edit requirement spec type' => 'Pflichtenhefttypen bearbeiten', |
893 | 894 |
'Edit risk level' => 'Risikograd bearbeiten', |
894 |
'Edit section #1' => 'Abschnitt #1 bearbeiten', |
|
895 | 895 |
'Edit templates' => 'Vorlagen bearbeiten', |
896 | 896 |
'Edit text block' => 'Textblock bearbeiten', |
897 | 897 |
'Edit text block \'#1\'' => 'Textblock \'#1\' bearbeiten', |
... | ... | |
906 | 906 |
'Edit units' => 'Einheiten bearbeiten', |
907 | 907 |
'Edit user signature' => 'Benutzersignatur bearbeiten', |
908 | 908 |
'Editable' => 'Bearbeitbar', |
909 |
'Effort' => 'Aufwand', |
|
910 | 909 |
'Either there are no open invoices, or you have already initiated bank transfers with the open amounts for those that are still open.' => 'Entweder gibt es keine offenen Rechnungen, oder es wurden bereits Überweisungen über die offenen Beträge aller offenen Rechnungen erstellt.', |
911 | 910 |
'Element disabled' => 'Element deaktiviert', |
912 | 911 |
'Employee' => 'Bearbeiter', |
... | ... | |
1457 | 1456 |
'No requirement spec statuses has been created yet.' => 'Es wurden noch keine Pflichtenheftstatus angelegt.', |
1458 | 1457 |
'No requirement spec type has been created yet.' => 'Es wurden noch keine Pflichtenhefttypen angelegt.', |
1459 | 1458 |
'No risks level has been created yet.' => 'Es wurden noch keine Risikograde angelegt.', |
1460 |
'No sections have been created so far.' => '', |
|
1459 |
'No sections have been created so far.' => 'Bisher wurden noch keine Abschnitte angelegt.',
|
|
1461 | 1460 |
'No shipto selected to delete' => 'Keine Lieferadresse zum Löschen ausgewählt', |
1462 | 1461 |
'No summary account' => 'Kein Sammelkonto', |
1463 | 1462 |
'No text blocks have been created for this position.' => 'Für diese Position wurden noch keine Textblöcke angelegt.', |
... | ... | |
2452 | 2451 |
'Three Options:' => 'Drei Optionen:', |
2453 | 2452 |
'Time Format' => 'Uhrzeitformat', |
2454 | 2453 |
'Time Tracking' => 'Zeiterfassung', |
2454 |
'Time estimate' => 'Zeitschätzung', |
|
2455 | 2455 |
'Time period for the analysis:' => 'Analysezeitraum:', |
2456 | 2456 |
'Timestamp' => 'Uhrzeit', |
2457 | 2457 |
'Title' => 'Titel', |
templates/webpages/requirement_spec/show.html | ||
---|---|---|
34 | 34 |
|
35 | 35 |
<script type="text/javascript"> |
36 | 36 |
<!-- |
37 |
var tree_data = [ |
|
38 |
{ data: [% JSON.json(LxERP.t8("Text blocks front")) %], |
|
39 |
metadata: { type: "text-blocks-front" }, |
|
40 |
attr: { id: "tb-front", class: "text-block-context-menu" }, |
|
41 |
children: [ |
|
37 |
$(function() { |
|
38 |
var tree_data = [ |
|
39 |
{ data: [% JSON.json(LxERP.t8("Text blocks front")) %], |
|
40 |
metadata: { type: "text-blocks-front" }, |
|
41 |
attr: { id: "tb-front", class: "text-block-context-menu" }, |
|
42 |
children: [ |
|
42 | 43 |
[% FOREACH tb = SELF.requirement_spec.text_blocks_for_position(0) %] |
43 | 44 |
[% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %] |
44 | 45 |
[% END %] |
45 |
] |
|
46 |
}, |
|
47 |
|
|
48 |
{ data: [% JSON.json(LxERP.t8("Sections")) %], |
|
49 |
metadata: { type: "sections" }, |
|
50 |
attr: { id: "sections", class: "section-context-menu" }, |
|
51 |
children: [ |
|
46 |
]}, |
|
52 | 47 |
|
48 |
{ data: [% JSON.json(LxERP.t8("Sections")) %], |
|
49 |
metadata: { type: "sections" }, |
|
50 |
attr: { id: "sections", class: "section-context-menu" }, |
|
51 |
children: [ |
|
53 | 52 |
[% FOREACH section = SELF.requirement_spec.sections %] |
54 | 53 |
[% P.requirement_spec_item_jstree_data(section).json %][% IF !loop.last %],[% END %] |
55 | 54 |
[% END %] |
56 |
] |
|
57 |
}, |
|
55 |
]}, |
|
58 | 56 |
|
59 |
{ data: [% JSON.json(LxERP.t8("Text blocks back")) %],
|
|
60 |
metadata: { type: "text-blocks-back" },
|
|
61 |
attr: { id: "tb-back", class: "text-block-context-menu" },
|
|
62 |
children: [
|
|
57 |
{ data: [% JSON.json(LxERP.t8("Text blocks back")) %], |
|
58 |
metadata: { type: "text-blocks-back" }, |
|
59 |
attr: { id: "tb-back", class: "text-block-context-menu" }, |
|
60 |
children: [ |
|
63 | 61 |
[% FOREACH tb = SELF.requirement_spec.text_blocks_for_position(1) %] |
64 | 62 |
[% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %] |
65 | 63 |
[% END %] |
66 |
] |
|
67 |
} |
|
68 |
]; |
|
69 |
|
|
70 |
$(function() { |
|
71 |
$('#tree').jstree({ |
|
72 |
core: { |
|
73 |
animation: 0, |
|
74 |
initially_open: [ "tb-front", "tb-back", "sections" |
|
64 |
]}]; |
|
65 |
|
|
66 |
$('#tree').jstree({ |
|
67 |
core: { |
|
68 |
animation: 0, |
|
69 |
initially_open: [ "tb-front", "tb-back", "sections" |
|
75 | 70 |
[%- FOREACH section = SELF.requirement_spec.sections -%] |
76 |
, "fb-[% section.id %]" |
|
71 |
, "fb-[% section.id %]"
|
|
77 | 72 |
[%- FOREACH function_block = section.children -%] |
78 |
, "fb-[% function_block.id -%]" |
|
73 |
, "fb-[% function_block.id -%]"
|
|
79 | 74 |
[%- END -%] |
80 | 75 |
[%- END -%] |
81 |
] |
|
82 |
}, |
|
83 |
json_data: { |
|
84 |
data: tree_data |
|
85 |
}, |
|
86 |
crrm: { |
|
87 |
move: { |
|
88 |
check_move: requirement_spec_tree_check_move, |
|
89 |
open_move: true |
|
90 |
} |
|
91 |
}, |
|
92 |
themes: { |
|
93 |
theme: "requirement-spec" |
|
94 |
}, |
|
95 |
plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ] |
|
96 |
}) |
|
97 |
.bind("move_node.jstree", requirement_spec_tree_node_moved) |
|
98 |
.bind("click.jstree", requirement_spec_tree_node_clicked); |
|
99 |
[%- IF SELF.requirement_spec_item -%] |
|
100 |
$.jstree._reference("#tree").select_node('fb-[% SELF.requirement_spec_item.id %]', true); |
|
101 |
[%- END -%] |
|
102 |
}); |
|
76 |
]}, |
|
77 |
json_data: { |
|
78 |
data: tree_data |
|
79 |
}, |
|
80 |
crrm: { |
|
81 |
move: { |
|
82 |
check_move: requirement_spec_tree_check_move, |
|
83 |
open_move: true |
|
84 |
} |
|
85 |
}, |
|
86 |
themes: { |
|
87 |
theme: "requirement-spec" |
|
88 |
}, |
|
89 |
plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ] |
|
90 |
}) |
|
91 |
.bind("move_node.jstree", requirement_spec_tree_node_moved) |
|
92 |
.bind("click.jstree", requirement_spec_tree_node_clicked); |
|
93 |
[% IF SELF.requirement_spec_item %] |
|
94 |
$.jstree._reference("#tree").select_node('#fb-[% SELF.requirement_spec_item.id %]', true); |
|
95 |
[% END %] |
|
96 |
}); |
|
103 | 97 |
|
104 | 98 |
function ask_delete_text_block(key, opt) { |
105 | 99 |
if (confirm("[% LxERP.t8("Are you sure?") %]")) |
... | ... | |
131 | 125 |
selector: '.section-context-menu', |
132 | 126 |
items: { |
133 | 127 |
add_section: { name: "[% LxERP.t8('Add section') %]", icon: "add", callback: standard_item_ajax_call }, |
134 |
add_function_block: { name: "[% LxERP.t8('Add function block') %]", icon: "add", callback: standard_text_block_ajax_call }, |
|
128 |
add_function_block: { name: "[% LxERP.t8('Add function block') %]", icon: "add", callback: standard_text_block_ajax_call, disabled: disable_edit_item_commands },
|
|
135 | 129 |
sep1: "---------", |
136 | 130 |
edit: { name: "[% LxERP.t8('Edit') %]", icon: "edit", callback: standard_item_ajax_call, disabled: disable_edit_item_commands }, |
137 | 131 |
delete: { name: "[% LxERP.t8('Delete') %]", icon: "delete", callback: ask_delete_item, disabled: disable_edit_item_commands }, |
templates/webpages/requirement_spec_item/_function_block.html | ||
---|---|---|
9 | 9 |
<div class="sub-function-block-header" id="sub-function-block_header_[%- requirement_spec_item.id -%]"> |
10 | 10 |
[%- LxERP.t8("Sub function blocks") -%] |
11 | 11 |
</div> |
12 |
[%- FOREACH sub_function_block = requirement_spec_item.children -%] |
|
12 |
[%- FOREACH sub_function_block = requirement_spec_item.sorted_children -%]
|
|
13 | 13 |
[%- INCLUDE 'requirement_spec_item/_sub_function_block.html' requirement_spec_item=sub_function_block -%] |
14 | 14 |
[%- END -%] |
15 | 15 |
</div> |
templates/webpages/requirement_spec_item/_function_block_content_bottom.html | ||
---|---|---|
1 | 1 |
[%- USE LxERP -%][%- USE P -%]<div id="[% id_prefix %]function-block-content-bottom-[% requirement_spec_item.id %]" class="smaller" style="text-align:right"> |
2 | 2 |
[%- IF requirement_spec_item.dependencies.size -%] |
3 | 3 |
<span class="gray"> |
4 |
[%- LxERP.t8("Dependencies") -%]: [%- P.requirement_spec_item_dependency_list(requirement_spec_item.dependencies) -%]
|
|
4 |
[%- LxERP.t8("Dependencies") -%]: [%- P.requirement_spec_item_dependency_list(requirement_spec_item) -%] |
|
5 | 5 |
</span><br> |
6 | 6 |
[%- END -%] |
7 | 7 |
<span class="gray"> |
8 |
[%- LxERP.t8("Complexity") -%]: [%- requirement_spec_item.requirement_spec_complexity.description IF requirement_spec_item.requirement_spec_complexity -%]
|
|
8 |
[%- LxERP.t8("Complexity") -%]: [%- requirement_spec_item.complexity.description -%]
|
|
9 | 9 |
| |
10 |
[%- LxERP.t8("Risk") -%]: [%- requirement_spec_item.requirement_spec_risk.description IF requirement_spec_item.requirement_spec_risk -%]
|
|
10 |
[%- LxERP.t8("Risk") -%]: [%- requirement_spec_item.risk.description -%]
|
|
11 | 11 |
| |
12 |
[%- LxERP.t8("Effort") -%]: [%#- render :partial => 'requirement_spec_items/time_estimation_item', :locals => { :item => requirement_spec_item } -%]
|
|
12 |
[%- LxERP.t8("Time estimate") -%]: TODO: Zeitabschätzung
|
|
13 | 13 |
</span> |
14 | 14 |
|
15 | 15 |
</div> |
templates/webpages/requirement_spec_item/_function_block_form.html | ||
---|---|---|
1 |
[%- USE LxERP -%][%- USE L -%][%- USE HTML -%][%- USE JavaScript -%][% SET style="width: 500px" %] |
|
2 |
[% DEFAULT id_base = 'edit_function_block_' _ SELF.item.id %] |
|
3 |
<form method="post" id="[% id_base %]_form" class="function-block-form"> |
|
4 |
[% L.hidden_tag(id_base _ '_id', SELF.item.id) %] |
|
5 |
[% L.hidden_tag(id_base _ '.requirement_spec_id', SELF.item.requirement_spec_id) %] |
|
6 |
[% L.hidden_tag(id_base _ '.parent_id', SELF.item.parent_id) %] |
|
7 |
[% IF insert_after %] |
|
8 |
[% L.hidden_tag(id_base _ '.insert_after', insert_after) %] |
|
9 |
[% END %] |
|
10 |
|
|
11 |
<div> |
|
12 |
<div style="width: 19%; float: right;"> |
|
13 |
[%- LxERP.t8("Dependencies") %]:<br> |
|
14 |
[%- L.select_tag(id_base _ '.dependencies[]', DEPENDENCIES, default=SELECTED_DEPENDENCIES, with_optgroups=1, multiple=1, size=8, style="width: 100%") %] |
|
15 |
</div> |
|
16 |
|
|
17 |
<div style="width: 19%; float: right; margin-right: 5px"> |
|
18 |
[%- LxERP.t8("Complexity") %]:<br> |
|
19 |
[%- L.select_tag(id_base _ '.complexity_id', SELF.complexities, title_key='description', default=SELF.item.complexity_id, style="width: 100%") %]<br> |
|
20 |
|
|
21 |
[%- LxERP.t8("Risk") %]:<br> |
|
22 |
[%- L.select_tag(id_base _ '.risk_id', SELF.risks, title_key='description', default=SELF.item.risk_id, style="width: 100%") %]<br> |
|
23 |
|
|
24 |
[%- IF !SELF.item.children.size %] |
|
25 |
[%- LxERP.t8("Time estimate") %]:<br> |
|
26 |
TODO: time estimate input |
|
27 |
[%- END %] |
|
28 |
</div> |
|
29 |
|
|
30 |
<div style="width: 59%"> |
|
31 |
[% LxERP.t8("Description of #1", SELF.item.fb_number) %]:<br> |
|
32 |
[% L.textarea_tag(id_base _ '.description', SELF.item.description, id=id_base _ '_description', rows=8, style="width: 100%") %] |
|
33 |
</div> |
|
34 |
</div> |
|
35 |
|
|
36 |
<p> |
|
37 |
[% L.button_tag('submit_edit_item_form("' _ id_base _ '")', LxERP.t8('Save')) %] |
|
38 |
<a href="#" onclick="cancel_edit_item_form('[% id_base %]', '[% SELF.item.get_type %]-content-top')">[%- LxERP.t8("Cancel") %]</a> |
|
39 |
</p> |
|
40 |
</form> |
templates/webpages/requirement_spec_item/_section.html | ||
---|---|---|
10 | 10 |
</div> |
11 | 11 |
|
12 | 12 |
<div id="section-list" class="section"> |
13 |
[%- FOREACH function_block = requirement_spec_item.children -%] |
|
13 |
[%- FOREACH function_block = requirement_spec_item.sorted_children -%]
|
|
14 | 14 |
[%- INCLUDE 'requirement_spec_item/_function_block.html' requirement_spec_item=function_block -%] |
15 | 15 |
[%- END -%] |
16 | 16 |
</div> |
Auch abrufbar als: Unified diff
Pflichtenheftpunkte bearbeiten