version 1.23, 2010/03/30 15:23:51
|
version 1.25, 2010/12/08 03:38:46
|
Line 260 sub display_queued_requests {
|
Line 260 sub display_queued_requests {
|
$formaction = '/adm/createcourse'; |
$formaction = '/adm/createcourse'; |
$namespace = 'courserequestqueue'; |
$namespace = 'courserequestqueue'; |
my $disposition = 'approval'; |
my $disposition = 'approval'; |
|
my $nextphase = 'requestchange'; |
if ($context eq 'pending') { |
if ($context eq 'pending') { |
$disposition = 'pending'; |
$disposition = 'pending'; |
|
$nextphase = 'requestvalidation'; |
} |
} |
%requesthash = &Apache::lonnet::dump_dom($namespace,$dom,'_'.$disposition); |
%requesthash = &Apache::lonnet::dump_dom($namespace,$dom,'_'.$disposition); |
$nextelement = '<input type="hidden" name="phase" value="requestchange" />'; |
$nextelement = '<input type="hidden" name="phase" value="'.$nextphase.'" />'; |
} |
} |
my ($output,%queue_by_date); |
my ($output,%queue_by_date); |
if (keys(%requesthash) > 0) { |
if (keys(%requesthash) > 0) { |
Line 322 sub display_queued_requests {
|
Line 324 sub display_queued_requests {
|
$output .= '</div>'; |
$output .= '</div>'; |
} |
} |
if ($context eq 'pending') { |
if ($context eq 'pending') { |
$output .= '<br /><input type="button" name="validationcheck" value="'. |
$output .= '<br /><input type="submit" name="validationcheck" value="'. |
&mt('Validate').'" onclick="javascript:runValidation();" /><br />'."\n". |
&mt('Validate').'" /><br />'."\n". |
'<p>'.&mt('Any course/community requests which are successfully validated will be created immediately.').' '.&mt('Unvalidated requests will be listed for manual approval/rejection.').'</p>'; |
'<p>'.&mt('Any course/community requests which are successfully validated will be created immediately.').' '.&mt('Unvalidated requests will be listed for manual approval/rejection.').'</p>'; |
} else { |
} else { |
$output .= '<br /><input type="submit" name="processqueue" value="'.&mt('Save').'" />'; |
$output .= '<br /><input type="submit" name="processqueue" value="'.&mt('Save').'" />'; |
Line 449 sub update_request_queue {
|
Line 451 sub update_request_queue {
|
@existing,@missingreq,@invalidusers,@limitexceeded,@completed, |
@existing,@missingreq,@invalidusers,@limitexceeded,@completed, |
@processing_errors,@warn_approves,@warn_rejects,@approvals,@warn_dels, |
@processing_errors,@warn_approves,@warn_rejects,@approvals,@warn_dels, |
@rejections,@rejectionerrors,@nopermissions,%courseroles, |
@rejections,@rejectionerrors,@nopermissions,%courseroles, |
%communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype,$queue); |
%communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype,$queue,$firsturl); |
@approvals = &Apache::loncommon::get_env_multiple('form.approvereq'); |
@approvals = &Apache::loncommon::get_env_multiple('form.approvereq'); |
@rejections = &Apache::loncommon::get_env_multiple('form.rejectreq'); |
@rejections = &Apache::loncommon::get_env_multiple('form.rejectreq'); |
$now = time; |
$now = time; |
Line 463 sub update_request_queue {
|
Line 465 sub update_request_queue {
|
$hostname = &Apache::lonnet::hostname($chome); |
$hostname = &Apache::lonnet::hostname($chome); |
$protocol = $Apache::lonnet::protocol{$chome}; |
$protocol = $Apache::lonnet::protocol{$chome}; |
$protocol = 'http' if ($protocol ne 'https'); |
$protocol = 'http' if ($protocol ne 'https'); |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($cdom); |
|
if ($domdefaults{'portal_def'}) { |
|
$firsturl = $domdefaults{'portal_def'}; |
|
} else { |
|
$firsturl = $protocol.'://'.$hostname; |
|
} |
%requesthash = &Apache::lonnet::dump($namespace,$cdom,$cnum); |
%requesthash = &Apache::lonnet::dump($namespace,$cdom,$cnum); |
$access_start = $env{'course.'.$cid.'.internal.selfenroll_start_access'}; |
$access_start = $env{'course.'.$cid.'.internal.selfenroll_start_access'}; |
$access_end = $env{'course.'.$cid.'.internal.selfenroll_end_access'}; |
$access_end = $env{'course.'.$cid.'.internal.selfenroll_end_access'}; |
Line 475 sub update_request_queue {
|
Line 483 sub update_request_queue {
|
}, |
}, |
{ |
{ |
mt => 'Visit [_1], to log-in and access the course', |
mt => 'Visit [_1], to log-in and access the course', |
args => [$protocol.'://'.$hostname], |
args => [$firsturl], |
}]; |
}]; |
$rejectedmsg = [{ |
$rejectedmsg = [{ |
mt => 'Your request for enrollment has not been approved.', |
mt => 'Your request for enrollment has not been approved.', |
Line 493 sub update_request_queue {
|
Line 501 sub update_request_queue {
|
$hostname = &Apache::lonnet::hostname($chome); |
$hostname = &Apache::lonnet::hostname($chome); |
$protocol = $Apache::lonnet::protocol{$chome}; |
$protocol = $Apache::lonnet::protocol{$chome}; |
$protocol = 'http' if ($protocol ne 'https'); |
$protocol = 'http' if ($protocol ne 'https'); |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($cdom); |
|
if ($domdefaults{'portal_def'}) { |
|
$firsturl = $domdefaults{'portal_def'}; |
|
} else { |
|
$firsturl = $protocol.'://'.$hostname; |
|
} |
my %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$cdom); |
my %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$cdom); |
if (ref($domconfig{'requestcourses'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') { |
if (ref($domconfig{'requestcourses'}{'notify'}) eq 'HASH') { |
Line 505 sub update_request_queue {
|
Line 519 sub update_request_queue {
|
}, |
}, |
{ |
{ |
mt => 'Visit [_1], to log-in and access the course', |
mt => 'Visit [_1], to log-in and access the course', |
args => [$protocol.'://'.$hostname], |
args => [$firsturl], |
}]; |
}]; |
$rejectionmsg{'course'} = |
$rejectionmsg{'course'} = |
[{ |
[{ |
Line 518 sub update_request_queue {
|
Line 532 sub update_request_queue {
|
}, |
}, |
{ |
{ |
mt => 'Visit [_1], to log-in and access the community', |
mt => 'Visit [_1], to log-in and access the community', |
args => [$protocol.'://'.$hostname], |
args => [$firsturl], |
}]; |
}]; |
|
|
$rejectionmsg{'community'} = |
$rejectionmsg{'community'} = |
Line 1320 sub process_official_reqs {
|
Line 1334 sub process_official_reqs {
|
my ($context,$dom) = @_; |
my ($context,$dom) = @_; |
my $reqsnamespace = 'courserequestqueue'; |
my $reqsnamespace = 'courserequestqueue'; |
my %requesthash = |
my %requesthash = |
&Apache::lonnet::dump_dom($reqsnamespace,$dom,undef,'_pending'); |
&Apache::lonnet::dump_dom($reqsnamespace,$dom,'_pending'); |
my (%newcids,%longroles,%stillpending); |
my (%newcids,%longroles,%stillpending); |
my @courseroles = ('cc','in','ta','ep','ad','st'); |
my @courseroles = ('cc','in','ta','ep','ad','st'); |
foreach my $role (@courseroles) { |
foreach my $role (@courseroles) { |