--- loncom/interface/slotrequest.pm 2006/05/18 20:53:24 1.62 +++ loncom/interface/slotrequest.pm 2006/06/16 19:49:00 1.64 @@ -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.62 2006/05/18 20:53:24 albertel Exp $ +# $Id: slotrequest.pm,v 1.64 2006/06/16 19:49:00 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,8 @@ 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)=@_; @@ -383,13 +385,13 @@ sub remove_registration_confirmation { 'no' => 'No',); $r->print(<<"END_CONFIRM");

$msg

-
+ $hidden_input
-
+
@@ -569,7 +571,7 @@ sub get_slot { $r->print("

Already have a reservation: $description1

"); if ($slot_name ne $env{'form.slotname'}) { $r->print(< +
@@ -614,7 +616,7 @@ STUFF $r->print(< Failed to reserve a spot for $description.

- + @@ -624,7 +626,7 @@ STUFF

or - +

@@ -763,9 +765,9 @@ sub show_choices { $command='get'; } } - my $escsymb=&Apache::lonnet::escape($symb); + my $escsymb=&escape($symb); $form=< +
@@ -862,14 +864,14 @@ sub remove_link { undef($udom); } - $slotname = &Apache::lonnet::escape($slotname); - $entry = &Apache::lonnet::escape($entry); - $uname = &Apache::lonnet::escape($uname); - $udom = &Apache::lonnet::escape($udom); - $symb = &Apache::lonnet::escape($symb); + $slotname = &escape($slotname); + $entry = &escape($entry); + $uname = &escape($uname); + $udom = &escape($udom); + $symb = &escape($symb); return <<"END_LINK"; - ($remove) END_LINK @@ -886,11 +888,11 @@ sub show_table { my $available; if ($mgr eq 'F') { $r->print('
'); - $r->print(' + $r->print(' '); - $r->print('
+ $r->print('
'); $r->print('
'); @@ -977,13 +979,16 @@ sub show_table { my $name_filter = {'type' => $name_filter_type, 'value' => $env{'form.name_filter_value'},}; + #deleted slot filtering + #default to hide if no value + $env{'form.deleted'} ||= 'hide'; my $hide_radio = &Apache::lonhtmlcommon::radio('deleted',$env{'form.deleted'},'hide'); my $show_radio = &Apache::lonhtmlcommon::radio('deleted',$env{'form.deleted'},'show'); - $r->print('
+ $r->print(' '); $r->print('
'); $r->print(' @@ -1106,7 +1111,7 @@ sub show_table { my $unique; if (ref($slots{$slot}{'uniqueperiod'})) { - $unique=localtime($slots{$slot}{'uniqueperiod'}[0]).','. + $unique=localtime($slots{$slot}{'uniqueperiod'}[0]).', '. localtime($slots{$slot}{'uniqueperiod'}[1]); } @@ -1164,7 +1169,7 @@ sub show_table { EDITLINK my $delete=(<<"DELETELINK"); -Delete +Delete DELETELINK my $remove_all=&remove_link($slot,'remove all').'
'; @@ -1212,9 +1217,13 @@ DELETELINK if (exists($show{'allowedusers'})) { $colspan++;$r->print("\n"); } + if (exists($show{'uniqueperiod'})) { + $colspan++;$r->print("\n"); + } if (exists($show{'scheduled'})) { - $colspan++;$r->print("\n\n"); + $colspan++;$r->print("\n"); } + $r->print("\n"); if (exists($show{'proctor'})) { $r->print(< @@ -1223,7 +1232,7 @@ DELETELINK STUFF } } - $r->print('
$allowedusers$unique$remove_all $ids
$remove_all $ids
'); + $r->print(''); } sub upload_start { @@ -1550,7 +1559,7 @@ sub handler { &csv_upload_map($r); } } else { - my $symb=&Apache::lonnet::unescape($env{'form.symb'}); + my $symb=&unescape($env{'form.symb'}); if (!defined($symb)) { &fail($r,'not_valid'); return OK;