version 1.60, 2006/05/12 01:20:31
|
version 1.61, 2006/05/12 05:12:27
|
Line 41 sub fail {
|
Line 41 sub fail {
|
my ($r,$code)=@_; |
my ($r,$code)=@_; |
if ($code eq 'not_valid') { |
if ($code eq 'not_valid') { |
$r->print('<p>'.&mt('Unable to understand what resource you wanted to sign up for.').'</p>'); |
$r->print('<p>'.&mt('Unable to understand what resource you wanted to sign up for.').'</p>'); |
|
} elsif ($code eq 'not_available') { |
|
$r->print('<p>'.&mt('No slots are available.').'</p>'); |
} elsif ($code eq 'not_allowed') { |
} elsif ($code eq 'not_allowed') { |
$r->print('<p>'.&mt('Not allowed to sign up or change reservations at this time.').'</p>'); |
$r->print('<p>'.&mt('Not allowed to sign up or change reservations at this time.').'</p>'); |
} else { |
} else { |
Line 1550 sub handler {
|
Line 1551 sub handler {
|
} |
} |
} else { |
} else { |
my $symb=&Apache::lonnet::unescape($env{'form.symb'}); |
my $symb=&Apache::lonnet::unescape($env{'form.symb'}); |
|
if (!defined($symb)) { |
|
&fail($r,'not_valid'); |
|
return OK; |
|
} |
my (undef,undef,$res)=&Apache::lonnet::decode_symb($symb); |
my (undef,undef,$res)=&Apache::lonnet::decode_symb($symb); |
my $useslots = &Apache::lonnet::EXT("resource.0.useslots",$symb); |
my $useslots = &Apache::lonnet::EXT("resource.0.useslots",$symb); |
if ($useslots ne 'resource' && $useslots ne 'map') { |
if ($useslots ne 'resource' && $useslots ne 'map') { |
&fail($r,'not_valid'); |
&fail($r,'not_available'); |
return OK; |
return OK; |
} |
} |
$env{'request.symb'}=$symb; |
$env{'request.symb'}=$symb; |