version 1.125.2.10, 2021/01/18 21:58:57
|
version 1.125.2.10.2.1, 2023/07/08 17:21:33
|
Line 56 sub fail {
|
Line 56 sub fail {
|
} |
} |
|
|
sub start_page { |
sub start_page { |
my ($r,$title,$brcrum,$bread_crumbs_component,$js)=@_; |
my ($r,$title,$brcrum,$bread_crumbs_component,$js,$mgr)=@_; |
my $args; |
my $args; |
if (ref($brcrum) eq 'ARRAY') { |
if (ref($brcrum) eq 'ARRAY') { |
$args = {bread_crumbs => $brcrum}; |
$args = {bread_crumbs => $brcrum}; |
Line 74 sub start_page {
|
Line 74 sub start_page {
|
$args = { 'add_entries' => \%loaditems }; |
$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)); |
$r->print(&Apache::loncommon::start_page($title,$js,$args)); |
} |
} |
|
|
Line 371 sub get_consumed_uniqueperiods {
|
Line 396 sub get_consumed_uniqueperiods {
|
return 'error: Unable to determine current status'; |
return 'error: Unable to determine current status'; |
} |
} |
my @problems = $navmap->retrieveResources(undef, |
my @problems = $navmap->retrieveResources(undef, |
sub { $_[0]->is_problem() },1,0); |
sub { $_[0]->is_problem() || $_[0]->is_tool() },1,0); |
my %used_slots; |
my %used_slots; |
foreach my $problem (@problems) { |
foreach my $problem (@problems) { |
my $symb = $problem->symb(); |
my $symb = $problem->symb(); |
Line 869 sub release_reservation {
|
Line 894 sub release_reservation {
|
if ($passed_resource->is_map()) { |
if ($passed_resource->is_map()) { |
my ($a_resource) = |
my ($a_resource) = |
$navmap->retrieveResources($passed_resource, |
$navmap->retrieveResources($passed_resource, |
sub {$_[0]->is_problem()},0,1); |
sub {$_[0]->is_problem() || $_[0]->is_tool() },0,1); |
$parm_symb = $a_resource->symb(); |
$parm_symb = $a_resource->symb(); |
} |
} |
} else { |
} else { |
Line 965 sub update_selectable {
|
Line 990 sub update_selectable {
|
if ($passed_resource->is_map()) { |
if ($passed_resource->is_map()) { |
my ($a_resource) = |
my ($a_resource) = |
$navmap->retrieveResources($passed_resource, |
$navmap->retrieveResources($passed_resource, |
sub {$_[0]->is_problem()},0,1); |
sub {$_[0]->is_problem() || $_[0]->is_tool() },0,1); |
$symb_for_parm = $a_resource->symb(); |
$symb_for_parm = $a_resource->symb(); |
} |
} |
# get parameter string, check for existence, rebuild string with the slot |
# get parameter string, check for existence, rebuild string with the slot |
Line 1041 sub delete_slot {
|
Line 1066 sub delete_slot {
|
|
|
sub return_link { |
sub return_link { |
my ($r) = @_; |
my ($r) = @_; |
|
my $target = &return_target(); |
if (($env{'form.command'} eq 'manageresv') || ($env{'form.context'} eq 'usermanage')) { |
if (($env{'form.command'} eq 'manageresv') || ($env{'form.context'} eq 'usermanage')) { |
$r->print('<p><a href="/adm/slotrequest?command=manageresv">'. |
$r->print('<p><a href="/adm/slotrequest?command=manageresv" target="'.$target.'">'. |
&mt('Return to reservations')); |
&mt('Return to reservations')); |
} else { |
} else { |
$r->print('<p><a href="/adm/flip?postdata=return:">'. |
$r->print('<p><a href="/adm/flip?postdata=return:" target="'.$target.'">'. |
&mt('Return to last resource').'</a></p>'); |
&mt('Return to last resource').'</a></p>'); |
} |
} |
} |
} |
|
|
|
sub return_target { |
|
my ($target,$ltitarget,$deeplinktarget); |
|
if ($env{'request.lti.login'}) { |
|
$ltitarget = $env{'request.lti.target'}; |
|
} |
|
if ($env{'request.deeplink.login'}) { |
|
$deeplinktarget = $env{'request.deeplink.target'}; |
|
} |
|
if (($ltitarget eq 'iframe') || ($deeplinktarget eq '_self')) { |
|
$target = '_self'; |
|
} else { |
|
$target = '_top'; |
|
} |
|
return $target; |
|
} |
|
|
sub get_slot { |
sub get_slot { |
my ($r,$symb,$conflictable_slot,$inhibit_return_link)=@_; |
my ($r,$symb,$conflictable_slot,$inhibit_return_link)=@_; |
|
|
Line 1287 sub show_choices {
|
Line 1329 sub show_choices {
|
if (!@{$available}) { |
if (!@{$available}) { |
$output = '<span class="LC_info">'.&mt('No available times.').'</span>'; |
$output = '<span class="LC_info">'.&mt('No available times.').'</span>'; |
if ($env{'form.command'} ne 'manageresv') { |
if ($env{'form.command'} ne 'manageresv') { |
$output .= ' <a href="/adm/flip?postdata=return:">'. |
my $target = &return_target(); |
|
$output .= ' <a href="/adm/flip?postdata=return:" target="'.$target.'">'. |
&mt('Return to last resource').'</a>'; |
&mt('Return to last resource').'</a>'; |
} |
} |
$r->print($output); |
$r->print($output); |
Line 2028 sub manage_reservations {
|
Line 2071 sub manage_reservations {
|
my $symb = $resource->symb(); |
my $symb = $resource->symb(); |
my $ressymb = $symb; |
my $ressymb = $symb; |
$contents{$lastcontainer} ++; |
$contents{$lastcontainer} ++; |
next if (!$resource->is_problem() && !$resource->is_sequence() && |
next if (!$resource->is_problem() && && !$resource->is_tool() && |
!$resource->is_page()); |
!$resource->is_sequence() && !$resource->is_page()); |
$count ++; |
$count ++; |
if (($resource->is_sequence()) || ($resource->is_page())) { |
if (($resource->is_sequence()) || ($resource->is_page())) { |
$lastcontainer = $count; |
$lastcontainer = $count; |
$container{$lastcontainer} = $resource; |
$container{$lastcontainer} = $resource; |
$container_title{$lastcontainer} = $resource->compTitle(); |
$container_title{$lastcontainer} = $resource->compTitle(); |
} |
} |
if ($resource->is_problem()) { |
if ($resource->is_problem() || $resource->is_tool()) { |
my ($useslots) = $resource->slot_control(); |
my ($useslots) = $resource->slot_control(); |
next if (($useslots eq '') || ($useslots =~ /^\s*no\s*$/i)); |
next if (($useslots eq '') || ($useslots =~ /^\s*no\s*$/i)); |
my ($msg,$get_choices,$slotdescription); |
my ($msg,$get_choices,$slotdescription); |
Line 3224 sub handler {
|
Line 3267 sub handler {
|
if (($env{'form.requestattempt'}) || ($env{'form.command'} eq 'manageresv')) { |
if (($env{'form.requestattempt'}) || ($env{'form.command'} eq 'manageresv')) { |
$js = &reservation_js(\%slots,$consumed_uniqueperiods,$available,$got_slots,$symb); |
$js = &reservation_js(\%slots,$consumed_uniqueperiods,$available,$got_slots,$symb); |
} |
} |
&start_page($r,$title,$brcrum,$bread_crumbs_component,$js); |
&start_page($r,$title,$brcrum,$bread_crumbs_component,$js,$mgr); |
|
|
if ($env{'form.command'} eq 'manageresv') { |
if ($env{'form.command'} eq 'manageresv') { |
$allavailable = $available; |
$allavailable = $available; |