--- loncom/interface/coursecatalog.pm 2007/10/06 04:32:49 1.23 +++ loncom/interface/coursecatalog.pm 2007/12/10 23:54:40 1.24 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for displaying the course catalog interface # -# $Id: coursecatalog.pm,v 1.23 2007/10/06 04:32:49 raeburn Exp $ +# $Id: coursecatalog.pm,v 1.24 2007/12/10 23:54:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -461,7 +461,7 @@ sub construct_data_table { } my $output = &Apache::loncommon::start_data_table(). &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') { $coltitles[1] = 'Your Section'; } @@ -469,6 +469,8 @@ sub construct_data_table { $output .= ''; if (defined($sortname{$item})) { $output .= ''.&mt($item).''; + } elsif ($item eq 'Count') { + $output .= '  '; } else { $output .= &mt($item); } @@ -503,10 +505,11 @@ sub construct_data_table { } else { @sorted_courses = sort { lc($a) cmp lc($b) } (keys(%Sortby)); } + my $count = 1; foreach my $item (@sorted_courses) { foreach my $course (@{$Sortby{$item}}) { $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(); } } @@ -650,7 +653,7 @@ sub count_students { } sub courseinfo_row { - my ($info,$knownuser,$details) = @_; + my ($info,$knownuser,$details,$countref) = @_; my ($cdom,$cnum,$title,$ownerlast,$code,$owner,$seclist,$xlist_items, $accessdates,$showsyllabus,$counts,$autoenrollment,$output); if (ref($info) eq 'HASH') { @@ -671,7 +674,8 @@ sub courseinfo_row { $code).''; return $output; } - $output .= ''.$code.''. + $output .= ''.$$countref.''. + ''.$code.''. ''.$seclist.''. ''.$xlist_items.''. ''.$title.' '; @@ -692,6 +696,7 @@ sub courseinfo_row { $output .= "".&mt('Show more details').''; } } + $$countref ++; return $output; }