--- loncom/interface/slotrequest.pm 2006/02/03 18:22:44 1.40 +++ loncom/interface/slotrequest.pm 2006/02/03 18:53:08 1.42 @@ -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.40 2006/02/03 18:22:44 albertel Exp $ +# $Id: slotrequest.pm,v 1.42 2006/02/03 18:53:08 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -47,8 +47,7 @@ sub fail { $r->print('

'.&mt('Failed.').'

'); } - $r->print('

'. - &mt('Return to last resource').'

'); + &return_link($r); &end_page($r); } @@ -126,6 +125,10 @@ sub check_for_reservation { my ($cnum,$cdom)=&get_course(); my %slots=&Apache::lonnet::get('slots', [@slots], $cdom, $cnum); + if (&network_error($student) || &network_error($course) || + &network_error(%slots)) { + return 'error: Unable to determine current status'; + } foreach my $slot_name (@slots) { next if (!defined($slots{$slot_name}) || !ref($slots{$slot_name})); @@ -150,9 +153,9 @@ sub check_for_conflict { my @slots = (split(/:/,$student), split(/:/, $course)); my ($cnum,$cdom)=&get_course(); my %slots=&Apache::lonnet::get('slots', [@slots], $cdom, $cnum); - my ($tmp) = %slots; + if (&network_error($student) || &network_error($course) || - &network_error($tmp)) { + &network_error(%slots)) { return 'error: Unable to determine current status'; } foreach my $slot_name (@slots) { @@ -304,8 +307,7 @@ sub release_slot { if ($mgr ne 'F') { if ($slot{$slot_name}{'starttime'} < time) { $r->print("

Not allowed to release Reservation: $description, as it has already ended.

"); - $r->print('

'. - &mt('Return to last resource').'

'); + &return_link($r); return 0; } } @@ -341,10 +343,7 @@ sub release_slot { $r->print('

'. &mt('Return to slot list').'

'); } - if (!$inhibit_return_link) { - $r->print('

'. - &mt('Return to last resource').'

'); - } + if (!$inhibit_return_link) { &return_link($r); } return 1; } @@ -378,8 +377,7 @@ sub delete_slot { } $r->print('

'. &mt('Return to slot list').'

'); - $r->print('

'. - &mt('Return to last resource').'

'); + &return_link($r); } sub return_link { @@ -468,8 +466,8 @@ or

or STUFF - $r->print('

'. - &mt('Return to last resource').'

'); + + &return_link($r); return; }