--- loncom/auth/lonroles.pm 2013/05/10 15:02:45 1.285 +++ loncom/auth/lonroles.pm 2014/01/15 14:46:21 1.295 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.285 2013/05/10 15:02:45 raeburn Exp $ +# $Id: lonroles.pm,v 1.295 2014/01/15 14:46:21 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -532,6 +532,7 @@ ENDENTERKEY my ($feeds,$syllabus_time); &Apache::lonrss::advertisefeeds($cnum,$cdom,undef,\$feeds); &Apache::lonnet::appenv({'request.course.feeds' => $feeds}); + &Apache::lonnet::get_numsuppfiles($cnum,$cdom,1); unless ($env{'course.'.$cdom.'_'.$cnum.'.updatedsyllabus'}) { unless (($env{'course.'.$cdom.'_'.$cnum.'.externalsyllabus'}) || ($env{'course.'.$cdom.'_'.$cnum.'.uploadedsyllabus'})) { @@ -544,13 +545,14 @@ ENDENTERKEY } } if (($env{'form.orgurl'}) && - ($env{'form.orgurl'}!~/^\/adm\/flip/)) { + ($env{'form.orgurl'}!~/^\/adm\/flip/) && + ($env{'form.orgurl'} ne '/adm/roles')) { my $dest=$env{'form.orgurl'}; if ($env{'form.symb'}) { if ($dest =~ /\?/) { $dest .= '&'; } else { - $dest .= '?' + $dest .= '?'; } $dest .= 'symb='.$env{'form.symb'}; } @@ -691,7 +693,7 @@ ENDENTERKEY $redirect_url .= $where; } $redirect_url .= '/'; - &redirect_user($r,&mt('Entering Construction Space'), + &redirect_user($r,&mt('Entering Authoring Space'), $redirect_url); return OK; } @@ -723,11 +725,13 @@ ENDENTERKEY my $crumbtext = 'User Roles'; my $pagetitle = 'My Roles'; my $recent = &mt('Recent Roles'); + my $standby = &mt('Role selected. Please stand by.'); my $show_course=&Apache::loncommon::show_course(); if ($show_course) { $crumbtext = 'Courses'; $pagetitle = 'My Courses'; $recent = &mt('Recent Courses'); + $standby = &mt('Course selected. Please stand by.'); } my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}]; @@ -737,7 +741,6 @@ ENDENTERKEY my $swinfo=&Apache::lonmenu::rawconfig(); my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum}); my $funcs = &get_roles_functions($showcount); - my $standby=&mt('Role selected. Please stand by.'); $standby=~s/\n/\\n/g; my $noscript='
'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'
'.&mt('As this is not the case, most functionality in the system will be unavailable.').'

'; @@ -886,11 +889,13 @@ ENDHEADER my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); $r->print( '

