Diff for /loncom/auth/lonroles.pm between versions 1.269.2.17 and 1.269.2.18

version 1.269.2.17, 2014/04/05 12:25:19 version 1.269.2.18, 2014/05/04 22:24:44
Line 598  ENDENTERKEY Line 598  ENDENTERKEY
  # Check to see if the user is a CC entering a course    # Check to see if the user is a CC entering a course 
  # for the first time   # for the first time
  if ((($role eq 'cc') || ($role eq 'co'))    if ((($role eq 'cc') || ($role eq 'co')) 
                                     && ($env{'course.' .$cdom.'_'.$cnum.'.course.helper.not.run'})) {                                       && ($env{'course.'.$cdom.'_'.$cnum.'.course.helper.not.run'})) { 
     $furl = "/adm/helper/course.initialization.helper";      $furl = "/adm/helper/course.initialization.helper";
     # Send the user to the course they selected      # Send the user to the course they selected
  } elsif ($env{'request.course.id'}) {   } elsif ($env{'request.course.id'}) {
Line 752  ENDENTERKEY Line 752  ENDENTERKEY
   
     my $swinfo=&Apache::lonmenu::rawconfig();      my $swinfo=&Apache::lonmenu::rawconfig();
     my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum});      my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum});
     my $funcs = &get_roles_functions($showcount);      my %domdefs=&Apache::lonnet::get_domain_defaults($env{'user.domain'}); 
       my $cattype = 'std';
       if ($domdefs{'catauth'}) {
           $cattype = $domdefs{'catauth'};
       }
       my $funcs = &get_roles_functions($showcount,$cattype);
     $standby=~s/\n/\\n/g;      $standby=~s/\n/\\n/g;
     my $noscript='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />';      my $noscript='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />';
   
Line 895  ENDHEADER Line 900  ENDHEADER
                       \%sortrole,\%roleclass,\%futureroles,\%timezones,$loncaparev);                        \%sortrole,\%roleclass,\%futureroles,\%timezones,$loncaparev);
     $refresh = $now;      $refresh = $now;
     &Apache::lonnet::appenv({'user.refresh.time'  => $refresh});      &Apache::lonnet::appenv({'user.refresh.time'  => $refresh});
     unless ($env{'user.adv'}) {      if ((($cattype eq 'std') || ($cattype eq 'domonly')) && (!$env{'user.adv'})) {
         if ($countactive > 0) {          if ($countactive > 0) {
             my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');              my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
             my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');               my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); 
Line 907  ENDHEADER Line 912  ENDHEADER
                    ,'<a href="/adm/coursecatalog?showdom='.$esc_dom.'">'                     ,'<a href="/adm/coursecatalog?showdom='.$esc_dom.'">'
                    ,'</a>'                     ,'</a>'
                    ,'</b>'                     ,'</b>'
                    ,'"'. $domdesc.'"')                     ,'"'.$domdesc.'"')
                .'<br />'                 .'<br />'
                .&mt('If a course or community is [_1]not[_2] in your list of current courses and communities below,'                 .&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.'                     .' you may be able to enroll if self-enrollment is permitted.'
Line 924  ENDHEADER Line 929  ENDHEADER
  } else {   } else {
     $r->print('<h2>'.&mt('Currently no active roles, courses or communities').'</h2>');      $r->print('<h2>'.&mt('Currently no active roles, courses or communities').'</h2>');
  }   }
         &findcourse_advice($r);          &requestcourse_advice($r,$cattype); 
         &requestcourse_advice($r);   
  $r->print('</form>');   $r->print('</form>');
         if ($countfuture) {          if ($countfuture) {
             $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));              $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));
