version 1.12.2.8, 2010/02/26 23:39:01
|
version 1.12.2.12, 2010/12/08 03:49:34
|
Line 376 sub update_request_queue {
|
Line 376 sub update_request_queue {
|
@processing_errors,@warn_approves,@warn_rejects,@approvals, |
@processing_errors,@warn_approves,@warn_rejects,@approvals, |
@rejections,@rejectionerrors,@nopermissions,%courseroles, |
@rejections,@rejectionerrors,@nopermissions,%courseroles, |
%communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype, |
%communityroles,%domdefs,%approvalmsg,%rejectionmsg,$crstype, |
@warn_coursereqs); |
@warn_coursereqs,$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 390 sub update_request_queue {
|
Line 390 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 402 sub update_request_queue {
|
Line 408 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 416 sub update_request_queue {
|
Line 422 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 428 sub update_request_queue {
|
Line 440 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 441 sub update_request_queue {
|
Line 453 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 459 sub update_request_queue {
|
Line 471 sub update_request_queue {
|
} |
} |
|
|
} |
} |
|
my %allnums = &Apache::loncommon::get_faculty_cnums(); |
foreach my $item (sort {$a <=> $b} @approvals) { |
foreach my $item (sort {$a <=> $b} @approvals) { |
if ($context eq 'course') { |
if ($context eq 'course') { |
my ($num,$uname,$udom,$usec) = split(/:/,$item); |
my ($num,$uname,$udom,$usec) = split(/:/,$item); |
my $uhome = &Apache::lonnet::homeserver($uname,$udom); |
my $uhome = &Apache::lonnet::homeserver($uname,$udom); |
if ($uhome ne 'no_host') { |
if ($uhome ne 'no_host') { |
if (exists($requesthash{$uname.':'.$udom})) { |
if (exists($requesthash{$uname.':'.$udom})) { |
if ($cdom eq 'gci' && $cnum eq '9615072b469884921gcil1') { |
if (($cdom ne '') && (ref($allnums{$cdom}) eq 'HASH')) { |
my $enresult = &enable_gci_submission($udom,$uname, |
my ($addothers,@others); |
$access_end,$access_start); |
foreach my $key (%{$allnums{$cdom}}) { |
|
if ($key eq $cnum) { |
|
$addothers = 1; |
|
} else { |
|
push(@others,$key); |
|
} |
|
} |
|
if ($addothers) { |
|
foreach my $crs (@others) { |
|
my $enresult = |
|
&enable_additional_roles($cdom,$crs,$udom,$uname, |
|
$access_end,$access_start); |
|
} |
|
} |
} |
} |
if (exists($classlist->{$uname.':'.$udom})) { |
if (exists($classlist->{$uname.':'.$udom})) { |
if (ref($classlist->{$uname.':'.$udom}) eq 'ARRAY') { |
if (ref($classlist->{$uname.':'.$udom}) eq 'ARRAY') { |
Line 514 sub update_request_queue {
|
Line 540 sub update_request_queue {
|
&Apache::lonnet::put($namespace,\%userrequest,$udom,$uname); |
&Apache::lonnet::put($namespace,\%userrequest,$udom,$uname); |
if ($userresult ne 'ok') { |
if ($userresult ne 'ok') { |
push(@warn_approves,$uname.':'.$udom); |
push(@warn_approves,$uname.':'.$udom); |
} elsif ($udom eq 'gci') { |
} elsif (ref($allnums{$udom}) eq 'HASH') { |
my %changehash = ( |
my %changehash = ( |
'reqcrsotherdom.unofficial' => 'gcitest:autolimit=', |
'reqcrsotherdom.unofficial' => $udom.'test:autolimit=', |
); |
); |
my $reqresult = &Apache::lonnet::put('environment',\%changehash, |
my $reqresult = &Apache::lonnet::put('environment',\%changehash, |
$udom,$uname); |
$udom,$uname); |
Line 917 sub update_request_queue {
|
Line 943 sub update_request_queue {
|
return $output; |
return $output; |
} |
} |
|
|
sub enable_gci_submission { |
sub enable_additional_roles { |
my ($udom,$uname,$access_end,$access_start) = @_; |
my ($cdom,$cnum,$udom,$uname,$access_end,$access_start) = @_; |
my $cdom = 'gci'; |
|
my $cnum = '1H96711d710194bfegcil1'; |
|
my ($stucounts,$idx,$classlist) = &get_student_counts($cdom,$cnum); |
my ($stucounts,$idx,$classlist) = &get_student_counts($cdom,$cnum); |
if (exists($classlist->{$uname.':'.$udom})) { |
if (exists($classlist->{$uname.':'.$udom})) { |
if (ref($classlist->{$uname.':'.$udom}) eq 'ARRAY') { |
if (ref($classlist->{$uname.':'.$udom}) eq 'ARRAY') { |
Line 990 sub build_batchcreatehash {
|
Line 1014 sub build_batchcreatehash {
|
my ($dom,$context,$details,$owneremail,$domdefs) = @_; |
my ($dom,$context,$details,$owneremail,$domdefs) = @_; |
my %batchhash; |
my %batchhash; |
my @items = qw{owner domain coursehome clonecrs clonedom cloneroster datemode dateshift enrollstart enrollend accessstart accessend sections crosslists users}; |
my @items = qw{owner domain coursehome clonecrs clonedom cloneroster datemode dateshift enrollstart enrollend accessstart accessend sections crosslists users}; |
if ($dom eq 'gcitest') { |
if ($dom =~ /^\w+citest$/) { |
push(@items,'firstres'); |
push(@items,'firstres'); |
} |
} |
if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) { |
if ((ref($details) eq 'HASH') && (ref($domdefs) eq 'HASH')) { |