--- loncom/interface/loncreateuser.pm 2024/08/24 15:09:55 1.406.2.20.2.6 +++ loncom/interface/loncreateuser.pm 2024/09/01 02:28:19 1.406.2.20.2.7 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.406.2.20.2.6 2024/08/24 15:09:55 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.406.2.20.2.7 2024/09/01 02:28:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1507,6 +1507,7 @@ sub print_user_modification_page { 'bread_crumbs_component' => 'User Management'}; if ($env{'form.popup'}) { $args->{'no_nav_bar'} = 1; + $args->{'add_modal'} = 1; } if (($context eq 'domain') && ($env{'request.role.domain'} eq $ccdomain)) { my @toggles; @@ -6226,6 +6227,27 @@ sub handler { $r->internal_redirect('/adm/viewcoauthors'); return OK; } + } elsif (($env{'form.action'} eq 'setenv') && ($context eq 'author')) { + my ($role,$audom,$auname,$canview,$canedit) = + &Apache::lonviewcoauthors::get_allowable(); + push(@{$brcrum}, + {href => '/adm/createuser?action=calist', + text => 'Coauthor-viewable list', + help => 'Author_List_Coauthors'}); + my $args = { 'bread_crumbs' => $brcrum }; + $r->print(&Apache::loncommon::start_page('Coauthor-viewable list',undef, + $args)); + my %viewsettings = + &Apache::lonviewcoauthors::retrieve_view_settings($auname,$audom,$role); + if ($viewsettings{'show'} eq 'none') { + $r->print('
'. + &mt('Listing of co-authors not enabled for this Authoring Space'). + '
'); + } else { + &Apache::lonviewcoauthors::print_coauthors($r,$auname,$audom,$role, + '/adm/createuser',\%viewsettings); + } } else { $bread_crumbs_component = 'User Management'; $args = { bread_crumbs => $brcrum, @@ -6726,6 +6748,27 @@ sub print_main_menu { ); } } elsif ($context eq 'author') { + my $coauthorlist; + if ($env{'request.role'} =~ m{^(?:ca|aa)\./($match_domain)/($match_username)$}) { + if ($env{'environment.internal.coauthorlist./'.$1.'/'.$2}) { + $coauthorlist = 1; + } + } elsif ($env{'request.role'} eq "au./$env{'user.domain'}/") { + if ($env{'environment.coauthorlist'}) { + $coauthorlist = 1; + } + } + if ($coauthorlist) { + push(@{ $menu[1]->{items} }, + { + linktext => 'Co-author-viewable list', + icon => 'clst.png', + #help => 'Coauthor_Listing', + url => '/adm/createuser?action=calist&forceedit=0', + permission => $permission->{'cusr'}, + linktitle => 'Co-author-viewable listing', + }); + } push(@{ $menu[2]->{items} }, #Category: Administration { linktext => 'Change Log',