Diff for /loncom/auth/lonroles.pm between versions 1.240.2.5 and 1.240.2.10

version 1.240.2.5, 2009/12/24 18:28:54 version 1.240.2.10, 2010/01/16 15:06:22
Line 139  use Apache::lonlocal; Line 139  use Apache::lonlocal;
 use Apache::lonpageflip();  use Apache::lonpageflip();
 use Apache::lonnavdisplay();  use Apache::lonnavdisplay();
 use Apache::lonmainmenu();  use Apache::lonmainmenu();
   use Apache::loncoursequeueadmin;
 use GDBM_File;  use GDBM_File;
 use LONCAPA qw(:DEFAULT :match);  use LONCAPA qw(:DEFAULT :match);
 use HTML::Entities;  use HTML::Entities;
Line 165  sub redirect_user { Line 166  sub redirect_user {
     my $start_page = &Apache::loncommon::start_page('Switching Role',undef,      my $start_page = &Apache::loncommon::start_page('Switching Role',undef,
                                                     {'redirect' => [1,$url],                                                      {'redirect' => [1,$url],
                                                      'bread_crumbs' => $brcrum,});                                                       'bread_crumbs' => $brcrum,});
       &Apache::lonhtmlcommon::clear_breadcrumbs();
     my $end_page   = &Apache::loncommon::end_page();      my $end_page   = &Apache::loncommon::end_page();
   
 # Note to style police:   # Note to style police: 
Line 727  ENDHEADER Line 729  ENDHEADER
             &Apache::loncommon::end_page();              &Apache::loncommon::end_page();
             return OK;              return OK;
         }          }
         my %courses = &Apache::loncommon::existing_gcitest_courses();          my %courses = &Apache::loncommon::existing_gcitest_courses('cc');
         $env{'browser.interface'}='faketextual';          $env{'browser.interface'}='faketextual';
         $env{'environment.remote'}='off';          $env{'environment.remote'}='off';
         my $numcourses = keys(%courses);          my $numcourses = keys(%courses);
         my $switcher;          my $switcher;
         if ($numcourses > 0) {          if ($numcourses > 0) {
             $switcher = &Apache::lonmainmenu::gcitest_switcher(%courses);              $switcher = &Apache::lonmainmenu::gcitest_switcher('cc',%courses);
             my $current;              my $current;
             if ($env{'request.course.id'}) {              if ($env{'request.course.id'}) {
                 $current = 'cc./'.$env{'course.'.$env{'request.course.id'}.'.domain'}.                  $current = 'cc./'.$env{'course.'.$env{'request.course.id'}.'.domain'}.
Line 751  ENDSCRIPT Line 753  ENDSCRIPT
         $r->print(&Apache::lonmenu::inlinemenu('gcicustom',$switcher).          $r->print(&Apache::lonmenu::inlinemenu('gcicustom',$switcher).
                   &Apache::loncommon::end_page());                    &Apache::loncommon::end_page());
         return OK;          return OK;
       } else {
           if ($env{'form.destinationurl'} eq '/adm/gci_info') {
               delete($env{'form.destinationurl'});
           }
     }      }
     if ($env{'user.adv'}) {      if ($env{'user.adv'}) {
         $r->print('<p><label><input type="checkbox" name="showall"');          $r->print('<p><label><input type="checkbox" name="showall"');
Line 760  ENDSCRIPT Line 766  ENDSCRIPT
                  .'</p>');                   .'</p>');
     } else {      } else {
         if ($countactive > 0) {          if ($countactive > 0) {
             &queued_selfenrollment($r);              $r->print(&Apache::loncoursequeueadmin::queued_selfenrollment());
             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'},'"<>&'); 
             $r->print(              unless ($env{'user.domain'} eq 'gcitest') {
                 '<p>'                  $r->print(
                .&mt('[_1]Visit the [_2]Course/Community Catalog[_3]'                      '<p>'
                    .' to view all [_4] LON-CAPA courses and communities.'                     .&mt('[_1]Visit the [_2]Course/Community Catalog[_3]'
                    ,'<b>'                         .' to view all [_4] LON-CAPA courses and communities.'
                    ,'<a href="/adm/coursecatalog?showdom='.$esc_dom.'">'                         ,'<b>'
                    ,'</a></b>',$domdesc)                         ,'<a href="/adm/coursecatalog?showdom='.$esc_dom.'">'
                .'<br />'                         ,'</a></b>',$domdesc)
                .&mt('If a course or community is [_1]not[_2] in your list of current courses and communities below,'                     .'<br />'
                      .&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.'
                    ,'<b>','</b>')                     ,'<b>','</b>')
                .'</p>'                     .'</p>'
             );                  );
               }
         }          }
     }      }
   
Line 786  ENDSCRIPT Line 794  ENDSCRIPT
  } 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);          unless ($env{'user.domain'} eq 'gcitest') {
         &requestcourse_advice($r);               &findcourse_advice($r);
               &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 1261  sub findcourse_advice { Line 1271  sub findcourse_advice {
     }      }
     $r->print('<h3>'.&mt('Self-Enrollment').'</h3>'.      $r->print('<h3>'.&mt('Self-Enrollment').'</h3>'.
               '<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 />');                '<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(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'</p>');      $r->print(&mt('You can search for courses and communities which permit self-enrollment, if you would like to enroll in one.').'</p>'.
     &queued_selfenrollment($r);                &Apache::loncoursequeueadmin::queued_selfenrollment());
     return;      return;
 }  }
   

Removed from v.1.240.2.5  
changed lines
  Added in v.1.240.2.10


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