Diff for /loncom/interface/loncreatecourse.pm between versions 1.56 and 1.63

version 1.56, 2004/05/08 00:48:30 version 1.63, 2004/07/02 00:27:44
Line 1 Line 1
 # The LearningOnline Network  #meserver The LearningOnline Network
 # Create a course  # Create a course
 #  #
 # $Id$  # $Id$
Line 42  use localenroll; Line 42  use localenroll;
   
 # ================================================ Get course directory listing  # ================================================ Get course directory listing
   
   my @output=();
   
 sub crsdirlist {  sub crsdirlist {
     my ($courseid,$which)=@_;      my ($courseid,$which)=@_;
     unless ($which) { $which=''; }      @output=();
       return &innercrsdirlist($courseid,$which);
   }
   
   sub innercrsdirlist {
       my ($courseid,$which,$path)=@_;
       my $dirptr=16384;
       unless ($which) { $which=''; } else { $which.='/'; }
       unless ($path)  { $path=''; } else { $path.='/'; }
     my %crsdata=&Apache::lonnet::coursedescription($courseid);      my %crsdata=&Apache::lonnet::coursedescription($courseid);
     my @listing=&Apache::lonnet::dirlist      my @listing=&Apache::lonnet::dirlist
  ($which,$crsdata{'domain'},$crsdata{'num'},   ($which,$crsdata{'domain'},$crsdata{'num'},
  &Apache::loncommon::propath($crsdata{'domain'},$crsdata{'num'}));   &Apache::loncommon::propath($crsdata{'domain'},$crsdata{'num'}));
     my @output=();  
     foreach (@listing) {      foreach (@listing) {
  unless ($_=~/^\./) {   unless ($_=~/^\./) {
     push (@output,(split(/\&/,$_))[0]);      my @unpackline = split (/\&/,$_);
       if ($unpackline[3]&$dirptr) {
   # is a directory, recurse
    &innercrsdirlist($courseid,$which.$unpackline[0],
               $path.$unpackline[0]);
       } else { 
   # is a file, put into output
    push (@output,$path.$unpackline[0]);
       }
  }   }
     }      }
     return @output;      return @output;
Line 236  sub print_course_creation_page { Line 253  sub print_course_creation_page {
     my $coursebrowserjs=&Apache::loncommon::coursebrowser_javascript();      my $coursebrowserjs=&Apache::loncommon::coursebrowser_javascript();
     my $starttime = time;      my $starttime = time;
     my $endtime = time+(6*30*24*60*60); # 6 months from now, approx      my $endtime = time+(6*30*24*60*60); # 6 months from now, approx
     my $date_table = &Apache::londropadd::date_setting_table($starttime,$endtime,'createcourse');      my $enroll_table = &Apache::londropadd::date_setting_table($starttime,$endtime,'create_enrolldates');
       my $access_table = &Apache::londropadd::date_setting_table($starttime,$endtime,'create_defaultdates');
     my ($krbdef,$krbdefdom) =      my ($krbdef,$krbdefdom) =
     &Apache::loncommon::get_kerberos_defaults($defdom);      &Apache::loncommon::get_kerberos_defaults($defdom);
     my $javascript_validations=&Apache::londropadd::javascript_validations('createcourse',$krbdefdom);      my $javascript_validations=&Apache::londropadd::javascript_validations('createcourse',$krbdefdom);
Line 298  sub print_course_creation_page { Line 316  sub print_course_creation_page {
                     'no'   => "No",                      'no'   => "No",
                     'audr' => "Automated drops",                      'audr' => "Automated drops",
                     'dacu' => "Duration of automated classlist updates",                      'dacu' => "Duration of automated classlist updates",
                       'dacc' => "Default start and end dates for student access",
                     'psam' => "Please select the authentication mechanism",                      'psam' => "Please select the authentication mechanism",
                     '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",
Line 434  $lt{'aesc'} Line 453  $lt{'aesc'}
 <input type="radio" name="autodrops" value="1" />$lt{'yes'} <input type="radio" name="autodrops" value="0" checked="true" />$lt{'no'}  <input type="radio" name="autodrops" value="1" />$lt{'yes'} <input type="radio" name="autodrops" value="0" checked="true" />$lt{'no'}
 </p><p>  </p><p>
 <b>$lt{'dacu'}</b>  <b>$lt{'dacu'}</b>
 $date_table  $enroll_table
 </p><p>  </p><p>
   <b>$lt{'dacc'}</b>
   $access_table
   <p></p>
 <b>$lt{'psam'}.</b><br />  <b>$lt{'psam'}.</b><br />
 $lt{'pcda'}.  $lt{'pcda'}.
 </p><p>  </p><p>
Line 477  ENDDOCUMENT Line 499  ENDDOCUMENT
 sub create_course {  sub create_course {
     my $r=shift;      my $r=shift;
     my $topurl='/res/'.&Apache::lonnet::declutter($ENV{'form.topmap'});      my $topurl='/res/'.&Apache::lonnet::declutter($ENV{'form.topmap'});
       my $this_server = $Apache::lonnet::perlvar{'lonHostID'};
     my $ccuname=$ENV{'form.ccuname'};      my $ccuname=$ENV{'form.ccuname'};
     my $ccdomain=$ENV{'form.ccdomain'};      my $ccdomain=$ENV{'form.ccdomain'};
     $ccuname=~s/\W//g;      $ccuname=~s/\W//g;
Line 523  ENDENHEAD Line 546  ENDENHEAD
     my $courseid=&Apache::lonnet::createcourse($ENV{'request.role.domain'},      my $courseid=&Apache::lonnet::createcourse($ENV{'request.role.domain'},
                                                $cdescr,$curl,                                                 $cdescr,$curl,
                                                $ENV{'form.course_home'},                                                 $ENV{'form.course_home'},
                                                $ENV{'form.nonstandard'});                                                 $ENV{'form.nonstandard'},
                                                  $ENV{'form.crscode'});
   
     # Note: The testing routines depend on this being output; see       # Note: The testing routines depend on this being output; see 
     # Utils::Course. This needs to at least be output as a comment      # Utils::Course. This needs to at least be output as a comment
Line 625  ENDENHEAD Line 649  ENDENHEAD
     if (@affiliates > 0) {      if (@affiliates > 0) {
         my @badclasses = ();          my @badclasses = ();
         foreach my $class (@affiliates) {          foreach my $class (@affiliates) {
             my $addcheck =  &localenroll::new_course($class,$cenv{'internal.courseowner'});              my $addcheck = &Apache::lonnet::auto_new_course($crsunum,$crsudom,$class,$cenv{'internal.courseowner'});
             unless ($addcheck eq 'ok') {              unless ($addcheck eq 'ok') {
                 push @badclasses, $class;                   push @badclasses, $class; 
             }              }
Line 639  ENDENHEAD Line 663  ENDENHEAD
             $r->print ("</ul><br/><br/></font>\n");              $r->print ("</ul><br/><br/></font>\n");
         }          }
     }      }
     my $startdate = &Apache::lonhtmlcommon::get_date_from_form('startdate');      my $enrollstart = &Apache::lonhtmlcommon::get_date_from_form('startenroll');
     my $enddate   = &Apache::lonhtmlcommon::get_date_from_form('enddate');      my $enrollend   = &Apache::lonhtmlcommon::get_date_from_form('endenroll');
       my $startaccess = &Apache::lonhtmlcommon::get_date_from_form('startaccess');
       my $endaccess = &Apache::lonhtmlcommon::get_date_from_form('endaccess');
     if ($ENV{'form.no_end_date'}) {      if ($ENV{'form.no_end_date'}) {
       $enddate = 0;        $endaccess = 0;
     }      }
     $cenv{'internal.autostart'}=$startdate;      $cenv{'internal.autostart'}=$enrollstart;
     $cenv{'internal.autoend'}=$enddate;      $cenv{'internal.autoend'}=$enrollend;
       $cenv{'default_enrollment_start_date'}=$startaccess;
       $cenv{'default_enrollment_end_date'}=$endaccess;
     if ($ENV{'form.showphotos'}) {      if ($ENV{'form.showphotos'}) {
       $cenv{'internal.showphotos'}=$ENV{'form.showphotos'};        $cenv{'internal.showphotos'}=$ENV{'form.showphotos'};
     }      }

Removed from v.1.56  
changed lines
  Added in v.1.63


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