[LON-CAPA-cvs] cvs: loncom /interface loncreateuser.pm
raeburn
raeburn at source.lon-capa.org
Sat Aug 31 17:12:45 EDT 2024
raeburn Sat Aug 31 21:12:45 2024 EDT
Modified files:
/loncom/interface loncreateuser.pm
Log:
- Support use of modal window for setting start and end dates for a role when
"Modify a user's information" is displayed in a pop-up window from
List Users screen.
- Authors and Co-author managers can display Co-author listing available to
co-authors and assistant co-authors, when list availability is on.
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.480 loncom/interface/loncreateuser.pm:1.481
--- loncom/interface/loncreateuser.pm:1.480 Tue May 21 02:57:15 2024
+++ loncom/interface/loncreateuser.pm Sat Aug 31 21:12:45 2024
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.480 2024/05/21 02:57:15 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.481 2024/08/31 21:12:45 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1525,6 +1525,7 @@
'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;
@@ -6486,6 +6487,27 @@
$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('<h3>'.&mt('Coauthor-viewable listing').'</h3>'.
+ '<p class="LC_info">'.
+ &mt('Listing of co-authors not enabled for this Authoring Space').
+ '</p>');
+ } else {
+ &Apache::lonviewcoauthors::print_coauthors($r,$auname,$audom,$role,
+ '/adm/createuser',\%viewsettings);
+ }
} else {
$bread_crumbs_component = 'User Management';
$args = { bread_crumbs => $brcrum,
@@ -6990,6 +7012,27 @@
);
}
} 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',
More information about the LON-CAPA-cvs
mailing list