--- loncom/interface/loncreateuser.pm 2013/07/02 19:04:37 1.378
+++ loncom/interface/loncreateuser.pm 2014/01/22 18:01:43 1.387
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.378 2013/07/02 19:04:37 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.387 2014/01/22 18:01:43 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -168,7 +168,7 @@ END_SCRIPT
my %titles = &Apache::lonlocal::texthash (
portfolio => "Disk space allocated to user's portfolio files",
- author => "Disk space allocated to user's authoring space (if role assigned)",
+ author => "Disk space allocated to user's Authoring Space (if role assigned)",
);
foreach my $name ('portfolio','author') {
my ($currquota,$quotatype,$inststatus,$defquota) =
@@ -189,19 +189,19 @@ END_SCRIPT
$showquota = $currquota;
if ($longinsttype eq '') {
$defaultinfo = &mt('For this user, the default quota would be [_1]'
- .' Mb.',$defquota);
+ .' MB.',$defquota);
} else {
$defaultinfo = &mt("For this user, the default quota would be [_1]".
- " Mb, as determined by the user's institutional".
+ " MB, as determined by the user's institutional".
" affiliation ([_2]).",$defquota,$longinsttype);
}
} else {
if ($longinsttype eq '') {
$defaultinfo = &mt('For this user, the default quota is [_1]'
- .' Mb.',$defquota);
+ .' MB.',$defquota);
} else {
$defaultinfo = &mt("For this user, the default quota of [_1]".
- " Mb, is determined by the user's institutional".
+ " MB, is determined by the user's institutional".
" affiliation ([_2]).",$defquota,$longinsttype);
}
}
@@ -212,21 +212,21 @@ END_SCRIPT
' '."\n".
&Apache::loncommon::start_data_table_row()."\n".
'
'.$lt{'cuqu'}.': '.
- $currquota.' Mb. '.
+ $currquota.' MB. '.
$defaultinfo.' | '."\n".
&Apache::loncommon::end_data_table_row()."\n".
&Apache::loncommon::start_data_table_row()."\n".
' '.$lt{'chqu'}.
': '.
+ 'value="0" '.$custom_off.' onchange="javascript:quota_changes('."'custom','$name'".');"'.
+ ' />'.$lt{'defa'}.' ('.$defquota.' MB). '.
' '.
- ' Mb | '."\n".
+ ' MB'."\n".
&Apache::loncommon::end_data_table_row()."\n";
}
}
@@ -241,7 +241,7 @@ sub build_tools_display {
my %lt = &Apache::lonlocal::texthash (
'blog' => "Personal User Blog",
'aboutme' => "Personal Information Page",
- 'webdav' => "WebDAV access to authoring spaces (if SSL and author/co-author)",
+ 'webdav' => "WebDAV access to Authoring Spaces (if SSL and author/co-author)",
'portfolio' => "Personal User Portfolio",
'avai' => "Available",
'cusa' => "availability",
@@ -251,13 +251,14 @@ sub build_tools_display {
'official' => 'Can request creation of official courses',
'unofficial' => 'Can request creation of unofficial courses',
'community' => 'Can request creation of communities',
+ 'textbook' => 'Can request creation of textbook courses',
'requestauthor' => 'Can request author space',
);
if ($context eq 'requestcourses') {
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
'requestcourses.official','requestcourses.unofficial',
- 'requestcourses.community');
- @usertools = ('official','unofficial','community');
+ 'requestcourses.community','requestcourses.textbook');
+ @usertools = ('official','unofficial','community','textbook');
@options =('norequest','approval','autolimit','validate');
%validations = &Apache::lonnet::auto_courserequest_checks($ccdomain);
%reqtitles = &courserequest_titles();
@@ -446,12 +447,13 @@ sub coursereq_externaluser {
'official' => 'Can request creation of official courses',
'unofficial' => 'Can request creation of unofficial courses',
'community' => 'Can request creation of communities',
+ 'textbook' => 'Can request creation of textbook courses',
);
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
'reqcrsotherdom.official','reqcrsotherdom.unofficial',
- 'reqcrsotherdom.community');
- @usertools = ('official','unofficial','community');
+ 'reqcrsotherdom.community','reqcrsotherdom.textbook');
+ @usertools = ('official','unofficial','community','textbook');
@options = ('approval','validate','autolimit');
%validations = &Apache::lonnet::auto_courserequest_checks($cdom);
my $optregex = join('|',@options);
@@ -531,6 +533,7 @@ sub courserequest_titles {
official => 'Official',
unofficial => 'Unofficial',
community => 'Communities',
+ textbook => 'Textbook',
norequest => 'Not allowed',
approval => 'Approval by Dom. Coord.',
validate => 'With validation',
@@ -568,6 +571,15 @@ sub requestauthor_display {
return %titles;
}
+sub requestchange_display {
+ my %titles = &Apache::lonlocal::texthash (
+ approval => "availability set to 'on' (approval required)",
+ automatic => "availability set to 'on' (automatic approval)",
+ norequest => "availability set to 'off'",
+ );
+ return %titles;
+}
+
sub curr_requestauthor {
my ($uname,$udom,$isadv,$inststatuses,$domconfig) = @_;
return unless ((ref($inststatuses) eq 'ARRAY') && (ref($domconfig) eq 'HASH'));
@@ -988,7 +1000,7 @@ ENDSCRIPT
$r->print('');
}
}
- $r->print('';
return $outcome;
}
@@ -4124,7 +4253,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 +4656,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 +4951,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 +4971,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 +4999,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;