Diff for /loncom/interface/loncreatecourse.pm between versions 1.76 and 1.77

version 1.76, 2005/02/17 08:29:42 version 1.77, 2005/03/03 21:24:24
Line 327  sub print_course_creation_page { Line 327  sub print_course_creation_page {
                     'pcda' => "Please choose the default authentication method to be used by new users added to this LON-CAPA domain by the automated enrollment process",                      'pcda' => "Please choose the default authentication method to be used by new users added to this LON-CAPA domain by the automated enrollment process",
                     'nech' => "Notification of enrollment changes",                      'nech' => "Notification of enrollment changes",
                     'nccl' => "Notification to course coordinator via LON-CAPA message when enrollment changes occur during the automated update?",                      'nccl' => "Notification to course coordinator via LON-CAPA message when enrollment changes occur during the automated update?",
                       'ndcl' => "Notification to domain coordinator via LON-CAPA message when enrollment changes occur during the automated update?",
                     'irsp' => "Include retrieval of student photographs?",                      'irsp' => "Include retrieval of student photographs?",
     'rshm' => 'Resource Space Home',      'rshm' => 'Resource Space Home',
                     'opco' => "Open Course"                      'opco' => "Open Course"
Line 524  $locform Line 525  $locform
 <b>$lt{'nech'}</b><br />  <b>$lt{'nech'}</b><br />
 $lt{'nccl'}<br/>  $lt{'nccl'}<br/>
 <label>  <label>
     <input type="radio" name="notify" value="1" />$lt{'yes'}      <input type="radio" name="notify_owner" value="1" />$lt{'yes'}
 </label>   </label> 
 <label>  <label>
     <input type="radio" name="notify" value="0" checked="true" />$lt{'no'}      <input type="radio" name="notify_owner" value="0" checked="true" />$lt{'no'}
   </label>
   <br />
   $lt{'ndcl'}<br/>
   <label>
       <input type="radio" name="notify_dc" value="1" />$lt{'yes'}
   </label>
   <label>
       <input type="radio" name="notify_dc" value="0" checked="true" />$lt{'no'}
 </label>  </label>
 </p><p>  </p><p>
 <b>$lt{'irsp'}</b>  <b>$lt{'irsp'}</b>
Line 548  $lt{'nccl'}<br/> Line 557  $lt{'nccl'}<br/>
 <label>  <label>
     <b>$lt{'dmn'}:</b> $domform      <b>$lt{'dmn'}:</b> $domform
 </label>  </label>
 </p><p>  
 <label>  
     <b>$lt{'ierc'}:</b>  
     <input type="checkbox" name="expireown" checked />  
 </label>  
 </p>  </p>
 <p>  <p>
 <input type="hidden" name="phase" value="two" />  <input type="hidden" name="phase" value="two" />
Line 625  ENDENHEAD Line 629  ENDENHEAD
                crsxlist => $ENV{'form.crsxlist'},                 crsxlist => $ENV{'form.crsxlist'},
                autoadds => $ENV{'form.autoadds'},                 autoadds => $ENV{'form.autoadds'},
                autodrops => $ENV{'form.autodrops'},                 autodrops => $ENV{'form.autodrops'},
                notify => $ENV{'form.notify'},                 notify_owner => $ENV{'form.notify_owner'},
                  notify_dc => $ENV{'form.notify_dc'},
                no_end_date => $ENV{'form.no_end_date'},                 no_end_date => $ENV{'form.no_end_date'},
                showphotos => $ENV{'form.showphotos'},                 showphotos => $ENV{'form.showphotos'},
                authtype => $authtype,                 authtype => $authtype,
Line 671  ENDENHEAD Line 676  ENDENHEAD
         return;          return;
     }      }
     my ($courseid,$crsudom,$crsunum);      my ($courseid,$crsudom,$crsunum);
     $r->print(&construct_course($args,\$logmsg,\$courseid,\$crsudom,\$crsunum));      $r->print(&construct_course($args,\$logmsg,\$courseid,\$crsudom,\$crsunum,$ENV{'user.domain'},$ENV{'user.name'}));
   
 #  #
 # Make current user course adminstrator  # Make the requested user a course coordinator
 #  
     my $end=undef;  
     my $addition='';  
     if ($ENV{'form.expireown'}) { $end=time+5; $addition='expired'; }  
     $r->print(&mt('Assigning').' '.$addition.' '.&mt('role of course coordinator to self').': '.  
     &Apache::lonnet::assignrole(  
      $ENV{'user.domain'},$ENV{'user.name'},$courseid,'cc',$end).'<br>');  
 #  
 # Make additional user course administrator  
 #  #
    if (($ccdomain) && ($ccuname)) {     if (($ccdomain) && ($ccuname)) {
     $r->print(&mt('Assigning role of course coordinator to').' '.      $r->print(&mt('Assigning role of course coordinator to').' '.
Line 700  ENDENHEAD Line 696  ENDENHEAD
 }  }
   
 sub construct_course {  sub construct_course {
     my ($args,$logmsg,$courseid,$crsudom,$crsunum) = @_;      my ($args,$logmsg,$courseid,$crsudom,$crsunum,$udom,$uname) = @_;
     my $outcome;      my $outcome;
   
 #  #
Line 824  sub construct_course { Line 820  sub construct_course {
     if ($args->{'autodrops'}) {      if ($args->{'autodrops'}) {
         $cenv{'internal.autodrops'}=$args->{'autodrops'};          $cenv{'internal.autodrops'}=$args->{'autodrops'};
     }      }
     if ($args->{'notify'}) {  # check for notification of enrollment changes
       if ($args->{'ccuname'}) {      my @notified = ();
         $cenv{'internal.notifylist'} = $args->{'ccuname'}.'@'.$args->{'ccdomain'};      if ($args->{'notify_owner'}) {
       }          if ($args->{'ccuname'} ne '') {
               push(@notified,$args->{'ccuname'}.'@'.$args->{'ccdomain'});
           }
       }
       if ($args->{'notify_dc'}) {
           if ($uname ne '') { 
               push(@notified,$uname.'@'.$udom);
           }
       }
       if (@notified > 0) {
           my $notifylist;
           if (@notified > 1) {
               $notifylist = join(',',@notified);
           } else {
               $notifylist = $notified[0];
           }
           $cenv{'internal.notifylist'} = $notifylist;
     }      }
     if (@badclasses > 0) {      if (@badclasses > 0) {
         my %lt=&Apache::lonlocal::texthash(          my %lt=&Apache::lonlocal::texthash(

Removed from v.1.76  
changed lines
  Added in v.1.77


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