5cca5a8bda0def3a8e9f9d5d4fc61c9bcc356153
[kivitendo-erp.git] / SL / Presenter / RequirementSpec.pm
1 package SL::Presenter::RequirementSpec;
2
3 use strict;
4
5 use parent qw(Exporter);
6
7 use Exporter qw(import);
8 our @EXPORT = qw(requirement_spec);
9
10 use Carp;
11
12 sub requirement_spec {
13   my ($self, $requirement_spec, %params) = @_;
14
15   $params{display} ||= 'inline';
16
17   croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
18
19   my $text = join '', (
20     $params{no_link} ? '' : '<a href="controller.pl?action=RequirementSpec/show&amp;id=' . $self->escape($requirement_spec->id) . '">',
21     $self->escape($requirement_spec->id),
22     $params{no_link} ? '' : '</a>',
23   );
24   return $self->escaped_text($text);
25 }
26
27 1;