--- loncom/auth/lonroles.pm 2022/07/01 04:05:16 1.366
+++ loncom/auth/lonroles.pm 2024/12/20 00:24:39 1.375
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.366 2022/07/01 04:05:16 raeburn Exp $
+# $Id: lonroles.pm,v 1.375 2024/12/20 00:24:39 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -444,6 +444,12 @@ sub handler {
$reqauthor = &Apache::loncoursequeueadmin::process_reqauthor(\$update);
}
+# ------------------------------------------------- Check for approval results
+ my $approvalresult;
+ if (($env{'form.approvals'} eq 'show') && ($env{'form.state'} eq 'done')) {
+ $approvalresult = &Apache::loncoursequeueadmin::update_request_queue('othdombyuser',
+ $env{'user.domain'});
+ }
my $envkey;
my %dcroles = ();
my %helpdeskroles = ();
@@ -499,6 +505,7 @@ sub handler {
"request.course.sec" => '',
"request.course.tied" => '',
"request.course.timechecked" => '',
+ "request.course.suppupdated" => '',
"request.role" => 'cm',
"request.role.adv" => $env{'user.adv'},
"request.role.domain" => $env{'user.domain'}});
@@ -696,7 +703,7 @@ sub handler {
$env{'user.name'},
&mt('Assigned from [_1] at [_2] for [_3]'
,$ip
- ,&Apache::lonlocal::locallocaltime()
+ ,&Apache::lonlocal::locallocaltime($now)
,$trolecode)
);
unless ($assignresult eq 'ok') {
@@ -853,7 +860,6 @@ ENDCLOSE
my ($feeds,$syllabus_time);
&Apache::lonrss::advertisefeeds($cnum,$cdom,undef,\$feeds);
&Apache::lonnet::appenv({'request.course.feeds' => $feeds});
- &Apache::lonnet::get_numsuppfiles($cnum,$cdom,1);
unless ($env{'course.'.$cdom.'_'.$cnum.'.updatedsyllabus'}) {
unless (($env{'course.'.$cdom.'_'.$cnum.'.externalsyllabus'}) ||
($env{'course.'.$cdom.'_'.$cnum.'.uploadedsyllabus'})) {
@@ -886,6 +892,8 @@ ENDCLOSE
if ($env{'form.symb'}) {
$furl .= '&symb='.&HTML::Entities::encode($env{'form.symb'},'<>&"');
}
+ } else {
+ &set_supplemental_access($cnum,$cdom);
}
if (($ferr) && ($tadv)) {
&error_page($r,$ferr,$furl);
@@ -951,6 +959,7 @@ ENDCLOSE
&Apache::loncommon::end_page());
}
} else {
+ &set_supplemental_access($cnum,$cdom);
if (($env{'request.lti.login'}) &&
($env{'request.lti.rosterid'} || $env{'request.lti.passbackid'})) {
&process_lti($r,$cdom,$cnum);
@@ -1130,6 +1139,12 @@ ENDCLOSE
$redirect_url .= $where;
}
$redirect_url .= '/';
+ if ($env{'form.orgurl'} =~ /^\Q$redirect_url\E/) {
+ my ($path) = ($env{'form.orgurl'} =~ m{^(.+)/[^/]+$});
+ if (($path ne '') && (-e $Apache::lonnet::perlvar{'lonDocRoot'}.$path)) {
+ $redirect_url = $env{'form.orgurl'};
+ }
+ }
&redirect_user($r,&mt('Entering Authoring Space'),
$redirect_url);
return OK;
@@ -1222,16 +1237,18 @@ ENDCLOSE
$start_page=&Apache::loncommon::start_page($pagetitle,undef,
{bread_crumbs=>$brcrum,crstype=>'Placement'});
} else {
- my $crumbsright;
+ my ($crumbsright,$crumbs_style);
unless (($norolelist) && ((split(/:/,$env{'user.error.msg'}))[2])) {
- $funcs = &get_roles_functions($showcount,$cattype);
+ $funcs = &get_roles_functions($showcount,$cattype,$domdefs{'userapprovals'});
if ($env{'browser.mobile'}) {
$crumbsright = $funcs;
undef($funcs);
+ $crumbs_style = 'overflow: visible;';
}
}
$start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum,
- bread_crumbs_component=>$crumbsright});
+ bread_crumbs_component=>$crumbsright,
+ bread_crumbs_style=>$crumbs_style,});
}
&js_escape(\$standby);
my $noscript='
'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'
'.&mt('As this is not the case, most functionality in the system will be unavailable.').'
';
@@ -1262,7 +1279,11 @@ function enterrole (thisform,rolecode,bu
}
function rolesView (caller) {
- if ((caller == 'showall') || (caller == 'noshowall')) {
+ if (caller == 'approvals') {
+ document.rolechoice.approvals.value = 'show';
+ } else if (caller == 'noapprovals') {
+ document.rolechoice.approvals.value = 'hide';
+ } else if ((caller == 'showall') || (caller == 'noshowall')) {
document.rolechoice.display.value = caller;
} else {
if ((caller == 'doupdate') || (caller == 'requestauthor') ||
@@ -1358,22 +1379,31 @@ ENDHEADER
}
if ($hotlist) {
$showresult .= $hotlist;
- }
+ }
$showresult .= '';
$r->print($showresult);
} elsif ($env{'form.state'} eq 'queued') {
$r->print(&get_queued());
+ } elsif ($env{'form.approvals'} eq 'show') {
+ if ($env{'form.state'} eq 'done') {
+ $r->print($approvalresult).'
';
+ }
+ $r->print('