');
+ &Apache::lonnet::appenv('environment.portfolioquota' => $changeHash{'portfolioquota'});
}
}
}
@@ -1274,7 +1344,7 @@ END
&Apache::lonnet::revokerole($env{'form.ccdomain'},
$env{'form.ccuname'},$1,$2).' ');
if ($2 eq 'st') {
- $1=~/^\/(\w+)\/(\w+)/;
+ $1=~m{^/($match_domain)/($match_courseid)};
my $cid=$1.'_'.$2;
$r->print(&mt('Drop from classlist').': '.
&Apache::lonnet::critical('put:'.
@@ -1286,10 +1356,10 @@ END
$env{'course.'.$cid.'.home'}).' ');
}
}
- if ($key=~/^form\.rev\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
+ if ($key=~m{^form\.rev\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) {
# Revoke custom role
$r->print(&mt('Revoking custom role:').
- ' '.$4.' by '.$3.'@'.$2.' in '.$1.': '.
+ ' '.$4.' by '.$3.':'.$2.' in '.$1.': '.
&Apache::lonnet::revokecustomrole($env{'form.ccdomain'},
$env{'form.ccuname'},$1,$2,$3,$4).
' ');
@@ -1301,7 +1371,7 @@ END
&Apache::lonnet::assignrole($env{'form.ccdomain'},
$env{'form.ccuname'},$1,$2,$now,0,1).' ');
if ($2 eq 'st') {
- $1=~/^\/(\w+)\/(\w+)/;
+ $1=~m{^/($match_domain)/($match_courseid)};
my $cid=$1.'_'.$2;
$r->print(&mt('Drop from classlist').': '.
&Apache::lonnet::critical('put:'.
@@ -1313,7 +1383,7 @@ END
$env{'course.'.$cid.'.home'}).' ');
}
}
- if ($key=~/^form\.del\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
+ if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) {
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4);
# Delete custom role
$r->print(&mt('Deleting custom role [_1] by [_2]@[_3] in [_4]',
@@ -1332,7 +1402,7 @@ END
my $logmsg;
my $output;
if ($role eq 'st') {
- if ($url =~ m-^/(\w+)/(\w+)/?(\w*)$-) {
+ if ($url =~ m-^/($match_domain)/($match_courseid)/?(\w*)$-) {
my $result = &Apache::loncommon::commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$1,$2,$3);
if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course')) {
$output = "Error: $result\n";
@@ -1352,7 +1422,7 @@ END
$r->print($output);
}
# Re-enable custom role
- if ($key=~/^form\.ren\:([^\_]+)\_cr\.cr\/(\w+)\/(\w+)\/(\w+)$/) {
+ if ($key=~m{^form\.ren\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) {
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4);
my $result = &Apache::lonnet::assigncustomrole(
$env{'form.ccdomain'}, $env{'form.ccuname'},
@@ -1363,7 +1433,7 @@ END
} elsif ($key=~/^form\.act/) {
my $udom = $env{'form.ccdomain'};
my $uname = $env{'form.ccuname'};
- if ($key=~/^form\.act\_([^\_]+)\_([^\_]+)\_cr_cr_([^\_]+)_(\w+)_([^\_]+)$/) {
+ if ($key=~/^form\.act\_($match_domain)\_($match_courseid)\_cr_cr_($match_domain)_($match_username)_([^\_]+)$/) {
# Activate a custom role
my ($one,$two,$three,$four,$five)=($1,$2,$3,$4,$5);
my $url='/'.$one.'/'.$two;
@@ -1394,7 +1464,7 @@ END
$r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end));
}
}
- } elsif ($key=~/^form\.act\_([^\_]+)\_(\w+)\_([^\_]+)$/) {
+ } elsif ($key=~/^form\.act\_($match_domain)\_($match_name)\_([^\_]+)$/) {
# Activate roles for sections with 3 id numbers
# set start, end times, and the url for the class
my ($one,$two,$three)=($1,$2,$3);
@@ -1481,6 +1551,17 @@ END
$r->print(&Apache::loncommon::end_page());
}
+sub quota_admin {
+ my ($setquota,$changeHash) = @_;
+ my $quotachanged;
+ if (&Apache::lonnet::allowed('mpq',$env{'form.ccdomain'})) {
+ # Current user has quota modification privileges
+ $quotachanged = 1;
+ $changeHash->{'portfolioquota'} = $setquota;
+ }
+ return $quotachanged;
+}
+
sub build_roles {
my ($sectionstr,$sections,$role) = @_;
my $num_sections = 0;
@@ -1755,9 +1836,6 @@ sub course_level_table {
my $area=$coursedata{'description'};
my $type=$coursedata{'type'};
if (!defined($area)) { $area=&mt('Unavailable course').': '.$protectedcourse; }
- my $bgcol=$thiscourse;
- $bgcol=~s/[^7-9a-e]//g;
- $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6);
my ($domain,$cnum)=split(/\//,$thiscourse);
my %sections_count;
if (defined($env{'request.course.id'})) {
@@ -1769,18 +1847,17 @@ sub course_level_table {
foreach my $role ('st','ta','ep','in','cc') {
if (&Apache::lonnet::allowed('c'.$role,$thiscourse)) {
my $plrole=&Apache::lonnet::plaintext($role);
- $table .= <
-
'."\n";
if (%sections_count) {
my $currsec = &course_sections(\%sections_count,$customrole);
$table.=
@@ -1839,20 +1914,25 @@ END
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$customrole.value,'start_$customrole','cu.pres','dateset')">$lt{'ssd'}
+"javascript:pjump('date_end','End Date $plrole',document.cu.end_$customrole.value,'end_$customrole','cu.pres','dateset')">$lt{'sed'}
ENDENTRY
+ $table .= &Apache::loncommon::end_data_table_row();
}
}
}
return '' if ($table eq ''); # return nothing if there is nothing
# in the table
- my $result = <$lt{'crl'}
-