Grades from defenses are now the same for the group
This commit is contained in:
parent
ea711bc7bc
commit
f5ff3c83b3
27
ACU/Trace.pm
27
ACU/Trace.pm
@ -133,14 +133,23 @@ sub getIds
|
|||||||
{
|
{
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $login = shift;
|
my $login = shift;
|
||||||
|
my $onlyNonZero = shift // 0;
|
||||||
|
|
||||||
my %ids;
|
my %ids;
|
||||||
foreach my $group (@{ $self->{groups} })
|
foreach my $group (@{ $self->{groups} })
|
||||||
{
|
{
|
||||||
my %tmp = $group->getIds($login);
|
my %tmp;
|
||||||
|
if ($self->{type} eq "defense")
|
||||||
|
{
|
||||||
|
# For a defense, we consider that this is a group grade, so don't consider login filtering
|
||||||
|
%tmp = $group->getIds();
|
||||||
|
} else {
|
||||||
|
%tmp = $group->getIds($login);
|
||||||
|
}
|
||||||
|
|
||||||
while (my ($key, $value) = each %tmp)
|
while (my ($key, $value) = each %tmp)
|
||||||
{
|
{
|
||||||
$ids{$key} = $value;
|
$ids{$key} = $value if !$onlyNonZero || $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return \%ids;
|
return \%ids;
|
||||||
@ -148,19 +157,7 @@ sub getIds
|
|||||||
|
|
||||||
sub getNonZeroIds
|
sub getNonZeroIds
|
||||||
{
|
{
|
||||||
my $self = shift;
|
return getIds($_[0], $_[1], 1);
|
||||||
my $login = shift;
|
|
||||||
|
|
||||||
my %ids;
|
|
||||||
foreach my $group (@{ $self->{groups} })
|
|
||||||
{
|
|
||||||
my %tmp = $group->getIds($login);
|
|
||||||
while (my ($key, $value) = each %tmp)
|
|
||||||
{
|
|
||||||
$ids{$key} = $value if $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return \%ids;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getValue
|
sub getValue
|
||||||
|
Reference in New Issue
Block a user