Diff for /loncom/interface/slotrequest.pm between versions 1.78 and 1.81

version 1.78, 2007/04/11 16:07:51 version 1.81, 2008/01/14 14:32:30
Line 241  sub make_reservation { Line 241  sub make_reservation {
    $env{'user.domain'},$env{'user.name'});     $env{'user.domain'},$env{'user.name'});
     &Apache::lonxml::debug("value is  $value<br />");      &Apache::lonxml::debug("value is  $value<br />");
   
     my $use_slots = &Apache::lonnet::EXT("resource.0.useslots");      my $use_slots = &Apache::lonnet::EXT("resource.0.useslots",$symb,
    $env{'user.domain'},$env{'user.name'});
     &Apache::lonxml::debug("use_slots is  $use_slots<br />");      &Apache::lonxml::debug("use_slots is  $use_slots<br />");
   
     if (&Apache::lonnet::error($value)       if (&Apache::lonnet::error($value) 
Line 459  sub release_reservation { Line 460  sub release_reservation {
     return (0,&mt('Not allowed to release Reservation: [_1], as it has already ended.',$description));      return (0,&mt('Not allowed to release Reservation: [_1], as it has already ended.',$description));
  }   }
     }      }
   
       # if the reservation symb is for a map get a resource in that map
       # to check slot parameters on
       my $navmap=Apache::lonnavmaps::navmap->new;
       my $passed_resource = $navmap->getBySymb($symb);
       if ($passed_resource->is_map()) {
    my ($a_resource) = 
       $navmap->retrieveResources($passed_resource, 
          sub {$_[0]->is_problem()},0,1);
    $symb = $a_resource->symb();
       }
   
     # get parameter string, check for existance, rebuild string with the slot      # get parameter string, check for existance, rebuild string with the slot
     my @slots = split(/:/,&Apache::lonnet::EXT("resource.0.availablestudent",      my $student = &Apache::lonnet::EXT("resource.0.availablestudent",
        $symb,$udom,$uname));                                         $symb,$udom,$uname);
       my @slots = split(/:/,$student);
   
     my @new_slots;      my @new_slots;
     foreach my $exist_slot (@slots) {      foreach my $exist_slot (@slots) {
Line 482  sub release_reservation { Line 496  sub release_reservation {
  }   }
     }      }
   
     my $use_slots = &Apache::lonnet::EXT("resource.0.useslots");      my $use_slots = &Apache::lonnet::EXT("resource.0.useslots",
    $symb,$udom,$uname);
     &Apache::lonxml::debug("use_slots is  $use_slots<br />");      &Apache::lonxml::debug("use_slots is  $use_slots<br />");
   
     if (&Apache::lonnet::error($use_slots)) {       if (&Apache::lonnet::error($use_slots)) { 
Line 1108  sub show_table { Line 1123  sub show_table {
  my ($id_count,$ids);   my ($id_count,$ids);
           
  if (exists($show{'scheduled'}) || exists($show{'space'}) ) {   if (exists($show{'scheduled'}) || exists($show{'space'}) ) {
     my @this_slot = grep(/^$slot\0/,keys(%consumed));      my $re_str = "$slot\0";
       my @this_slot = grep(/^\Q$re_str\E/,keys(%consumed));
     $id_count = scalar(@this_slot);      $id_count = scalar(@this_slot);
     if (exists($show{'scheduled'})) {      if (exists($show{'scheduled'})) {
  foreach my $entry (sort { $consumed{$a}{name} cmp    foreach my $entry (sort { $consumed{$a}{name} cmp 
       $consumed{$b}{name} }        $consumed{$b}{name} }
    (keys(%consumed))) {     (@this_slot)) {
     my (undef,$id)=split("\0",$entry);      my (undef,$id)=split("\0",$entry);
     my ($uname,$udom) = split(':',$consumed{$entry}{'name'});      my ($uname,$udom) = split(':',$consumed{$entry}{'name'});
     $ids.= '<nobr>';      $ids.= '<nobr>';

Removed from v.1.78  
changed lines
  Added in v.1.81


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>