--- loncom/auth/lonroles.pm 2012/05/16 21:19:44 1.266 +++ loncom/auth/lonroles.pm 2012/07/21 21:09:03 1.269 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.266 2012/05/16 21:19:44 droeschl Exp $ +# $Id: lonroles.pm,v 1.269 2012/07/21 21:09:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -266,6 +266,7 @@ sub handler { "request.course.fn" => '', "request.course.uri" => '', "request.course.sec" => '', + "request.course.tied" => '', "request.role" => 'cm', "request.role.adv" => $env{'user.adv'}, "request.role.domain" => $env{'user.domain'}}); @@ -519,7 +520,8 @@ ENDENTERKEY if ($dest =~ m{^/adm/coursedocs\?folderpath}) { if ($env{'request.course.id'} eq $cdom.'_'.$cnum) { my $chome = &Apache::lonnet::homeserver($cnum,$cdom); - &update_content_constraints($cdom,$cnum,$chome,$cdom.'_'.$cnum); + &Apache::loncommon::update_content_constraints($cdom,$cnum,$chome, + $cdom.'_'.$cnum); } } $r->internal_redirect($dest); @@ -954,7 +956,12 @@ ENDHEADER $r->print('
'
@@ -1681,43 +1688,6 @@ sub check_release_required {
return ($switchserver,$warning);
}
-sub update_content_constraints {
- my ($cdom,$cnum,$chome,$cid) = @_;
- my %curr_reqd_hash = &Apache::lonnet::userenvironment($cdom,$cnum,'internal.releaserequired');
- my ($reqdmajor,$reqdminor) = split(/\./,$curr_reqd_hash{'internal.releaserequired'});
- my %checkresponsetypes;
- foreach my $key (keys(%Apache::lonnet::needsrelease)) {
- my ($item,$name,$value) = split(/:/,$key);
- if ($item eq 'resourcetag') {
- if ($name eq 'responsetype') {
- $checkresponsetypes{$value} = $Apache::lonnet::needsrelease{$key}
- }
- }
- }
- my $navmap = Apache::lonnavmaps::navmap->new();
- if (defined($navmap)) {
- my %allresponses;
- foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) {
- my %responses = $res->responseTypes();
- foreach my $key (keys(%responses)) {
- next unless(exists($checkresponsetypes{$key}));
- $allresponses{$key} += $responses{$key};
- }
- }
- foreach my $key (keys(%allresponses)) {
- my ($major,$minor) = split(/\./,$checkresponsetypes{$key});
- if (($major > $reqdmajor) || ($major == $reqdmajor && $minor > $reqdminor)) {
- ($reqdmajor,$reqdminor) = ($major,$minor);
- }
- }
- undef($navmap);
- }
- unless (($reqdmajor eq '') && ($reqdminor eq '')) {
- &Apache::lonnet::update_released_required($reqdmajor.'.'.$reqdminor,$cdom,$cnum,$chome,$cid);
- }
- return;
-}
-
sub courselink {
my ($dcdom,$rowtype) = @_;
my $courseform=&Apache::loncommon::selectcourse_link
@@ -2288,7 +2258,7 @@ sub update_session_roles {
}
if (keys(%deletedroles) > 0) {
$changemsg .= '';
foreach my $item (sort(keys(%deletedroles))) {
$changemsg .= '