');
+ my $personal_table =
&personal_data_display($ccuname,$ccdomain,$newuser,$context,
$inst_results{$ccuname.':'.$ccdomain});
$r->print($personal_table);
- if ($showforceid) {
- $r->print('
');
- }
if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) {
$r->print('
'.
&Apache::loncommon::start_data_table());
@@ -1392,7 +1398,8 @@ ENDCHANGEUSER
my ($isadv,$isauthor) =
&Apache::lonnet::is_advanced_user($ccuname,$ccdomain);
if ((!$isauthor) &&
- (&Apache::lonnet::allowed('cau',$env{'request.role.domain'}))) {
+ (&Apache::lonnet::allowed('cau',$env{'request.role.domain'}))
+ && ($env{'request.role.domain'} eq $ccdomain)) {
$user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain);
}
$user_text{'auth'} = &user_authentication($ccuname,$ccdomain,$formname);
@@ -1404,8 +1411,8 @@ ENDCHANGEUSER
if (!&Apache::lonnet::allowed('mpq',$ccdomain)) {
if (&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) {
my %lt=&Apache::lonlocal::texthash(
- 'dska' => "Disk quotas for user's portfolio and authoring space",
- 'youd' => "You do not have privileges to modify the portfolio and/or authoring space quotas for this user.",
+ 'dska' => "Disk quotas for user's portfolio and Authoring Space",
+ 'youd' => "You do not have privileges to modify the portfolio and/or Authoring Space quotas for this user.",
'ichr' => "If a change is required, contact a domain coordinator for the domain",
);
$user_text{'quota'} = <
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;
}
}
@@ -2502,7 +2512,7 @@ sub update_user_data {
my (%alerts,%rulematch,%inst_results,%curr_rules);
my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id');
my @usertools = ('aboutme','blog','webdav','portfolio');
- my @requestcourses = ('official','unofficial','community');
+ my @requestcourses = ('official','unofficial','community','textbook');
my @requestauthor = ('requestauthor');
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'});
@@ -2597,7 +2607,8 @@ sub update_user_data {
$newcustom{$item} = $env{'form.crsreq_'.$item};
if ($env{'form.crsreq_'.$item} eq 'autolimit') {
$newcustom{$item} .= '=';
- unless ($env{'form.crsreq_'.$item.'_limit'} =~ /\D/) {
+ $env{'form.crsreq_'.$item.'_limit'} =~ s/\D+//g;
+ if ($env{'form.crsreq_'.$item.'_limit'}) {
$newcustom{$item} .= $env{'form.crsreq_'.$item.'_limit'};
}
}
@@ -2671,8 +2682,9 @@ sub update_user_data {
'id','permanentemail','portfolioquota','authorquota','inststatus',
'tools.aboutme','tools.blog','tools.webdav','tools.portfolio',
'requestcourses.official','requestcourses.unofficial',
- 'requestcourses.community','reqcrsotherdom.official',
- 'reqcrsotherdom.unofficial','reqcrsotherdom.community',
+ 'requestcourses.community','requestcourses.textbook',
+ 'reqcrsotherdom.official','reqcrsotherdom.unofficial',
+ 'reqcrsotherdom.community','reqcrsotherdom.textbook',
'requestauthor'],
$env{'form.ccdomain'},$env{'form.ccuname'});
my ($tmp) = keys(%userenv);
@@ -2923,9 +2935,13 @@ sub update_user_data {
}
if ($oldisdefault{$name}) {
$oldsettingstext{'quota'}{$name} = &get_defaultquota_text($oldsettingstatus{$name});
+ } else {
+ $oldsettingstext{'quota'}{$name} = &mt('custom quota: [_1] MB',$oldquota{$name});
}
if ($newisdefault{$name}) {
$newsettingstext{'quota'}{$name} = &get_defaultquota_text($newsettingstatus{$name});
+ } else {
+ $newsettingstext{'quota'}{$name} = &mt('custom quota: [_1] MB',$newquota{$name});
}
}
&tool_changes('tools',\@usertools,\%oldsettings,\%oldsettingstext,\%userenv,
@@ -2933,7 +2949,8 @@ sub update_user_data {
if ($env{'form.ccdomain'} eq $env{'request.role.domain'}) {
&tool_changes('requestcourses',\@requestcourses,\%oldsettings,\%oldsettingstext,
\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext);
- &tool_changes('requestauthor',\@requestauthor,\%oldsettings,\%oldsettingstext,\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext);
+ &tool_changes('requestauthor',\@requestauthor,\%oldsettings,\%oldsettingstext,
+ \%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext);
} else {
&tool_changes('reqcrsotherdom',\@requestcourses,\%oldsettings,\%oldsettingstext,
\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext);
@@ -2945,8 +2962,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} = $oldquota{$name}.' MB';
+ $newsettings{'quota'}{$name} = $newquota{$name}.' MB';
}
if ((keys(%namechanged) > 0) || (keys(%changed) > 0)) {
my ($chgresult,$namechgresult);
@@ -3045,9 +3062,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,
@@ -3095,13 +3115,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('');
- if ($crstype eq 'Community') {
- $r->print(&mt('Enroll Another Member'));
- } else {
- $r->print(&mt('Enroll Another Student'));
- }
- $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) {
@@ -3156,7 +3177,7 @@ sub display_userinfo {
'id' => 'Student/Employee ID',
'permanentemail' => 'Permanent e-mail address',
'portfolioquota' => 'Disk space allocated to portfolio files',
- 'authorquota' => 'Disk space allocated to authoring space',
+ 'authorquota' => 'Disk space allocated to Authoring Space',
'blog' => 'Blog Availability',
'webdav' => 'WebDAV Availability',
'aboutme' => 'Personal Information Page Availability',
@@ -3164,6 +3185,7 @@ sub display_userinfo {
'official' => 'Can Request Official Courses',
'unofficial' => 'Can Request Unofficial Courses',
'community' => 'Can Request Communities',
+ 'textbook' => 'Can Request Textbook Courses',
'requestauthor' => 'Can Request Author Role',
'inststatus' => "Affiliation",
'prvs' => 'Previous Value:',
@@ -3178,67 +3200,83 @@ sub display_userinfo {
$r->print(''.$lt{'chto'}.' | ');
$r->print(&Apache::loncommon::end_data_table_header_row());
my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id');
-
foreach my $item (@userinfo) {
my $value = $env{'form.c'.$item};
#show changes only:
- unless($value eq $userenv->{$item}){
+ unless ($value eq $userenv->{$item}){
$r->print(&Apache::loncommon::start_data_table_row());
-
$r->print("$lt{$item} | \n");
- $r->print(''.$userenv->{$item}.' | ');
+ $r->print("".$userenv->{$item}." | \n");
$r->print("$value | \n");
-
$r->print(&Apache::loncommon::end_data_table_row());
}
}
foreach my $entry (@{$order}) {
- if ($canshow->{$entry} && ($newsetting->{$entry} ne $newsetting->{$entry})) {
- $r->print(&Apache::loncommon::start_data_table_row());
- if (($entry eq 'requestcourses') || ($entry eq 'reqcrsotherdom')) {
- foreach my $item (@{$requestcourses}) {
- $r->print("$lt{$item} | \n");
- $r->print("$oldsetting->{$item} $oldsettingtext->{$item} | \n");
- my $value = $newsetting->{$item}.' '.$newsettingtext->{$item};
- if ($changedhash->{$item}) {
- $value = ''.$value.'';
+ if ($canshow->{$entry}) {
+ if (($entry eq 'requestcourses') || ($entry eq 'reqcrsotherdom') || ($entry eq 'requestauthor')) {
+ my @items;
+ if ($entry eq 'requestauthor') {
+ @items = ($entry);
+ } else {
+ @items = @{$requestcourses};
+ }
+ foreach my $item (@items) {
+ if (($newsetting->{$item} ne $oldsetting->{$item}) ||
+ ($newsettingtext->{$item} ne $oldsettingtext->{$item})) {
+ $r->print(&Apache::loncommon::start_data_table_row()."\n");
+ $r->print("$lt{$item} | \n");
+ $r->print("".$oldsetting->{$item});
+ if ($oldsettingtext->{$item}) {
+ if ($oldsetting->{$item}) {
+ $r->print(' -- ');
+ }
+ $r->print($oldsettingtext->{$item});
+ }
+ $r->print(" | \n");
+ $r->print("".$newsetting->{$item});
+ if ($newsettingtext->{$item}) {
+ if ($newsetting->{$item}) {
+ $r->print(' -- ');
+ }
+ $r->print($newsettingtext->{$item});
+ }
+ $r->print(" | \n");
+ $r->print(&Apache::loncommon::end_data_table_row()."\n");
}
- $r->print("$value | \n");
}
} elsif ($entry eq 'tools') {
foreach my $item (@{$usertools}) {
- $r->print("$lt{$item} | \n");
- $r->print("$oldsetting->{$item} $oldsettingtext->{$item} | \n");
- my $value = $newsetting->{$item}.' '.$newsettingtext->{$item};
- if ($changedhash->{$item}) {
- $value = ''.$value.'';
+ if ($newsetting->{$item} ne $oldsetting->{$item}) {
+ $r->print(&Apache::loncommon::start_data_table_row()."\n");
+ $r->print("$lt{$item} | \n");
+ $r->print("".$oldsetting->{$item}.' '.$oldsettingtext->{$item}." | \n");
+ $r->print("".$newsetting->{$item}.' '.$newsettingtext->{$item}." | \n");
+ $r->print(&Apache::loncommon::end_data_table_row()."\n");
}
- $r->print("$value | \n");
}
} elsif ($entry eq 'quota') {
if ((ref($oldsetting->{$entry}) eq 'HASH') && (ref($oldsettingtext->{$entry}) eq 'HASH') &&
(ref($newsetting->{$entry}) eq 'HASH') && (ref($newsettingtext->{$entry}) eq 'HASH')) {
foreach my $name ('portfolio','author') {
- $r->print("$lt{$name.$entry} | \n");
- $r->print("$oldsetting->{$entry}->{$name} $oldsettingtext->{$entry}->{$name} | \n");
- my $value = $newsetting->{$entry}->{$name}.' '.$newsettingtext->{$entry}->{$name};
- if ($changedhash->{$entry}) {
- $value = ''.$value.'';
+ if ($newsetting->{$entry}->{$name} ne $oldsetting->{$entry}->{$name}) {
+ $r->print(&Apache::loncommon::start_data_table_row()."\n");
+ $r->print("$lt{$name.$entry} | \n");
+ $r->print("".$oldsettingtext->{$entry}->{$name}." | \n");
+ $r->print("".$newsettingtext->{$entry}->{$name}." | \n");
+ $r->print(&Apache::loncommon::end_data_table_row()."\n");
}
- $r->print("$value | \n");
}
}
} else {
- $r->print("$lt{$entry} | \n");
- $r->print("$oldsetting->{$entry} $oldsettingtext->{$entry} | \n");
- my $value = $newsetting->{$entry}.' '.$newsettingtext->{$entry};
- if ($changedhash->{$entry}) {
- $value = ''.$value.'';
+ if ($newsetting->{$entry} ne $oldsetting->{$entry}) {
+ $r->print(&Apache::loncommon::start_data_table_row()."\n");
+ $r->print("$lt{$entry} | \n");
+ $r->print("".$oldsetting->{$entry}.' '.$oldsettingtext->{$entry}." | \n");
+ $r->print("".$newsetting->{$entry}.' '.$newsettingtext->{$entry}." | \n");
+ $r->print(&Apache::loncommon::end_data_table_row()."\n");
}
- $r->print("$value | \n");
}
- $r->print(&Apache::loncommon::end_data_table_row());
}
}
$r->print(&Apache::loncommon::end_data_table().'
');
@@ -3258,20 +3296,20 @@ sub tool_changes {
(ref($newaccess) eq 'HASH') && (ref($newaccesstext) eq 'HASH'))) {
return;
}
+ my %reqdisplay = &requestchange_display();
if ($context eq 'reqcrsotherdom') {
my @options = ('approval','validate','autolimit');
my $optregex = join('|',@options);
- my %reqdisplay = &courserequest_display();
my $cdom = $env{'request.role.domain'};
foreach my $tool (@{$usertools}) {
- $oldaccesstext->{$tool} = &mt('No');
+ $oldaccesstext->{$tool} = &mt("availability set to 'off'");
$newaccesstext->{$tool} = $oldaccesstext->{$tool};
$changeHash->{$context.'.'.$tool} = $userenv->{$context.'.'.$tool};
- my $newop;
+ my ($newop,$limit);
if ($env{'form.'.$context.'_'.$tool}) {
$newop = $env{'form.'.$context.'_'.$tool};
if ($newop eq 'autolimit') {
- my $limit = $env{'form.'.$context.'_'.$tool.'_limit'};
+ $limit = $env{'form.'.$context.'_'.$tool.'_limit'};
$limit =~ s/\D+//g;
$newop .= '='.$limit;
}
@@ -3281,7 +3319,15 @@ sub tool_changes {
$changed->{$tool}=&tool_admin($tool,$cdom.':'.$newop,
$changeHash,$context);
if ($changed->{$tool}) {
- $newaccesstext->{$tool} = &mt('Yes');
+ if ($newop =~ /^autolimit/) {
+ if ($limit) {
+ $newaccesstext->{$tool} = &mt('available with automatic approval, up to limit of [quant,_1,request] per user',$limit);
+ } else {
+ $newaccesstext->{$tool} = &mt('available with automatic approval (unlimited)');
+ }
+ } else {
+ $newaccesstext->{$tool} = $reqdisplay{$newop};
+ }
} else {
$newaccesstext->{$tool} = $oldaccesstext->{$tool};
}
@@ -3292,8 +3338,17 @@ sub tool_changes {
my $changedoms;
foreach my $req (@curr) {
if ($req =~ /^\Q$cdom\E\:($optregex\=?\d*)$/) {
- $oldaccesstext->{$tool} = &mt('Yes');
my $oldop = $1;
+ if ($oldop =~ /^autolimit=(\d*)/) {
+ my $limit = $1;
+ if ($limit) {
+ $oldaccesstext->{$tool} = &mt('available with automatic approval, up to limit of [quant,_1,request] per user',$limit);
+ } else {
+ $oldaccesstext->{$tool} = &mt('available with automatic approval (unlimited)');
+ }
+ } else {
+ $oldaccesstext->{$tool} = $reqdisplay{$oldop};
+ }
if ($oldop ne $newop) {
$changedoms = 1;
foreach my $item (@curr) {
@@ -3327,15 +3382,15 @@ sub tool_changes {
my $limit = $env{'form.'.$context.'_'.$tool.'_limit'};
$limit =~ s/\D+//g;
if ($limit) {
- $newaccesstext->{$tool} = &mt('Yes, up to limit of [quant,_1,request] per user.',$limit);
+ $newaccesstext->{$tool} = &mt('available with automatic approval, up to limit of [quant,_1,request] per user',$limit);
} else {
- $newaccesstext->{$tool} = &mt('Yes, processed automatically');
+ $newaccesstext->{$tool} = &mt('available with automatic approval (unlimited)');
}
} else {
$newaccesstext->{$tool} = $reqdisplay{$env{'form.'.$context.'_'.$tool}};
}
} else {
- $newaccesstext->{$tool} = &mt('No');
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
}
}
}
@@ -3344,12 +3399,14 @@ sub tool_changes {
return;
}
foreach my $tool (@{$usertools}) {
- my ($newval,$envkey);
+ my ($newval,$limit,$envkey);
$envkey = $context.'.'.$tool;
if ($context eq 'requestcourses') {
$newval = $env{'form.crsreq_'.$tool};
if ($newval eq 'autolimit') {
- $newval .= '='.$env{'form.crsreq_'.$tool.'_limit'};
+ $limit = $env{'form.crsreq_'.$tool.'_limit'};
+ $limit =~ s/\D+//g;
+ $newval .= '='.$limit;
}
} elsif ($context eq 'requestauthor') {
$newval = $env{'form.'.$context};
@@ -3359,10 +3416,25 @@ sub tool_changes {
}
if ($userenv->{$envkey} ne '') {
$oldaccess->{$tool} = &mt('custom');
- if ($userenv->{$envkey}) {
- $oldaccesstext->{$tool} = &mt("availability set to 'on'");
+ if (($context eq 'requestcourses') || ($context eq 'requestauthor')) {
+ if ($userenv->{$envkey} =~ /^autolimit=(\d*)$/) {
+ my $currlimit = $1;
+ if ($currlimit eq '') {
+ $oldaccesstext->{$tool} = &mt('available with automatic approval (unlimited)');
+ } else {
+ $oldaccesstext->{$tool} = &mt('available with automatic approval, up to limit of [quant,_1,request] per user',$currlimit);
+ }
+ } elsif ($userenv->{$envkey}) {
+ $oldaccesstext->{$tool} = $reqdisplay{$userenv->{$envkey}};
+ } else {
+ $oldaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
} else {
- $oldaccesstext->{$tool} = &mt("availability set to 'off'");
+ if ($userenv->{$envkey}) {
+ $oldaccesstext->{$tool} = &mt("availability set to 'on'");
+ } else {
+ $oldaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
}
$changeHash->{$envkey} = $userenv->{$envkey};
if ($env{'form.custom'.$tool} == 1) {
@@ -3371,17 +3443,45 @@ sub tool_changes {
$context);
if ($changed->{$tool}) {
$newaccess->{$tool} = &mt('custom');
- if ($newval) {
- $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ if (($context eq 'requestcourses') || ($context eq 'requestauthor')) {
+ if ($newval =~ /^autolimit/) {
+ if ($limit) {
+ $newaccesstext->{$tool} = &mt('available with automatic approval, up to limit of [quant,_1,request] per user',$limit);
+ } else {
+ $newaccesstext->{$tool} = &mt('available with automatic approval (unlimited)');
+ }
+ } elsif ($newval) {
+ $newaccesstext->{$tool} = $reqdisplay{$newval};
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
} else {
- $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ if ($newval) {
+ $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
}
} else {
$newaccess->{$tool} = $oldaccess->{$tool};
- if ($userenv->{$context.'.'.$tool}) {
- $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ if (($context eq 'requestcourses') || ($context eq 'requestauthor')) {
+ if ($newval =~ /^autolimit/) {
+ if ($limit) {
+ $newaccesstext->{$tool} = &mt('available with automatic approval, up to limit of [quant,_1,request] per user',$limit);
+ } else {
+ $newaccesstext->{$tool} = &mt('available with automatic approval (unlimited)');
+ }
+ } elsif ($newval) {
+ $newaccesstext->{$tool} = $reqdisplay{$newval};
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
} else {
- $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ if ($userenv->{$context.'.'.$tool}) {
+ $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
}
}
} else {
@@ -3394,10 +3494,24 @@ sub tool_changes {
$newaccess->{$tool} = &mt('default');
} else {
$newaccess->{$tool} = $oldaccess->{$tool};
- if ($userenv->{$context.'.'.$tool}) {
- $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ if (($context eq 'requestcourses') || ($context eq 'requestauthor')) {
+ if ($newval =~ /^autolimit/) {
+ if ($limit) {
+ $newaccesstext->{$tool} = &mt('available with automatic approval, up to limit of [quant,_1,request] per user',$limit);
+ } else {
+ $newaccesstext->{$tool} = &mt('available with automatic approval (unlimited)');
+ }
+ } elsif ($newval) {
+ $newaccesstext->{$tool} = $reqdisplay{$newval};
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
} else {
- $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ if ($userenv->{$context.'.'.$tool}) {
+ $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
}
}
}
@@ -3408,10 +3522,24 @@ sub tool_changes {
$context);
if ($changed->{$tool}) {
$newaccess->{$tool} = &mt('custom');
- if ($newval) {
- $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ if (($context eq 'requestcourses') || ($context eq 'requestauthor')) {
+ if ($newval =~ /^autolimit/) {
+ if ($limit) {
+ $newaccesstext->{$tool} = &mt('available with automatic approval, up to limit of [quant,_1,request] per user',$limit);
+ } else {
+ $newaccesstext->{$tool} = &mt('available with automatic approval (unlimited)');
+ }
+ } elsif ($newval) {
+ $newaccesstext->{$tool} = $reqdisplay{$newval};
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
} else {
- $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ if ($newval) {
+ $newaccesstext->{$tool} = &mt("availability set to 'on'");
+ } else {
+ $newaccesstext->{$tool} = &mt("availability set to 'off'");
+ }
}
} else {
$newaccess->{$tool} = $oldaccess->{$tool};
@@ -3799,7 +3927,7 @@ sub enroll_single_student {
$startdate,'manual',undef,$env{'request.course.id'},'',$context,
$credits);
if ($enroll_result =~ /^ok/) {
- $r->print(&mt('[_1] enrolled',$env{'form.ccuname'}.':'.$env{'form.ccdomain'}));
+ $r->print(&mt('[_1] enrolled',''.$env{'form.ccuname'}.':'.$env{'form.ccdomain'}.''));
if ($env{'form.sections'} ne '') {
$r->print(' '.&mt('in section [_1]',$env{'form.sections'}));
}
@@ -3816,7 +3944,7 @@ 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.'));
} else {
@@ -3834,14 +3962,14 @@ sub get_defaultquota_text {
my ($settingstatus) = @_;
my $defquotatext;
if ($settingstatus eq '') {
- $defquotatext = &mt('(default)');
+ $defquotatext = &mt('default');
} else {
my ($usertypes,$order) =
&Apache::lonnet::retrieve_inst_usertypes($env{'form.ccdomain'});
if ($usertypes->{$settingstatus} eq '') {
- $defquotatext = &mt('(default)');
+ $defquotatext = &mt('default');
} else {
- $defquotatext = &mt('(default for [_1])',$usertypes->{$settingstatus});
+ $defquotatext = &mt('default for [_1]',$usertypes->{$settingstatus});
}
}
return $defquotatext;
@@ -3866,8 +3994,8 @@ sub update_result_form {
$outcome .= ''."\n";
}
$outcome .= ''."\n".
- ''."\n".
- ''."\n".
+ ''."\n".
+ ''."\n".
'';
return $outcome;
}
@@ -4124,7 +4252,7 @@ sub custom_role_editor {
$r->print('
');
$r->print(<
+');
+ $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(
+ &Apache::loncommon::confirmwrapper($message)
+ .'
'
+ .&Apache::lonhtmlcommon::actionbox([
+ ''
+ .&mt('Create or edit another custom role')
+ .''])
+ .''
+ );
}
# ================================================================ Main Handler
@@ -4504,7 +4655,7 @@ sub handler {
(&Apache::lonnet::allowed('cau',$env{'request.role.domain'}))) {
push(@{$brcrum},
{href => '/adm/createuser?action=processauthorreq',
- text => 'Authoring space requests',
+ text => 'Authoring Space requests',
help => 'Domain_Role_Approvals'});
$bread_crumbs_component = 'Authoring requests';
if ($env{'form.state'} eq 'done') {
@@ -4799,6 +4950,7 @@ function updateCols(caller) {
document.getElementById('showcolrole').disabled = 'disabled';
}
if (context == 'domain') {
+ var quotausageshow = 0;
if ((document.studentform.roletype.options[document.studentform.roletype.selectedIndex].value == 'course') ||
(document.studentform.roletype.options[document.studentform.roletype.selectedIndex].value == 'community')) {
document.getElementById('showcolstatus').checked = false;
@@ -4818,6 +4970,16 @@ function updateCols(caller) {
document.getElementById('showcolextent').checked = 'false';
document.getElementById('showextent').style.display='none';
document.getElementById('showcoltextextent').innerHTML = '';
+ if ((document.studentform.showrole.options[document.studentform.showrole.selectedIndex].value == 'au') ||
+ (document.studentform.showrole.options[document.studentform.showrole.selectedIndex].value == 'Any')) {
+ if (document.getElementById('showcolauthorusage')) {
+ document.getElementById('showcolauthorusage').disabled = '';
+ }
+ if (document.getElementById('showcolauthorquota')) {
+ document.getElementById('showcolauthorquota').disabled = '';
+ }
+ quotausageshow = 1;
+ }
} else {
document.getElementById('showextent').style.display='block';
document.getElementById('showextent').style.textAlign='left';
@@ -4836,6 +4998,16 @@ function updateCols(caller) {
}
}
}
+ if (quotausageshow == 0) {
+ if (document.getElementById('showcolauthorusage')) {
+ document.getElementById('showcolauthorusage').checked = false;
+ document.getElementById('showcolauthorusage').disabled = 'disabled';
+ }
+ if (document.getElementById('showcolauthorquota')) {
+ document.getElementById('showcolauthorquota').checked = false;
+ document.getElementById('showcolauthorquota').disabled = 'disabled';
+ }
+ }
}
}
return;
@@ -6823,22 +6995,22 @@ sub course_level_dc {
my $otheritems = &Apache::loncommon::start_data_table_row()."\n".
' '.
$courseform.(' ' x4).' | '."\n".
- '
|