Revision a4767524
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/InstanceConfiguration.pm | ||
---|---|---|
11 | 11 |
); |
12 | 12 |
|
13 | 13 |
sub init_data { |
14 |
return {} if !$::auth->client; |
|
15 |
|
|
14 | 16 |
my $dbh = $::form->get_standard_dbh; |
15 | 17 |
my $data = SL::DBUtils::selectfirst_hashref_query($::form, $dbh, qq|SELECT * FROM defaults|); |
16 | 18 |
$data->{default_currency} = (SL::DBUtils::selectfirst_array_query($::form, $dbh, qq|SELECT name FROM currencies WHERE id = ?|, $data->{currency_id}))[0] if $data->{currency_id}; |
... | ... | |
19 | 21 |
} |
20 | 22 |
|
21 | 23 |
sub init_currencies { |
24 |
return [] if !$::auth->client; |
|
22 | 25 |
return [ map { $_->{name} } SL::DBUtils::selectall_hashref_query($::form, $::form->get_standard_dbh, qq|SELECT name FROM currencies ORDER BY id ASC|) ]; |
23 | 26 |
} |
24 | 27 |
|
Auch abrufbar als: Unified diff
InstanceConfiguration: Nur dann Daten aus Client-DB auslesen, wenn $::auth->client gesetzt ist