version 1.1149, 2011/12/14 21:03:53
|
version 1.1150, 2011/12/20 22:40:06
|
Line 9399 sub get_slot {
|
Line 9399 sub get_slot {
|
} |
} |
return $slotinfo{$which}; |
return $slotinfo{$which}; |
} |
} |
|
|
|
sub get_reservable_slots { |
|
my ($cnum,$cdom,$uname,$udom) = @_; |
|
my $now = time; |
|
my $reservable_info; |
|
my $key=join("\0",'reservableslots',$cdom,$cnum,$uname,$udom); |
|
if (exists($remembered{$key})) { |
|
$reservable_info = $remembered{$key}; |
|
} else { |
|
my %resv; |
|
($resv{'now_order'},$resv{'now'},$resv{'future_order'},$resv{'future'}) = |
|
&Apache::loncommon::get_future_slots($cnum,$cdom,$now); |
|
$reservable_info = \%resv; |
|
$remembered{$key} = $reservable_info; |
|
} |
|
return $reservable_info; |
|
} |
|
|
|
sub get_course_slots { |
|
my ($cnum,$cdom) = @_; |
|
my $hashid=$cnum.':'.$cdom; |
|
my ($result,$cached) = &Apache::lonnet::is_cached_new('allslots',$hashid); |
|
if (defined($cached)) { |
|
if (ref($result) eq 'HASH') { |
|
return %{$result}; |
|
} |
|
} else { |
|
my %slots=&Apache::lonnet::dump('slots',$cdom,$cnum); |
|
my ($tmp) = keys(%slots); |
|
if ($tmp !~ /^(con_lost|error|no_such_host)/i) { |
|
&Apache::lonnet::do_cache_new('allslots',$hashid,\%slots,600); |
|
return %slots; |
|
} |
|
} |
|
return; |
|
} |
|
|
|
sub devalidate_slots_cache { |
|
my ($cnum,$cdom)=@_; |
|
my $hashid=$cnum.':'.$cdom; |
|
&devalidate_cache_new('allslots',$hashid); |
|
} |
|
|
# ------------------------------------------------- Update symbolic store links |
# ------------------------------------------------- Update symbolic store links |
|
|
sub symblist { |
sub symblist { |