support override of reports

This commit is contained in:
Oliver Gorwits
2014-10-05 12:34:02 +01:00
parent 745a3b7a63
commit 7630b6ec7b

View File

@@ -169,20 +169,21 @@ register 'register_report' => sub {
return error "bad config to register_report"; return error "bad config to register_report";
} }
foreach my $tag (@{setting('_reports_menu')->{ $config->{category} }}) { if (0 == scalar grep {$_ eq $config->{tag}}
if ($tag eq $config->{tag}) { @{setting('_reports_menu')->{ $config->{category} }}) {
setting('_reports')->{$tag} = $config; push @{setting('_reports_menu')->{ $config->{category} }}, $config->{tag};
return;
}
} }
push @{setting('_reports_menu')->{ $config->{category} }}, $config->{tag}; foreach my $tag (@{setting('_reports_menu')->{ $config->{category} }}) {
setting('_reports')->{$config->{tag}} = $config; if ($config->{tag} eq $tag) {
setting('_reports')->{$tag} = $config;
foreach my $rconfig (@{setting('reports')}) { foreach my $rconfig (@{setting('reports')}) {
if ($rconfig->{tag} eq $config->{tag}) { if ($rconfig->{tag} eq $tag) {
setting('_reports')->{$config->{tag}}->{'rconfig'} = $rconfig; setting('_reports')->{$tag}->{'rconfig'} = $rconfig;
last; last;
}
}
} }
} }
}; };