' - .&mt('[_1]Visit the [_2]Course/Community Catalog[_3]' - .' to view all [_4] LON-CAPA courses and communities.' + .&mt('[_1]Visit the [_2]Course/Community Catalog[_3][_4]' + .' to view all [_5] LON-CAPA courses and communities.' ,'' ,'' - ,'',$domdesc) + ,'' + ,'' + ,'"'.$domdesc.'"') .'
' .&mt('If a course or community is [_1]not[_2] in your list of current courses and communities below,' .' you may be able to enroll if self-enrollment is permitted.' @@ -1155,7 +1160,7 @@ sub gather_roles { } #next if ($home eq 'no_host'); $home = &Apache::lonnet::hostname($home); - $ttype='Construction Space'; + $ttype='Authoring Space'; $twhere=&mt('User').': '.$trest.'
'.&mt('Domain'). ': '.$tdom.'
'. ' '.&mt('Server').': '.$home; @@ -1174,7 +1179,7 @@ sub gather_roles { } #next if ($home eq 'no_host'); $home = &Apache::lonnet::hostname($home); - $ttype='Construction Space'; + $ttype='Authoring Space'; $twhere=&mt('Domain').': '.$tdom.'
'.&mt('Server'). ': '.$home; $env{'course.'.$tdom.'_'.$trest.'.description'}='ca'; @@ -1347,7 +1352,7 @@ sub roletable_headers { } sub roletypes { - my @types = ('Domain','Construction Space','Course','Community','Unavailable','System'); + my @types = ('Domain','Authoring Space','Course','Community','Unavailable','System'); return @types; } @@ -1486,7 +1491,7 @@ sub privileges_info { my (undef,$tdom,$trest,$tsec)=split(m{/},$where); if ($trest) { if ($env{'course.'.$tdom.'_'.$trest.'.description'} eq 'ca') { - $ttype='Construction Space'; + $ttype='Authoring Space'; $twhere='User: '.$trest.', Domain: '.$tdom; } else { $ttype= &Apache::loncommon::course_type($tdom.'_'.$trest); @@ -2440,9 +2445,11 @@ sub update_session_roles { &unescape($groupinfo{'description'}); } $groupdesc = $groupdescs{$cdom.'_'.$cnum}{$group}; - $groupmsg .= '

  • '. - &mt('[_1] with status: [_2].', - ''.$groupdesc.'',$newgroup{$item}).'
  • '; + if ($groupdesc) { + $groupmsg .= '
  • '. + &mt('[_1] with status: [_2].', + ''.$groupdesc.'',$newgroup{$item}).'
  • '; + } } } if ($groupmsg) { @@ -2456,47 +2463,67 @@ sub update_session_roles { } } if (keys(%newrole) > 0) { - $changemsg .= '
  • '.&mt('New roles'). - '
  • '; } if (keys(%customprivchg) > 0) { - $changemsg .= '
  • '. - &mt('Custom roles with privilege changes'). - '
  • '; + if ($privmsg) { + $changemsg .= '
  • '. + &mt('Custom roles with privilege changes'). + ''. + '
  • '; + } } if (keys(%rolechange) > 0) { - $changemsg .= '
  • '. - &mt('Existing roles with status changes').'
  • '. - ''; } if (keys(%deletedroles) > 0) { - $changemsg .= '
  • '. - &mt('Existing roles now expired').'
  • '. - ''; } } if ((keys(%changed_groups) > 0) || (keys(%groupchange) > 0)) { @@ -2556,6 +2583,12 @@ sub update_session_roles { } if ($changemsg) { $msg .= ''; + } else { + if (&Apache::loncommon::show_course()) { + $msg = &mt('No new courses or communities'); + } else { + $msg = &mt('No role changes'); + } } return $msg; } @@ -2567,6 +2600,7 @@ sub role_desc { &Apache::lonnet::role_status('user.role.'.$item,$update,$refresh, $now,\$role,\$where,\$trolecode, \$tstatus,\$tstart,\$tend); + return unless ($role); if ($role =~ /^cr\//) { my ($rdummy,$rdomain,$rauthor,$rrole)=split(/\//,$role); $tremark = &mt('Customrole defined by [_1].',$rauthor.':'.$rdomain); @@ -2608,9 +2642,15 @@ sub role_desc { } elsif ($tdom) { $twhere = &mt('Domain').': '.$tdom; } - my $output = "$trole -- $twhere"; - if ($tremark) { - $output .= '
    '.$tremark; + my $output; + if ($trole) { + $output = $trole; + if ($twhere) { + $output .= " -- $twhere"; + } + if ($tremark) { + $output .= '
    '.$tremark; + } } return $output; } @@ -2696,11 +2736,14 @@ sub get_roles_functions { } if ($env{'user.adv'}) { if ($env{'form.display'} eq 'showall') { - push(@links,["javascript:rolesView('noshowall');",'edit-redo-22x22',&mt('Exclude expired roles')]); + push(@links,["javascript:rolesView('noshowall');",'edit-redo-22x22',&mt('Exclude expired')]); } else { - push(@links,["javascript:rolesView('showall');",'edit-undo-22x22',&mt('Include expired roles')]); + push(@links,["javascript:rolesView('showall');",'edit-undo-22x22',&mt('Include expired')]); } } + if (&Apache::loncommon::designparm('login.coursecatalog',$env{'user.domain'})) { + push(@links,['/adm/coursecatalog','ccat-22x22',&mt('Course catalog')]); + } my $funcs = &Apache::lonhtmlcommon::start_funclist(); foreach my $link (@links) { $funcs .= &Apache::lonhtmlcommon::add_item_funclist( @@ -2769,7 +2812,7 @@ sub get_queued { if (($status eq 'approval') || ($status eq 'approved')) { $output .= '

    '.&mt('Author role request').'
    '; if ($status eq 'approval') { - $output .= &mt('A request for authoring space submitted on [_1] is awaiting approval', + $output .= &mt('A request for Authoring Space submitted on [_1] is awaiting approval', &Apache::lonlocal::locallocaltime($timestamp)); } elsif ($status eq 'approved') { my %roleshash =