--- loncom/auth/lonroles.pm 2022/06/26 04:03:47 1.365 +++ loncom/auth/lonroles.pm 2023/10/17 14:43:03 1.371 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.365 2022/06/26 04:03:47 raeburn Exp $ +# $Id: lonroles.pm,v 1.371 2023/10/17 14:43:03 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'}}); @@ -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); @@ -1040,7 +1049,7 @@ ENDCLOSE if ($env{'form.ttoken'}) { $dest .= (($dest =~/\?/)? '&':'?').'ttoken='.$env{'form.ttoken'}; } - unless ($env{'request.lti.login'}) { + unless (($env{'request.lti.login'}) || ($env{'request.deeplink.login'})) { $msg = '
'.&mt('Entering [_1] ...', $env{'course.'.$cdom.'_'.$cnum.'.description'}). '
'; @@ -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; @@ -1224,7 +1239,7 @@ ENDCLOSE } else { my $crumbsright; 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); @@ -1262,7 +1277,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 +1377,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).'