--- loncom/auth/lonroles.pm 2005/06/05 07:10:32 1.120 +++ loncom/auth/lonroles.pm 2005/11/01 21:59:24 1.131 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.120 2005/06/05 07:10:32 albertel Exp $ +# $Id: lonroles.pm,v 1.131 2005/11/01 21:59:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,7 +50,8 @@ sub redirect_user { my $swinfo=&Apache::lonmenu::rawconfig(); my $navwindow; if ($launch_nav eq 'on') { - $navwindow.=&Apache::lonnavmaps::launch_win('now'); + $navwindow.=&Apache::lonnavmaps::launch_win('now',undef,undef, + ($url eq '/adm/whatsnew')); } else { $navwindow.=&Apache::lonnavmaps::close(); } @@ -227,7 +228,7 @@ ENDENTERKEY my $tadv=0; my $msg=&mt('Entering course ...'); - if (($cnum) && ($role ne 'ca')) { + if (($cnum) && ($role ne 'ca') && ($role ne 'aa')) { my ($furl,$ferr)= &Apache::lonuserstate::readmap($cdom.'/'.$cnum); if (($env{'form.orgurl'}) && @@ -243,7 +244,7 @@ ENDENTERKEY "request.course.id" => $cdom.'_'.$cnum); $furl='/adm/roles?tryagain=1'; $msg= - '
Access : ". + $r->print("Access : ". Apache::lonnet::plaintext($priv)."\n"); $r->print("Resource: ".&Apache::lonenc::check_encrypt($fn)."\n"); $r->print("Action : $msg\n
"); @@ -354,7 +362,7 @@ ENDHEADER } else { if ($env{'user.error.msg'}) { $r->print( - ''. + '
'. &mt('You need to choose another user role or enter a specific course for this function').'
'); } } @@ -380,7 +388,7 @@ ENDHEADER ($env{'user.name'},$env{'user.domain'})}. "
\n"); $r->print(&mt( - "Author and Co-Author roles may not be available on servers other than your home server.")); + "Author and Co-Author roles are not available on servers other than their respective home servers.")); } if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) { $fn.='?'.$ENV{'REDIRECT_QUERY_STRING'}; @@ -453,7 +461,7 @@ ENDHEADER my $trole; if ($role =~ /^cr\//) { my ($rdummy,$rdomain,$rauthor,$rrole)=split(/\//,$role); - $tremark.='
'.&mt('Defined by ').$rauthor. + $tremark.='
'.&mt('Defined by ').$rauthor. &mt(' at ').$rdomain.'.'; $trole=$rrole; } else { @@ -464,18 +472,14 @@ ENDHEADER my ($tdom,$trest,$tsection)= split(/\//,Apache::lonnet::declutter($where)); # First, Co-Authorship roles - if ($role eq 'ca') { + if (($role eq 'ca') || ($role eq 'aa')) { my $home = &Apache::lonnet::homeserver($trest,$tdom); my $allowed=0; my @ids=&Apache::lonnet::current_machine_ids(); foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } } if (!$allowed) { $button=0; - $switchserver=&Apache::lonnet::escape('http://'. - $Apache::lonnet::hostname{$home}. - '/adm/login?domain='.$env{'user.domain'}. - '&username='.$env{'user.name'}. - '&firsturl=/priv/'.$trest.'/'); + $switchserver='otherserver='.$home.'&role='.$trolecode; } #next if ($home eq 'no_host'); $home = $Apache::lonnet::hostname{$home}; @@ -511,9 +515,6 @@ ENDHEADER $sortkey=$role; } elsif ($trest) { $ttype='Course'; - if ($tsection) { - $ttype.='
'.&mt('Section/Group').': '.$tsection; - } my $tcourseid=$tdom.'_'.$trest; if ($env{'course.'.$tcourseid.'.description'}) { $twhere=$env{'course.'.$tcourseid.'.description'}; @@ -538,6 +539,10 @@ ENDHEADER $sortkey=$role."\0".$tdom."\0".$twhere."\0".$envkey; } } + if ($tsection) { + $twhere.='
'.&mt('Section/Group').': '.$tsection; + } + if ($role ne 'st') { $twhere.="
".&mt('Domain').":".$tdom; } } elsif ($tdom) { $ttype='Domain'; @@ -583,11 +588,11 @@ ENDHEADER } $r->print('
'); unless ($nochoose) { $r->print(' '."\n"); my $doheaders=-1; - foreach my $type ('Construction Space','Course','Domain','System') { + foreach my $type ('Domain','Construction Space','Course','System') { my $haverole=0; foreach my $which (sort {uc($a) cmp uc($b)} (keys(%sortrole))) { if ($roleclass{$sortrole{$which}} =~ /^\Q$type\E/) { @@ -611,8 +616,8 @@ ENDHEADER } } if ($output) { - $r->print("'); } - $r->print(' '.&mt('User Role').' '.&mt('Extent'). + $r->print(' '.&mt('User Role').' '.&mt('Extent'). ' '.&mt('Start').' '.&mt('End').' '. &mt('Remarks and Calendar Announcements').' ". - &mt('Recent Roles')." "); + $r->print(""); $doheaders ++; @@ -637,8 +642,8 @@ ENDHEADER } if ($output) { if ($doheaders > 0) { - $r->print(" ". + &mt('Recent Roles')." "); $r->print($output); $r->print("". - " "); + $r->print("".&mt($type)." ". + " "); } $r->print($output); } @@ -660,7 +665,7 @@ ENDHEADER $r->print('".&mt($type)." '); } } - $r->print(' '.&mt('No role specified'). + $r->print(' '.&mt('No role specified'). ' '.$tremark. ' '."\n"); @@ -670,7 +675,7 @@ ENDHEADER } # ------------------------------------------------------------ Privileges Info if (($advanced) && (($env{'user.error.msg'}) || ($error))) { - $r->print('Current Privileges
'); + $r->print('Current Privileges
'); foreach $envkey (sort keys %env) { if ($envkey=~/^user\.priv\.$env{'request.role'}\./) { @@ -763,7 +768,7 @@ sub build_roletext { unless ($nochoose) { if (!$button) { if ($switchserver) { - $roletext.=''.&mt('Switch Server').' '; } else { $roletext.=(''); @@ -789,8 +794,7 @@ sub build_roletext { $roletext.=' '.$trole. - ' '.$ttype. - ' '.$twhere. + ' '.$twhere. ' '.$tpstart. ' '.$tpend. ' '.$tremark. @@ -947,17 +951,17 @@ sub allcourses_row { my $dcdom = shift; my $ccrole = Apache::lonnet::plaintext('cc'); my $selectlink = &courselink($dcdom); - my $output = ' '. + my $output = ' '. ' '."\n"; return $output;'. ' '. ''. - $ccrole.' '.&mt('Course').' '. + $ccrole.''. ''.&mt('All courses').': '. $selectlink.''. '
'.&mt('Domain').':'.$dcdom.''. - ''. + ' '. &mt('Course Coordinator access to all courses in domain'). ': '.$dcdom.'