Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ee51b82f

Von Tamino Steinert vor etwa 2 Jahren hinzugefügt

  • ID ee51b82f6206a33d436cb453ebe835d6fbbb4c2c
  • Vorgänger a0a10e44
  • Nachfolger 84dfd7a5

Presenter: nutze link_tag anstelle von html im perl-code

(cherry picked aus Kundenprojekt)

Unterschiede anzeigen:

SL/Presenter/DeliveryOrder.pm
5 5
use SL::DB::DeliveryOrder::TypeData ();
6 6
use SL::Locale::String qw(t8);
7 7
use SL::Presenter::EscapedText qw(escape is_escaped);
8
use SL::Presenter::Tag         qw(link_tag);
8 9

  
9 10
use Exporter qw(import);
10 11
our @EXPORT_OK = qw(sales_delivery_order purchase_delivery_order delivery_order_status_line);
......
57 58

  
58 59
  croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
59 60

  
60
  my $text = join '', (
61
    $params{no_link} ? '' : '<a href="do.pl?action=edit&amp;type=' . $type . '&amp;id=' . escape($delivery_order->id) . '">',
62
    escape($delivery_order->donumber),
63
    $params{no_link} ? '' : '</a>',
64
  );
61
  my $text = escape($delivery_order->donumber);
62
  if (! delete $params{no_link}) {
63
    my $href = 'do.pl?action=edit&type=' . $type
64
               . '&id=' . escape($delivery_order->id);
65
    $text = link_tag($href, $text, %params);
66
  }
67

  
65 68
  is_escaped($text);
66 69
}
67 70

  
......
128 131
L<SL::Presenter::EscapedText>) of the sales delivery order object
129 132
C<$object>.
130 133

  
131
C<%params> can include:
134
Remaining C<%params> are passed to the function
135
C<SL::Presenter::Tag::link_tag>. It can include:
132 136

  
133 137
=over 2
134 138

  
135 139
=item * display
136 140

  
137
Either C<inline> (the default) or C<table-cell>. At the moment both
138
representations are identical and produce the objects's delivery
139
order number linked to the corresponding 'edit' action.
141
Either C<inline> (the default) or C<table-cell>. Is passed to the function
142
C<SL::Presenter::Tag::link_tag>.
140 143

  
141 144
=item * no_link
142 145

  
......
151 154
L<SL::Presenter::EscapedText>) of the purchase delivery order object
152 155
C<$object>.
153 156

  
154
C<%params> can include:
157
Remaining C<%params> are passed to the function
158
C<SL::Presenter::Tag::link_tag>. It can include:
155 159

  
156 160
=over 2
157 161

  
158 162
=item * display
159 163

  
160
Either C<inline> (the default) or C<table-cell>. At the moment both
161
representations are identical and produce the objects's delivery
162
order number linked to the corresponding 'edit' action.
164
Either C<inline> (the default) or C<table-cell>. Is passed to the function
165
C<SL::Presenter::Tag::link_tag>.
163 166

  
164 167
=item * no_link
165 168

  

Auch abrufbar als: Unified diff