--- loncom/interface/lonnavmaps.pm 2019/02/03 22:25:47 1.509.2.9
+++ loncom/interface/lonnavmaps.pm 2016/07/18 19:28:57 1.522
@@ -1,8 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.509.2.9 2019/02/03 22:25:47 raeburn Exp $
-
+# $Id: lonnavmaps.pm,v 1.522 2016/07/18 19:28:57 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -643,9 +642,6 @@ sub getDescription {
} elsif ($slot_status == $res->RESERVABLE) {
$slotmsg = &mt('Reservable, reservations close [_1]',
timeToHumanString($slot_time,'end'));
- } elsif ($slot_status == $res->NEEDS_CHECKIN) {
- $slotmsg = &mt('Reserved, check-in needed - ends [_1]',
- timeToHumanString($slot_time,'end'));
} elsif ($slot_status == $res->RESERVABLE_LATER) {
$slotmsg = &mt('Reservable, reservations open [_1]',
timeToHumanString($slot_time,'start'));
@@ -941,28 +937,7 @@ sub render_resource {
# links to open and close the folder
my $whitespace = $location.'/whitespace_21.gif';
- my $linkopen = "";
- my $nomodal;
- if (($params->{'modalLink'}) && (!$resource->is_sequence())) {
- if ($link =~m{^(?:|/adm/wrapper)/ext/([^#]+)}) {
- my $exturl = $1;
- if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) {
- $nomodal = 1;
- }
- } elsif (($link eq "/public/$LONCAPA::match_domain/$LONCAPA::match_courseid/syllabus") &&
- ($env{'request.course.id'}) && ($ENV{'SERVER_PORT'} == 443) &&
- ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
- $nomodal = 1;
- }
- my $esclink = &js_escape($link);
- if ($nomodal) {
- $linkopen .= "";
- } else {
- $linkopen .= "";
- }
- } else {
- $linkopen .= "";
- }
+ my $linkopen = ""."";
my $linkclose = "";
# Default icon: unknown page
@@ -1020,8 +995,7 @@ sub render_resource {
$linkopen = "";
$linkclose = "";
}
- if (((&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) ||
- (&Apache::lonnet::allowed('cev',$env{'request.course.id'}))) &&
+ if ((&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) &&
($resource->symb=~/\_\_\_[^\_]+\_\_\_uploaded/)) {
if (!$params->{'map_no_edit_link'}) {
my $icon = &Apache::loncommon::lonhttpdurl('/res/adm/pages').'/editmap.png';
@@ -1087,19 +1061,10 @@ sub render_resource {
}
if (!$params->{'resource_nolink'} && !$resource->is_sequence() && !$resource->is_empty_sequence) {
- $linkclose = '';
- if ($params->{'modalLink'}) {
- my $esclink = &js_escape($link);
- if ($nomodal) {
- $linkopen = "";
- } else {
- $linkopen = "";
- }
- } else {
- $linkopen = "";
- }
+ $result .= "$curMarkerBegin$title$partLabel$curMarkerEnd$editmapLink$nonLinkedText";
+ } else {
+ $result .= "$curMarkerBegin$linkopen$title$partLabel$curMarkerEnd$editmapLink$nonLinkedText";
}
- $result .= "$curMarkerBegin$linkopen$title$partLabel$linkclose$curMarkerEnd$editmapLink$nonLinkedText";
return $result;
}
@@ -1453,13 +1418,10 @@ sub render {
if ($args->{'iterator_map'}) {
my $map = $args->{'iterator_map'};
$map = $navmap->getResourceByUrl($map);
- if (ref($map)) {
- my $firstResource = $map->map_start();
- my $finishResource = $map->map_finish();
- $args->{'iterator'} = $it = $navmap->getIterator($firstResource, $finishResource, $filterHash, $condition);
- } else {
- return;
- }
+ my $firstResource = $map->map_start();
+ my $finishResource = $map->map_finish();
+
+ $args->{'iterator'} = $it = $navmap->getIterator($firstResource, $finishResource, $filterHash, $condition);
} else {
$args->{'iterator'} = $it = $navmap->getIterator(undef, undef, $filterHash, $condition,undef,$args->{'include_top_level_map'});
}
@@ -1578,8 +1540,7 @@ END
$result.='';
}
if (($args->{'caller'} eq 'navmapsdisplay') &&
- ((&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) ||
- (&Apache::lonnet::allowed('cev',$env{'request.course.id'})))) {
+ (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) {
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
if ($env{'course.'.$env{'request.course.id'}.'.url'} eq
@@ -1629,7 +1590,7 @@ END
# We also do this even if $args->{'suppressEmptySequences'}
# is not true, so we can hide empty sequences for which the
# hiddenresource parameter is set to yes (at map level), or
- # mark as hidden for users who have $userCanSeeHidden.
+ # mark as hidden for users who have $userCanSeeHidden.
# Use DFS for speed, since structure actually doesn't matter,
# except what map has what resources.
@@ -1637,7 +1598,6 @@ END
$it->{FIRST_RESOURCE},
$it->{FINISH_RESOURCE},
{}, undef, 1);
-
my $depth = 0;
$dfsit->next();
my $curRes = $dfsit->next();
@@ -1645,7 +1605,7 @@ END
if ($curRes == $dfsit->BEGIN_MAP()) { $depth++; }
if ($curRes == $dfsit->END_MAP()) { $depth--; }
- if (ref($curRes)) {
+ if (ref($curRes)) {
# Parallel pre-processing: Do sequences have non-filtered-out children?
if ($curRes->is_map()) {
$curRes->{DATA}->{HAS_VISIBLE_CHILDREN} = 0;
@@ -1723,11 +1683,6 @@ END
}
- my $inhibitmenu;
- if ($args->{'modalLink'}) {
- $inhibitmenu = '&inhibitmenu=yes';
- }
-
while (1) {
if ($args->{'sort'}) {
$curRes = shift(@resources);
@@ -1768,7 +1723,7 @@ END
next;
} else {
my $mapname = &Apache::lonnet::declutter($curRes->src());
- $mapname = &Apache::lonnet::deversion($mapname);
+ $mapname = &Apache::lonnet::deversion($mapname);
if (lc($navmap->get_mapparam(undef,$mapname,"0.hiddenresource")) eq 'yes') {
if ($userCanSeeHidden) {
$args->{'mapHidden'} = 1;
@@ -1864,7 +1819,7 @@ END
my $srcHasQuestion = $src =~ /\?/;
$args->{"resourceLink"} = $src.
($srcHasQuestion?'&':'?') .
- 'symb=' . &escape($symb).$inhibitmenu.$anchor;
+ 'symb=' . &escape($symb).$anchor;
}
# Now, we've decided what parts to show. Loop through them and
# show them.
@@ -2185,7 +2140,7 @@ sub change_user {
- # Now clear the parm cache and reconstruct the parm hash fromt he big_hash
+ # Now clear the parm cache and reconstruct the parm hash from the big_hash
# param.xxxx keys.
$self->{PARM_CACHE} = {};
@@ -2278,7 +2233,7 @@ sub generate_email_discuss_status {
foreach my $msgid (@keys) {
if ((!$emailstatus{$msgid}) || ($emailstatus{$msgid} eq 'new')) {
my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$fromcid,
- $symb,$error) = &Apache::lonmsg::unpackmsgid(&LONCAPA::escape($msgid));
+ $symb,$error) = &Apache::lonmsg::unpackmsgid($msgid);
&Apache::lonenc::check_decrypt(\$symb);
if (($fromcid ne '') && ($fromcid ne $cid)) {
next;
@@ -2650,6 +2605,7 @@ sub parmval {
return $self->{PARM_CACHE}->{$hashkey};
}
}
+
my $result = $self->parmval_real($what, $symb, $recurse);
$self->{PARM_CACHE}->{$hashkey} = $result;
if (wantarray) {
@@ -2683,29 +2639,35 @@ sub parmval_real {
my ($mapname,$id,$fn)=&Apache::lonnet::decode_symb($symb);
$mapname = &Apache::lonnet::deversion($mapname);
+ my ($recursed,@recurseup);
+
# ----------------------------------------------------- Cascading lookup scheme
my $rwhat=$what;
$what=~s/^parameter\_//;
$what=~s/\_/\./;
my $symbparm=$symb.'.'.$what;
+ my $recurseparm=$mapname.'___(rec).'.$what;
my $mapparm=$mapname.'___(all).'.$what;
my $usercourseprefix=$cid;
-
+
my $grplevel=$usercourseprefix.'.['.$cgroup.'].'.$what;
my $grplevelr=$usercourseprefix.'.['.$cgroup.'].'.$symbparm;
+ my $grpleveli=$usercourseprefix.'.['.$cgroup.'].'.$recurseparm;
my $grplevelm=$usercourseprefix.'.['.$cgroup.'].'.$mapparm;
my $seclevel= $usercourseprefix.'.['.$csec.'].'.$what;
my $seclevelr=$usercourseprefix.'.['.$csec.'].'.$symbparm;
+ my $secleveli=$usercourseprefix.'.['.$csec.'].'.$recurseparm;
my $seclevelm=$usercourseprefix.'.['.$csec.'].'.$mapparm;
my $courselevel= $usercourseprefix.'.'.$what;
my $courselevelr=$usercourseprefix.'.'.$symbparm;
+ my $courseleveli=$usercourseprefix.'.'.$recurseparm;
my $courselevelm=$usercourseprefix.'.'.$mapparm;
@@ -2717,6 +2679,17 @@ sub parmval_real {
if ($uname and defined($useropt)) {
if (defined($$useropt{$courselevelr})) { return [$$useropt{$courselevelr},'resource']; }
if (defined($$useropt{$courselevelm})) { return [$$useropt{$courselevelm},'map']; }
+ if (defined($$useropt{$courseleveli})) { return [$$useropt{$courseleveli},'map']; }
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.'.$item.'___(all).'.$what;
+ last if (defined($$useropt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.'.$item.'___(rec).'.$what;
+ if (defined($$useropt{$recursechk})) { return [$$useropt{$recursechk},'map']; }
+ }
if (defined($$useropt{$courselevel})) { return [$$useropt{$courselevel},'course']; }
}
@@ -2724,12 +2697,34 @@ sub parmval_real {
if ($cgroup ne '' and defined($courseopt)) {
if (defined($$courseopt{$grplevelr})) { return [$$courseopt{$grplevelr},'resource']; }
if (defined($$courseopt{$grplevelm})) { return [$$courseopt{$grplevelm},'map']; }
+ if (defined($$courseopt{$grpleveli})) { return [$$courseopt{$grpleveli},'map']; }
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.['.$cgroup.'].'.$item.'___(all).'.$what;
+ last if (defined($$courseopt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.['.$cgroup.'].'.$item.'___(rec).'.$what;
+ if (defined($$courseopt{$recursechk})) { return [$$courseopt{$recursechk},'map']; }
+ }
if (defined($$courseopt{$grplevel})) { return [$$courseopt{$grplevel},'course']; }
}
- if ($csec and defined($courseopt)) {
+ if ($csec ne '' and defined($courseopt)) {
if (defined($$courseopt{$seclevelr})) { return [$$courseopt{$seclevelr},'resource']; }
if (defined($$courseopt{$seclevelm})) { return [$$courseopt{$seclevelm},'map']; }
+ if (defined($$courseopt{$secleveli})) { return [$$courseopt{$secleveli},'map']; }
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.['.$csec.'].'.$item.'___(all).'.$what;
+ last if (defined($$courseopt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.['.$csec.'].'.$item.'___(rec).'.$what;
+ if (defined($$courseopt{$recursechk})) { return [$$courseopt{$recursechk},'map']; }
+ }
if (defined($$courseopt{$seclevel})) { return [$$courseopt{$seclevel},'course']; }
}
@@ -2753,6 +2748,19 @@ sub parmval_real {
# --------------------------------------------------- fifth, check more course
if (defined($courseopt)) {
if (defined($$courseopt{$courselevelm})) { return [$$courseopt{$courselevelm},'map']; }
+ if (defined($$courseopt{$courseleveli})) { return [$$courseopt{$courseleveli},'map']; }
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.'.$item.'___(all).'.$what;
+ last if (defined($$courseopt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.'.$item.'___(rec).'.$what;
+ if (defined($$courseopt{$recursechk})) {
+ return [$$courseopt{$recursechk},'map'];
+ }
+ }
if (defined($$courseopt{$courselevel})) {
my $ret = [$$courseopt{$courselevel},'course'];
return $ret;
@@ -2804,7 +2812,7 @@ sub map_printdates {
my $opendate = $self->get_mapparam($res->symb(),'',"$part.printstartdate");
- my $closedate= $self->get_mapparam($res->symb(),'', "$part.printenddate");
+ my $closedate= $self->get_mapparam($res->symb(),'',"$part.printenddate");
return ($opendate, $closedate);
@@ -2834,6 +2842,7 @@ sub get_mapparam {
my $result='';
my ($recursed,@recurseup);
+
# Figure out which map we are in.
if ($symb && !$mapname) {
@@ -2842,21 +2851,25 @@ sub get_mapparam {
$mapname = &Apache::lonnet::deversion($mapname);
}
+
my $rwhat=$what;
$what=~s/^parameter\_//;
$what=~s/\_/\./;
# Build the hash keys for the lookup:
- my $symbparm=$symb.'.'.$what;
my $mapparm=$mapname.'___(all).'.$what;
+ my $recurseparm=$mapname.'___(rec).'.$what;
my $usercourseprefix=$cid;
- my $grplevel = "$usercourseprefix.[$cgroup].$mapparm";
- my $seclevel = "$usercourseprefix.[$csec].$mapparm";
- my $courselevel = "$usercourseprefix.$mapparm";
-
+ my $grplevelm = "$usercourseprefix.[$cgroup].$mapparm";
+ my $seclevelm = "$usercourseprefix.[$csec].$mapparm";
+ my $courselevelm = "$usercourseprefix.$mapparm";
+
+ my $grpleveli = "$usercourseprefix.[$cgroup].$recurseparm";
+ my $secleveli = "$usercourseprefix.[$csec].$recurseparm";
+ my $courseleveli = "$usercourseprefix.$recurseparm";
# Get handy references to the hashes we need in $self:
@@ -2869,21 +2882,22 @@ sub get_mapparam {
if ($uname and defined($useropt)) {
- if (defined($$useropt{$courselevel})) {
- return $$useropt{$courselevel};
+ if (defined($$useropt{$courselevelm})) {
+ return $$useropt{$courselevelm};
}
- if ($what =~ /\.(encrypturl|hiddenresource)$/) {
- unless ($recursed) {
- @recurseup = $self->recurseup_maps($mapname);
- $recursed = 1;
- }
- foreach my $item (@recurseup) {
- my $norecursechk=$usercourseprefix.'.'.$item.'___(all).'.$what;
- if (defined($$useropt{$norecursechk})) {
- if ($what =~ /\.(encrypturl|hiddenresource)$/) {
- return $$useropt{$norecursechk};
- }
- }
+ if (defined($$useropt{$courseleveli})) {
+ return $$useropt{$courseleveli};
+ }
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.'.$item.'___(all).'.$what;
+ last if (defined($$useropt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.'.$item.'___(rec).'.$what;
+ if (defined($$useropt{$recursechk})) {
+ return $$useropt{$recursechk};
}
}
}
@@ -2893,21 +2907,22 @@ sub get_mapparam {
if ($cgroup ne '' and defined ($courseopt)) {
- if (defined($$courseopt{$grplevel})) {
- return $$courseopt{$grplevel};
+ if (defined($$courseopt{$grplevelm})) {
+ return $$courseopt{$grplevelm};
}
- if ($what =~ /\.(encrypturl|hiddenresource)$/) {
- unless ($recursed) {
- @recurseup = $self->recurseup_maps($mapname);
- $recursed = 1;
- }
- foreach my $item (@recurseup) {
- my $norecursechk=$usercourseprefix.'.['.$cgroup.'].'.$item.'___(all).'.$what;
- if (defined($$courseopt{$norecursechk})) {
- if ($what =~ /\.(encrypturl|hiddenresource)$/) {
- return $$courseopt{$norecursechk};
- }
- }
+ if (defined($$courseopt{$grpleveli})) {
+ return $$courseopt{$grpleveli};
+ }
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.['.$cgroup.'].'.$item.'___(all).'.$what;
+ last if (defined($$courseopt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.['.$cgroup.'].'.$item.'___(rec).'.$what;
+ if (defined($$courseopt{$recursechk})) {
+ return $$courseopt{$recursechk};
}
}
}
@@ -2915,25 +2930,23 @@ sub get_mapparam {
# Check course -- section
-
-
-
- if ($csec and defined($courseopt)) {
- if (defined($$courseopt{$seclevel})) {
- return $$courseopt{$seclevel};
+ if ($csec ne '' and defined($courseopt)) {
+ if (defined($$courseopt{$seclevelm})) {
+ return $$courseopt{$seclevelm};
}
- if ($what =~ /\.(encrypturl|hiddenresource)$/) {
- unless ($recursed) {
- @recurseup = $self->recurseup_maps($mapname);
- $recursed = 1;
- }
- foreach my $item (@recurseup) {
- my $norecursechk=$usercourseprefix.'.['.$csec.'].'.$item.'___(all).'.$what;
- if (defined($$courseopt{$norecursechk})) {
- if ($what =~ /\.(encrypturl|hiddenresource)$/) {
- return $$courseopt{$norecursechk};
- }
- }
+ if (defined($$courseopt{$secleveli})) {
+ return $$courseopt{$secleveli};
+ }
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ foreach my $item (@recurseup) {
+ my $norecursechk=$usercourseprefix.'.['.$csec.'].'.$item.'___(all).'.$what;
+ last if (defined($$courseopt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.['.$csec.'].'.$item.'___(rec).'.$what;
+ if (defined($$courseopt{$recursechk})) {
+ return $$courseopt{$recursechk};
}
}
}
@@ -2943,7 +2956,7 @@ sub get_mapparam {
my $symbparm=$symb.'.'.$what;
my $thisparm = $$parmhash{$symbparm};
if (defined($thisparm)) {
- return $thisparm;
+ return $thisparm;
}
}
@@ -2951,25 +2964,25 @@ sub get_mapparam {
# Additional course parameters:
if (defined($courseopt)) {
- if (defined($$courseopt{$courselevel})) {
- return $$courseopt{$courselevel};
+ if (defined($$courseopt{$courselevelm})) {
+ return $$courseopt{$courselevelm};
}
- if ($what =~ /\.(encrypturl|hiddenresource)$/) {
- unless ($recursed) {
- @recurseup = $self->recurseup_maps($mapname);
- $recursed = 1;
- }
+ unless ($recursed) {
+ @recurseup = $self->recurseup_maps($mapname);
+ $recursed = 1;
+ }
+ if (@recurseup) {
foreach my $item (@recurseup) {
my $norecursechk=$usercourseprefix.'.'.$item.'___(all).'.$what;
- if (defined($$courseopt{$norecursechk})) {
- if ($what =~ /\.(encrypturl|hiddenresource)$/) {
- return $$courseopt{$norecursechk};
- }
+ last if (defined($$courseopt{$norecursechk}));
+ my $recursechk=$usercourseprefix.'.'.$item.'___(rec).'.$what;
+ if (defined($$courseopt{$recursechk})) {
+ return $$courseopt{$recursechk};
}
}
}
}
- return undef; # Unefined if we got here.
+ return undef; # Undefined if we got here.
}
sub course_printdates {
@@ -3011,10 +3024,6 @@ sub getcourseparam {
$what=~s/^parameter\_//;
$what=~s/\_/\./;
-
- my $symbparm = $symb . '.' . $what;
- my $mapparm=$mapname.'___(all).'.$what;
-
# Local refs to the hashes we're going to look at:
my $useropt = $self->{USER_OPT};
@@ -4017,7 +4026,7 @@ sub new {
# This is a speed optimization, to avoid calling symb() too often.
$self->{SYMB} = $self->symb();
-
+
return $self;
}
@@ -4143,7 +4152,6 @@ sub enclosing_map_src {
}
sub symb {
my $self=shift;
- if (defined($self->{SYMB})) { return $self->{SYMB}; }
(my $first, my $second) = $self->{ID} =~ /(\d+).(\d+)/;
my $symbSrc = &Apache::lonnet::declutter($self->src());
my $symb = &Apache::lonnet::declutter($self->navHash('map_id_'.$first))
@@ -4673,11 +4681,12 @@ sub duedate {
my $date;
my @interval=$self->parmval("interval", $part);
my $due_date=$self->parmval("duedate", $part);
- if ($interval[0] =~ /\d+/) {
- my $first_access=&Apache::lonnet::get_first_access($interval[1],
- $self->{SYMB});
+ if ($interval[0] =~ /^(\d+)/) {
+ my $timelimit = $1;
+ my $first_access=&Apache::lonnet::get_first_access($interval[1],
+ $self->{SYMB});
if (defined($first_access)) {
- my $interval = $first_access+$interval[0];
+ my $interval = $first_access+$timelimit;
$date = (!$due_date || $interval < $due_date) ? $interval
: $due_date;
} else {
@@ -5583,7 +5592,7 @@ sub check_for_slot {
($checkedin,$checkedinslot) = $self->checkedin();
unless ((grep(/^\Q$checkedin\E/,@proctors)) &&
($checkedinslot eq $slot_name)) {
- return (NEEDS_CHECKIN,$end,$slot_name);
+ return (NEEDS_CHECKIN,undef,$slot_name);
}
}
return (RESERVED,$end,$slot_name);
@@ -5629,12 +5638,29 @@ sub check_for_slot {
my $reservable = &Apache::lonnet::get_reservable_slots($cnum,$cdom,$env{'user.name'},
$env{'user.domain'});
if (ref($reservable) eq 'HASH') {
+ my ($map) = &Apache::lonnet::decode_symb($symb);
if ((ref($reservable->{'now_order'}) eq 'ARRAY') && (ref($reservable->{'now'}) eq 'HASH')) {
foreach my $slot (reverse (@{$reservable->{'now_order'}})) {
my $canuse;
- if (($reservable->{'now'}{$slot}{'symb'} eq '') ||
- ($reservable->{'now'}{$slot}{'symb'} eq $symb)) {
+ if ($reservable->{'now'}{$slot}{'symb'} eq '') {
$canuse = 1;
+ } else {
+ my %oksymbs;
+ my @slotsymbs = split(/\s*,\s*/,$reservable->{'now'}{$slot}{'symb'});
+ map { $oksymbs{$_} = 1; } @slotsymbs;
+ if ($oksymbs{$symb}) {
+ $canuse = 1;
+ } else {
+ foreach my $item (@slotsymbs) {
+ if ($item =~ /\.(page|sequence)$/) {
+ (undef,undef, my $sloturl) = &Apache::lonnet::decode_symb($item);
+ if (($map ne '') && ($map eq $sloturl)) {
+ $canuse = 1;
+ last;
+ }
+ }
+ }
+ }
}
if ($canuse) {
if ($checkedin) {
@@ -5655,8 +5681,26 @@ sub check_for_slot {
if ((ref($reservable->{'future_order'}) eq 'ARRAY') && (ref($reservable->{'future'}) eq 'HASH')) {
foreach my $slot (@{$reservable->{'future_order'}}) {
my $canuse;
- if (($reservable->{'future'}{$slot}{'symb'} eq '') ||
- ($reservable->{'future'}{$slot}{'symb'} eq $symb)) {
+ if ($reservable->{'future'}{$slot}{'symb'} eq '') {
+ $canuse = 1;
+ } elsif ($reservable->{'future'}{$slot}{'symb'} =~ /,/) {
+ my %oksymbs;
+ my @slotsymbs = split(/\s*,\s*/,$reservable->{'future'}{$slot}{'symb'});
+ map { $oksymbs{$_} = 1; } @slotsymbs;
+ if ($oksymbs{$symb}) {
+ $canuse = 1;
+ } else {
+ foreach my $item (@slotsymbs) {
+ if ($item =~ /\.(page|sequence)$/) {
+ (undef,undef, my $sloturl) = &Apache::lonnet::decode_symb($item);
+ if (($map ne '') && ($map eq $sloturl)) {
+ $canuse = 1;
+ last;
+ }
+ }
+ }
+ }
+ } elsif ($reservable->{'future'}{$slot}{'symb'} eq $symb) {
$canuse = 1;
}
if ($canuse) {