--- loncom/html/adm/helper/newslot.helper 2010/10/31 15:32:15 1.27 +++ loncom/html/adm/helper/newslot.helper 2018/06/27 14:35:09 1.30.4.1 @@ -112,6 +112,20 @@ +

Time students can no longer reserve:
    + + + + return &{$helper->{DATA}{origslot}}('endreserve','anytime'); + + + if (defined($val) && $val > $helper->{'VARS'}{'starttime'}) { + return 'Reservation end time must come before the slot has started.'; + } + return undef; + + +

Maximum number of students allowed in this slot:
    @@ -168,12 +182,36 @@ $helper->{'VARS'}{'type'} eq 'preassigned' delete($helper->{'VARS'}{'startreserve'}); + delete($helper->{'VARS'}{'endreserve'}); delete($helper->{'VARS'}{'maxspace'}); - delete($helper->{'VARS'}{'startunique'}); - delete($helper->{'VARS'}{'endunique'}); + +

Period of time when this slot can only be uniquely assigned:
   Start: + + + + my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime'); + if ($default eq 'anytime') { return 'anytime' }; + if (ref($default)) { return $default->[0]; } + return 'anytime'; + + +
   End:
+ + + my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime'); + if ($default eq 'anytime') { return 'anytime' }; + if (ref($default)) { return $default->[1]; } + return 'anytime'; + + + if (defined($val) && $val < $helper->{'VARS'}{'startunique'}) { + return 'End time must be later than the start time.'; + } + return undef; + + -

Proctored access: @@ -299,7 +337,7 @@ - + Created Slot @@ -330,6 +368,10 @@ $slot{'startreserve'} = $helper->{'VARS'}{'startreserve'}; } + if ( $helper->{'VARS'}{'endreserve'} > 0) { + $slot{'endreserve'} = $helper->{'VARS'}{'endreserve'}; + } + if ( $helper->{'VARS'}{'startunique'} > 0 && $helper->{'VARS'}{'endunique'} > 0 ) { $slot{'uniqueperiod'} = [$helper->{'VARS'}{'startunique'}, @@ -377,6 +419,9 @@ my $ret = &Apache::lonnet::cput('slots', {$helper->{'VARS'}{'name'} => \%slot}, $cdom,$cname); + if ($ret eq 'ok') { + &Apache::lonnet::devalidate_slots_cache($cname,$cdom); + } $result.="\n ".'Name: '.&HTML::Entities::encode($helper->{'VARS'}{'name'}).''. "\n".'

  • Starts: '.&Apache::lonlocal::locallocaltime($slot{'starttime'}).'
  • '. "\n".'
  • Ends: '.&Apache::lonlocal::locallocaltime($slot{'endtime'}).'
  • '. @@ -395,6 +440,11 @@ &Apache::lonlocal::locallocaltime($slot{'startreserve'}).''; } + if (exists($slot{'endreserve'})) { + $result.="\n".'
  • '.$labels{'endreserve'}.': '. + &Apache::lonlocal::locallocaltime($slot{'endreserve'}).'
  • '; + } + if (exists($slot{'reservationmsg'})) { my %options = &Apache::slotrequest::slot_reservationmsg_options(); $result.="\n".'
  • '.$labels{'reservationmsg'}.': '.