--- loncom/auth/lonroles.pm 2003/11/08 12:06:38 1.75 +++ loncom/auth/lonroles.pm 2003/11/11 00:54:57 1.77 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.75 2003/11/08 12:06:38 albertel Exp $ +# $Id: lonroles.pm,v 1.77 2003/11/11 00:54:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -445,7 +445,7 @@ ENDHEADER my $tcourseid=$tdom.'_'.$trest; if ($ENV{'course.'.$tcourseid.'.description'}) { $twhere=$ENV{'course.'.$tcourseid.'.description'}; - $sortkey=$twhere."\0".$envkey; + $sortkey=$tdom."\0".$twhere."\0".$envkey; unless ($twhere eq &mt('Currently not available')) { $twhere.=' '. &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom,$tfont). @@ -455,7 +455,8 @@ ENDHEADER my %newhash=Apache::lonnet::coursedescription ($tcourseid); if (%newhash) { - $sortkey=$newhash{'description'}."\0".$envkey; + $sortkey=$tdom."\0".$newhash{'description'}. + "\0".$envkey; $twhere=$newhash{'description'}. ' '. &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom,$tfont). @@ -463,7 +464,7 @@ ENDHEADER } else { $twhere=&mt('Currently not available'); $ENV{'course.'.$tcourseid.'.description'}=$twhere; - $sortkey=$twhere."\0".$envkey; + $sortkey=$tdom."\0".$twhere."\0".$envkey; } } if ($role ne 'st') { $twhere.="
".&mt('Domain').":".$tdom; } @@ -519,12 +520,32 @@ ENDHEADER } } } - foreach my $type ('Construction Space','Course','Domain','System') { + my $doheaders=-1; + foreach my $type (&mt('Construction Space'),&mt('Course'), + &mt('Domain'),&mt('System')) { + my $haverole=0; foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { - $r->print($roletext{$sortrole{$which}}); + $haverole=1; } } + if ($haverole) { $doheaders++; } + } + foreach my $type (&mt('Construction Space'),&mt('Course'), + &mt('Domain'),&mt('System')) { + my $output; + foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { + if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { + $output.=$roletext{$sortrole{$which}}; + } + } + if ($output) { + if ($doheaders > 0) { + $r->print("". + "$type"); + } + $r->print($output); + } } my $tremark=''; my $tfont='#003300';