version 1.22, 2007/10/03 19:57:29
|
version 1.25, 2008/01/12 22:32:04
|
Line 461 sub construct_data_table {
|
Line 461 sub construct_data_table {
|
} |
} |
my $output = &Apache::loncommon::start_data_table(). |
my $output = &Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(); |
&Apache::loncommon::start_data_table_header_row(); |
my @coltitles = ('Code','Sections','Crosslisted','Title','Owner(s)'); |
my @coltitles = ('Count','Code','Sections','Crosslisted','Title','Owner(s)'); |
if (ref($usersections) eq 'HASH') { |
if (ref($usersections) eq 'HASH') { |
$coltitles[1] = 'Your Section'; |
$coltitles[1] = 'Your Section'; |
} |
} |
Line 469 sub construct_data_table {
|
Line 469 sub construct_data_table {
|
$output .= '<th>'; |
$output .= '<th>'; |
if (defined($sortname{$item})) { |
if (defined($sortname{$item})) { |
$output .= '<a href="javascript:changeSort('."'$sortname{$item}'".')">'.&mt($item).'</a>'; |
$output .= '<a href="javascript:changeSort('."'$sortname{$item}'".')">'.&mt($item).'</a>'; |
|
} elsif ($item eq 'Count') { |
|
$output .= ' '; |
} else { |
} else { |
$output .= &mt($item); |
$output .= &mt($item); |
} |
} |
Line 494 sub construct_data_table {
|
Line 496 sub construct_data_table {
|
} elsif ($env{'form.sortby'} eq 'owner') { |
} elsif ($env{'form.sortby'} eq 'owner') { |
push(@{$Sortby{$courseinfo{$course}{'ownerlastnames'}}},$course); |
push(@{$Sortby{$courseinfo{$course}{'ownerlastnames'}}},$course); |
} else { |
} else { |
push(@{$Sortby{$courseinfo{$course}{'title'}}},$course); |
my $clean_title = $courseinfo{$course}{'title'}; |
|
$clean_title =~ s/\W+//g; |
|
if ($clean_title eq '') { |
|
$clean_title = $courseinfo{$course}{'title'}; |
|
} |
|
push(@{$Sortby{$clean_title}},$course); |
} |
} |
} |
} |
my @sorted_courses; |
my @sorted_courses; |
Line 503 sub construct_data_table {
|
Line 510 sub construct_data_table {
|
} else { |
} else { |
@sorted_courses = sort { lc($a) cmp lc($b) } (keys(%Sortby)); |
@sorted_courses = sort { lc($a) cmp lc($b) } (keys(%Sortby)); |
} |
} |
|
my $count = 1; |
foreach my $item (@sorted_courses) { |
foreach my $item (@sorted_courses) { |
foreach my $course (@{$Sortby{$item}}) { |
foreach my $course (@{$Sortby{$item}}) { |
$output.=&Apache::loncommon::start_data_table_row(); |
$output.=&Apache::loncommon::start_data_table_row(); |
$output.=&courseinfo_row($courseinfo{$course},$knownuser,$details); |
$output.=&courseinfo_row($courseinfo{$course},$knownuser,$details,\$count); |
$output.=&Apache::loncommon::end_data_table_row(); |
$output.=&Apache::loncommon::end_data_table_row(); |
} |
} |
} |
} |
Line 522 sub build_courseinfo_hash {
|
Line 530 sub build_courseinfo_hash {
|
my $descr; |
my $descr; |
if (ref($courses->{$course}) eq 'HASH') { |
if (ref($courses->{$course}) eq 'HASH') { |
$descr = $courses->{$course}{'description'}; |
$descr = $courses->{$course}{'description'}; |
} elsif ($courses->{$course} =~ m/^([^:]*):/i) { |
|
$descr = &unescape($1); |
|
} else { |
|
$descr = &unescape($courses->{$course}); |
|
} |
} |
my $cleandesc=&HTML::Entities::encode($descr,'<>&"'); |
my $cleandesc=&HTML::Entities::encode($descr,'<>&"'); |
$cleandesc=~s/'/\\'/g; |
$cleandesc=~s/'/\\'/g; |
Line 534 sub build_courseinfo_hash {
|
Line 538 sub build_courseinfo_hash {
|
my ($descr,$instcode,$singleowner,$ttype,@owners,%ownernames); |
my ($descr,$instcode,$singleowner,$ttype,@owners,%ownernames); |
if (ref($courses->{$course}) eq 'HASH') { |
if (ref($courses->{$course}) eq 'HASH') { |
$descr = $courses->{$course}{'description'}; |
$descr = $courses->{$course}{'description'}; |
$instcode = $courses->{$course}{'instcode'}; |
$instcode = $courses->{$course}{'inst_code'}; |
$singleowner = $courses->{$course}{'owner'}; |
$singleowner = $courses->{$course}{'owner'}; |
$ttype = $courses->{$course}{'type'}; |
$ttype = $courses->{$course}{'type'}; |
push(@owners,$singleowner); |
push(@owners,$singleowner); |
Line 543 sub build_courseinfo_hash {
|
Line 547 sub build_courseinfo_hash {
|
push(@owners,$item); |
push(@owners,$item); |
} |
} |
} |
} |
} else { |
|
($descr,$instcode,$singleowner,$ttype) = |
|
split(/:/,$courses->{$course}); |
|
push(@owners,$singleowner); |
|
} |
} |
foreach my $owner (@owners) { |
foreach my $owner (@owners) { |
my ($ownername,$ownerdom) = @_; |
my ($ownername,$ownerdom) = @_; |
Line 658 sub count_students {
|
Line 658 sub count_students {
|
} |
} |
|
|
sub courseinfo_row { |
sub courseinfo_row { |
my ($info,$knownuser,$details) = @_; |
my ($info,$knownuser,$details,$countref) = @_; |
my ($cdom,$cnum,$title,$ownerlast,$code,$owner,$seclist,$xlist_items, |
my ($cdom,$cnum,$title,$ownerlast,$code,$owner,$seclist,$xlist_items, |
$accessdates,$showsyllabus,$counts,$autoenrollment,$output); |
$accessdates,$showsyllabus,$counts,$autoenrollment,$output); |
if (ref($info) eq 'HASH') { |
if (ref($info) eq 'HASH') { |
Line 679 sub courseinfo_row {
|
Line 679 sub courseinfo_row {
|
$code).'</td>'; |
$code).'</td>'; |
return $output; |
return $output; |
} |
} |
$output .= '<td>'.$code.'</td>'. |
$output .= '<td>'.$$countref.'</td>'. |
|
'<td>'.$code.'</td>'. |
'<td>'.$seclist.'</td>'. |
'<td>'.$seclist.'</td>'. |
'<td>'.$xlist_items.'</td>'. |
'<td>'.$xlist_items.'</td>'. |
'<td>'.$title.' <font size="-2">'; |
'<td>'.$title.' <font size="-2">'; |
Line 700 sub courseinfo_row {
|
Line 701 sub courseinfo_row {
|
$output .= "<td><a href=\"javascript:setCourseId('$cnum')\">".&mt('Show more details').'</a></td>'; |
$output .= "<td><a href=\"javascript:setCourseId('$cnum')\">".&mt('Show more details').'</a></td>'; |
} |
} |
} |
} |
|
$$countref ++; |
return $output; |
return $output; |
} |
} |
|
|