Diff for /loncom/interface/coursecatalog.pm between versions 1.7 and 1.8

version 1.7, 2006/10/16 19:39:51 version 1.8, 2006/10/17 18:11:46
Line 42  sub handler { Line 42  sub handler {
     if ($r->header_only) {      if ($r->header_only) {
         return OK;          return OK;
     }      }
       my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));
       my $lonid=$cookies{'lonID'};
       my $lonidsdir=$r->dir_config('lonIDsDir');
       my $handle;
       if ($lonid) {
           $handle=$lonid->value;
           $handle=~s/\W//g;
       }
       if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) {
           &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle);
       }
     &Apache::lonacc::get_posted_cgi($r);      &Apache::lonacc::get_posted_cgi($r);
     &Apache::lonlocal::get_language_handle($r);      &Apache::lonlocal::get_language_handle($r);
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['sortby']);      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['sortby']);
Line 50  sub handler { Line 61  sub handler {
     my $domdesc = $Apache::lonnet::domaindescription{$codedom};      my $domdesc = $Apache::lonnet::domaindescription{$codedom};
   
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
     if ($env{'form.coursenum'} ne '') {      if ($env{'form.coursenum'} ne '' && &user_is_known()) {
         &course_details($r,$codedom,$formname,$domdesc);          &course_details($r,$codedom,$formname,$domdesc);
     } else {      } else {
         &course_selector($r,$codedom,$formname,$domdesc);          &course_selector($r,$codedom,$formname,$domdesc);
Line 369  sub print_course_listing { Line 380  sub print_course_listing {
             $output = &mt('No courses match the criteria you selected.');              $output = &mt('No courses match the criteria you selected.');
             return $output;              return $output;
         }          }
         $output = &mt('<b>Note for students:</b> If you are officially enrolled in a course but the course is not listed in your LON-CAPA courses, click the "Show more details" link for the specific course and check the default access dates and/or automated enrollment settings.<br /><br />');          if (&user_is_known()) {
               $output = &mt('<b>Note for students:</b> If you are officially enrolled in a course but the course is not listed in your LON-CAPA courses, click the "Show more details" link for the specific course and check the default access dates and/or automated enrollment settings.<br /><br />');
           }
     }      }
     $output .= &Apache::loncommon::start_data_table().      $output .= &Apache::loncommon::start_data_table().
                &Apache::loncommon::start_data_table_header_row();                 &Apache::loncommon::start_data_table_header_row();
Line 389  sub print_course_listing { Line 402  sub print_course_listing {
         }          }
         $output .= '</th>';          $output .= '</th>';
     }      }
     if ($env{'form.coursenum'} eq '') {      if (&user_is_known()) {
         $output .= '<th>&nbsp;</th>';          if ($env{'form.coursenum'} eq '') {
     } else {              $output .= '<th>&nbsp;</th>';
         $output .=          } else {
               $output .=
               '<th>'.&mt('Default Access Dates for Students').'</th>'.                '<th>'.&mt('Default Access Dates for Students').'</th>'.
               '<th>'.&mt('Student Counts').'</th>'.                '<th>'.&mt('Student Counts').'</th>'.
               '<th>'.&mt('Auto-enrollment of <br />registered students').'</th>';                '<th>'.&mt('Auto-enrollment of <br />registered students').'</th>';
           }
     }      }
     &Apache::loncommon::end_data_table_header_row();      &Apache::loncommon::end_data_table_header_row();
     my %courseinfo = &build_courseinfo_hash(%courses);      my %courseinfo = &build_courseinfo_hash(%courses);
Line 573  sub courseinfo_row { Line 588  sub courseinfo_row {
     }      }
     $output .= '</font></td>'.      $output .= '</font></td>'.
                '<td>'.$ownerlast.'</td>';                 '<td>'.$ownerlast.'</td>';
     if ($env{'form.coursenum'} eq '') {      if (&user_is_known()) {
         $output .= "<td><a href=\"javascript:setCourseId('$cnum')\">".&mt('Show more details').'</a></td>';          if ($env{'form.coursenum'} eq '') {
     } else {              $output .= "<td><a href=\"javascript:setCourseId('$cnum')\">".&mt('Show more details').'</a></td>';
         $output .=          } else { 
               $output .=
                '<td>'.$accessdates.'</td>'.                  '<td>'.$accessdates.'</td>'. 
                '<td>'.$counts.'</td>'.                 '<td>'.$counts.'</td>'.
                '<td>'.$autoenrollment.'</td>';                 '<td>'.$autoenrollment.'</td>';
           }
     }      }
     return $output;      return $output;
 }  }
Line 821  sub autoenroll_info { Line 838  sub autoenroll_info {
     return $autoenrolldates;      return $autoenrolldates;
 }  }
   
   sub user_is_known {
       my $known = 0;
       if ($env{'user.name'} ne '' && $env{'user.name'} ne 'public' 
           && $env{'user.domain'} ne '' && $env{'user.domain'} ne 'public') {
           $known = 1;
       }
       return $known;
   }
   
 1;  1;

Removed from v.1.7  
changed lines
  Added in v.1.8


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