Revision 09c8c053
Von Moritz Bunkus vor fast 7 Jahren hinzugefügt
SL/DB/CustomDataExportQueryParameter.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 | 1 |
package SL::DB::CustomDataExportQueryParameter; |
5 | 2 |
|
6 | 3 |
use strict; |
... | ... | |
10 | 7 |
|
11 | 8 |
__PACKAGE__->meta->initialize; |
12 | 9 |
|
10 |
sub _default_value_type_fixed_value { $_[0]->default_value } |
|
11 |
sub _default_value_type_current_user_login { $::myconfig{login} } |
|
12 |
|
|
13 |
sub _default_value_type_sql_query { |
|
14 |
my ($self) = @_; |
|
15 |
|
|
16 |
return '' if !$self->default_value; |
|
17 |
|
|
18 |
my @result = $self->db->dbh->selectrow_array($self->default_value); |
|
19 |
$::form->dberror if !@result; |
|
20 |
|
|
21 |
return $result[0]; |
|
22 |
} |
|
23 |
|
|
24 |
sub calculate_default_value { |
|
25 |
my ($self) = @_; |
|
26 |
|
|
27 |
my $method = "_default_value_type_" . ($self->default_value_type // ''); |
|
28 |
return $self->can($method) ? $self->$method : ''; |
|
29 |
} |
|
30 |
|
|
13 | 31 |
1; |
Auch abrufbar als: Unified diff
Benutzerdefinierte Datenexporte: Standardwerte für Parameter angeben können