[LON-CAPA-cvs] cvs: loncom /interface slotrequest.pm
raeburn
raeburn at source.lon-capa.org
Tue Dec 20 17:44:27 EST 2011
raeburn Tue Dec 20 22:44:27 2011 EDT
Modified files:
/loncom/interface slotrequest.pm
Log:
- RESERVABLE_LATER status provides appropriate message on manage reservations screen
- devalidate allslots cache when changes made to a slot.
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.111 loncom/interface/slotrequest.pm:1.112
--- loncom/interface/slotrequest.pm:1.111 Sun Dec 18 17:15:03 2011
+++ loncom/interface/slotrequest.pm Tue Dec 20 22:44:27 2011
@@ -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 @@
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 @@
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 @@
} 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 @@
$r->rflush();
$countdone++;
}
+ if ($countdone) {
+ &Apache::lonnet::devalidate_slots_cache($cname,$cdom);
+ }
$r->print('<p>'.&mt('Created [quant,_1,slot]',$countdone)."\n".'</p>');
foreach my $error (@errors) {
$r->print('<p><span class="LC_warning">'.$error.'</span></p>'."\n");
More information about the LON-CAPA-cvs
mailing list