Revision ca18e047
Von Moritz Bunkus vor fast 11 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
2137 | 2137 |
sub _get_employees { |
2138 | 2138 |
$main::lxdebug->enter_sub(); |
2139 | 2139 |
|
2140 |
my ($self, $dbh, $default_key, $key) = @_; |
|
2140 |
my ($self, $dbh, $params) = @_; |
|
2141 |
|
|
2142 |
my $deleted = 0; |
|
2143 |
|
|
2144 |
my $key; |
|
2145 |
if (ref $params eq 'HASH') { |
|
2146 |
$key = $params->{key}; |
|
2147 |
$deleted = $params->{deleted}; |
|
2148 |
|
|
2149 |
} else { |
|
2150 |
$key = $params; |
|
2151 |
} |
|
2141 | 2152 |
|
2142 |
$key = $default_key unless ($key); |
|
2143 |
$self->{$key} = selectall_hashref_query($self, $dbh, qq|SELECT * FROM employee ORDER BY lower(name)|); |
|
2153 |
$key ||= "all_employees"; |
|
2154 |
my $filter = $deleted ? '' : 'WHERE NOT COALESCE(deleted, FALSE)'; |
|
2155 |
$self->{$key} = selectall_hashref_query($self, $dbh, qq|SELECT * FROM employee $filter ORDER BY lower(name)|); |
|
2144 | 2156 |
|
2145 | 2157 |
$main::lxdebug->leave_sub(); |
2146 | 2158 |
} |
... | ... | |
2380 | 2392 |
} |
2381 | 2393 |
|
2382 | 2394 |
if ($params{"employees"}) { |
2383 |
$self->_get_employees($dbh, "all_employees", $params{"employees"});
|
|
2395 |
$self->_get_employees($dbh, $params{"employees"}); |
|
2384 | 2396 |
} |
2385 | 2397 |
|
2386 | 2398 |
if ($params{"salesmen"}) { |
Auch abrufbar als: Unified diff
SL::Form->get_lists für employees: Gelöschte nur auf Anfrage mitliefern
Behebt #2116.