Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7ac61a7e

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID 7ac61a7e2daace7dd425f25a4d63f40f13bc8b72
  • Vorgänger 67f4335c

Debitoren-/Kreditorenbuchung: Kunde/Lieferant in neuem Tab bearbeiten

Unterschiede anzeigen:

SL/Presenter/CustomerVendor.pm
2 2

  
3 3
use strict;
4 4

  
5
use SL::DB::Customer;
6
use SL::DB::Vendor;
7
use SL::Locale::String;
5 8
use SL::Presenter::EscapedText qw(escape is_escaped);
6 9
use SL::Presenter::Tag qw(input_tag html_tag name_to_id select_tag link_tag);
7 10

  
......
16 19
}
17 20

  
18 21
sub customer {
19
  my ($customer, %params) = @_;
22
  my ($customer_or_id, %params) = @_;
23
  my $customer;
24
  if (ref($customer_or_id) eq 'SL::DB::Customer') {
25
    $customer = $customer_or_id;
26
  } else {
27
    $customer = SL::DB::Customer->new(id => $customer_or_id)->load;
28
  }
20 29
  return _customer_vendor($customer, 'customer', %params);
21 30
}
22 31

  
23 32
sub vendor {
24
  my ($vendor, %params) = @_;
33
  my ($vendor_or_id, %params) = @_;
34
  my $vendor;
35
  if (ref($vendor_or_id) eq 'SL::DB::Vendor') {
36
    $vendor = $vendor_or_id;
37
  } else {
38
    $vendor = SL::DB::Vendor->new(id => $vendor_or_id)->load;
39
  }
25 40
  return _customer_vendor($vendor, 'vendor', %params);
26 41
}
27 42

  
......
32 47

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

  
35
  my $text = escape($cv->name);
50
  my $text = escape(delete $params{text} || $cv->name);
36 51
  if (! delete $params{no_link}) {
37 52
    my $href = 'controller.pl?action=CustomerVendor/edit&db=' . $type
38 53
               . '&id=' . escape($cv->id);
......
107 122

  
108 123
=over 4
109 124

  
110
=item C<customer $object, %params>
125
=item C<customer $object_or_id, %params>
111 126

  
112 127
Returns a rendered version (actually an instance of
113 128
L<SL::Presenter::EscapedText>) of the customer object C<$object>.
......
127 142
If falsish (the default) then the customer's name will be linked to
128 143
the "edit customer" dialog from the master data menu.
129 144

  
145
=item * text
146

  
147
If falsish (the default) then the customer's name will be used, otherwise the
148
value is displayed.
149

  
130 150
=back
131 151

  
132
=item C<vendor $object, %params>
152
=item C<vendor $object_or_id, %params>
133 153

  
134 154
Returns a rendered version (actually an instance of
135 155
L<SL::Presenter::EscapedText>) of the vendor object C<$object>.
......
149 169
If falsish (the default) then the vendor's name will be linked to
150 170
the "edit vendor" dialog from the master data menu.
151 171

  
172
=item * text
173

  
174
If falsish (the default) then the vendor's name will be used, otherwise the
175
value is displayed.
176

  
152 177
=back
153 178

  
154 179
=item C<customer_vendor $object, %params>
templates/design40_webpages/ap/form_header.html
87 87
      <td class="wi-lightwide">
88 88
        [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", onchange="\$('#update_button').click()") %]
89 89
        [% L.button_tag("show_vc_details('vendor')", LxERP.t8('Details (one letter abbreviation)'), class='wi-tiny neutral') %]
90
        [% IF vendor_id %]
91
          [% P.customer_vendor.vendor(vendor_id,
92
                                      text=LxERP.t8('text=LxERP.t8('Edit'),
93
                                      title=LxERP.t8('Open in new window'),
94
                                      target='_blank',
95
                                      class="button",
96
                                      style="color:#fff") %]
97
        [% END %]
90 98
        [% L.hidden_tag("previous_vendor_id", vendor_id) %]
91 99
      </td>
92 100
    </tr>
templates/design40_webpages/ar/form_header.html
56 56
        <td>
57 57
         [% P.customer_vendor.picker("customer_id", customer_id, type="customer", class=(initial_focus == 'customer_id' ? "initial_focus" : ""), onchange="\$('#update_button').click()") %]
58 58
         [% L.button_tag("show_vc_details('customer')", LxERP.t8('Details (one letter abbreviation)')) %]
59
         [% IF customer_id %]
60
           [% P.customer_vendor.customer(customer_id,
61
                                         text=LxERP.t8('Edit'),
62
                                         title=LxERP.t8('Open in new window'),
63
                                         target='_blank',
64
                                         class="button",
65
                                         style="color:#fff") %]
66
         [% END %]
59 67
         [% L.hidden_tag("previous_customer_id", customer_id) %]
60 68
         [% L.hidden_tag('terms', terms) %]
61 69
       </td>

Auch abrufbar als: Unified diff