--- loncom/interface/lonpickcourse.pm 2004/12/28 05:55:11 1.23
+++ loncom/interface/lonpickcourse.pm 2005/01/27 19:20:55 1.24
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Pick a course
#
-# $Id: lonpickcourse.pm,v 1.23 2004/12/28 05:55:11 raeburn Exp $
+# $Id: lonpickcourse.pm,v 1.24 2005/01/27 19:20:55 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -225,18 +225,31 @@ ENDSCRIPT
} else {
$descr = &Apache::lonnet::unescape($courses{$course});
}
- $by_descrip{lc($descr)}=$course;
+ my $description = lc($descr);
+ if (exists($by_descrip{$description})) {
+ push @{$by_descrip{$description}}, ($course);
+ } else {
+ @{$by_descrip{$description}} = ($course);
+ }
}
foreach my $description (sort(keys(%by_descrip))) {
- my $course=$by_descrip{$description};
- my $cleandesc=&HTML::Entities::encode($description,'<>&"');
- $cleandesc=~s/'/\\'/g;
- my ($cdom,$cnum)=split(/\_/,$course);
- $r->print(' '.$description.' ('.
- ($Apache::lonnet::domaindescription{$cdom}?
- $Apache::lonnet::domaindescription{$cdom}:$cdom).
- ")
\n");
+ foreach my $course (@{$by_descrip{$description}}) {
+ my $cleandesc=&HTML::Entities::encode($description,'<>&"');
+ $cleandesc=~s/'/\\'/g;
+ my ($cdom,$cnum)=split(/\_/,$course);
+ my ($descr,$instcode,$owner) = split/:/,$courses{$course};
+ $r->print(' '.$description.' ('.
+ ($Apache::lonnet::domaindescription{$cdom}?
+ $Apache::lonnet::domaindescription{$cdom}:$cdom).")");
+ unless ($instcode eq '') {
+ $r->print(" - ".&Apache::lonnet::unescape($instcode));
+ }
+ unless ($owner eq '') {
+ $r->print(", owner - ".&Apache::lonnet::unescape($owner));
+ }
+ $r->print("
\n");
+ }
}
if (!%courses) { $r->print(&mt('None found')); }
$r->print(''."\n".