version 1.15, 2009/02/05 12:27:21
|
version 1.16, 2009/02/09 04:11:11
|
Line 550 sub store_selfenroll_request {
|
Line 550 sub store_selfenroll_request {
|
); |
); |
my $putresult = &Apache::lonnet::put($namespace,\%selfenroll,$cdom,$cnum); |
my $putresult = &Apache::lonnet::put($namespace,\%selfenroll,$cdom,$cnum); |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
|
my %userenroll = ( |
|
$cdom.'_'.$cnum => { |
|
timestamp => $now, |
|
section => $usec, |
|
status => 'request', |
|
}); |
|
my $warning; |
|
my $userresult = &Apache::lonnet::put($namespace,\%userenroll,$udom,$uname); |
|
if ($userresult ne 'ok') { |
|
$warning = &mt('An error occurred saving a personal record of your request.'); |
|
} |
$output = &mt('Your request for self-enrollment has been recorded.').'<br />'. |
$output = &mt('Your request for self-enrollment has been recorded.').'<br />'. |
&mt('A message will be sent to your LON-CAPA account when the course coordinator takes action on your request').'<br />'; |
&mt('A message will be sent to your LON-CAPA account when the course coordinator takes action on your request.').'<br />'; |
my %emails = &Apache::loncommon::getemails($uname,$udom); |
my %emails = &Apache::loncommon::getemails($uname,$udom); |
if (($emails{'permanentemail'} ne '') || ($emails{'notification'} ne '')) { |
if (($emails{'permanentemail'} ne '') || ($emails{'notification'} ne '')) { |
my $address = $emails{'permanentemail'}; |
my $address = $emails{'permanentemail'}; |
if ($address eq '') { |
if ($address eq '') { |
$address = $emails{'notification'}; |
$address = $emails{'notification'}; |
} |
} |
$output.= &mt('An e-mail will also be sent to: [_1] when this occurs.',$address); |
$output.= &mt('An e-mail will also be sent to: [_1] when this occurs.',$address).'<br />'; |
|
} |
|
if ($warning) { |
|
$output .= '<span class="LC_warning">'.$warning.'</span><br />'; |
} |
} |
|
|
if ($selfenroll_notifylist) { |
if ($selfenroll_notifylist) { |
my $fullname = &Apache::loncommon::plainname($uname,$udom); |
my $fullname = &Apache::loncommon::plainname($uname,$udom); |
my %courseinfo = &Apache::lonnet::coursedescription($cdom.'_'.$cnum); |
my %courseinfo = &Apache::lonnet::coursedescription($cdom.'_'.$cnum); |
Line 589 sub send_notification {
|
Line 604 sub send_notification {
|
$rawsubj = 'Self-enrollment requests processed'; |
$rawsubj = 'Self-enrollment requests processed'; |
push(@rawmsg,{ |
push(@rawmsg,{ |
mt => 'Enrollment requests in the following course: [_1] have been processed.', |
mt => 'Enrollment requests in the following course: [_1] have been processed.', |
args => [$coursedesc], |
args => ["\n$coursedesc\n"], |
}); |
}); |
} elsif ($context eq 'enroller') { |
} elsif ($context eq 'enroller') { |
$rawsubj = 'Enrollment request'; |
$rawsubj = 'Enrollment request'; |
push(@rawmsg,{ |
push(@rawmsg,{ |
mt => 'Your request for enrollment in the following course: [_1], requested on [_2], has been reviewed by a Course Coordinator.', |
mt => 'Your request for enrollment in the following course: [_1], requested on [_2], has been reviewed by a Course Coordinator.', |
args => [$coursedesc,$timestamp], |
args => ["\n$coursedesc\n","$timestamp\n"], |
|
|
}); |
}); |
if (ref($textstr) eq 'ARRAY') { |
if (ref($textstr) eq 'ARRAY') { |
push(@rawmsg,@{$textstr}); |
push(@rawmsg,@{$textstr}); |
Line 604 sub send_notification {
|
Line 620 sub send_notification {
|
$rawsubj = 'Self-enrollment request'; |
$rawsubj = 'Self-enrollment request'; |
push(@rawmsg,{ |
push(@rawmsg,{ |
mt => 'Enrollment in the following course: [_1] was requested by [_2] on [_3].', |
mt => 'Enrollment in the following course: [_1] was requested by [_2] on [_3].', |
args => [$coursedesc,$textstr,$timestamp], |
args => ["\n$coursedesc\n",$textstr,$timestamp], |
}, |
}, |
{ |
{ |
mt =>'As Course Coordinator, use Main Menu -> Manage Couse Users -> "Enrollment Requests" to display a list of pending enrollment requests which you can either approve or reject.' |
mt =>'As Course Coordinator, use: [_1]Main Menu -> Manage Couse Users -> Enrollment Requests[_1] to display a list of pending enrollment requests,[_1] which you can either approve or reject.', |
|
args => ["\n"], |
}); |
}); |
} |
} |
my @to_notify = split(/,/,$notifylist); |
my @to_notify = split(/,/,$notifylist); |