--- loncom/interface/slotrequest.pm 2011/12/18 17:15:03 1.111 +++ loncom/interface/slotrequest.pm 2011/12/20 22:44:27 1.112 @@ -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.111 2011/12/18 17:15:03 raeburn Exp $ +# $Id: slotrequest.pm,v 1.112 2011/12/20 22:44:27 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -137,7 +137,7 @@ sub check_for_reservation { return 'error: Unable to determine current status'; } my @got; - my @sorted_slots = &Apache::loncommon::sorted_slots(\@slots,\%slots); + my @sorted_slots = &Apache::loncommon::sorted_slots(\@slots,\%slots,'starttime'); foreach my $slot_name (@sorted_slots) { next if (!defined($slots{$slot_name}) || !ref($slots{$slot_name})); @@ -842,7 +842,7 @@ sub show_choices { my ($r,$symb,$formname)=@_; my ($cnum,$cdom)=&get_course(); - my %slots=&Apache::lonnet::dump('slots',$cdom,$cnum); + my %slots = &Apache::lonnet::get_course_slots($cnum,$cdom); my $consumed_uniqueperiods = &get_consumed_uniqueperiods(\%slots); if (ref($consumed_uniqueperiods) eq 'HASH') { if (&Apache::lonnet::error(%$consumed_uniqueperiods)) { @@ -1566,6 +1566,8 @@ sub manage_reservations { } elsif ($slot_status == $resource->RESERVABLE) { $msg=&mt('Reservation needed'); $get_choices = 1; + } elsif ($slot_status == $resource->RESERVABLE_LATER) { + $msg=&mt('Reservation needed: will be reservable later.'); } elsif ($slot_status == $resource->NOTRESERVABLE) { $msg=&mt('Reservation needed: none available.'); } elsif ($slot_status == $resource->UNKNOWN) { @@ -2494,6 +2496,9 @@ sub csv_upload_assign { $r->rflush(); $countdone++; } + if ($countdone) { + &Apache::lonnet::devalidate_slots_cache($cname,$cdom); + } $r->print('

'.&mt('Created [quant,_1,slot]',$countdone)."\n".'

'); foreach my $error (@errors) { $r->print('

'.$error.'

'."\n");