Revision 54daa586
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/Controller/RequirementSpec.pm | ||
---|---|---|
23 | 23 |
); |
24 | 24 |
|
25 | 25 |
__PACKAGE__->run_before('setup'); |
26 |
__PACKAGE__->run_before('load_requirement_spec', only => [ qw( edit update destroy) ]); |
|
26 |
__PACKAGE__->run_before('load_requirement_spec', only => [ qw( edit update destroy tree) ]);
|
|
27 | 27 |
__PACKAGE__->run_before('load_select_options', only => [ qw(new edit create update list) ]); |
28 | 28 |
__PACKAGE__->run_before('load_search_select_options', only => [ qw( list) ]); |
29 | 29 |
|
... | ... | |
109 | 109 |
$self->render('1;', { type => 'js', inline => 1 }); |
110 | 110 |
} |
111 | 111 |
|
112 |
sub action_tree { |
|
113 |
my ($self) = @_; |
|
114 |
my $r = $self->render('requirement_spec/tree', now => DateTime->now); |
|
115 |
} |
|
116 |
|
|
112 | 117 |
# |
113 | 118 |
# filters |
114 | 119 |
# |
... | ... | |
117 | 122 |
my ($self) = @_; |
118 | 123 |
|
119 | 124 |
$::auth->assert('config'); |
120 |
$::request->{layout}->use_stylesheet("requirement_spec.css"); |
|
125 |
$::request->{layout}->use_stylesheet("${_}.css") for qw(requirement_spec yaml/core/base.min); |
|
126 |
$::request->{layout}->use_javascript("${_}.js") for qw(jquery.jstree requirement_spec); |
|
121 | 127 |
$self->is_template($::form->{is_template} ? 1 : 0); |
122 | 128 |
|
123 | 129 |
return 1; |
124 | 130 |
} |
125 | 131 |
|
132 |
sub load_requirement_spec { |
|
133 |
my ($self) = @_; |
|
134 |
$self->{requirement_spec} = SL::DB::RequirementSpec->new(id => $::form->{id})->load || die "No such requirement spec"; |
|
135 |
} |
|
136 |
|
|
137 |
sub load_select_options { |
|
138 |
my ($self) = @_; |
|
139 |
|
|
140 |
my @filter = ('!obsolete' => 1); |
|
141 |
if ($self->requirement_spec && $self->requirement_spec->customer_id) { |
|
142 |
@filter = ( or => [ @filter, id => $self->requirement_spec->customer_id ] ); |
|
143 |
} |
|
144 |
|
|
145 |
$self->customers(SL::DB::Manager::Customer->get_all_sorted(where => \@filter)); |
|
146 |
$self->statuses( SL::DB::Manager::RequirementSpecStatus->get_all_sorted); |
|
147 |
$self->types( SL::DB::Manager::RequirementSpecType->get_all_sorted); |
|
148 |
} |
|
149 |
|
|
150 |
sub load_search_select_options { |
|
151 |
my ($self) = @_; |
|
152 |
|
|
153 |
$self->projects(SL::DB::Manager::Project->get_all_sorted); |
|
154 |
} |
|
155 |
|
|
126 | 156 |
# |
127 | 157 |
# helpers |
128 | 158 |
# |
... | ... | |
149 | 179 |
$self->redirect_to(action => 'list'); |
150 | 180 |
} |
151 | 181 |
|
152 |
sub load_requirement_spec { |
|
153 |
my ($self) = @_; |
|
154 |
$self->{requirement_spec} = SL::DB::RequirementSpec->new(id => $::form->{id})->load; |
|
155 |
} |
|
156 |
|
|
157 |
sub load_select_options { |
|
158 |
my ($self) = @_; |
|
159 |
|
|
160 |
my @filter = ('!obsolete' => 1); |
|
161 |
if ($self->requirement_spec && $self->requirement_spec->customer_id) { |
|
162 |
@filter = ( or => [ @filter, id => $self->requirement_spec->customer_id ] ); |
|
163 |
} |
|
164 |
|
|
165 |
$self->customers(SL::DB::Manager::Customer->get_all_sorted(where => \@filter)); |
|
166 |
$self->statuses( SL::DB::Manager::RequirementSpecStatus->get_all_sorted); |
|
167 |
$self->types( SL::DB::Manager::RequirementSpecType->get_all_sorted); |
|
168 |
} |
|
169 |
|
|
170 |
sub load_search_select_options { |
|
171 |
my ($self) = @_; |
|
172 |
|
|
173 |
$self->projects(SL::DB::Manager::Project->get_all_sorted); |
|
174 |
} |
|
175 |
|
|
176 | 182 |
sub setup_db_args_from_filter { |
177 | 183 |
my ($self) = @_; |
178 | 184 |
|
Auch abrufbar als: Unified diff
Pflichtenhefte: Erste Version Baumansicht Textblöcke/Abschnitte/Funktionsblöcke