".
+ $output{$type};
+ $rolesdisplay = 1;
+ }
+ }
+ if ($rolesdisplay == 1) {
+ my $contextrole='';
+ if ($env{'request.course.id'}) {
+ my $crstype = &Apache::loncommon::course_type();
+ $contextrole = "Existing Roles in this $crstype";
+ } elsif ($env{'request.role'} =~ /^au\./) {
+ $contextrole = 'Existing Co-Author Roles in your Construction Space';
} else {
- $contextrole = &mt('Existing Roles in this Course');
+ $contextrole = 'Existing Roles in this Domain';
}
- } elsif ($env{'request.role'} =~ /^au\./) {
- $contextrole = 'Existing Co-Author Roles in your Construction Space';
- } else {
- $contextrole = 'Existing Roles in this Domain';
- }
- $r->print('
+ $r->print('
'.$lt{'rer'}.'
'.
'
'.&mt($contextrole).'
'.
&Apache::loncommon::start_data_table("LC_createuser").
@@ -1668,13 +1589,14 @@ sub display_existing_roles {
'
'.$lt{'rol'}.'
'.$lt{'ext'}.
'
'.$lt{'sta'}.'
'.$lt{'end'}.'
'.
&Apache::loncommon::end_data_table_header_row());
- foreach my $type ('Construction Space','Course','Community','Domain','System','Unknown') {
- if ($output{$type}) {
- $r->print($output{$type}."\n");
+ foreach my $type ('Construction Space','Course','Community','Domain','System','Unknown') {
+ if ($output{$type}) {
+ $r->print($output{$type}."\n");
+ }
}
+ $r->print(&Apache::loncommon::end_data_table());
}
- $r->print(&Apache::loncommon::end_data_table());
- }
+ } # End of check for keys in rolesdump
return;
}
@@ -2285,7 +2207,7 @@ sub update_user_data {
$env{'form.ccuname'}, $env{'form.ccdomain'}).'');
my (%alerts,%rulematch,%inst_results,%curr_rules);
my @usertools = ('aboutme','blog','portfolio');
- my @requestcourses = ('official','unofficial');
+ my @requestcourses = ('official','unofficial','community');
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'});
if ($env{'form.makeuser'}) {
@@ -2691,7 +2613,8 @@ sub update_user_data {
$newenvhash{'environment.requestcourses.'.$key} =
$changeHash{'requestcourses.'.$key};
if ($changeHash{'requestcourses.'.$key} ne '') {
- $newenvhash{'environment.canrequest.'.$key} = 1;
+ $newenvhash{'environment.canrequest.'.$key} =
+ $changeHash{'requestcourses.'.$key};
} else {
$newenvhash{'environment.canrequest.'.$key} =
&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},
@@ -3494,8 +3417,8 @@ sub enroll_single_student {
$r->print(&mt('If the member is currently logged-in to LON-CAPA, the new role will be available when the member next logs in.'));
} else {
$r->print(&mt('If the student is currently logged-in to LON-CAPA, the new role will be available when the student next logs in.'));
- }
- $r->print('');
+ }
+ $r->print('');
}
} else {
$r->print(&mt('unable to enroll').": ".$enroll_result);
@@ -3621,7 +3544,7 @@ sub build_roles {
sub custom_role_editor {
my ($r) = @_;
my $action = $env{'form.customroleaction'};
- my $rolename;
+ my $rolename;
if ($action eq 'new') {
$rolename=$env{'form.newrolename'};
} else {
@@ -3658,7 +3581,7 @@ sub custom_role_editor {
# ------------------------------------------------- Get current role privileges
($syspriv,$dompriv,$coursepriv)=split(/\_/,$roledef);
if ($crstype eq 'Community') {
- $syspriv =~ s/bre\&S//;
+ $syspriv =~ s/bre\&S//;
}
} else {
$body_top .= &mt('New Role').' "';
@@ -3699,8 +3622,8 @@ sub custom_role_editor {
my ($jsback,$elements) = &crumb_utilities();
my $button_code = "\n";
my $head_script = "\n";
- $head_script .= ''."\n";
+
+ $head_script .= "\n".$jsback."\n"
+ .'// ]]>'."\n"
+ .''."\n";
$r->print(&Apache::loncommon::start_page('Custom Role Editor',$head_script));
- &Apache::lonhtmlcommon::add_breadcrumb
+ &Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:backPage(document.form1,'pickrole','')",
text=>"Pick custom role",
faq=>282,bug=>'Instructor Interface',},
@@ -3765,6 +3689,7 @@ sub custom_role_editor {
'dml' => "Domain Level",
'ssl' => "System Level");
+
$r->print('
'
.'';
+
+ # Only display table, if content is available (has been collected above)
+ if (!$content) {
+ $r->print('