Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 36d7ceb2

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 36d7ceb2d203115fe890f1a47e252e20c5e5a1d2
  • Vorgänger f596739c
  • Nachfolger e2e5606d

S:Presenter:Record: Alias Funktion "show" in verwendeten Objekten

Verknüpfte Belege nutzt folgende Objekte:
DeliveryOrder, Dunning, EmailJournal, GL, Invoice, Letter, Order,
Reclamation, RequirementSpec, ShopOrder

Unterschiede anzeigen:

SL/Presenter/DeliveryOrder.pm
8 8
use SL::Presenter::Tag         qw(link_tag);
9 9

  
10 10
use Exporter qw(import);
11
our @EXPORT_OK = qw(sales_delivery_order purchase_delivery_order delivery_order_status_line);
11
our @EXPORT_OK = qw(
12
  show delivery_order delivery_order_status_line
13
  sales_delivery_order purchase_delivery_order
14
  rma_delivery_order supplier_delivery_order
15
);
12 16

  
13 17
use Carp;
14 18

  
15
sub sales_delivery_order {
16
  my ($delivery_order, %params) = @_;
19
sub show {goto &delivery_order};
17 20

  
18
  return _do_record($delivery_order, 'sales_delivery_order', %params);
19
}
21
sub sales_delivery_order {goto &delivery_order}
20 22

  
21
sub rma_delivery_order {
22
  my ($delivery_order, %params) = @_;
23

  
24
  return _do_new_record($delivery_order, 'rma_delivery_order', %params);
25
}
23
sub rma_delivery_order {goto &delivery_order};
26 24

  
27
sub purchase_delivery_order {
28
  my ($delivery_order, %params) = @_;
25
sub purchase_delivery_order {goto &delivery_order};
29 26

  
30
  return _do_record($delivery_order, 'purchase_delivery_order', %params);
31
}
27
sub supplier_delivery_order {goto &delivery_order};
32 28

  
33
sub supplier_delivery_order {
29
sub delivery_order {
34 30
  my ($delivery_order, %params) = @_;
35 31

  
36
  return _do_new_record($delivery_order, 'supplier_delivery_order', %params);
37
}
38

  
39
sub _do_new_record {
40
  my ($delivery_order, $type, %params) = @_;
41

  
42
  $params{display} ||= 'inline';
43

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

  
46
  my $text = join '', (
47
    $params{no_link} ? '' : '<a href="controller.pl?action=DeliveryOrder/edit&amp;type=' . $type . '&amp;id=' . escape($delivery_order->id) . '">',
48
    escape($delivery_order->donumber),
49
    $params{no_link} ? '' : '</a>',
50
  );
51
  is_escaped($text);
52
}
53

  
54
sub _do_record {
55
  my ($delivery_order, $type, %params) = @_;
56

  
57 32
  $params{display} ||= 'inline';
58 33

  
59 34
  croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
......
121 96
  my $object = SL::DB::Manager::DeliveryOrder->get_first(where => [ record_type  => PURCHASE_DELIVERY_ORDER_TYPE ]);
122 97
  my $html   = SL::Presenter::DeliveryOrder::purchase_delivery_order($object, display => 'inline');
123 98

  
99
  #...
100

  
101
  # or for all types:
102
  my $html   = SL::Presenter::DeliveryOrder::delivery_order($object);
103
  my $html   = $object->presenter->show();
104

  
124 105
=head1 FUNCTIONS
125 106

  
126 107
=over 4
127 108

  
128
=item C<sales_delivery_order $object, %params>
109
=item C<show $object %params>
129 110

  
130
Returns a rendered version (actually an instance of
131
L<SL::Presenter::EscapedText>) of the sales delivery order object
132
C<$object>.
111
Alias for C<delivery_order $object %params>.
133 112

  
134
Remaining C<%params> are passed to the function
135
C<SL::Presenter::Tag::link_tag>. It can include:
113
=item C<sales_delivery_order $object, %params>
136 114

  
137
=over 2
115
Alias for C<delivery_order $object %params>.
138 116

  
139
=item * display
117
=item C<purchase_delivery_order $object, %params>
140 118

  
141
Either C<inline> (the default) or C<table-cell>. Is passed to the function
142
C<SL::Presenter::Tag::link_tag>.
119
Alias for C<delivery_order $object %params>.
143 120

  
144
=item * no_link
121
=item C<rma_delivery_order $object, %params>
145 122

  
146
If falsish (the default) then the delivery order number will be linked
147
to the "edit delivery order" dialog from the sales menu.
123
Alias for C<delivery_order $object %params>.
148 124

  
149
=back
125
=item C<supplier_delivery_order $object, %params>
150 126

  
151
=item C<purchase_delivery_order $object, %params>
127
Alias for C<delivery_order $object %params>.
128

  
129
=item C<delivery_order $object, %params>
152 130

  
153 131
Returns a rendered version (actually an instance of
154
L<SL::Presenter::EscapedText>) of the purchase delivery order object
132
L<SL::Presenter::EscapedText>) of the sales delivery order object
155 133
C<$object>.
156 134

  
157 135
Remaining C<%params> are passed to the function
158
C<SL::Presenter::Tag::link_tag>. It can include:
136
L<SL::Presenter::Tag/link_tag>. It can include:
159 137

  
160 138
=over 2
161 139

  
......
167 145
=item * no_link
168 146

  
169 147
If falsish (the default) then the delivery order number will be linked
170
to the "edit delivery order" dialog from the purchase menu.
148
to the "edit delivery order" dialog from the sales menu.
171 149

  
172 150
=back
173 151

  
SL/Presenter/Dunning.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(dunning);
9
our @EXPORT_OK = qw(show dunning);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &dunning};
14

  
13 15
sub dunning {
14 16
  my ($dunning, %params) = @_;
15 17

  
......
19 21

  
20 22
  my $text = escape($dunning->dunning_config->dunning_description);
21 23
  if (! delete $params{no_link}) {
22
    my @flags;
24
    my @flags = ();
23 25
    push @flags, 'showold=1';
24 26
    push @flags, 'l_mails=1'      if $::instance_conf->get_email_journal;
25 27
    push @flags, 'l_webdav=1'     if $::instance_conf->get_webdav;
......
34 36
}
35 37

  
36 38
1;
39

  
40
__END__
41

  
42
=pod
43

  
44
=encoding utf8
45

  
46
=head1 NAME
47

  
48
SL::Presenter::Dunning - Presenter module for SL::DB::Dunning objects
49

  
50
=head1 SYNOPSIS
51

  
52
  my $object = SL::DB::Manager::Dunning->get_first();
53
  my $html   = SL::Presenter::Dunning::dunning($object);
54
  # or
55
  my $html   = $object->presenter->show();
56

  
57
=head1 FUNCTIONS
58

  
59
=over 4
60

  
61
=item C<show $object>
62

  
63
Alias for C<dunning $object %params>.
64

  
65
=item C<dunning $object %params>
66

  
67
Returns a rendered version (actually an instance of
68
L<SL::Presenter::EscapedText>) of the dunning object
69
C<$object>.
70

  
71
Remaining C<%params> are passed to the function
72
C<SL::Presenter::Tag::link_tag>. It can include:
73

  
74
=over 2
75

  
76
=item * no_link
77

  
78
If falsish (the default) then the  dunning will be linked to the "show" dialog.
79

  
80
=back
81

  
82
=back
83

  
84
=head1 BUGS
85

  
86
Nothing here yet.
87

  
88
=head1 AUTHOR
89

  
90
Tamino Steinert E<lt>tamino.steinert@tamino.stE<gt>
91

  
92
=cut
SL/Presenter/EmailJournal.pm
9 9
use SL::DB::EmailJournalAttachment;
10 10

  
11 11
use Exporter qw(import);
12
our @EXPORT_OK = qw(email_journal entry_status attachment_preview);
12
our @EXPORT_OK = qw(show email_journal entry_status attachment_preview);
13 13

  
14 14
use Carp;
15 15

  
16
sub show {goto &email_journal};
17

  
16 18
sub email_journal {
17 19
  my ($email_journal_entry, %params) = @_;
18 20

  
......
91 93

  
92 94
  my $journal_entry = SL::DB::Manager::EmailJournal->get_first();
93 95
  my $html   = SL::Presenter::EmailJournal::email_journal($journal_entry, display => 'inline');
96
  # or
97
  my $html   = $journal_entry->presenter->show();
94 98

  
95 99
  # pp $html
96 100
  # <a href="controller.pl?action=EmailJournal/show&amp;id=1">IDEV Daten fuer webdav/idev/2017-KW-26.csv erzeugt</a>
......
99 103

  
100 104
=over 4
101 105

  
106
=item C<show $object %params>
107

  
108
Alias for C<email_journal $object %params>.
109

  
102 110
=item C<email_journal $object, %params>
103 111

  
104 112
Returns a rendered version (actually an instance of
SL/Presenter/GL.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(gl_transaction);
9
our @EXPORT_OK = qw(show gl_transaction);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &gl_transaction};
14

  
13 15
sub gl_transaction {
14 16
  my ($gl_transaction, %params) = @_;
15 17

  
......
42 44

  
43 45
  my $object = SL::DB::Manager::GLTransaction->get_first();
44 46
  my $html   = SL::Presenter::GL::gl_transaction($object, display => 'inline');
47
  # or
48
  my $html   = $object->presenter->show();
45 49

  
46 50
=head1 FUNCTIONS
47 51

  
48 52
=over 4
49 53

  
54
=item C<show $object %params>
55

  
56
Alias for C<gl_transaction $object %params>.
57

  
50 58
=item C<gl_transaction $object, %params>
51 59

  
52 60
Returns a rendered version (actually an instance of
SL/Presenter/Invoice.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(invoice sales_invoice ar_transaction purchase_invoice ap_transaction);
9
our @EXPORT_OK = qw(show invoice sales_invoice ar_transaction purchase_invoice ap_transaction);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &invoice};
14

  
13 15
sub invoice {
14 16
  my ($invoice, %params) = @_;
15 17

  
......
102 104

  
103 105
  # use with any of the above ar/ap/is/ir types:
104 106
  my $html   = SL::Presenter::Invoice::invoice($object, display => 'inline');
107
  my $html   = $object->presenter->show();
105 108

  
106 109
=head1 FUNCTIONS
107 110

  
108 111
=over 4
109 112

  
113
=item C<show $object>
114

  
115
Alias for C<invoice $object %params>.
116

  
110 117
=item C<invoice $object, %params>
111 118

  
112 119
Returns a rendered version (actually an instance of
SL/Presenter/Letter.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(letter);
9
our @EXPORT_OK = qw(show letter);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &letter};
14

  
13 15
sub letter {
14 16
  my ($letter, %params) = @_;
15 17

  
......
43 45

  
44 46
  my $letter = SL::DB::Manager::Letter->get_first(where => [ … ]);
45 47
  my $html   = SL::Presenter::Letter::letter($letter, display => 'inline');
48
  # or
49
  my $html   = $letter->presenter->show();
46 50

  
47 51
=head1 FUNCTIONS
48 52

  
49 53
=over 4
50 54

  
55
=item C<show $object>
56

  
57
Alias for C<letter $object %params>.
58

  
51 59
=item C<letter $object, %params>
52 60

  
53 61
Returns a rendered version (actually an instance of
SL/Presenter/Order.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(sales_quotation sales_order request_quotation purchase_order);
9
our @EXPORT_OK = qw(show order sales_quotation sales_order request_quotation purchase_order);
10 10

  
11 11
use Carp;
12 12

  
13
sub sales_quotation {
14
  my ($order, %params) = @_;
13
sub show {goto &order}
15 14

  
16
  return _oe_record($order, 'sales_quotation', %params);
17
}
15
sub sales_quotation {goto &order}
18 16

  
19
sub sales_order_intake {
20
  my ($order, %params) = @_;
17
sub sales_order_intake {goto &order}
21 18

  
22
  return _oe_record($order, 'sales_order_intake', %params);
23
}
19
sub sales_order {goto &order}
24 20

  
25
sub sales_order {
26
  my ($order, %params) = @_;
21
sub request_quotation {goto &order}
27 22

  
28
  return _oe_record($order, 'sales_order', %params);
29
}
23
sub purchase_quotation_intake {goto &order}
30 24

  
31
sub request_quotation {
32
  my ($order, %params) = @_;
25
sub purchase_order {goto &order}
33 26

  
34
  return _oe_record($order, 'request_quotation', %params);
35
}
36

  
37
sub purchase_quotation_intake {
27
sub order {
38 28
  my ($order, %params) = @_;
39

  
40
  return _oe_record($order, 'purchase_quotation_intake', %params);
41
}
42

  
43
sub purchase_order {
44
  my ($order, %params) = @_;
45

  
46
  return _oe_record($order, 'purchase_order', %params);
47
}
48

  
49
sub _oe_record {
50
  my ($order, $type, %params) = @_;
29
  my $type = $order->record_type;
51 30

  
52 31
  $params{display} ||= 'inline';
53 32

  
......
100 79
  my $object = SL::DB::Manager::Order->get_first(where => [ SL::DB::Manager::Order->type_filter('purchase_order') ]);
101 80
  my $html   = SL::Presenter::Order::purchase_order($object, display => 'inline');
102 81

  
82
  # or for all types:
83
  my $html   = SL::Presenter::Order::order($object);
84
  my $html   = $object->presenter->show();
85

  
103 86
=head1 FUNCTIONS
104 87

  
105 88
=over 4
106 89

  
107
=item C<sales_quotation $object, %params>
108

  
109
Returns a rendered version (actually an instance of
110
L<SL::Presenter::EscapedText>) of the sales quotation object
111
C<$object>.
112

  
113
Remaining C<%params> are passed to the function
114
C<SL::Presenter::Tag::link_tag>. It can include:
115

  
116
=over 2
117

  
118
=item * display
119

  
120
Either C<inline> (the default) or C<table-cell>. Is passed to the function
121
C<SL::Presenter::Tag::link_tag>.
122

  
123
=item * no_link
124

  
125
If falsish (the default) then the order number will be linked to the
126
"edit quotation" dialog from the sales menu.
127

  
128
=back
129

  
130
=item C<sales_order $object, %params>
131

  
132
Returns a rendered version (actually an instance of
133
L<SL::Presenter::EscapedText>) of the sales order object C<$object>.
134

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

  
138
=over 2
139

  
140
=item * display
90
=item C<show $object %params>
141 91

  
142
Either C<inline> (the default) or C<table-cell>. Is passed to the function
143
C<SL::Presenter::Tag::link_tag>.
92
Alias for C<order $object %params>.
144 93

  
145
=item * no_link
94
=item C<sales_quotation $object %params>
146 95

  
147
If falsish (the default) then the  order number will be linked
148
to the "edit order" dialog from the sales menu.
96
Alias for C<order $object %params>.
149 97

  
150
=back
98
=item C<sales_order_intake $object %params>
151 99

  
152
=item C<request_quotation $object, %params>
100
Alias for C<order $object %params>.
153 101

  
154
Returns a rendered version (actually an instance of
155
L<SL::Presenter::EscapedText>) of the request for quotation object
156
C<$object>.
102
=item C<sales_order $object %params>
157 103

  
158
Remaining C<%params> are passed to the function
159
C<SL::Presenter::Tag::link_tag>. It can include:
104
Alias for C<order $object %params>.
160 105

  
161
=over 2
106
=item C<request_quotation $object %params>
162 107

  
163
=item * display
108
Alias for C<order $object %params>.
164 109

  
165
Either C<inline> (the default) or C<table-cell>. Is passed to the function
166
C<SL::Presenter::Tag::link_tag>.
110
=item C<purchase_quotation_intake $object %params>
167 111

  
168
=item * no_link
112
Alias for C<order $object %params>.
169 113

  
170
If falsish (the default) then the order number will be linked to the
171
"edit request for quotation" dialog from the purchase menu.
114
=item C<purchase_order $object %params>
172 115

  
173
=back
116
Alias for C<order $object %params>.
174 117

  
175
=item C<purchase_order $object, %params>
118
=item C<order $object %params>
176 119

  
177 120
Returns a rendered version (actually an instance of
178 121
L<SL::Presenter::EscapedText>) of the purchase order object
......
191 134
=item * no_link
192 135

  
193 136
If falsish (the default) then the  order number will be linked
194
to the "edit order" dialog from the purchase menu.
137
to the "edit order" dialog.
195 138

  
196 139
=back
197 140

  
SL/Presenter/Reclamation.pm
3 3
use strict;
4 4

  
5 5
use SL::Presenter::EscapedText qw(escape is_escaped);
6
use SL::Presenter::Tag qw(html_tag);
6
use SL::Presenter::Tag qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(sales_reclamation purchase_reclamation);
9
our @EXPORT_OK = qw(show sales_reclamation purchase_reclamation);
10 10

  
11 11
use Carp;
12 12

  
13
sub sales_reclamation {
14
  my ($reclamation, %params) = @_;
13
sub show {goto &reclamation};
15 14

  
16
  return _reclamation_record($reclamation, 'sales_reclamation', %params);
17
}
15
sub sales_reclamation {goto &reclamation}
16
sub purchase_reclamation {goto &reclamation}
18 17

  
19
sub purchase_reclamation {
18
sub reclamation {
20 19
  my ($reclamation, %params) = @_;
21 20

  
22
  return _reclamation_record($reclamation, 'purchase_reclamation', %params);
23
}
24

  
25
sub _reclamation_record {
26
  my ($reclamation, $type, %params) = @_;
27

  
28 21
  $params{display} ||= 'inline';
29 22

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

  
32 23
  my $text = escape($reclamation->record_number);
33 24
  unless ($params{no_link}) {
34
    my $id = $reclamation->id;
35
    $text =  html_tag('a', $text, href => escape("controller.pl?action=Reclamation/edit&type=${type}&id=${id}"));
25
    my $href = 'controller.pl?action=Reclamation/edit&id=' . escape($reclamation->id);
26
    $text =  link_tag($href, $text, %params);
36 27
  }
37 28

  
38 29
  is_escaped($text);
......
57 48
  my $object = SL::DB::Manager::Reclamation->get_first(
58 49
    where => [ SL::DB::Manager::Reclamation->type_filter('sales_reclamation') ]
59 50
  );
60
  my $html   = SL::Presenter::Reclamation::sales_reclamation(
61
    $object, display => 'inline'
62
  );
51
  my $html   = SL::Presenter::Reclamation::sales_reclamation($object);
63 52

  
64 53
  # Purchase reclamations:
65 54
  my $object = SL::DB::Manager::Reclamation->get_first(
66 55
    where => [ SL::DB::Manager::Reclamation->type_filter('purchase_reclamation') ]
67 56
  );
68
  my $html   = SL::Presenter::Reclamation::purchase_reclamation(
57
  my $html   = SL::Presenter::Reclamation::purchase_reclamation($object);
58

  
59
  # or for all types:
60
  my $html   = SL::Presenter::Reclamation::reclamation(
69 61
    $object, display => 'inline'
70 62
  );
63
  my $html   = $object->presenter->show();
71 64

  
72 65
=head1 FUNCTIONS
73 66

  
74 67
=over 4
75 68

  
76
=item C<sales_reclamation $object, %params>
69
=item C<show $object %params>
77 70

  
78
Returns a rendered version (actually an instance of
79
L<SL::Presenter::EscapedText>) of the sales reclamation object C<$object>.
80

  
81
C<%params> can include:
71
Alias for C<reclamation $object %params>.
82 72

  
83
=over 2
84

  
85
=item * display
73
=item C<sales_reclamation $object, %params>
86 74

  
87
Either C<inline> (the default) or C<table-cell>. At the moment both
88
representations are identical and produce the objects's
89
reclamation number linked to the corresponding 'edit' action.
75
Alias for C<reclamation $object %params>.
90 76

  
91
=item * no_link
77
=item C<purchase_reclamation $object, %params>
92 78

  
93
If falsish (the default) then the  reclamation number will be linked to the
94
"edit reclamation" dialog from the sales menu.
79
Alias for C<reclamation $object %params>.
95 80

  
96
=back
97

  
98
=item C<purchase_reclamation $object, %params>
81
=item C<reclamation $object %params>
99 82

  
100 83
Returns a rendered version (actually an instance of
101
L<SL::Presenter::EscapedText>) of the purchase reclamation object C<$object>.
84
L<SL::Presenter::EscapedText>) of the sales reclamation object C<$object>.
102 85

  
103 86
C<%params> can include:
104 87

  
105 88
=over 2
106 89

  
107
=item * display
108

  
109
Either C<inline> (the default) or C<table-cell>. At the moment both
110
representations are identical and produce the objects's reclamation number
111
linked to the corresponding 'edit' action.
112

  
113 90
=item * no_link
114 91

  
115 92
If falsish (the default) then the  reclamation number will be linked to the
116
"edit reclamation" dialog from the purchase menu.
93
"edit reclamation" dialog.
117 94

  
118 95
=back
119 96

  
97
When C<$params{no_link}> is falsish, other C<%params> get passed to
98
L<SL::Presenter::Tag/link_tag> .
99

  
120 100
=back
121 101

  
122 102
=head1 BUGS
SL/Presenter/RequirementSpec.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(requirement_spec);
9
our @EXPORT_OK = qw(show requirement_spec);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &requirement_spec};
14

  
13 15
sub requirement_spec {
14 16
  my ($requirement_spec, %params) = @_;
15 17

  
......
28 30
}
29 31

  
30 32
1;
33

  
34
__END__
35

  
36
=pod
37

  
38
=encoding utf8
39

  
40
=head1 NAME
41

  
42
SL::Presenter::RequirementSpec - Presenter module for SL::DB::RequirementSpec objects
43

  
44
=head1 SYNOPSIS
45

  
46
  my $object = SL::DB::Manager::RequirementSpec->get_first();
47
  my $html   = SL::Presenter::RequirementSpec::requirement_spec($object);
48
  # or
49
  my $html   = $object->presenter->show();
50

  
51
=head1 FUNCTIONS
52

  
53
=over 4
54

  
55
=item C<show $object>
56

  
57
Alias for C<requirement_spec $object %params>.
58

  
59
=item C<requirement_spec $object %params>
60

  
61
Returns a rendered version (actually an instance of
62
L<SL::Presenter::EscapedText>) of the bank transaction object
63
C<$object>. C<%params> gets passed to L<SL::Presenter::Tag/link_tag>.
64

  
65
=back
66

  
67
=head1 BUGS
68

  
69
Nothing here yet.
70

  
71
=head1 AUTHOR
72

  
73
Tamino Steinert E<lt>tamino.steinert@tamino.stE<gt>
74

  
75
=cut
SL/Presenter/ShopOrder.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(shop_order);
9
our @EXPORT_OK = qw(show shop_order);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &shop_order};
14

  
13 15
sub shop_order {
14
  my ($shop_order, $type, %params) = @_;
16
  my ($shop_order, %params) = @_;
15 17

  
16 18
  $params{display} ||= 'inline';
17 19

  
......
26 28

  
27 29
  is_escaped($text);
28 30
}
31

  
29 32
1;
33

  
34
__END__
35

  
36
=pod
37

  
38
=encoding utf8
39

  
40
=head1 NAME
41

  
42
SL::Presenter::ShopOrder - Presenter module for SL::DB::ShopOrder objects
43

  
44
=head1 SYNOPSIS
45

  
46
  my $object = SL::DB::Manager::ShopOrder->get_first();
47
  my $html   = SL::Presenter::ShopOrder::shop_order($object);
48
  # or
49
  my $html   = $object->presenter->show();
50

  
51
=head1 FUNCTIONS
52

  
53
=over 4
54

  
55
=item C<show $object>
56

  
57
Alias for C<shop_order $object %params>.
58

  
59
=item C<shop_order $object %params>
60

  
61
Returns a rendered version (actually an instance of
62
L<SL::Presenter::EscapedText>) of the shop order object
63
C<$object>.
64

  
65
Remaining C<%params> are passed to the function
66
C<SL::Presenter::Tag::link_tag>. It can include:
67

  
68
=over 2
69

  
70
=item * no_link
71

  
72
If falsish (the default) then the shop order will be linked to the "show" dialog.
73

  
74
=back
75

  
76
C<%params> gets passed to L<SL::Presenter::Tag/link_tag>.
77

  
78
=back
79

  
80
=head1 BUGS
81

  
82
Nothing here yet.
83

  
84
=head1 AUTHOR
85

  
86
Tamino Steinert E<lt>tamino.steinert@tamino.stE<gt>
87

  
88
=cut

Auch abrufbar als: Unified diff