--- loncom/interface/loncreatecourse.pm 2007/06/01 18:07:47 1.101.2.1 +++ loncom/interface/loncreatecourse.pm 2008/12/15 08:44:25 1.110.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network # Create a course # -# $Id: loncreatecourse.pm,v 1.101.2.1 2007/06/01 18:07:47 albertel Exp $ +# $Id: loncreatecourse.pm,v 1.110.2.2 2008/12/15 08:44:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,7 +35,7 @@ use Apache::lonnet; use Apache::loncommon; use Apache::londocs; use Apache::lonlocal; -use Apache::londropadd; +use Apache::lonuserutils; use Apache::lonclonecourse; use LONCAPA::batchcreatecourse; use LONCAPA; @@ -71,13 +71,13 @@ sub print_course_creation_page { if ($crstype eq 'Course') { my $starttime = time; my $endtime = time+(6*30*24*60*60); # 6 months from now, approx - $enroll_table = &Apache::londropadd::date_setting_table($starttime, - $endtime,'create_enrolldates'); - $access_table = &Apache::londropadd::date_setting_table($starttime, - $endtime,'create_defaultdates'); + $enroll_table = &Apache::lonuserutils::date_setting_table($starttime, + $endtime,'create_enrolldates'); + $access_table = &Apache::lonuserutils::date_setting_table($starttime, + $endtime,'create_defaultdates'); ($krbdef,$krbdefdom) = &Apache::loncommon::get_kerberos_defaults($defdom); - $javascript_validations=&Apache::londropadd::javascript_validations( + $javascript_validations=&Apache::lonuserutils::javascript_validations( 'createcourse',$krbdefdom); my %param = ( formname => 'document.ccrs', kerb_def_dom => $krbdefdom, @@ -128,7 +128,11 @@ function validate(formname) { 'navi' => "Navigate", 'cid' => "Course ID", 'dmn' => "Domain", + 'dsh' => "Date Shift", 'asov' => "Additional settings, if specified below, will override cloned settings", + 'ncd' => "Do not clone date parameters", + 'prd' => 'Clone date parameters as-is', + 'shd' => 'Shift date parameters by number of days', 'assp' => "Assessment Parameters", 'oaas' => "Open all assessments", 'mssg' => "Messaging", @@ -151,7 +155,7 @@ function validate(formname) { 'audr' => "Automated drops", '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", 'nech' => "Notification of enrollment changes", 'nccl' => "Notification to course coordinator via LON-CAPA message when enrollment changes occur during the automated update?", @@ -221,210 +225,249 @@ END 'Create_Course',undef, 'Create_Courses'); $r->print($start_page.$crumbs); + if ($crstype eq 'Course') { + $r->print('
ENDDOCUMENT + } elsif ($crstype eq 'Group') { $r->print(<
'); - } - if ($env{'form.setkeys'}) { - $r->print( - '
'); - } -# Flush the course logs so reverse user roles immediately updated - &Apache::lonnet::flushcourselogs(); - $r->print(''.&mt('Roles will be active at next login').'.
'. - ''.
+ my ($success,$output) =
+ &Apache::loncommon::construct_course($args,\$logmsg,\$courseid,
+ \$crsudom,\$crsunum,
+ $env{'user.domain'},
+ $env{'user.name'});
+ $r->print($output);
+ if ($success) {
+ #
+ # Make the requested user a course coordinator or group coordinator
+ #
+ if (($ccdomain) && ($ccuname)) {
+ $r->print(&mt('Assigning role of [_1] Coordinator to [_2] at [_3]: ',
+ $crstype,$ccuname,$ccdomain).
+ &Apache::lonnet::assignrole($ccdomain,$ccuname,$courseid,
+ 'cc','','','','','createcourse').' ');
+ }
+ if ($env{'form.setkeys'}) {
+ $r->print(
+ ' '.&mt('Roles will be active at next login').'. '.
&mt('Create Another [_1]',$crstype).'
'.
+ &mt('Creation options menu').''.$end_page);
}