Line 1413  sub print_rolerows { Line 1417  sub print_rolerows {
 }  }
   
 sub findcourse_advice {  sub findcourse_advice {
     my ($r) = @_;      my ($r,$cattype) = @_;
     my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');      my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
     my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');      my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');
     if (&Apache::lonnet::auto_run(undef,$env{'user.domain'})) {      if (&Apache::lonnet::auto_run(undef,$env{'user.domain'})) {
Line 1428  sub findcourse_advice { Line 1432  sub findcourse_advice {
     } else {      } else {
         $r->print(&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'<br />');          $r->print(&mt('If you were expecting to see an active role listed for a particular course, that course may not have been created yet.').'<br />');
     }      }
     $r->print('<h3>'.&mt('Self-Enrollment').'</h3>'.      if (($cattype eq 'std') || ($cattype eq 'domonly')) {
               '<p>'.&mt('The [_1]Course/Community Catalog[_2] provides information about all [_3] classes for which LON-CAPA courses have been created, as well as any communities in the domain.','<a href="/adm/coursecatalog?showdom='.$esc_dom.'">','</a>',$domdesc).'<br />');          $r->print('<h3>'.&mt('Self-Enrollment').'</h3>'.
     $r->print(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'</p>'.                    '<p>'.&mt('The [_1]Course/Community Catalog[_2] provides information about all [_3] classes for which LON-CAPA courses have been created, as well as any communities in the domain.','<a href="/adm/coursecatalog?showdom='.$esc_dom.'">','</a>',$domdesc).'<br />');
               &Apache::loncoursequeueadmin::queued_selfenrollment());          $r->print(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'</p>'.
           &Apache::loncoursequeueadmin::queued_selfenrollment());
       }
     return;      return;
 }  }
   
 sub requestcourse_advice {  sub requestcourse_advice {
     my ($r) = @_;      my ($r,$cattype) = @_;
     my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');      my $domdesc = &Apache::lonnet::domain($env{'user.domain'},'description');
     my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');      my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&');
     my (%can_request,%request_doms);      my (%can_request,%request_doms);
Line 1484  sub requestcourse_advice { Line 1490  sub requestcourse_advice {
             }               } 
             $r->print('</ul>'.&mt('Use the [_1]request form[_2] to submit a request for creation of a new course or community.','<a href="'.$requrl.'">','</a>').'</p>');              $r->print('</ul>'.&mt('Use the [_1]request form[_2] to submit a request for creation of a new course or community.','<a href="'.$requrl.'">','</a>').'</p>');
         }          }
       } elsif (!$env{'user.adv'}) {
           &findcourse_advice($r,$cattype);
     }      }
     return;      return;
 }  }
Line 2464  sub update_session_roles { Line 2472  sub update_session_roles {
                 if ($desc) {                  if ($desc) {
                     $newmsg .= '<li>'.                      $newmsg .= '<li>'.
                                &mt('[_1] with status: [_2].',                                 &mt('[_1] with status: [_2].',
                                $desc,$newrole{$item}).'</li>';                                 $desc,&mt($newrole{$item})).'</li>';
                 }                  }
             }              }
             if ($newmsg) {              if ($newmsg) {
Line 2710  sub is_active_course { Line 2718  sub is_active_course {
 }  }
   
 sub get_roles_functions {  sub get_roles_functions {
     my ($rolescount) = @_;      my ($rolescount,$cattype) = @_;
     my @links;      my @links;
     push(@links,["javascript:rolesView('doupdate');",'start-here-22x22',&mt('Check for changes')]);      push(@links,["javascript:rolesView('doupdate');",'start-here-22x22',&mt('Check for changes')]);
     if ($env{'environment.canrequest.author'}) {      if ($env{'environment.canrequest.author'}) {
Line 2736  sub get_roles_functions { Line 2744  sub get_roles_functions {
             push(@links,["javascript:rolesView('showall');",'edit-undo-22x22',&mt('Include expired')]);              push(@links,["javascript:rolesView('showall');",'edit-undo-22x22',&mt('Include expired')]);
         }          }
     }      }
     if (&Apache::loncommon::designparm('login.coursecatalog',$env{'user.domain'})) {      unless ($cattype eq 'none') {
         push(@links,['/adm/coursecatalog','ccat-22x22',&mt('Course catalog')]);          push(@links,['/adm/coursecatalog','ccat-22x22',&mt('Course catalog')]);
     }      }
     my $funcs = &Apache::lonhtmlcommon::start_funclist();      my $funcs = &Apache::lonhtmlcommon::start_funclist();
Line 2807  sub get_queued { Line 2815  sub get_queued {
             if (($status eq 'approval') || ($status eq 'approved')) {              if (($status eq 'approval') || ($status eq 'approved')) {
                 $output .= '<p><b>'.&mt('Author role request').'</b><br />';                  $output .= '<p><b>'.&mt('Author role request').'</b><br />';
                 if ($status eq 'approval') {                  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));                                    &Apache::lonlocal::locallocaltime($timestamp));
                 } elsif ($status eq 'approved') {                  } elsif ($status eq 'approved') {
                     my %roleshash =                      my %roleshash =

Removed from v.1.269.2.17  
changed lines
  Added in v.1.269.2.18


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>