Diff for /loncom/auth/lonroles.pm between versions 1.240.2.18 and 1.240.2.23

version 1.240.2.18, 2010/10/06 18:46:53 version 1.240.2.23, 2010/12/08 06:48:56
Line 500  ENDENTERKEY Line 500  ENDENTERKEY
     $courseid = substr($courseid, 1);      $courseid = substr($courseid, 1);
  }   }
  $courseid =~ s/\//_/;   $courseid =~ s/\//_/;
  if (($cdom ne 'gcitest') && (($role eq 'cc') || ($role eq 'co'))    if (($cdom !~ /^\w+citest$/) && (($role eq 'cc') || ($role eq 'co')) 
                                     && ($env{'course.' . $courseid .'.course.helper.not.run'})) {                                       && ($env{'course.' . $courseid .'.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
Line 524  ENDENTERKEY Line 524  ENDENTERKEY
     .$env{'request.course.sec'})      .$env{'request.course.sec'})
  ) {   ) {
  my $startpage = &courseloadpage($courseid);   my $startpage = &courseloadpage($courseid);
  unless (($startpage eq 'firstres') || ($cdom eq 'gcitest')) {   unless (($startpage eq 'firstres') || ($cdom =~ /^\w+citest$/)) {
     $msg = &mt('Entering [_1] ...',      $msg = &mt('Entering [_1] ...',
        $env{'course.'.$courseid.'.description'});         $env{'course.'.$courseid.'.description'});
     &redirect_user($r,&mt('New in course'),      &redirect_user($r,&mt('New in course'),
Line 539  ENDENTERKEY Line 539  ENDENTERKEY
 # Guess not ...  # Guess not ...
     $furl=&Apache::lonpageflip::first_accessible_resource();      $furl=&Apache::lonpageflip::first_accessible_resource();
  }   }
                                 if (($cdom eq 'gcitest') && ($custommenu)) {                                  if (($cdom =~ /^\w+citest$/) && ($custommenu)) {
                                     $furl = '/adm/navmaps';                                      $furl = '/adm/navmaps';
                                 }                                  }
                                 $msg = &mt('Entering [_1] ...',                                  $msg = &mt('Entering [_1] ...',
Line 593  ENDENTERKEY Line 593  ENDENTERKEY
   
     my ($crumbtext,$pagetitle,$recent,$show_course);      my ($crumbtext,$pagetitle,$recent,$show_course);
     $show_course=&Apache::loncommon::show_course();      $show_course=&Apache::loncommon::show_course();
     my $noscript='<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 />';
     if ($custommenu) {      if ($custommenu) {
         my $brcrum = {'bread_crumbs' => 1};          my $start_page = &Apache::loncommon::start_page('Main Menu');
         if ($env{'form.destinationurl'} eq '/adm/gci_info') {  
             undef($brcrum);   
         }  
         my $start_page = &Apache::loncommon::start_page('Main Menu',undef,$brcrum);  
         $r->print(<<"ENDCUSTOM");          $r->print(<<"ENDCUSTOM");
 $start_page  $start_page
 <br />  
 <noscript>  <noscript>
 $noscript  $noscript
 </noscript>  </noscript>
Line 622  ENDCUSTOM Line 617  ENDCUSTOM
                          text    => $crumbtext,},                           text    => $crumbtext,},
                      ];                       ];
         my $args;          my $args;
         if (($env{'user.domain'} eq 'gcitest') && (!$numdc)) {          if ($numdc) {
             $args = {bread_crumbs        => $brcrum,  
                      bread_crumbs_nomenu => 1};  
         } else {  
             $args = {bread_crumbs => $brcrum};              $args = {bread_crumbs => $brcrum};
           } else {
               $args = {bread_crumbs          => $brcrum,
                        bread_crumbs_menulink => '_nomenu'};
         }          }
         my $start_page=&Apache::loncommon::start_page($pagetitle,undef,$args);          my $start_page=&Apache::loncommon::start_page($pagetitle,undef,$args);
         my $swinfo=&Apache::lonmenu::rawconfig();          my $swinfo=&Apache::lonmenu::rawconfig();
         $standby=~s/\n/\\n/g;          $standby=~s/\n/\\n/g;
         $r->print(<<ENDHEADER);          $r->print(<<ENDHEADER);
 $start_page  $start_page
 <br />  
 <noscript>  <noscript>
 $noscript  $noscript
 </noscript>  </noscript>
Line 749  ENDHEADER Line 743  ENDHEADER
         }          }
     }      }
     if ($custommenu) {      if ($custommenu) {
         if ($env{'form.destinationurl'} eq '/adm/gci_info') {          if ($env{'form.destinationurl'} eq '/adm/ci_info') {
             $r->print(&gci_info_page()).              $r->print(&ci_info_page()).
             &Apache::loncommon::end_page();              &Apache::loncommon::end_page();
             return OK;              return OK;
         }          }
Line 761  ENDHEADER Line 755  ENDHEADER
         my $switcher;          my $switcher;
         if ($numcourses > 0) {          if ($numcourses > 0) {
             $switcher = &Apache::loncommon::gcitest_switcher('cc',%courses);              $switcher = &Apache::loncommon::gcitest_switcher('cc',%courses);
             my $current;  
             if ($env{'request.course.id'}) {  
                 $current = 'cc./'.$env{'course.'.$env{'request.course.id'}.'.domain'}.  
                            '/'.$env{'course.'.$env{'request.course.id'}.'.num'};  
             }  
             my $switcher_js = &Apache::loncommon::gcitest_switcher_js($current,$numcourses);  
             $r->print(<<"ENDSCRIPT");  
 <script type="text/javascript">  
 // <![CDATA[  
 $switcher_js  
 // ]]>  
 </script>  
 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 {      } else {
         if ($env{'form.destinationurl'} eq '/adm/gci_info') {          if ($env{'form.destinationurl'} eq '/adm/ci_info') {
             delete($env{'form.destinationurl'});              delete($env{'form.destinationurl'});
         }          }
     }      }
Line 794  ENDSCRIPT Line 775  ENDSCRIPT
             $r->print(&Apache::loncoursequeueadmin::queued_selfenrollment());              $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'},'"<>&'); 
             unless ($env{'user.domain'} eq 'gcitest') {              unless ($env{'user.domain'} =~ /^\w+citest$/) {
                 $r->print(                  $r->print(
                     '<p>'                      '<p>'
                    .&mt('[_1]Visit the [_2]Course/Community Catalog[_3]'                     .&mt('[_1]Visit the [_2]Course/Community Catalog[_3]'
Line 818  ENDSCRIPT Line 799  ENDSCRIPT
     $r->print('<h2>'.&mt('Currently no additional roles, courses or communities').'</h2>');      $r->print('<h2>'.&mt('Currently no additional roles, courses or communities').'</h2>');
  } else {   } else {
             if ($show_course) {              if ($show_course) {
                 if ($env{'user.domain'} eq 'gcitest') {                  if ($env{'user.domain'} =~ /^\w+citest$/) {
                     $r->print('<h2>'.&mt('Currently no active Concept Tests').'</h2>');                      $r->print('<h2>'.&mt('Currently no active Concept Tests').'</h2>');
                 } else {                   } elsif ($env{'user.domain'} =~ /^\w+ci$/) {
                     $r->print('<h2>'.&mt('Currently no active courses or communities').'</h2>');                      my $inventory = uc($env{'user.domain'});
                       $r->print('<h2>'.&mt('Currently not assigned as a [_1] contributor',$inventory).'</h2>');
                 }                  }
             } 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>');
             }              }
  }   }
         unless ($env{'user.domain'} eq 'gcitest') {          unless ($env{'user.domain'} =~ /^\w+citest$/) {
             &findcourse_advice($r);              &findcourse_advice($r);
             &requestcourse_advice($r);              &requestcourse_advice($r);
         }          }
  $r->print('</form>');   $r->print('</form>');
         if ($countfuture) {          if ($countfuture) {
             if ($show_course) {              if ($show_course) {
                 if ($env{'user.domain'} eq 'gcitest') {                  if ($env{'user.domain'} =~ /^\w+citest$/) {
                     $r->print(&mt('The following [quant,_1,Concept Test] will be available in the future:',$countfuture));                      $r->print(&mt('The following [quant,_1,Concept Test] will be available in the future:',$countfuture));
                 } else {                  } else {
                     $r->print(&mt('The following [quant,_1,course] will become active in the future:',$countfuture));                      $r->print(&mt('The following [quant,_1,course] will become active in the future:',$countfuture));
Line 991  ENDSCRIPT Line 973  ENDSCRIPT
     return OK;      return OK;
 }  }
   
 sub gci_info_page {  sub ci_info_page {
     return <<"END";      my %longname = (
 <h2>Welcome to the Geoscience Concept Inventory WebCenter</h2>                       GCI  => 'Geoscience Concept Inventory',
                        SLCI => 'Science Literacy Concept Inventory',
                      );
       my $inventory = uc($env{'user.domain'});
       my %features = (
                        review     => "Review and comment on existing $inventory questions",
                        submit     => "Submit $inventory questions of your own",
                        managetest => 'Create an online test for your students',
                        tutorial   => 'View tutorials on creating online tests',
                      );
       my $tabs = &Apache::loncommon::ci_tabs($env{'user.domain'});
       my %info = (
                    GCI => '<p>For more information about writing and reviewing Concept Inventory questions please refer to the <a href="/res/gci/gci/internal/pdfs/GCIWorkbook.pdf">GCI Workbook</a>.</p>',
                  ); 
       my $output = <<"END";
   <br clear="all">
   <div>
   <h2>Welcome to the $longname{$inventory} WebCenter</h2>
 <p>  <p>
 Use the tabs to navigate the WebCenter and...  Use the tabs to navigate the WebCenter and...
 <ul>  <ul>
 <li>Review and comment on existing GCI questions</li>  END
 <li>Submit GCI questions of your own</li>      if (ref($tabs) eq 'ARRAY') {
 <li>Create an online test for your students</li>          foreach my $tab (@{$tabs}) {
 <li>View tutorials on creating online tests</li>              if ($features{$tab}) {
                   $output .= '<li>'.$features{$tab}.'</li>'."\n";
               }
           }
       }
       $output .= <<"END";
 </ul>  </ul>
 </p>  </p>
 <p>For more information about writing and reviewing Concept Inventory questions  $info{$inventory}
 please refer to the <a href="/res/gci/gci/internal/pdfs/GCIWorkbook.pdf">GCI Workbook</a>.  </div>
   
 END  END
   
 }  }
   
 sub gather_roles {  sub gather_roles {
Line 1311  sub findcourse_advice { Line 1315  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>'.      my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment();
               '<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 />');      if ($queued) {
     $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($queued);
               &Apache::loncoursequeueadmin::queued_selfenrollment());      } else {
           $r->print(&mt('You have no request for contributor access pending approval by the GCI WebCenter team.').'<ul>'.
               '<li>'.&mt('This may mean that action was taken on your request in the time since your most recent log-in.[_1]View [_2]Message[_3] to see if this is the case.','<br />','<a href="/adm/communicate">','</a>').'</li>'.
               '<li>'.&mt('If you logout and log-in again you may find you now have access to the Geoscience Concept Inventory, as a contributor.').'</li>'.
              '</ul>');
       }
     return;      return;
 }  }
   

Removed from v.1.240.2.18  
changed lines
  Added in v.1.240.2.23


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