--- loncom/interface/slotrequest.pm 2021/01/18 21:46:09 1.143 +++ loncom/interface/slotrequest.pm 2023/07/12 15:48:23 1.147 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for requesting to have slots added to a students record # -# $Id: slotrequest.pm,v 1.143 2021/01/18 21:46:09 raeburn Exp $ +# $Id: slotrequest.pm,v 1.147 2023/07/12 15:48:23 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,18 +50,18 @@ sub fail { } else { $r->print('
'.&mt('Failed.').'
'); } - + &return_link($r); &end_page($r); } sub start_page { - my ($r,$title,$brcrum,$bread_crumbs_component,$js)=@_; + my ($r,$title,$brcrum,$bread_crumbs_component,$js,$mgr)=@_; my $args; if (ref($brcrum) eq 'ARRAY') { $args = {bread_crumbs => $brcrum}; - if ($bread_crumbs_component) { - $args->{bread_crumbs_component} = $bread_crumbs_component; + if ($bread_crumbs_component) { + $args->{bread_crumbs_component} = $bread_crumbs_component; } } if (($env{'form.requestattempt'}) || ($env{'form.command'} eq 'manageresv')) { @@ -74,6 +74,31 @@ sub start_page { $args = { 'add_entries' => \%loaditems }; } } + unless (($env{'form.context'} eq 'usermanage') || (($mgr eq 'F') && + (($env{'form.command'} eq 'release') || + ($env{'form.command'} eq 'remove_registration')))) { + if ($env{'form.symb'}) { + my $symb=&unescape($env{'form.symb'}); + my ($mapurl,$id,$resurl) = &Apache::lonnet::decode_symb($symb); + if ($resurl =~ /ext\.tool$/) { + my $target; + my ($marker,$exttool) = (split(m{/},$resurl))[3,4]; + $marker=~s/\D//g; + if (($marker) && ($exttool) && ($env{'request.course.id'})) { + my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + my ($idx,$crstool,$is_tool,%toolhash,%toolsettings); + if ($resurl eq "adm/$cdom/$cnum/$marker/$exttool") { + my %toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); + $target = $toolsettings{'target'}; + } + } + if ($target eq 'iframe') { + $args->{'only_body'} = 1; + } + } + } + } $r->print(&Apache::loncommon::start_page($title,$js,$args)); } @@ -259,7 +284,7 @@ function uncheckSlotRadio() { } if (slotpicks.length) { for (var i=0; i'.&mt('Releasing reservations').'
'); foreach my $entry (sort { $consumed{$a}{'name'} cmp @@ -776,7 +801,7 @@ sub release_slot { } else { $r->print("$msg
"); } - + if ($mgr eq 'F') { $r->print(''. &mt('Return to slot list').'
'); @@ -1138,15 +1163,32 @@ sub delete_slot { sub return_link { my ($r) = @_; + my $target = &return_target(); if (($env{'form.command'} eq 'manageresv') || ($env{'form.context'} eq 'usermanage')) { - $r->print(''.
- &mt('Return to reservations'));
+ $r->print(' '.
+ &mt('Return to reservations').' '.
+ $r->print(' '.
&mt('Return to last resource').'