version 1.61, 2003/07/18 19:50:28
|
version 1.62, 2003/07/18 20:53:06
|
Line 314 END
|
Line 314 END
|
} |
} |
# Compute the background color based on $area |
# Compute the background color based on $area |
$bgcol=$1.'_'.$2; |
$bgcol=$1.'_'.$2; |
$bgcol=~s/[^8-9b-e]//g; |
$bgcol=~s/[^7-9a-e]//g; |
$bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',0,6); |
$bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6); |
if ($area=~/^\/(\w+)\/(\d\w+)\/(\w+)/) { |
if ($area=~/^\/(\w+)\/(\d\w+)\/(\w+)/) { |
$carea.='<br>Section/Group: '.$3; |
$carea.='<br>Section/Group: '.$3; |
} |
} |
Line 347 END
|
Line 347 END
|
} |
} |
} |
} |
my $row = ''; |
my $row = ''; |
$row.='<tr bgcolor=#"'.$bgcol.'"><td>'; |
$row.='<tr bgcolor="#'.$bgcol.'"><td>'; |
my $active=1; |
my $active=1; |
$active=0 if (($role_end_time) && ($now>$role_end_time)); |
$active=0 if (($role_end_time) && ($now>$role_end_time)); |
if (($active) && ($allowed)) { |
if (($active) && ($allowed)) { |
Line 861 sub custom_role_editor {
|
Line 861 sub custom_role_editor {
|
$r->print('Existing Role "'); |
$r->print('Existing Role "'); |
# ------------------------------------------------- Get current role privileges |
# ------------------------------------------------- Get current role privileges |
($syspriv,$dompriv,$coursepriv)=split(/\_/,$roledef); |
($syspriv,$dompriv,$coursepriv)=split(/\_/,$roledef); |
$r->print($syspriv.' '.$dompriv.' '.$coursepriv); |
|
} else { |
} else { |
$r->print('New Role "'); |
$r->print('New Role "'); |
$roledef=''; |
$roledef=''; |
Line 1026 sub handler {
|
Line 1025 sub handler {
|
sub course_level_table { |
sub course_level_table { |
my %inccourses = @_; |
my %inccourses = @_; |
my $table = ''; |
my $table = ''; |
|
# Custom Roles? |
|
|
|
my %customroles=&my_custom_roles(); |
|
|
foreach (sort( keys(%inccourses))) { |
foreach (sort( keys(%inccourses))) { |
my $thiscourse=$_; |
my $thiscourse=$_; |
my $protectedcourse=$_; |
my $protectedcourse=$_; |
Line 1034 sub course_level_table {
|
Line 1037 sub course_level_table {
|
my $area=$coursedata{'description'}; |
my $area=$coursedata{'description'}; |
if (!defined($area)) { $area='Unavailable course: '.$_; } |
if (!defined($area)) { $area='Unavailable course: '.$_; } |
my $bgcol=$thiscourse; |
my $bgcol=$thiscourse; |
$bgcol=~s/[^8-9b-e]//g; |
$bgcol=~s/[^7-9a-e]//g; |
$bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',0,6); |
$bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',2,6); |
foreach ('st','ta','ep','ad','in','cc') { |
foreach ('st','ta','ep','ad','in','cc') { |
if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) { |
if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) { |
my $plrole=&Apache::lonnet::plaintext($_); |
my $plrole=&Apache::lonnet::plaintext($_); |
Line 1065 ENDTIMEENTRY
|
Line 1068 ENDTIMEENTRY
|
$table.= "</tr>\n"; |
$table.= "</tr>\n"; |
} |
} |
} |
} |
|
foreach (sort keys %customroles) { |
|
my $plrole=$_; |
|
$table .= <<ENDENTRY; |
|
<tr bgcolor="#$bgcol"> |
|
<td><input type="checkbox" name="act_$protectedcourse\_$_"></td> |
|
<td>$plrole</td> |
|
<td>$area</td> |
|
<td><input type="text" size="5" name="sec_$protectedcourse\_$_"></td> |
|
<td><input type=hidden name="start_$protectedcourse\_$_" value=''> |
|
<a href= |
|
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$_.value,'start_$protectedcourse\_$_','cu.pres','dateset')">Set Start Date</a></td> |
|
<td><input type=hidden name="end_$protectedcourse\_$_" value=''> |
|
<a href= |
|
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$_.value,'end_$protectedcourse\_$_','cu.pres','dateset')">Set End Date</a></td></tr> |
|
ENDENTRY |
|
} |
} |
} |
return '' if ($table eq ''); # return nothing if there is nothing |
return '' if ($table eq ''); # return nothing if there is nothing |
# in the table |
# in the table |