'
.'
'.
- &Apache::loncommon::end_page());
+ '
');
}
# --------------------------------------------------------
sub make_script_template {
@@ -3886,11 +4050,11 @@ sub make_button_code {
}
# ---------------------------------------------------------- Call to definerole
sub set_custom_role {
- my ($r,$context) = @_;
+ my ($r,$context,$brcrum) = @_;
my $rolename=$env{'form.rolename'};
$rolename=~s/[^A-Za-z0-9]//gs;
if (!$rolename) {
- &custom_role_editor($r);
+ &custom_role_editor($r,$brcrum);
return;
}
my ($jsback,$elements) = &crumb_utilities();
@@ -3899,20 +4063,24 @@ sub set_custom_role {
.$jsback."\n"
.'// ]]>'."\n"
.''."\n";
-
- $r->print(&Apache::loncommon::start_page('Save Custom Role'),$jscript);
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.customresult,'pickrole','')",
- text=>"Pick custom role",
- faq=>282,bug=>'Instructor Interface',},
- {href=>"javascript:backPage(document.customresult,'selected_custom_edit','')",
- text=>"Edit custom role",
- faq=>282,bug=>'Instructor Interface',},
- {href=>"javascript:backPage(document.customresult,'set_custom_roles','')",
- text=>"Result",
- faq=>282,bug=>'Instructor Interface',});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
- 'Course_Editing_Custom_Roles'));
+ push(@{$brcrum},
+ {href => "javascript:backPage(document.customresult,'pickrole','')",
+ text => "Pick custom role",
+ faq => 282,
+ bug => 'Instructor Interface',},
+ {href => "javascript:backPage(document.customresult,'selected_custom_edit','')",
+ text => "Edit custom role",
+ faq => 282,
+ bug => 'Instructor Interface',},
+ {href => "javascript:backPage(document.customresult,'set_custom_roles','')",
+ text => "Result",
+ faq => 282,
+ bug => 'Instructor Interface',
+ help => 'Course_Editing_Custom_Roles'},
+ );
+ my $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => 'User Management'};
+ $r->print(&Apache::loncommon::start_page('Save Custom Role',$jscript,$args));
my ($rdummy,$roledef)=
&Apache::lonnet::get('roles',["rolesdef_$rolename"]);
@@ -3969,7 +4137,6 @@ sub set_custom_role {
}
$r->print('
'.&mt('Create or edit another custom role').'
');
- $r->print(&Apache::loncommon::end_page());
}
# ================================================================ Main Handler
@@ -3993,17 +4160,24 @@ sub handler {
['action','state','callingform','roletype','showrole','bulkaction','popup','phase',
'username','domain','srchterm','srchdomain','srchin','srchby','srchtype']);
&Apache::lonhtmlcommon::clear_breadcrumbs();
+ my $args;
+ my $brcrum = [];
+ my $bread_crumbs_component = 'User Management';
if ($env{'form.action'} ne 'dateselect') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"/adm/createuser",
- text=>"User Management",
- help=>'Course_Create_Class_List,Course_Change_Privileges,Course_View_Class_List,Course_Editing_Custom_Roles,Course_Add_Student,Course_Drop_Student,Course_Automated_Enrollment,Course_Self_Enrollment,Course_Manage_Group'});
+ $brcrum = [{href=>"/adm/createuser",
+ text=>"User Management",
+ help=>'Course_Create_Class_List,Course_Change_Privileges,Course_View_Class_List,Course_Editing_Custom_Roles,Course_Add_Student,Course_Drop_Student,Course_Automated_Enrollment,Course_Self_Enrollment,Course_Manage_Group'}
+ ];
}
#SD Following files not added to help, because the corresponding .tex-files seem to
#be missing: Course_Approve_Selfenroll,Course_User_Logs,
my ($permission,$allowed) =
&Apache::lonuserutils::get_permission($context,$crstype);
if (!$allowed) {
+ if ($context eq 'course') {
+ $r->internal_redirect('/adm/viewclasslist');
+ return OK;
+ }
$env{'user.error.msg'}=
"/adm/createuser:cst:0:0:Cannot create/modify user data ".
"or view user status.";
@@ -4015,17 +4189,20 @@ sub handler {
# Main switch on form.action and form.state, as appropriate
if (! exists($env{'form.action'})) {
- $r->print(&header());
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
$r->print(&print_main_menu($permission,$context,$crstype));
- $r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'upload' && $permission->{'cusr'}) {
- $r->print(&header());
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=upload&state=',
- text=>"Upload Users List"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Upload Users List',
- 'Course_Create_Class_List'));
+ push(@{$brcrum},
+ { href => '/adm/createuser?action=upload&state=',
+ text => 'Upload Users List',
+ help => 'Course_Create_Class_List',
+ });
+ $bread_crumbs_component = 'Upload Users List';
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
$r->print('
'.&Apache::loncommon::end_page());
} elsif ((($env{'form.action'} eq 'singleuser') || ($env{'form.action'}
eq 'singlestudent')) && ($permission->{'cusr'})) {
my $phase = $env{'form.phase'};
@@ -4056,15 +4232,19 @@ sub handler {
if ($env{'form.phase'} eq 'createnewuser') {
my $response;
if ($env{'form.srchterm'} !~ /^$match_username$/) {
- my $response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @');
+ my $response =
+ '
'
+ .&mt('You must specify a valid username. Only the following are allowed:'
+ .' letters numbers - . @')
+ .'';
$env{'form.phase'} = '';
- &print_username_entry_form($r,$context,$response,$srch,undef,$crstype);
+ &print_username_entry_form($r,$context,$response,$srch,undef,$crstype,$brcrum);
} else {
my $ccuname =&LONCAPA::clean_username($srch->{'srchterm'});
my $ccdomain=&LONCAPA::clean_domain($srch->{'srchdomain'});
&print_user_modification_page($r,$ccuname,$ccdomain,
$srch,$response,$context,
- $permission,$crstype);
+ $permission,$crstype,$brcrum);
}
} elsif ($env{'form.phase'} eq 'get_user_info') {
my ($currstate,$response,$forcenewuser,$results) =
@@ -4074,7 +4254,8 @@ sub handler {
}
if ($currstate eq 'select') {
&print_user_selection_page($r,$response,$srch,$results,
- \@search,$context,undef,$crstype);
+ \@search,$context,undef,$crstype,
+ $brcrum);
} elsif ($currstate eq 'modify') {
my ($ccuname,$ccdomain);
if (($srch->{'srchby'} eq 'uname') &&
@@ -4092,58 +4273,91 @@ sub handler {
}
&print_user_modification_page($r,$ccuname,$ccdomain,
$srch,$response,$context,
- $permission,$crstype);
+ $permission,$crstype,$brcrum);
} elsif ($currstate eq 'query') {
- &print_user_query_page($r,'createuser');
+ &print_user_query_page($r,'createuser',$brcrum);
} else {
$env{'form.phase'} = '';
&print_username_entry_form($r,$context,$response,$srch,
- $forcenewuser,$crstype);
+ $forcenewuser,$crstype,$brcrum);
}
} elsif ($env{'form.phase'} eq 'userpicked') {
my $ccuname = &LONCAPA::clean_username($env{'form.seluname'});
my $ccdomain = &LONCAPA::clean_domain($env{'form.seludom'});
&print_user_modification_page($r,$ccuname,$ccdomain,$srch,'',
- $context,$permission,$crstype);
+ $context,$permission,$crstype,
+ $brcrum);
}
} elsif ($env{'form.phase'} eq 'update_user_data') {
- &update_user_data($r,$context,$crstype);
+ &update_user_data($r,$context,$crstype,$brcrum);
} else {
- &print_username_entry_form($r,$context,undef,$srch,undef,$crstype);
+ &print_username_entry_form($r,$context,undef,$srch,undef,$crstype,
+ $brcrum);
}
} elsif ($env{'form.action'} eq 'custom' && $permission->{'custom'}) {
if ($env{'form.phase'} eq 'set_custom_roles') {
- &set_custom_role($r,$context);
+ &set_custom_role($r,$context,$brcrum);
} else {
- &custom_role_editor($r);
+ &custom_role_editor($r,$brcrum);
+ }
+ } elsif (($env{'form.action'} eq 'processauthorreq') &&
+ ($permission->{'cusr'}) &&
+ (&Apache::lonnet::allowed('cau',$env{'request.role.domain'}))) {
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=processauthorreq',
+ text => 'Authoring space requests',
+ help => 'Domain_Role_Approvals'});
+ $bread_crumbs_component = 'Authoring requests';
+ if ($env{'form.state'} eq 'done') {
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=authorreqqueue',
+ text => 'Result',
+ help => 'Domain_Role_Approvals'});
+ $bread_crumbs_component = 'Authoring request result';
+ }
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
+ if (!exists($env{'form.state'})) {
+ $r->print(&Apache::loncoursequeueadmin::display_queued_requests('requestauthor',
+ $env{'request.role.domain'}));
+ } elsif ($env{'form.state'} eq 'done') {
+ $r->print('
'.&mt('Authoring request processing').'
'."\n");
+ $r->print(&Apache::loncoursequeueadmin::update_request_queue('requestauthor',
+ $env{'request.role.domain'}));
}
} elsif (($env{'form.action'} eq 'listusers') &&
($permission->{'view'} || $permission->{'cusr'})) {
if ($env{'form.phase'} eq 'bulkchange') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=listusers',
- text=>"List Users"},
- {href=>"/adm/createuser",
- text=>"Result"});
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=listusers',
+ text => "List Users"},
+ {href => "/adm/createuser",
+ text => "Result",
+ help => 'Course_View_Class_List'});
+ $bread_crumbs_component = 'Update Users';
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
my $setting = $env{'form.roletype'};
my $choice = $env{'form.bulkaction'};
- $r->print(&header());
- $r->print(&Apache::lonhtmlcommon::breadcrumbs("Update Users",
- 'Course_View_Class_List'));
if ($permission->{'cusr'}) {
- &Apache::lonuserutils::update_user_list($r,$context,$setting,$choice);
- $r->print(&Apache::loncommon::end_page());
+ &Apache::lonuserutils::update_user_list($r,$context,$setting,$choice,$crstype);
} else {
$r->print(&mt('You are not authorized to make bulk changes to user roles'));
$r->print('
'.&mt('Display User Lists').'');
- $r->print(&Apache::loncommon::end_page());
}
} else {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=listusers',
- text=>"List Users"});
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=listusers',
+ text => "List Users",
+ help => 'Course_View_Class_List'});
+ $bread_crumbs_component = 'List Users';
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles);
my $formname = 'studentform';
+ my $hidecall = "hide_searching();";
if (($context eq 'domain') && (($env{'form.roletype'} eq 'course') ||
($env{'form.roletype'} eq 'community'))) {
if ($env{'form.roletype'} eq 'course') {
@@ -4160,132 +4374,143 @@ sub handler {
);
$jscript = &Apache::lonhtmlcommon::set_form_elements(\%elements);
}
- $jscript .= &verify_user_display();
+ $jscript .= &verify_user_display($context)."\n".
+ &Apache::loncommon::check_uncheck_jscript();
my $js = &add_script($jscript).$cb_jscript;
my $loadcode =
&Apache::lonuserutils::course_selector_loadcode($formname);
if ($loadcode ne '') {
- $r->print(&header($js,{'onload' => $loadcode,}));
+ $args->{add_entries} = {onload => "$loadcode;$hidecall"};
} else {
- $r->print(&header($js));
+ $args->{add_entries} = {onload => $hidecall};
}
+ $r->print(&header($js,$args));
} else {
- $r->print(&header(&add_script(&verify_user_display())));
+ $args->{add_entries} = {onload => $hidecall};
+ $jscript = &verify_user_display($context).
+ &Apache::loncommon::check_uncheck_jscript();
+ $r->print(&header(&add_script($jscript),$args));
}
- $r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users",
- 'Course_View_Class_List'));
&Apache::lonuserutils::print_userlist($r,undef,$permission,$context,
$formname,$totcodes,$codetitles,$idlist,$idlist_titles);
- $r->print(&Apache::loncommon::end_page());
}
} elsif ($env{'form.action'} eq 'drop' && $permission->{'cusr'}) {
- $r->print(&header());
my $brtext;
if ($crstype eq 'Community') {
$brtext = 'Drop Members';
} else {
$brtext = 'Drop Students';
}
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=drop',
- text=>$brtext});
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=drop',
+ text => $brtext,
+ help => 'Course_Drop_Student'});
+ if ($env{'form.state'} eq 'done') {
+ push(@{$brcrum},
+ {href=>'/adm/createuser?action=drop',
+ text=>"Result"});
+ }
+ $bread_crumbs_component = $brtext;
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
if (!exists($env{'form.state'})) {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($brtext,
- 'Course_Drop_Student'));
-
&Apache::lonuserutils::print_drop_menu($r,$context,$permission,$crstype);
} elsif ($env{'form.state'} eq 'done') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=drop',
- text=>"Result"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($brtext,
- 'Course_Drop_Student'));
&Apache::lonuserutils::update_user_list($r,$context,undef,
$env{'form.action'});
}
- $r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'dateselect') {
if ($permission->{'cusr'}) {
- $r->print(&header(undef,undef,{'no_nav_bar' => 1}).
+ $r->print(&header(undef,{'no_nav_bar' => 1}).
&Apache::lonuserutils::date_section_selector($context,
- $permission,$crstype).
- &Apache::loncommon::end_page());
+ $permission,$crstype));
} else {
- $r->print(&header().
- ''.&mt('You do not have permission to modify dates or sections for users').''.
- &Apache::loncommon::end_page());
+ $r->print(&header(undef,{'no_nav_bar' => 1}).
+ ''.&mt('You do not have permission to modify dates or sections for users').'');
}
} elsif ($env{'form.action'} eq 'selfenroll') {
- $r->print(&header());
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=selfenroll',
- text=>"Configure Self-enrollment"});
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=selfenroll',
+ text => "Configure Self-enrollment",
+ help => 'Course_Self_Enrollment'});
if (!exists($env{'form.state'})) {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Configure Self-enrollment',
- 'Course_Self_Enrollment'));
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => 'Configure Self-enrollment'};
+ $r->print(&header(undef,$args));
$r->print('
'.&mt('Self-enrollment with a student role').'
'."\n");
&print_selfenroll_menu($r,$context,$permission);
} elsif ($env{'form.state'} eq 'done') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=selfenroll',
- text=>"Result"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Self-enrollment result',
- 'Course_Self_Enrollment'));
+ push (@{$brcrum},
+ {href=>'/adm/createuser?action=selfenroll',
+ text=>"Result"});
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => 'Self-enrollment result'};
+ $r->print(&header(undef,$args));
$r->print('
'.&mt('Self-enrollment with a student role').'
'."\n");
&update_selfenroll_config($r,$context,$permission);
}
- $r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'selfenrollqueue') {
- $r->print(&header());
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=selfenrollqueue',
- text=>"Enrollment requests"});
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=selfenrollqueue',
+ text => 'Enrollment requests',
+ help => 'Course_Self_Enrollment'});
+ $bread_crumbs_component = 'Enrollment requests';
+ if ($env{'form.state'} eq 'done') {
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=selfenrollqueue',
+ text => 'Result',
+ help => 'Course_Self_Enrollment'});
+ $bread_crumbs_component = 'Enrollment result';
+ }
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
my $cid = $env{'request.course.id'};
my $cdom = $env{'course.'.$cid.'.domain'};
my $cnum = $env{'course.'.$cid.'.num'};
my $coursedesc = $env{'course.'.$cid.'.description'};
if (!exists($env{'form.state'})) {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Enrollment requests',
- 'Course_SelfEnrollment_Approval'));
$r->print('
'.&mt('Pending enrollment requests').'
'."\n");
$r->print(&Apache::loncoursequeueadmin::display_queued_requests($context,
$cdom,$cnum));
} elsif ($env{'form.state'} eq 'done') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=selfenrollqueue',
- text=>"Result"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Enrollment result',
- 'Course_Self_Enrollment'));
$r->print('
'.&mt('Enrollment request processing').'
'."\n");
$r->print(&Apache::loncoursequeueadmin::update_request_queue($context,
$cdom,$cnum,$coursedesc));
}
- $r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'changelogs') {
- $r->print(&header());
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=changelogs',
- text=>"User Management Logs"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Changes',
- 'Course_User_Logs'));
- &print_userchangelogs_display($r,$context,$permission);
- $r->print(&Apache::loncommon::end_page());
+ my $helpitem;
+ if ($context eq 'course') {
+ $helpitem = 'Course_User_Logs';
+ }
+ push (@{$brcrum},
+ {href => '/adm/createuser?action=changelogs',
+ text => 'User Management Logs',
+ help => $helpitem});
+ $bread_crumbs_component = 'User Changes';
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
+ &print_userchangelogs_display($r,$context,$permission);
} else {
- $r->print(&header());
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
+ $bread_crumbs_component = 'User Management';
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
$r->print(&print_main_menu($permission,$context,$crstype));
- $r->print(&Apache::loncommon::end_page());
}
+ $r->print(&Apache::loncommon::end_page());
return OK;
}
sub header {
- my ($jscript,$loaditems,$args) = @_;
+ my ($jscript,$args) = @_;
my $start_page;
- if (ref($loaditems) eq 'HASH') {
- $start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems});
- } else {
+ if (ref($args) eq 'HASH') {
$start_page=&Apache::loncommon::start_page('User Management',$jscript,$args);
+ } else {
+ $start_page=&Apache::loncommon::start_page('User Management',$jscript);
}
return $start_page;
}
@@ -4300,14 +4525,68 @@ sub add_script {
}
sub verify_user_display {
+ my ($context) = @_;
+ my $photos;
+ if (($context eq 'course') && $env{'request.course.id'}) {
+ $photos = $env{'course.'.$env{'request.course.id'}.'.internal.showphoto'};
+ }
my $output = <<"END";
+function hide_searching() {
+ if (document.getElementById('searching')) {
+ document.getElementById('searching').style.display = 'none';
+ }
+ return;
+}
+
function display_update() {
document.studentform.action.value = 'listusers';
document.studentform.phase.value = 'display';
document.studentform.submit();
}
+function updateCols(caller) {
+ var context = '$context';
+ var photos = '$photos';
+ if (caller == 'Status') {
+ if (document.studentform.Status.options[document.studentform.Status.selectedIndex].value == 'Any') {
+ document.getElementById('showcolstatus').checked = true;
+ document.getElementById('showcolstatus').disabled = '';
+ document.getElementById('showcolstart').checked = true;
+ document.getElementById('showcolend').checked = true;
+ } else {
+ document.getElementById('showcolstatus').checked = false;
+ document.getElementById('showcolstatus').disabled = 'disabled';
+ document.getElementById('showcolstart').checked = false;
+ document.getElementById('showcolend').checked = false;
+ }
+ }
+ if (caller == 'output') {
+ if (photos == 1) {
+ if (document.getElementById('showcolphoto')) {
+ var photoitem = document.getElementById('showcolphoto');
+ if (document.studentform.output.options[document.studentform.output.selectedIndex].value == 'html') {
+ photoitem.checked = true;
+ photoitem.disabled = '';
+ } else {
+ photoitem.checked = false;
+ photoitem.disabled = 'disabled';
+ }
+ }
+ }
+ }
+ if (caller == 'showrole') {
+ if (document.studentform.showrole.options[document.studentform.showrole.selectedIndex].value == 'Any') {
+ document.getElementById('showcolrole').checked = true;
+ document.getElementById('showcolrole').disabled = '';
+ } else {
+ document.getElementById('showcolrole').checked = false;
+ document.getElementById('showcolrole').disabled = 'disabled';
+ }
+ }
+ return;
+}
+
END
return $output;
@@ -4318,9 +4597,6 @@ END
# Menu Phase One
sub print_main_menu {
my ($permission,$context,$crstype) = @_;
- if (($context eq 'course') && (&Apache::loncommon::needs_gci_custom())) {
- return &print_gci_main_menu($permission,$context,$crstype)
- }
my $linkcontext = $context;
my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));
if (($context eq 'course') && ($crstype eq 'Community')) {
@@ -4341,12 +4617,12 @@ sub print_main_menu {
course => {
upload => 'Upload a File of Course Users',
singleuser => 'Add/Modify a Course User',
- listusers => 'Manage Course Users',
+ listusers => 'List and Modify Multiple Course Users',
},
community => {
upload => 'Upload a File of Community Users',
singleuser => 'Add/Modify a Community User',
- listusers => 'Manage Community Users',
+ listusers => 'List and Modify Multiple Community Users',
},
);
my %linktitles = (
@@ -4385,7 +4661,7 @@ sub print_main_menu {
[
{
linktext => $links{$linkcontext}{'upload'},
- icon => 'sctr.png',
+ icon => 'uplusr.png',
#help => 'Course_Create_Class_List',
url => '/adm/createuser?action=upload',
permission => $permission->{'cusr'},
@@ -4393,7 +4669,7 @@ sub print_main_menu {
},
{
linktext => $links{$linkcontext}{'listusers'},
- icon => 'edit-find.png',
+ icon => 'mngcu.png',
#help => 'Course_View_Class_List',
url => '/adm/createuser?action=listusers',
permission => ($permission->{'view'} || $permission->{'cusr'}),
@@ -4417,6 +4693,22 @@ sub print_main_menu {
permission => $permission->{'custom'},
linktitle => 'Configure a custom role.',
},
+ {
+ linktext => 'Authoring Space Requests',
+ icon => 'selfenrl-queue.png',
+ #help => 'Domain_Role_Approvals',
+ url => '/adm/createuser?action=processauthorreq',
+ permission => $permission->{'cusr'},
+ linktitle => 'Approve or reject author role requests',
+ },
+ {
+ linktext => 'Change Log',
+ icon => 'document-properties.png',
+ #help => 'Course_User_Logs',
+ url => '/adm/createuser?action=changelogs',
+ permission => $permission->{'cusr'},
+ linktitle => 'View change log.',
+ },
);
}elsif ($context eq 'course'){
@@ -4480,7 +4772,7 @@ sub print_main_menu {
},
{
linktext => $linktext{$crstype}{'groups'},
- icon => 'conf.png',
+ icon => 'grps.png',
#help => 'Course_Manage_Group',
url => '/adm/coursegroups?refpage=cusr',
permission => $permission->{'grp_manage'},
@@ -4525,7 +4817,7 @@ sub print_main_menu {
push(@{ $menu[2]->{items} },
{
linktext => 'User Self-Enrollment',
- icon => 'cstr.png',
+ icon => 'self_enroll.png',
#help => 'Course_Self_Enrollment',
url => '/adm/createuser?action=selfenroll',
permission => $permission->{'cusr'},
@@ -4533,8 +4825,17 @@ sub print_main_menu {
},
);
}
- };
-return Apache::lonhtmlcommon::generate_menu(@menu);
+ } elsif ($context eq 'author') {
+ {
+ linktext => 'Change Log',
+ icon => 'document-properties.png',
+ #help => 'Course_User_Logs',
+ url => '/adm/createuser?action=changelogs',
+ permission => $permission->{'cusr'},
+ linktitle => 'View change log.',
+ },
+ }
+ return Apache::lonhtmlcommon::generate_menu(@menu);
# { text => 'View Log-in History',
# help => 'Course_User_Logins',
# action => 'logins',
@@ -4542,82 +4843,6 @@ return Apache::lonhtmlcommon::generate_m
# });
}
-sub print_gci_main_menu {
- my ($permission,$context,$crstype) = @_;
- my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));
- my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity();
- my %links = (
- course => {
- single => 'Add/Modify a Student',
- drop => 'Drop Students',
- upload => 'Upload a File of Course Users',
- singleuser => 'Add/Modify a Course User',
- listusers => 'Manage Course Users',
- },
- );
- my %linktitles = (
- course => {
- singleuser => 'Add a user with a certain role to this course.',
- listusers => 'Show and manage users in this course.',
- single => 'Add a user with the role of student to this course',
- drop => 'Remove a student from this course.',
- upload => 'Upload a CSV or a text file containing users.',
- },
- );
- my @menu = ( {categorytitle => 'Manage Users',
- items =>
- [
- {
- linktext => $links{$context}{'single'},
- #help => 'Course_Add_Student',
- icon => 'list-add.png',
- url => '/adm/createuser?action=singlestudent',
- permission => $permission->{'cusr'},
- linktitle => $linktitles{$context}{'single'},
-
- },
- {
- linktext => $links{$context}{'drop'},
- icon => 'edit-undo.png',
- #help => 'Course_Drop_Student',
- url => '/adm/createuser?action=drop',
- permission => $permission->{'cusr'},
- linktitle => $linktitles{$context}{'drop'},
- },
- {
- linktext => $links{$context}{'upload'},
- icon => 'sctr.png',
- #help => 'Course_Create_Class_List',
- url => '/adm/createuser?action=upload',
- permission => $permission->{'cusr'},
- linktitle => $linktitles{$context}{'upload'},
- },
- {
- linktext => $links{$context}{'listusers'},
- icon => 'edit-find.png',
- #help => 'Course_View_Class_List',
- url => '/adm/createuser?action=listusers',
- permission => ($permission->{'view'} || $permission->{'cusr'}),
- linktitle => $linktitles{$context}{'listusers'},
- },
- ]},
- {categorytitle => 'Administration',
- items => [ ]},
- );
-
- push(@{ $menu[1]->{items} }, #Category: Administration
- {
- linktext => 'Change Log',
- icon => 'document-properties.png',
- #help => 'Course_User_Logs',
- url => '/adm/createuser?action=changelogs',
- permission => $permission->{'cusr'},
- linktitle => 'View change log.',
- },
- );
- return Apache::lonhtmlcommon::generate_menu(@menu);
-}
-
sub restore_prev_selections {
my %saveable_parameters = ('srchby' => 'scalar',
'srchin' => 'scalar',
@@ -5027,7 +5252,7 @@ ENDSCRIPT
'
'.
&Apache::loncommon::plainname($ccuname,$ccudom).
'';
- $count;
+ $count ++;
}
my $rem = $count%$numcols;
if ($rem) {
@@ -5044,7 +5269,7 @@ ENDSCRIPT
my $cid = $env{'request.course.id'};
my $currlim = $env{'course.'.$cid.'.internal.selfenroll_limit'};
my $currcap = $env{'course.'.$cid.'.internal.selfenroll_cap'};
- my $nolimit = ' checked="checked" ';
+ $nolimit = ' checked="checked" ';
if ($currlim eq 'allstudents') {
$crslimit = ' checked="checked" ';
$selflimit = ' ';
@@ -5100,9 +5325,9 @@ sub visible_in_cat {
dc_chgcat => 'Ask a domain coordinator to change the category assigned to the course, as the one currently assigned is no longer used in the domain',
dc_addcat => 'Ask a domain coordinator to assign a category to the course.',
);
- $visactions{'unhide'} = &mt('Use [_1]Set course environment[_2] to change the "Exclude from course catalog" setting.','"
','"');
- $visactions{'chgcat'} = &mt('Use [_1]Set course environment[_2] to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','"
','"');
- $visactions{'addcat'} = &mt('Use [_1]Set course environment[_2] to assign a category to the course.','"
','"');
+ $visactions{'unhide'} = &mt('Use [_1]Categorize course[_2] to change the "Exclude from course catalog" setting.','
','"');
+ $visactions{'chgcat'} = &mt('Use [_1]Categorize course[_2] to change the category assigned to the course, as the one currently assigned is no longer used in the domain.','"
','"');
+ $visactions{'addcat'} = &mt('Use [_1]Categorize course[_2] to assign a category to the course.','"
','"');
if (ref($domconf{'coursecategories'}) eq 'HASH') {
if ($domconf{'coursecategories'}{'togglecats'} eq 'crs') {
$settable{'togglecats'} = 1;
@@ -5300,18 +5525,35 @@ sub selfenroll_date_forms {
sub print_userchangelogs_display {
my ($r,$context,$permission) = @_;
- my $formname = 'roleslog';
- my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
- my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
- my $crstype = &Apache::loncommon::course_type();
- my %roleslog=&Apache::lonnet::dump('nohist_rolelog',$cdom,$cnum);
+ my $formname = 'rolelog';
+ my ($username,$domain,$crstype,%roleslog);
+ if ($context eq 'domain') {
+ $domain = $env{'request.role.domain'};
+ %roleslog=&Apache::lonnet::dump_dom('nohist_rolelog',$domain);
+ } else {
+ if ($context eq 'course') {
+ $domain = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ $username = $env{'course.'.$env{'request.course.id'}.'.num'};
+ $crstype = &Apache::loncommon::course_type();
+ my %saveable_parameters = ('show' => 'scalar',);
+ &Apache::loncommon::store_course_settings('roles_log',
+ \%saveable_parameters);
+ &Apache::loncommon::restore_course_settings('roles_log',
+ \%saveable_parameters);
+ } elsif ($context eq 'author') {
+ $domain = $env{'user.domain'};
+ if ($env{'request.role'} =~ m{^au\./\Q$domain\E/$}) {
+ $username = $env{'user.name'};
+ } else {
+ undef($domain);
+ }
+ }
+ if ($domain ne '' && $username ne '') {
+ %roleslog=&Apache::lonnet::dump('nohist_rolelog',$domain,$username);
+ }
+ }
if ((keys(%roleslog))[0]=~/^error\:/) { undef(%roleslog); }
- my %saveable_parameters = ('show' => 'scalar',);
- &Apache::loncommon::store_course_settings('roles_log',
- \%saveable_parameters);
- &Apache::loncommon::restore_course_settings('roles_log',
- \%saveable_parameters);
# set defaults
my $now = time();
my $defstart = $now - (7*24*3600); #7 days ago
@@ -5353,7 +5595,8 @@ sub print_userchangelogs_display {
# Form Header
$r->print('