$lt{'cnu'} "$ccuname" $lt{'ind'} $ccdomain
ENDTITLE
if ($env{'form.action'} eq 'singlestudent') {
if ($crstype eq 'Community') {
- $r->print(' ('.$lt{'ame'}.')');
+ $title = &mt('Create New User [_1] in domain [_2] as a member',
+ '"'.$ccuname.'"','"'.$ccdomain.'"');
} else {
- $r->print(' ('.$lt{'ast'}.')');
+ $title = &mt('Create New User [_1] in domain [_2] as a student',
+ '"'.$ccuname.'"','"'.$ccdomain.'"');
}
+ } else {
+ $title = &mt('Create New User [_1] in domain [_2]',
+ '"'.$ccuname.'"','"'.$ccdomain.'"');
}
- $r->print('
'.
+ &Apache::lonhtmlcommon::row_closure(1);
+ $rowcount ++;
+ }
+ my $submit_text = &mt('Create account');
+ $output .= &Apache::lonhtmlcommon::row_title()."\n".
+ ' '.
+ ''.
+ &Apache::lonhtmlcommon::row_closure(1);
+ }
$output .= &Apache::lonhtmlcommon::end_pick_box();
if (wantarray) {
if ($context eq 'selfcreate') {
return($output,$rowcount,$editable);
} else {
- return ($output,$showforceid);
+ return $output;
}
} else {
return $output;
@@ -2474,9 +2534,12 @@ sub update_user_data {
if (! exists($env{'form.makeuser'})) {
# Modifying an existing user, so check the validity of the name
if ($uhome eq 'no_host') {
- $r->print($error.&mt('Unable to determine home server for ').
- $env{'form.ccuname'}.&mt(' in domain ').
- $env{'form.ccdomain'}.'.');
+ $r->print(
+ $error
+ .'
'
+ .&mt('Unable to determine home server for [_1] in domain [_2].',
+ '"'.$env{'form.ccuname'}.'"','"'.$env{'form.ccdomain'}.'"')
+ .'
');
return;
}
}
@@ -2654,7 +2717,7 @@ sub update_user_data {
$r->print($error.'Invalid login mode or password'.$end.$rtnlink);
return;
}
- # Only allow authentification modification if the person has authority
+ # Only allow authentication modification if the person has authority
if (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'})) {
$r->print('Modifying authentication: '.
&Apache::lonnet::modifyuserauth(
@@ -2664,7 +2727,7 @@ sub update_user_data {
($env{'form.ccuname'},$env{'form.ccdomain'}));
} else {
# Okay, this is a non-fatal error.
- $r->print($error.&mt('You do not have the authority to modify this users authentification information').'.'.$end);
+ $r->print($error.&mt('You do not have the authority to modify this users authentication information.').$end);
}
}
$r->rflush(); # Finish display of header before time consuming actions start
@@ -2966,8 +3029,8 @@ sub update_user_data {
}
}
foreach my $name ('portfolio','author') {
- $oldsettings{'quota'}{$name} = $oldquota{$name}.' MB';
- $newsettings{'quota'}{$name} = $newquota{$name}.' MB';
+ $oldsettings{'quota'}{$name} = &mt('[_1] MB',$oldquota{$name});
+ $newsettings{'quota'}{$name} = &mt('[_1] MB',$newquota{$name});
}
if ((keys(%namechanged) > 0) || (keys(%changed) > 0)) {
my ($chgresult,$namechgresult);
@@ -2981,7 +3044,7 @@ sub update_user_data {
my %newenvhash;
foreach my $key (keys(%changed)) {
if (($key eq 'official') || ($key eq 'unofficial')
- || ($key eq 'community')) {
+ || ($key eq 'community') || ($key eq 'textbook')) {
$newenvhash{'environment.requestcourses.'.$key} =
$changeHash{'requestcourses.'.$key};
if ($changeHash{'requestcourses.'.$key}) {
@@ -3047,7 +3110,7 @@ sub update_user_data {
\%newsettingstext);
if ($env{'form.cid'} ne $userenv{'id'}) {
&Apache::lonnet::idput($env{'form.ccdomain'},
- ($env{'form.ccuname'} => $env{'form.cid'}));
+ {$env{'form.ccuname'} => $env{'form.cid'}},$uhome,'ids');
if (($recurseid) &&
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) {
my $idresult =
@@ -3066,9 +3129,12 @@ sub update_user_data {
&Apache::lonnet::appenv(\%newenvhash);
}
} else { # error occurred
- $r->print(''.&mt('Unable to successfully change environment for').' '.
- $env{'form.ccuname'}.' '.&mt('in domain').' '.
- $env{'form.ccdomain'}.' ');
+ $r->print(
+ '
'
+ .&mt('Unable to successfully change environment for [_1] in domain [_2].',
+ '"'.$env{'form.ccuname'}.'"',
+ '"'.$env{'form.ccdomain'}.'"')
+ .'
');
}
} else { # End of if ($env ... ) logic
# They did not want to change the users name, quota, tool availability,
@@ -3086,9 +3152,9 @@ sub update_user_data {
$rolestr = &mt('No roles');
}
if ($context eq 'course') {
- $contextname = &mt('course');
+ $contextname = 'course';
} elsif ($context eq 'author') {
- $contextname = &mt('co-author');
+ $contextname = 'co-author';
}
$r->print(&mt('The following fields were not updated: ').'
');
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles();
@@ -3097,9 +3163,9 @@ sub update_user_data {
}
$r->print('
');
if (@mod_disallowed == 1) {
- $r->print(&mt("You do not have the authority to change this field given the user's current set of active/future [_1] roles:",$contextname));
+ $r->print(&mt("You do not have the authority to change this field given the user's current set of active/future $contextname roles:"));
} else {
- $r->print(&mt("You do not have the authority to change these fields given the user's current set of active/future [_1] roles:",$contextname));
+ $r->print(&mt("You do not have the authority to change these fields given the user's current set of active/future $contextname roles:"));
}
my $helplink = 'javascript:helpMenu('."'display'".')';
$r->print(''.$rolestr.' '
@@ -3116,13 +3182,14 @@ sub update_user_data {
if ($env{'form.action'} eq 'singlestudent') {
&enroll_single_student($r,$uhome,$amode,$genpwd,$now,$newuser,$context,
$crstype,$showcredits,$defaultcredits);
- $r->print('
');
+ my $linktext = ($crstype eq 'Community' ?
+ &mt('Enroll Another Member') : &mt('Enroll Another Student'));
+ $r->print(
+ &Apache::lonhtmlcommon::actionbox([
+ ''
+ .($crstype eq 'Community' ?
+ &mt('Enroll Another Member') : &mt('Enroll Another Student'))
+ .'']));
} else {
my @rolechanges = &update_roles($r,$context,$showcredits);
if (keys(%namechanged) > 0) {
@@ -3558,7 +3625,7 @@ sub update_roles {
my @rolechanges;
my %disallowed;
$r->print('
'.&mt('Modifying Roles').'
');
- foreach my $key (keys (%env)) {
+ foreach my $key (keys(%env)) {
next if (! $env{$key});
next if ($key eq 'form.action');
# Revoke roles
@@ -3740,7 +3807,7 @@ sub update_roles {
} else {
my %curr_groups =
&Apache::longroup::coursegroups($one,$two);
- foreach my $sec (sort {$a cmp $b} keys %sections) {
+ foreach my $sec (sort {$a cmp $b} keys(%sections)) {
if (($sec eq 'none') || ($sec eq 'all') ||
exists($curr_groups{$sec})) {
$disallowed{$sec} = $url;
@@ -3786,7 +3853,7 @@ sub update_roles {
my %curr_groups =
&Apache::longroup::coursegroups($one,$two);
my $emptysec = 0;
- foreach my $sec (sort {$a cmp $b} keys %sections) {
+ foreach my $sec (sort {$a cmp $b} keys(%sections)) {
$sec =~ s/\W//g;
if ($sec ne '') {
if (($sec eq 'none') || ($sec eq 'all') ||
@@ -3826,7 +3893,7 @@ sub update_roles {
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$two,$start,$end,$one,undef,'',$context));
} else {
my $emptysec = 0;
- foreach my $sec (sort {$a cmp $b} keys %sections) {
+ foreach my $sec (sort {$a cmp $b} keys(%sections)) {
if ($sec ne '') {
my $securl = $url.'/'.$sec;
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$two,$start,$end,$one,undef,$sec,$context));
@@ -3944,11 +4011,11 @@ sub enroll_single_student {
}
$r->print('. '.$showstart.'; '.$showend);
if ($startdate <= $now && !$newuser) {
- $r->print('
');
+ $r->print('
');
if ($crstype eq 'Community') {
- $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.'));
+ $r->print(&mt('If the member is currently logged-in to LON-CAPA, the new role can be displayed by using the "Check for changes" link on the Roles/Courses page.'));
} 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(&mt('If the student is currently logged-in to LON-CAPA, the new role can be displayed by using the "Check for changes" link on the Roles/Courses page.'));
}
$r->print('
');
}
@@ -4114,6 +4181,7 @@ sub custom_role_editor {
my $dompriv='';
my $coursepriv='';
my $body_top;
+ my $newrole;
my ($rdummy,$roledef)=
&Apache::lonnet::get('roles',["rolesdef_$rolename"]);
# ------------------------------------------------------- Does this role exist?
@@ -4126,6 +4194,7 @@ sub custom_role_editor {
$syspriv =~ s/bre\&S//;
}
} else {
+ $newrole = 1;
$body_top .= &mt('New Role').' "';
$roledef='';
}
@@ -4395,6 +4464,7 @@ sub set_custom_role {
bread_crumbs_component => 'User Management'};
$r->print(&Apache::loncommon::start_page('Save Custom Role',$jscript,$args));
+ my $newrole;
my ($rdummy,$roledef)=
&Apache::lonnet::get('roles',["rolesdef_$rolename"]);
@@ -4405,6 +4475,7 @@ sub set_custom_role {
} else {
$r->print(&mt('New Role').' "');
$roledef='';
+ $newrole = 1;
}
$r->print($rolename.'"');
# ------------------------------------------------------- What can be assigned?
@@ -4435,25 +4506,43 @@ sub set_custom_role {
$sysrole.=':'.$item;
}
}
- $r->print(' Defining Role: '.
- &Apache::lonnet::definerole($rolename,$sysrole,$domrole,$courole));
+ # Assign role; Compile and show result
+ my $errmsg;
+ my $result =
+ &Apache::lonnet::definerole($rolename,$sysrole,$domrole,$courole);
+ if ($result ne 'ok') {
+ $errmsg = ': '.$result;
+ }
+ my $message =
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('Defining Role').$errmsg, ($result eq 'ok' ? 0 : 1));
if ($env{'request.course.id'}) {
my $url='/'.$env{'request.course.id'};
$url=~s/\_/\//g;
- $r->print(' '.&mt('Assigning Role to Self').': '.
- &Apache::lonnet::assigncustomrole($env{'user.domain'},
- $env{'user.name'},
- $url,
- $env{'user.domain'},
- $env{'user.name'},
- $rolename,undef,undef,undef,$context));
+ $result =
+ &Apache::lonnet::assigncustomrole(
+ $env{'user.domain'},$env{'user.name'},
+ $url,
+ $env{'user.domain'},$env{'user.name'},
+ $rolename,undef,undef,undef,$context);
+ if ($result ne 'ok') {
+ $errmsg = ': '.$result;
+ }
+ $message .=
+ ' '
+ .&Apache::lonhtmlcommon::confirm_success(
+ &mt('Assigning Role to Self').$errmsg, ($result eq 'ok' ? 0 : 1));
}
$r->print(
- '