Revision 7c54e92f
Von Moritz Bunkus vor fast 10 Jahren hinzugefügt
SL/Controller/RequirementSpec.pm | ||
---|---|---|
21 | 21 |
use SL::DB::RequirementSpecStatus; |
22 | 22 |
use SL::DB::RequirementSpecType; |
23 | 23 |
use SL::DB::RequirementSpec; |
24 |
use SL::Helper::CreatePDF qw(); |
|
24 | 25 |
use SL::Helper::Flash; |
25 | 26 |
use SL::Locale::String; |
26 | 27 |
use SL::Template::LaTeX; |
... | ... | |
29 | 30 |
( |
30 | 31 |
scalar => [ qw(requirement_spec_item visible_item visible_section) ], |
31 | 32 |
'scalar --get_set_init' => [ qw(requirement_spec customers types statuses complexities risks projects project_types project_statuses default_project_type default_project_status copy_source js |
32 |
current_text_block_output_position models time_based_units) ], |
|
33 |
current_text_block_output_position models time_based_units html_template) ],
|
|
33 | 34 |
); |
34 | 35 |
|
35 | 36 |
__PACKAGE__->run_before('setup'); |
... | ... | |
231 | 232 |
unlink $result{file_name}; |
232 | 233 |
} |
233 | 234 |
|
235 |
sub action_create_html { |
|
236 |
my ($self, %params) = @_; |
|
237 |
|
|
238 |
my $base_name = $self->requirement_spec->type->template_file_name || 'requirement_spec'; |
|
239 |
my @pictures = $self->prepare_pictures_for_printing; |
|
240 |
my $content = SL::Helper::CreatePDF->create_parsed_file( |
|
241 |
template => "${base_name}.html", |
|
242 |
format => 'html', |
|
243 |
template_type => 'HTML', |
|
244 |
variables => { |
|
245 |
SELF => $self, |
|
246 |
rspec => $self->requirement_spec, |
|
247 |
}); |
|
248 |
|
|
249 |
# $content is now a scalar of bytes, but $self->render() expects a |
|
250 |
# scalar of characters. |
|
251 |
$content = Encode::decode('utf-8', $content); |
|
252 |
|
|
253 |
$self->render(\$content, { layout => 0, process => 0 }); |
|
254 |
} |
|
255 |
|
|
234 | 256 |
sub action_select_template_to_paste { |
235 | 257 |
my ($self) = @_; |
236 | 258 |
|
... | ... | |
613 | 635 |
); |
614 | 636 |
} |
615 | 637 |
|
638 |
sub init_html_template { |
|
639 |
my ($self) = @_; |
|
640 |
my $base_name = $self->requirement_spec->type->template_file_name || 'requirement_spec'; |
|
641 |
my $template = SL::Helper::CreatePDF->find_template(name => $base_name, extension => 'html'); |
|
642 |
return !!$template; |
|
643 |
} |
|
644 |
|
|
616 | 645 |
1; |
Auch abrufbar als: Unified diff
Pflichtenhefte: Ausgabemöglichkeit als HTML
Menüpunkte dafür werden aber nur eingeblendet, sofern auch eine Vorlage
dafür im Vorlagenverzeichnis existiert.
Die erzeugte HTML-Seite wird in einem neuen Browserfenster angezeigt.