--- loncom/interface/slotrequest.pm 2007/04/10 23:30:41 1.76 +++ loncom/interface/slotrequest.pm 2007/04/11 21:49:02 1.79 @@ -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.76 2007/04/10 23:30:41 albertel Exp $ +# $Id: slotrequest.pm,v 1.79 2007/04/11 21:49:02 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -334,7 +334,7 @@ sub remove_registration { my %consumed=&Apache::lonnet::dump('slot_reservations',$cdom,$cnum, "^$slot_name\0"); if (&Apache::lonnet::error(%consumed)) { - $r->print("

".&mt('A network error has occured.').'

'); + $r->print("

".&mt('A network error has occured.').'

'); return; } if (!%consumed) { @@ -527,7 +527,7 @@ sub delete_slot { if ($ret eq 'ok') { $r->print("

Slot $slot_name marked as deleted.

"); } else { - $r->print("

An error ($ret) occurse when attempting to delete Slot $slot_name.

"); + $r->print("

An error ($ret) occurse when attempting to delete Slot $slot_name.

"); } } else { if (%consumed) { @@ -554,7 +554,7 @@ sub get_slot { my $slot_name=&check_for_conflict($symb,$env{'form.slotname'},\%slot); if ($slot_name =~ /^error: (.*)/) { - $r->print("

An error occured while attempting to make a reservation. ($1)

"); + $r->print("

An error occured while attempting to make a reservation. ($1)

"); &return_link($r); return 0; } @@ -595,7 +595,7 @@ STUFF if (defined($reserved)) { my $retvalue = 0; if ($slot_name =~ /^error: (.*)/) { - $r->print("

An error occured while attempting to make a reservation. ($1)

"); + $r->print("

An error occured while attempting to make a reservation. ($1)

"); } elsif ($reserved > -1) { $r->print("

Success: $description

"); $retvalue = 1; @@ -616,7 +616,7 @@ STUFF } $r->print(< Failed to reserve a spot for $description.

+

Failed to reserve a spot for $description.

@@ -646,7 +646,6 @@ sub allowed_slot { #already started if ($slot->{'starttime'} < time) { - # all open slot to be schedulable return 0; } &Apache::lonxml::debug("$slot_name starttime good"); @@ -1109,12 +1108,13 @@ sub show_table { my ($id_count,$ids); 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); if (exists($show{'scheduled'})) { foreach my $entry (sort { $consumed{$a}{name} cmp $consumed{$b}{name} } - (keys(%consumed))) { + (@this_slot)) { my (undef,$id)=split("\0",$entry); my ($uname,$udom) = split(':',$consumed{$entry}{'name'}); $ids.= ''; @@ -1548,7 +1548,7 @@ sub csv_upload_assign { } $r->print("

Created $countdone slots\n

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

$error\n

"); + $r->print("

$error

\n"); } &show_table($r,$mgr); return '';