--- loncom/interface/slotrequest.pm 2005/09/12 20:27:25 1.14 +++ loncom/interface/slotrequest.pm 2012/08/23 14:17:13 1.115 @@ -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.14 2005/09/12 20:27:25 albertel Exp $ +# $Id: slotrequest.pm,v 1.115 2012/08/23 14:17:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,36 +34,39 @@ use Apache::Constants qw(:common :http : use Apache::loncommon(); use Apache::lonlocal; use Apache::lonnet; +use Apache::lonnavmaps(); use Date::Manip; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; sub fail { my ($r,$code)=@_; if ($code eq 'not_valid') { $r->print('
'.&mt('Unable to understand what resource you wanted to sign up for.').'
'); - + } elsif ($code eq 'not_available') { + $r->print(''.&mt('No slots are available.').'
'); } elsif ($code eq 'not_allowed') { $r->print(''.&mt('Not allowed to sign up or change reservations at this time.').'
'); } else { $r->print(''.&mt('Failed.').'
'); } - $r->print(''. - &mt('Return to last resource').'
'); + &return_link($r); &end_page($r); } sub start_page { - my ($r)=@_; - my $html=&Apache::lonxml::xmlbegin(); - $r->print($html.''.$env{'form.command'}.'
'); + my ($r,$title,$brcrum)=@_; + my $args; + if (ref($brcrum) eq 'ARRAY') { + $args = {bread_crumbs => $brcrum}; + } + $r->print(&Apache::loncommon::start_page($title,undef,$args)); } sub end_page { my ($r)=@_; - $r->print(&Apache::loncommon::endbodytag().'