Diff for /loncom/interface/loncreatecourse.pm between versions 1.96 and 1.101

version 1.96, 2006/08/11 22:00:08 version 1.101, 2007/03/03 01:40:28
Line 33  use strict; Line 33  use strict;
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::loncommon;  use Apache::loncommon;
 use Apache::lonratedt;  
 use Apache::londocs;  use Apache::londocs;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::londropadd;  use Apache::londropadd;
Line 50  sub print_course_creation_page { Line 49  sub print_course_creation_page {
         $crstype = 'Course';          $crstype = 'Course';
     }      }
     my $defdom=$env{'request.role.domain'};      my $defdom=$env{'request.role.domain'};
     my %host_servers = &Apache::loncommon::get_library_servers($defdom);      my %host_servers = &Apache::lonnet::get_servers($defdom,'library');
     my $course_home = '<select name="course_home" size="1">'."\n";      my $course_home = '<select name="course_home" size="1">'."\n";
     foreach my $server (sort(keys(%host_servers))) {      foreach my $server (sort(keys(%host_servers))) {
         $course_home .= qq{<option value="$server"};          $course_home .= qq{<option value="$server"};
Line 567  ENDDOCUMENT Line 566  ENDDOCUMENT
   
 sub create_course {  sub create_course {
     my $r=shift;      my $r=shift;
     my $ccuname=$env{'form.ccuname'};      my $ccuname =&LONCAPA::clean_username($env{'form.ccuname'});
     my $ccdomain=$env{'form.ccdomain'};      my $ccdomain=&LONCAPA::clean_domain($env{'form.ccdomain'});
     $ccuname=~s/\W//g;  
     $ccdomain=~s/\W//g;  
     my $crstype = 'Group';      my $crstype = 'Group';
     my ($enrollstart,$enrollend,$startaccess,$endaccess);      my ($enrollstart,$enrollend,$startaccess,$endaccess);
   
Line 665  sub create_course { Line 662  sub create_course {
  return;   return;
     }      }
     # Check the proposed home server for the course      # Check the proposed home server for the course
     my %host_servers = &Apache::loncommon::get_library_servers      my %host_servers = 
         ($env{'request.role.domain'});   &Apache::lonnet::get_servers($env{'request.role.domain'},'library');
     if (! exists($host_servers{$env{'form.course_home'}})) {      if (! exists($host_servers{$env{'form.course_home'}})) {
         $r->print(&mt('Invalid home server for course').': '.          $r->print(&mt('Invalid home server for course').': '.
                   $env{'form.course_home'}.&Apache::loncommon::end_page());                    $env{'form.course_home'}.&Apache::loncommon::end_page());
Line 691  sub create_course { Line 688  sub create_course {
 # Flush the course logs so reverse user roles immediately updated  # Flush the course logs so reverse user roles immediately updated
     &Apache::lonnet::flushcourselogs();      &Apache::lonnet::flushcourselogs();
     $r->print('<p>'.&mt('Roles will be active at next login').'.</p>'.      $r->print('<p>'.&mt('Roles will be active at next login').'.</p>'.
       '<p><a href="/adm/createcourse">'.        '<p><a href="/adm/createcourse?phase='.lc($crstype).'one">'.
       &mt('Create Another [_1]',$crstype).'</a></p>'.        &mt('Create Another [_1]',$crstype).'</a></p>'.
       &Apache::loncommon::end_page());        &Apache::loncommon::end_page());
 }  }
Line 719  sub print_intro_page { Line 716  sub print_intro_page {
                      name => &mt('Create courses/groups by uploading an attributes file'),                       name => &mt('Create courses/groups by uploading an attributes file'),
                      short_description =>                       short_description =>
     &mt('Upload an attributes file containing specifications for one or more courses or groups in XML format'),      &mt('Upload an attributes file containing specifications for one or more courses or groups in XML format'),
                        help => 'Batch_Creation',
                  },                   },
     );      );
     my $options;      my $options;
     foreach my $choice (@choices) {      foreach my $choice (@choices) {
         $options .='    <h3><a href="/adm/createcourse?phase='.          $options .='    <h3><a href="/adm/createcourse?phase='.
             $choice->{'internal_name'}.'" >'.              $choice->{'internal_name'}.'" >'.
             $choice->{'name'}."</a></h3>\n";              $choice->{'name'}.'</a>';
         $options .= '    '.('&nbsp;'x8).$choice->{'short_description'}.          if (exists($choice->{'help'})) {
               $options .= &Apache::loncommon::help_open_topic($choice->{'help'});
           }
           $options .= "</h3>\n".'    '.('&nbsp;'x8).$choice->{'short_description'}.
             "\n";              "\n";
     }      }
   

Removed from v.1.96  
changed lines
  Added in v.1.101


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