Archived
1
0

Grades from defenses are now the same for the group

This commit is contained in:
Mercier Pierre-Olivier 2014-01-09 18:00:29 +01:00
parent ea711bc7bc
commit f5ff3c83b3

View File

@ -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