projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b468aaa
)
SL::DB::Unit: convertible_units die Einheitenliste übergeben können
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Mon, 27 Jan 2014 16:27:57 +0000
(17:27 +0100)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Mon, 24 Feb 2014 13:40:00 +0000
(14:40 +0100)
…damit nicht jeder Aufruf von convertible_units an die DB geht.
SL/DB/Unit.pm
patch
|
blob
|
history
diff --git
a/SL/DB/Unit.pm
b/SL/DB/Unit.pm
index
927e31b
..
b133d8f
100644
(file)
--- a/
SL/DB/Unit.pm
+++ b/
SL/DB/Unit.pm
@@
-27,10
+27,12
@@
sub unit_class {
sub convertible_units {
my $self = shift;
+ my $all_units = scalar(@_) && (ref($_[0]) eq 'ARRAY') ? $_[0] : \@_;
+ $all_units = SL::DB::Manager::Unit->get_all if !@{ $all_units };
return [
sort { $a->sortkey <=> $b->sortkey }
grep { $_->unit_class->name eq $self->unit_class->name }
- @{
SL::DB::Manager::Unit->get_all
}
+ @{
$all_units
}
];
}