version 1.119, 2006/05/30 20:12:15
|
version 1.127, 2006/06/29 17:41:06
|
Line 142 sub print_username_entry_form {
|
Line 142 sub print_username_entry_form {
|
'nr' => "Name of Role", |
'nr' => "Name of Role", |
'cre' => "Custom Role Editor" |
'cre' => "Custom Role Editor" |
); |
); |
my $help = &Apache::loncommon::help_open_menu('',undef,undef,'',282,'Instructor Interface'); |
my $help = &Apache::loncommon::help_open_menu(undef,undef,282,'Instructor Interface'); |
my $helpsiur=&Apache::loncommon::help_open_topic('Course_Change_Privileges'); |
my $helpsiur=&Apache::loncommon::help_open_topic('Course_Change_Privileges'); |
my $helpecpr=&Apache::loncommon::help_open_topic('Course_Editing_Custom_Roles'); |
my $helpecpr=&Apache::loncommon::help_open_topic('Course_Editing_Custom_Roles'); |
$r->print(<<"ENDDOCUMENT"); |
$r->print(<<"ENDDOCUMENT"); |
Line 246 sub print_user_modification_page {
|
Line 246 sub print_user_modification_page {
|
my @rolevals = ('st','ta','ep','in','cc'); |
my @rolevals = ('st','ta','ep','in','cc'); |
my (@crsroles,@grproles); |
my (@crsroles,@grproles); |
for (my $i=0; $i<@rolevals; $i++) { |
for (my $i=0; $i<@rolevals; $i++) { |
$crsroles[$i]=&Apache::lonnet::plaintext($rolevals[$i]); |
$crsroles[$i]=&Apache::lonnet::plaintext($rolevals[$i],'Course'); |
$grproles[$i]=&Apache::loncommon::convert_role($crsroles[$i],'Group'); |
$grproles[$i]=&Apache::lonnet::plaintext($rolevals[$i],'Group'); |
} |
} |
my $rolevalslist = join('","',@rolevals); |
my $rolevalslist = join('","',@rolevals); |
my $crsrolenameslist = join('","',@crsroles); |
my $crsrolenameslist = join('","',@crsroles); |
Line 415 ENDSCRIPT
|
Line 415 ENDSCRIPT
|
sections = document.cu.elements[i+1].value; |
sections = document.cu.elements[i+1].value; |
} |
} |
var newsecs = document.cu.elements[i+1].value; |
var newsecs = document.cu.elements[i+1].value; |
|
var numsplit; |
if (newsecs != null && newsecs != "") { |
if (newsecs != null && newsecs != "") { |
var numsplit = newsecs.split(/,/g); |
numsplit = newsecs.split(/,/g); |
numsec = numsec + numsplit.length; |
numsec = numsec + numsplit.length; |
} |
} |
|
|
if ((role == 'st') && (numsec > 1)) { |
if ((role == 'st') && (numsec > 1)) { |
alert("In each course, each user may only have one student role at a time. You had selected "+numsec+" sections.\\nPlease modify your selections so they include no more than one section.") |
alert("In each course, each user may only have one student role at a time. You had selected "+numsec+" sections.\\nPlease modify your selections so they include no more than one section.") |
return; |
return; |
} |
} |
else { |
else if (numsplit != null) { |
for (var j=0; j<numsplit.length; j++) { |
for (var j=0; j<numsplit.length; j++) { |
if ((numsplit[j] == 'all') || |
if ((numsplit[j] == 'all') || |
(numsplit[j] == 'none')) { |
(numsplit[j] == 'none')) { |
Line 705 END
|
Line 707 END
|
} |
} |
my $plaintext=''; |
my $plaintext=''; |
unless ($croletitle) { |
unless ($croletitle) { |
$plaintext=&Apache::lonnet::plaintext($role_code); |
$plaintext=&Apache::lonnet::plaintext($role_code,$class) |
if ($class eq 'Group') { |
|
$plaintext = &Apache::loncommon::convert_role($plaintext,$class); |
|
} |
|
} else { |
} else { |
$plaintext= |
$plaintext= |
"Customrole '$croletitle' defined by $croleuname\@$croleudom"; |
"Customrole '$croletitle' defined by $croleuname\@$croleudom"; |
Line 1601 sub custom_role_editor {
|
Line 1600 sub custom_role_editor {
|
ENDCCF |
ENDCCF |
foreach my $priv (sort keys %full) { |
foreach my $priv (sort keys %full) { |
my $privtext = &Apache::lonnet::plaintext($priv); |
my $privtext = &Apache::lonnet::plaintext($priv); |
if ($env{'course.'.$env{'request.course.id'}.'.type'}) { |
|
$privtext =~ s/Student/Member/; |
|
$privtext =~ s/student/member/; |
|
$privtext =~ s/course/group/; |
|
} |
|
$r->print('<tr><td>'.$privtext.'</td><td>'. |
$r->print('<tr><td>'.$privtext.'</td><td>'. |
($courselevel{$priv}?'<input type="checkbox" name="'.$priv.':c" '. |
($courselevel{$priv}?'<input type="checkbox" name="'.$priv.':c" '. |
($courselevelcurrent{$priv}?'checked="1"':'').' />':' '). |
($courselevelcurrent{$priv}?'checked="1"':'').' />':' '). |
Line 1773 sub course_level_table {
|
Line 1767 sub course_level_table {
|
foreach ('st','ta','ep','in','cc') { |
foreach ('st','ta','ep','in','cc') { |
if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) { |
if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) { |
my $plrole=&Apache::lonnet::plaintext($_); |
my $plrole=&Apache::lonnet::plaintext($_); |
if ($type eq 'Group') { |
|
$plrole = &Apache::loncommon::convert_role($plrole,$type); |
|
} |
|
$table .= <<ENDEXTENT; |
$table .= <<ENDEXTENT; |
<tr bgcolor="#$bgcol"> |
<tr bgcolor="#$bgcol"> |
<td><input type="checkbox" name="act_$protectedcourse\_$_"></td> |
<td><input type="checkbox" name="act_$protectedcourse\_$_"></td> |