version 1.6, 2006/05/17 15:22:32
|
version 1.7, 2006/05/23 21:41:26
|
Line 36 use HTML::Entities;
|
Line 36 use HTML::Entities;
|
# This function produces a list references to four |
# This function produces a list references to four |
# arrays: |
# arrays: |
# (\@course_personel, \@current_members, \@expired_members, \@future_members) |
# (\@course_personel, \@current_members, \@expired_members, \@future_members) |
# |
# |
|
# |
|
# Parameters; |
|
# |
|
# restrict - Optional.. if present and defined should be a section name. |
|
# The *_members arrays will then only contain people |
|
# in that section |
|
# |
# Where: |
# Where: |
# course_personnel - Each element of this array is itself a reference to an array |
# course_personnel - Each element of this array is itself a reference to an array |
# containing information about a member of the course staff. |
# containing information about a member of the course staff. |
Line 66 use HTML::Entities;
|
Line 73 use HTML::Entities;
|
# [4] username:domain of the user. |
# [4] username:domain of the user. |
# |
# |
sub get_people_in_class { |
sub get_people_in_class { |
|
my ($section_restriction) = @_; |
my %coursepersonnel = &Apache::lonnet::get_course_adv_roles(); |
my %coursepersonnel = &Apache::lonnet::get_course_adv_roles(); |
# |
# |
# Enumerate the course_personnel. |
# Enumerate the course_personnel. |
Line 114 sub get_people_in_class {
|
Line 122 sub get_people_in_class {
|
|
|
|
|
for my $user (@keys) { |
for my $user (@keys) { |
|
if (!$section_restriction || |
if ( $classlist->{$user}->[$status] eq |
($section_restriction eq $classlist->{$user}->[$section])) { |
'Active') { |
|
push(@current_members, [$user, $classlist->{$user}->[$fullname], |
|
$classlist->{$user}->[$section], |
|
$classlist->{$user}->[$status], 'Student']); |
|
} else { |
|
# Need to figure out if this user is future or |
|
# Expired... If the start date is in the future |
|
# the user is future...else expired. |
|
|
|
my $now = time; |
if ( $classlist->{$user}->[$status] eq |
if ($classlist->{$user}->[$start_date] > $now) { |
'Active') { |
push(@future_members, [$user, $classlist->{$user}->[$fullname], |
push(@current_members, [$user, $classlist->{$user}->[$fullname], |
$classlist->{$user}->[$section], |
$classlist->{$user}->[$section], |
"Future", "Student"]); |
$classlist->{$user}->[$status], 'Student']); |
} else { |
} else { |
push(@expired_members, [$user, |
# Need to figure out if this user is future or |
$classlist->{$user}->[$fullname], |
# Expired... If the start date is in the future |
$classlist->{$user}->[$section], |
# the user is future...else expired. |
"Expired", "Student"]); |
|
|
my $now = time; |
|
if ($classlist->{$user}->[$start_date] > $now) { |
|
push(@future_members, [$user, $classlist->{$user}->[$fullname], |
|
$classlist->{$user}->[$section], |
|
"Future", "Student"]); |
|
} else { |
|
push(@expired_members, [$user, |
|
$classlist->{$user}->[$fullname], |
|
$classlist->{$user}->[$section], |
|
"Expired", "Student"]); |
|
} |
|
|
} |
} |
|
|
} |
} |
} |
} |
return (\@course_personnel, |
return (\@course_personnel, |