--- loncom/interface/loncreateuser.pm 2023/11/03 21:40:22 1.471 +++ loncom/interface/loncreateuser.pm 2024/02/29 14:09:30 1.475 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.471 2023/11/03 21:40:22 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.475 2024/02/29 14:09:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -273,13 +273,13 @@ sub build_tools_display { my ($ccuname,$ccdomain,$context) = @_; my (@usertools,%userenv,$output,@options,%validations,%reqtitles,%reqdisplay, $colspan,$isadv,%domconfig,@defaulteditors,@customeditors,@custommanagers, - @possmanagers,$editorsty,$customsty); + @possmanagers); my %lt = &Apache::lonlocal::texthash ( 'blog' => "Personal User Blog", 'aboutme' => "Personal Information Page", 'webdav' => "WebDAV access to Authoring Spaces (https)", 'editors' => "Available Editors", - 'managers' => "Co-authors who can add/revoke co-authors", + 'managers' => "Co-authors who can add/revoke roles", 'portfolio' => "Personal User Portfolio", 'portaccess' => "Portfolio Shareable", 'timezone' => "Can set Time Zone", @@ -337,13 +337,15 @@ sub build_tools_display { } foreach my $item (@usertools) { my ($custom_access,$curr_access,$cust_on,$cust_off,$tool_on,$tool_off, - $currdisp,$custdisp,$custradio,$onclick); + $currdisp,$custdisp,$custradio,$onclick,$customsty,$editorsty); $cust_off = 'checked="checked" '; $tool_on = 'checked="checked" '; - $curr_access = - &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef, - $context,\%userenv,'', - {'is_adv' => $isadv}); + unless (($context eq 'authordefaults') && ($item ne 'webdav')) { + $curr_access = + &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef, + $context,\%userenv,'', + {'is_adv' => $isadv}); + } if ($context eq 'requestauthor') { if ($userenv{$context} ne '') { $cust_on = ' checked="checked" '; @@ -466,7 +468,7 @@ sub build_tools_display { $tool_off = 'checked="checked" '; $tool_on = ''; } - $customsty = ' style="display:inline;"'; + $customsty = ' style="display:block;"'; } } $output .= '
'.&mt('Select manager(s)').': '; + $output .= '
'.&mt('If checked, can manage').': '; foreach my $user (@possmanagers) { my $checked; if (grep(/^\Q$user\E$/,@custommanagers)) { @@ -6350,7 +6391,7 @@ sub handler { if (($permission->{cusr}) && ($context eq 'author')) { push(@{$brcrum}, {href => '/adm/createuser?action=camanagers', - text => 'Co-authors who manage', + text => 'Co-author Managers', help => 'Author_Manage_Coauthors'}); if ($env{'form.state'} eq 'process') { push(@{$brcrum}, @@ -6510,6 +6551,15 @@ function updateCols(caller) { document.getElementById('showcolstart').checked = false; document.getElementById('showcolend').checked = false; } + if (context == 'author') { + if (document.studentform.Status.options[document.studentform.Status.selectedIndex].value == 'Expired') { + document.getElementById('showcolmanager').checked = false; + document.getElementById('showcolmanager').disabled = 'disabled'; + } else if (document.studentform.showrole.options[document.studentform.showrole.selectedIndex].value != 'aa') { + document.getElementById('showcolmanager').checked = true; + document.getElementById('showcolmanager').disabled = ''; + } + } } } if (caller == 'output') { @@ -6595,6 +6645,15 @@ function updateCols(caller) { } } } + if (context == 'author') { + if (document.studentform.showrole.options[document.studentform.showrole.selectedIndex].value == 'aa') { + document.getElementById('showcolmanager').checked = false; + document.getElementById('showcolmanager').disabled = 'disabled'; + } else if (document.studentform.Status.options[document.studentform.Status.selectedIndex].value != 'Expired') { + document.getElementById('showcolmanager').checked = true; + document.getElementById('showcolmanager').disabled = ''; + } + } } return; } @@ -6900,16 +6959,16 @@ sub print_main_menu { linktitle => 'View change log.', }, { - linktext => 'Co-authors who can add/revoke co-author roles', - icon => 'helpdesk-access.png', + linktext => 'Co-author Managers', + icon => 'camanager.png', #help => 'Coauthor_Management', url => '/adm/createuser?action=camanagers', permission => $permission->{'author'}, linktitle => 'Assign/Revoke right to manage co-author roles', }, { - linktext => 'Configure coauthor-viewable listing', - icon => 'helpdesk-access.png', + linktext => 'Configure Co-author Listing', + icon => 'coauthors.png', #help => 'Coauthor_Settings', url => '/adm/createuser?action=calist&forceedit=1', permission => ($permission->{'cusr'}),