version 1.3, 2006/05/17 15:01:40
|
version 1.6, 2006/05/17 15:22:32
|
Line 71 sub get_people_in_class {
|
Line 71 sub get_people_in_class {
|
# Enumerate the course_personnel. |
# Enumerate the course_personnel. |
# |
# |
my @course_personnel; |
my @course_personnel; |
for (sort keys %coursepersonnel) { |
for my $role (sort(keys(%coursepersonnel))) { |
for my $role (split /,/, $coursepersonnel{$_}) { |
# extract the names so we can sort them |
# extract the names so we can sort them |
my @people; |
my @people; |
for my $person (split(/,/, $coursepersonnel{$role})) { |
|
my ($uname,$domain) = split(/:/, $person); |
for (split /,/, $role) { |
push(@people, [&Apache::loncommon::plainname($uname,$domain), |
push @people, [split /:/, $role]; |
$uname,$domain]); |
} |
} |
|
@people = sort { $a->[0] cmp $b->[0] } (@people); |
@people = sort { $a->[0] cmp $b->[0] } @people; |
|
|
|
for my $person (@people) { |
for my $person (@people) { |
push @course_personnel, [join(':', @$person), $person->[0], '', $_]; |
push(@course_personnel, [join(':', $person->[1],$person->[2]), |
} |
$person->[0], '', '', $role]); |
} |
} |
} |
} |
# Students must be split into the three categories: |
# Students must be split into the three categories: |
Line 102 sub get_people_in_class {
|
Line 101 sub get_people_in_class {
|
|
|
|
|
my $classlist = &Apache::loncoursedata::get_classlist(); |
my $classlist = &Apache::loncoursedata::get_classlist(); |
my @keys = keys %{$classlist}; |
my @keys = keys(%{$classlist}); |
# Sort by: Section, name |
# Sort by: Section, name |
@keys = sort { |
@keys = sort { |
if ($classlist->{$a}->[$section] ne $classlist->{$b}->[$section]) { |
if ($classlist->{$a}->[$section] ne $classlist->{$b}->[$section]) { |
return $classlist->{$a}->[$section] cmp $classlist->{$b}->[$section]; |
return $classlist->{$a}->[$section] cmp $classlist->{$b}->[$section]; |
} |
} |
return $classlist->{$a}->[$fullname] cmp $classlist->{$b}->[$fullname]; |
return $classlist->{$a}->[$fullname] cmp $classlist->{$b}->[$fullname]; |
} @keys; |
} (@keys); |
|
|
|
|
|
|
|
|
for (@keys) { |
for my $user (@keys) { |
|
|
if ( $classlist->{$_}->[$status] eq |
if ( $classlist->{$user}->[$status] eq |
'Active') { |
'Active') { |
push @current_members, [$_, $classlist->{$_}->[$fullname], |
push(@current_members, [$user, $classlist->{$user}->[$fullname], |
$classlist->{$_}->[$section], |
$classlist->{$user}->[$section], |
$classlist->{$_}->[$status], 'Student']; |
$classlist->{$user}->[$status], 'Student']); |
} else { |
} else { |
# Need to figure out if this user is future or |
# Need to figure out if this user is future or |
# Expired... If the start date is in the future |
# Expired... If the start date is in the future |
# the user is future...else expired. |
# the user is future...else expired. |
|
|
my $now = time; |
my $now = time; |
if ($classlist->{$_}->[$start_date] > $now) { |
if ($classlist->{$user}->[$start_date] > $now) { |
push @future_members, [$_, $classlist->{$_}->[$fullname], |
push(@future_members, [$user, $classlist->{$user}->[$fullname], |
$classlist->{$_}->[$section], |
$classlist->{$user}->[$section], |
"Future", "Student"]; |
"Future", "Student"]); |
} else { |
} else { |
push @expired_members, [$_, $classlist->{$_}->[$fullname], |
push(@expired_members, [$user, |
$classlist->{$_}->[$section], |
$classlist->{$user}->[$fullname], |
"Expired", "Student"]; |
$classlist->{$user}->[$section], |
|
"Expired", "Student"]); |
} |
} |
|
|
} |
} |
Line 355 SCRIPT
|
Line 355 SCRIPT
|
|
|
# Figure out which students are checked by default... |
# Figure out which students are checked by default... |
|
|
if(%$defaultusers) { |
if (%$defaultusers) { |
if (exists ($defaultusers->{$user})) { |
if (exists ($defaultusers->{$user})) { |
$result .= ' checked ="checked" '; |
$result .= ' checked ="checked" '; |
$checked = 1; |
$checked = 1; |
Line 364 SCRIPT
|
Line 364 SCRIPT
|
$result .= ' checked="checked" '; |
$result .= ' checked="checked" '; |
$checked = 1; # First one for radio if no default specified. |
$checked = 1; # First one for radio if no default specified. |
} |
} |
$result .= ' value="'. HTML::Entities::encode($user . ':' |
$result .= ' value="'.&HTML::Entities::encode($user . ':' |
.$student->[2] . ':' |
.$student->[2] . ':' |
.$student->[1] . ':' |
.$student->[1] . ':' |
.$student->[3] . ':' |
.$student->[3] . ':' |
.$student->[4] . ":" |
.$student->[4] . ":" |
.$formprefix, "<>&\"'") |
.$formprefix, "<>&\"'") |
."\" /></td><td>\n"; |
."\" /></td><td>\n"; |
$result .= HTML::Entities::encode($student->[1], '<>&"') |
$result .= &HTML::Entities::encode($student->[1], '<>&"') |
. '</td><td align="center" >'."\n"; |
. '</td><td align="center" >'."\n"; |
$result .= HTML::Entities::encode($student->[2], '<>&"') |
$result .= &HTML::Entities::encode($student->[2], '<>&"') |
. '</td><td align="center">'."\n"; |
. '</td><td align="center">'."\n"; |
$result .= HTML::Entities::encode($student->[3], '<>&"') |
$result .= &HTML::Entities::encode($student->[3], '<>&"') |
. '</td><td align="center">'."\n"; |
. '</td><td align="center">'."\n"; |
$result .= HTML::Entities::encode($student->[4], '<>&"') |
$result .= &HTML::Entities::encode($student->[4], '<>&"') |
. '</td><td align="center">'."\n"; |
. '</td><td align="center">'."\n"; |
$result .= HTML::Entities::encode($student->[0], '<>&"') |
$result .= &HTML::Entities::encode($student->[0], '<>&"') |
. '</td>'.&Apache::loncommon::end_data_table_row(). |
. '</td>'.&Apache::loncommon::end_data_table_row(). |
"\n"; |
"\n"; |
} |
} |