version 1.7, 2005/08/09 15:38:13
|
version 1.8, 2005/08/15 19:54:26
|
Line 38 use Apache::lonnet;
|
Line 38 use Apache::lonnet;
|
sub fail { |
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>'.$env{'form.symb'}); |
$r->print('<p>'.&mt('Unable to understand what resource you wanted to sign up for.').'</p>'); |
|
|
|
} elsif ($code eq 'not_allowed') { |
|
$r->print('<p>'.&mt('Not allowed to sign up or change reservations at this time.').'</p>'); |
|
} else { |
|
$r->print('<p>'.&mt('Failed.').'</p>'); |
} |
} |
|
|
$r->print('<p><a href="/adm/flip?postdata=return:">'. |
$r->print('<p><a href="/adm/flip?postdata=return:">'. |
&mt('Return to last resource').'</a></p>'); |
&mt('Return to last resource').'</a></p>'); |
&end_page($r); |
&end_page($r); |
Line 486 STUFF
|
Line 491 STUFF
|
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
|
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); |
&start_page($r); |
&start_page($r); |
my $symb=&Apache::lonnet::unescape($env{'form.symb'}); |
my $symb=&Apache::lonnet::unescape($env{'form.symb'}); |
my (undef,undef,$res)=&Apache::lonnet::decode_symb($symb); |
my (undef,undef,$res)=&Apache::lonnet::decode_symb($symb); |
Line 493 sub handler {
|
Line 499 sub handler {
|
&fail($r,'not_valid'); |
&fail($r,'not_valid'); |
return OK; |
return OK; |
} |
} |
|
$env{'request.symb'}=$symb; |
if ($env{'form.command'} eq 'showslots') { |
my ($status) = &Apache::lonhomework::check_task_access('0'); |
|
if ($status eq 'CAN_ANSWER' || |
|
$status eq 'NEEDS_CHECKIN' || |
|
$status eq 'WAITING_FOR_GRADE') { |
|
&fail($r,'not_allowed'); |
|
return OK; |
|
} |
|
my $vgr=&Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
|
if ($env{'form.command'} eq 'showslots' && $vgr eq 'F') { |
&show_table($r,$symb); |
&show_table($r,$symb); |
} elsif ($env{'form.requestattempt'}) { |
} elsif ($env{'form.requestattempt'}) { |
&show_choices($r,$symb); |
&show_choices($r,$symb); |
Line 505 sub handler {
|
Line 519 sub handler {
|
} elsif ($env{'form.command'} eq 'change') { |
} elsif ($env{'form.command'} eq 'change') { |
&release_slot($r,$symb,$env{'form.releaseslot'},1); |
&release_slot($r,$symb,$env{'form.releaseslot'},1); |
&get_slot($r,$symb); |
&get_slot($r,$symb); |
|
} else { |
|
$r->print("<p>Unknown command: ".$env{'form.command'}."</p>"); |
} |
} |
|
$r->print('<p>1'.$symb.'</p>'); |
|
$r->print('<p>2'.&Apache::lonnet::symbread().'</p>'); |
|
$r->print(&check_for_reservation($symb)); |
|
$r->print( &Apache::lonhomework::check_task_access('0')); |
&end_page($r); |
&end_page($r); |
return OK; |
return OK; |
} |
} |