version 1.75, 2005/01/20 16:30:52
|
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" |
); |
); |
|
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
<html> |
$html |
|
<head> |
<script language="JavaScript" type="text/javascript"> |
<script language="JavaScript" type="text/javascript"> |
var editbrowser = null; |
var editbrowser = null; |
function openbrowser(formname,elementname) { |
function openbrowser(formname,elementname) { |
Line 354 function openbrowser(formname,elementnam
|
Line 357 function openbrowser(formname,elementnam
|
$javascript_validations |
$javascript_validations |
</script> |
</script> |
$coursebrowserjs |
$coursebrowserjs |
<head> |
|
<title>The LearningOnline Network with CAPA</title> |
<title>The LearningOnline Network with CAPA</title> |
</head> |
</head> |
$bodytag |
$bodytag |
Line 523 $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 547 $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 597 sub create_course {
|
Line 602 sub create_course {
|
} |
} |
|
|
my $logmsg; |
my $logmsg; |
|
my $html=&Apache::lonxml::xmlbegin(); |
my $bodytag=&Apache::loncommon::bodytag('Create a New Course'); |
my $bodytag=&Apache::loncommon::bodytag('Create a New Course'); |
$r->print(<<ENDENHEAD); |
$r->print(<<ENDENHEAD); |
<html> |
$html |
<head> |
<head> |
<title>The LearningOnline Network with CAPA</title> |
<title>The LearningOnline Network with CAPA</title> |
</head> |
</head> |
Line 623 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 669 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 698 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 822 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( |