X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FHelper%2FSorted.pm;h=98c0a7c1088707e6267cdd1c7c86eed5c7fd32f1;hb=faa7c313f767600c554fcbfb6321819c3f96c3e6;hp=8699f00c748467084e82a4b5c5c8f25033ae7e29;hpb=d08c706c8c3790ff09c5c9c97541c7936e74e6c9;p=kivitendo-erp.git diff --git a/SL/Controller/Helper/Sorted.pm b/SL/Controller/Helper/Sorted.pm index 8699f00c7..98c0a7c10 100644 --- a/SL/Controller/Helper/Sorted.pm +++ b/SL/Controller/Helper/Sorted.pm @@ -11,7 +11,7 @@ our @EXPORT = qw(make_sorted get_sort_spec get_current_sort_params set_report_ge use constant PRIV => '__sortedhelperpriv'; -my $controller_sort_spec; +my %controller_sort_spec; sub make_sorted { my ($class, %specs) = @_; @@ -22,7 +22,7 @@ sub make_sorted { while (my ($column, $spec) = each %specs) { next if $column =~ m/^[A-Z_]+$/; - $spec = $specs{$column} = { title => $spec } if !ref $spec; + $spec = $specs{$column} = { title => $spec } if (ref($spec) || '') ne 'HASH'; $spec->{model} ||= $specs{MODEL}; $spec->{model_column} ||= $column; @@ -35,7 +35,7 @@ sub make_sorted { $specs{ONLY} ||= []; $specs{ONLY} = [ $specs{ONLY} ] if !ref $specs{ONLY}; - $controller_sort_spec = \%specs; + $controller_sort_spec{$class} = \%specs; my %hook_params = @{ $specs{ONLY} } ? ( only => $specs{ONLY} ) : (); $class->run_before('_save_current_sort_params', %hook_params); @@ -53,7 +53,7 @@ sub make_sorted { sub get_sort_spec { my ($class_or_self) = @_; - return $controller_sort_spec; + return $controller_sort_spec{ref($class_or_self) || $class_or_self}; } sub get_current_sort_params {