version 1.368, 2022/10/19 00:03:11
|
version 1.375, 2024/12/20 00:24:39
|
Line 444 sub handler {
|
Line 444 sub handler {
|
$reqauthor = &Apache::loncoursequeueadmin::process_reqauthor(\$update); |
$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 $envkey; |
my %dcroles = (); |
my %dcroles = (); |
my %helpdeskroles = (); |
my %helpdeskroles = (); |
Line 697 sub handler {
|
Line 703 sub handler {
|
$env{'user.name'}, |
$env{'user.name'}, |
&mt('Assigned from [_1] at [_2] for [_3]' |
&mt('Assigned from [_1] at [_2] for [_3]' |
,$ip |
,$ip |
,&Apache::lonlocal::locallocaltime() |
,&Apache::lonlocal::locallocaltime($now) |
,$trolecode) |
,$trolecode) |
); |
); |
unless ($assignresult eq 'ok') { |
unless ($assignresult eq 'ok') { |
Line 1231 ENDCLOSE
|
Line 1237 ENDCLOSE
|
$start_page=&Apache::loncommon::start_page($pagetitle,undef, |
$start_page=&Apache::loncommon::start_page($pagetitle,undef, |
{bread_crumbs=>$brcrum,crstype=>'Placement'}); |
{bread_crumbs=>$brcrum,crstype=>'Placement'}); |
} else { |
} else { |
my $crumbsright; |
my ($crumbsright,$crumbs_style); |
unless (($norolelist) && ((split(/:/,$env{'user.error.msg'}))[2])) { |
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'}) { |
if ($env{'browser.mobile'}) { |
$crumbsright = $funcs; |
$crumbsright = $funcs; |
undef($funcs); |
undef($funcs); |
|
$crumbs_style = 'overflow: visible;'; |
} |
} |
} |
} |
$start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum, |
$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); |
&js_escape(\$standby); |
my $noscript='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />'; |
my $noscript='<br /><span class="LC_error">'.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').'<br />'.&mt('As this is not the case, most functionality in the system will be unavailable.').'</span><br />'; |
Line 1271 function enterrole (thisform,rolecode,bu
|
Line 1279 function enterrole (thisform,rolecode,bu
|
} |
} |
|
|
function rolesView (caller) { |
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; |
document.rolechoice.display.value = caller; |
} else { |
} else { |
if ((caller == 'doupdate') || (caller == 'requestauthor') || |
if ((caller == 'doupdate') || (caller == 'requestauthor') || |
Line 1367 ENDHEADER
|
Line 1379 ENDHEADER
|
} |
} |
if ($hotlist) { |
if ($hotlist) { |
$showresult .= $hotlist; |
$showresult .= $hotlist; |
} |
} |
$showresult .= '</div>'; |
$showresult .= '</div>'; |
$r->print($showresult); |
$r->print($showresult); |
} elsif ($env{'form.state'} eq 'queued') { |
} elsif ($env{'form.state'} eq 'queued') { |
$r->print(&get_queued()); |
$r->print(&get_queued()); |
|
} elsif ($env{'form.approvals'} eq 'show') { |
|
if ($env{'form.state'} eq 'done') { |
|
$r->print($approvalresult).'<br />'; |
|
} |
|
$r->print('<div class="LC_left_float"><fieldset><legend>'.&mt('Role assignments queued pending your acceptance').'</legend>'. |
|
&get_approvals(). |
|
'</fieldset></div><br clear="all" />'); |
} |
} |
if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) { |
if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) { |
$fn.='?'.$ENV{'REDIRECT_QUERY_STRING'}; |
$fn.='?'.$ENV{'REDIRECT_QUERY_STRING'}; |
} |
} |
my $display = ($env{'form.display'} =~ /^(showall)$/); |
my $display = ($env{'form.display'} =~ /^(showall)$/); |
|
my $approvals = ($env{'form.approvals'} =~ /^(show)$/); |
$r->print('<form method="post" name="rolechoice" action="'.(($fn)?$fn:$r->uri).'">'); |
$r->print('<form method="post" name="rolechoice" action="'.(($fn)?$fn:$r->uri).'">'); |
$r->print('<input type="hidden" name="orgurl" value="'.$fn.'" />'); |
$r->print('<input type="hidden" name="orgurl" value="'.$fn.'" />'); |
$r->print('<input type="hidden" name="selectrole" value="1" />'); |
$r->print('<input type="hidden" name="selectrole" value="1" />'); |
$r->print('<input type="hidden" name="newrole" value="" />'); |
$r->print('<input type="hidden" name="newrole" value="" />'); |
$r->print('<input type="hidden" name="display" value="'.$display.'" />'); |
$r->print('<input type="hidden" name="display" value="'.$display.'" />'); |
$r->print('<input type="hidden" name="state" value="" />'); |
$r->print('<input type="hidden" name="state" value="" />'); |
|
$r->print('<input type="hidden" name="approvals" value="'.$approvals.'" />'); |
if ($blocked_by_ip) { |
if ($blocked_by_ip) { |
my $blocked_role = 'student'; |
my $blocked_role = 'student'; |
if ($blocked_type eq 'Community') { |
if ($blocked_type eq 'Community') { |
Line 1782 sub gather_roles {
|
Line 1803 sub gather_roles {
|
foreach my $rolename (sort(keys(%{$domdef{'adhocroles'}}))) { |
foreach my $rolename (sort(keys(%{$domdef{'adhocroles'}}))) { |
if (ref($domdef{'adhocroles'}{$rolename}) eq 'HASH') { |
if (ref($domdef{'adhocroles'}{$rolename}) eq 'HASH') { |
$adhocdesc{$tdom}{$rolename} = $domdef{'adhocroles'}{$rolename}{'desc'}; |
$adhocdesc{$tdom}{$rolename} = $domdef{'adhocroles'}{$rolename}{'desc'}; |
$desc = $adhocdesc{$tdom}{$rolename}; |
|
} |
} |
} |
} |
|
$desc = $adhocdesc{$tdom}{$rolename}; |
} |
} |
} |
} |
if ($desc ne '') { |
if ($desc ne '') { |
Line 2226 sub build_roletext {
|
Line 2247 sub build_roletext {
|
$trolecode."','".$buttonname.'\');" /></td>'; |
$trolecode."','".$buttonname.'\');" /></td>'; |
} |
} |
} |
} |
if (($trolecode !~ m/^(dc|ca|au|aa)\./) && (!$skipcal)) { |
if (($trolecode !~ m/^(ca|aa)\./) && ($trest ne '') && (!$skipcal)) { |
$tremark.=&Apache::lonannounce::showday(time,1, |
$tremark.=&Apache::lonannounce::showday(time,1, |
&Apache::lonannounce::readcalendar($tdom.'_'.$trest)); |
&Apache::lonannounce::readcalendar($tdom.'_'.$trest)); |
} |
} |
Line 2685 sub update_session_roles {
|
Line 2706 sub update_session_roles {
|
} |
} |
} else { |
} else { |
$newrole{$rolekey} = $status_in_db; |
$newrole{$rolekey} = $status_in_db; |
|
if ($role eq 'au') { |
|
my %userenv = |
|
&Apache::lonnet::userenvironment($env{'user.domain'}, |
|
$env{'user.name'},'authoreditors'); |
|
if ($userenv{'authoreditors'}) { |
|
$userenv{'editors'} = $userenv{'authoreditors'}; |
|
} else { |
|
my %domdef = &Apache::lonnet::get_domain_defaults($env{'user.domain'}); |
|
if ($domdef{'editors'} ne '') { |
|
$userenv{'editors'} = $domdef{'editors'}; |
|
} else { |
|
$userenv{'editors'} = 'edit,xml'; |
|
} |
|
} |
|
&Apache::lonnet::appenv(\%userenv); |
|
} |
} |
} |
} |
} |
} |
} |
Line 3366 sub is_active_course {
|
Line 3403 sub is_active_course {
|
} |
} |
|
|
sub get_roles_functions { |
sub get_roles_functions { |
my ($rolescount,$cattype) = @_; |
my ($rolescount,$cattype,$userapprovals) = @_; |
my @links; |
my @links; |
push(@links,["javascript:rolesView('doupdate');",'start-here-22x22',&mt('Check for changes')]); |
push(@links,["javascript:rolesView('doupdate');",'start-here-22x22',&mt('Check for changes')]); |
if ($env{'environment.canrequest.author'}) { |
if ($env{'environment.canrequest.author'}) { |
Line 3395 sub get_roles_functions {
|
Line 3432 sub get_roles_functions {
|
unless ($cattype eq 'none') { |
unless ($cattype eq 'none') { |
push(@links,['/adm/coursecatalog','ccat-22x22',&mt('Course catalog')]); |
push(@links,['/adm/coursecatalog','ccat-22x22',&mt('Course catalog')]); |
} |
} |
|
if ($userapprovals) { |
|
if ($env{'form.approvals'} eq 'show') { |
|
push(@links,["javascript:rolesView('noapprovals');",'list-add-22x22',&mt('Hide pending')]); |
|
} else { |
|
push(@links,["javascript:rolesView('approvals');",'list-add-22x22',&mt('Show pending')]); |
|
} |
|
} |
my $funcs; |
my $funcs; |
if ($env{'browser.mobile'}) { |
if ($env{'browser.mobile'}) { |
my @functions; |
my @functions; |
Line 3498 sub get_queued {
|
Line 3542 sub get_queued {
|
unless ($output) { |
unless ($output) { |
if ($env{'environment.canrequest.author'} || $env{'environment.canrequest.official'} || |
if ($env{'environment.canrequest.author'} || $env{'environment.canrequest.official'} || |
$env{'environment.canrequest.unofficial'} || $env{'environment.canrequest.community'}) { |
$env{'environment.canrequest.unofficial'} || $env{'environment.canrequest.community'}) { |
$output = &mt('No requests for courses, communities or authoring currently queued'); |
$output = '<span class="LC_info">'. |
|
&mt('No requests for courses, communities or authoring currently queued'). |
|
'</span>'; |
} else { |
} else { |
$output = &mt('No enrollment requests currently queued awaiting approval'); |
$output = '<span class="LC_info">'. |
|
&mt('No enrollment requests currently queued awaiting approval'). |
|
'</span>'; |
} |
} |
} |
} |
return '<div class="LC_left_float"><fieldset><legend>'.&mt('Queued requests').'</legend>'. |
return '<div class="LC_left_float"><fieldset><legend>'.&mt('Queued requests').'</legend>'. |
$output.'</fieldset></div><br clear="all" />'; |
$output.'</fieldset></div><br clear="all" />'; |
} |
} |
|
|
|
sub get_approvals { |
|
return &Apache::loncoursequeueadmin::display_queued_requests('othdomaction',$env{'user.domain'},'','user'); |
|
} |
|
|
sub process_lti { |
sub process_lti { |
my ($r,$cdom,$cnum) = @_; |
my ($r,$cdom,$cnum) = @_; |
my %lti = &Apache::lonnet::get_domain_lti($cdom,'provider'); |
my %lti = &Apache::lonnet::get_domain_lti($cdom,'provider'); |
Line 3582 sub ltienroll {
|
Line 3634 sub ltienroll {
|
&LONCAPA::ltiutils::batchaddroster($item); |
&LONCAPA::ltiutils::batchaddroster($item); |
} |
} |
} |
} |
|
$rosterupdates = []; |
} |
} |
|
return OK; |
} |
} |
|
|
sub set_deeplink_target { |
sub set_deeplink_target { |
Line 3615 sub set_deeplink_target {
|
Line 3669 sub set_deeplink_target {
|
|
|
sub set_supplemental_access { |
sub set_supplemental_access { |
my ($cnum,$cdom) = @_; |
my ($cnum,$cdom) = @_; |
my ($supplemental,$refs_updated) = &Apache::lonnet::get_supplemental($cnum,$cdom); |
my ($supplemental,$refs_updated) = &Apache::loncommon::get_supplemental($cnum,$cdom); |
unless ($refs_updated) { |
unless ($refs_updated) { |
&Apache::loncommon::set_supp_httprefs($cnum,$cdom,$supplemental); |
&Apache::loncommon::set_supp_httprefs($cnum,$cdom,$supplemental); |
} |
} |