--- loncom/interface/slotrequest.pm 2006/02/09 17:59:57 1.46 +++ loncom/interface/slotrequest.pm 2006/02/09 18:04:51 1.47 @@ -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.46 2006/02/09 17:59:57 albertel Exp $ +# $Id: slotrequest.pm,v 1.47 2006/02/09 18:04:51 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -714,10 +714,11 @@ sub show_table { 'ip' => 'IP or DNS restrictions', 'symb' => 'Resource slot is restricted to.', 'uniqueperiod' => 'Period of time slot is unique', + 'scheduled' => 'Scheduled Students', 'proctor' => 'List of proctors'); my @show_order=('name','description','type','starttime','endtime', 'startreserve','secret','maxspace','ip','symb', - 'uniqueperiod','proctor'); + 'uniqueperiod','scheduled','proctor'); my @show = (exists($env{'form.show'})) ? &Apache::loncommon::get_env_multiple('form.show') : keys(%show_fields); @@ -793,7 +794,6 @@ sub show_table { $r->print(''.$linkstart.$which.'">'.$show_fields{$which}.''); } } - $r->print('Scheduled Students'); my %name_cache; my $slotsort = sub { @@ -829,27 +829,28 @@ sub show_table { #next; } my $description=&get_description($slot,$slots{$slot}); - my %consumed=&Apache::lonnet::dump('slot_reservations',$cdom,$cnum, - "^$slot\0"); my $ids; - - my ($tmp)=%consumed; - if ($tmp !~ /^error: /) { - foreach my $entry (sort(keys(%consumed))) { - my (undef,$id)=split("\0",$entry); - my ($uname,$udom) = split('@',$consumed{$entry}{'name'}); - $ids.= ''; - foreach my $item (@stu_display_order) { - if ($stu_display{$item}) { - if ($item eq 'fullname') { - $ids.=$fullname->{"$uname:$udom"}.' '; - } elsif ($item eq 'username') { - $ids.="$uname\@$udom "; + if (exists($show{'scheduled'})) { + my %consumed=&Apache::lonnet::dump('slot_reservations',$cdom,$cnum, + "^$slot\0"); + my ($tmp)=%consumed; + if ($tmp !~ /^error: /) { + foreach my $entry (sort(keys(%consumed))) { + my (undef,$id)=split("\0",$entry); + my ($uname,$udom) = split('@',$consumed{$entry}{'name'}); + $ids.= ''; + foreach my $item (@stu_display_order) { + if ($stu_display{$item}) { + if ($item eq 'fullname') { + $ids.=$fullname->{"$uname:$udom"}.' '; + } elsif ($item eq 'username') { + $ids.="$uname\@$udom "; + } } } + $ids.=&remove_link($slot,$entry,$uname,$udom, + $consumed{$entry}{'symb'}).'
'; } - $ids.=&remove_link($slot,$entry,$uname,$udom, - $consumed{$entry}{'symb'}).'
'; } } @@ -937,7 +938,9 @@ DELETELINK if (exists($show{'uniqueperiod'})) { $colspan++;$r->print("$unique\n"); } - $colspan++;$r->print("$ids\n\n"); + if (exists($show{'scheduled'})) { + $colspan++;$r->print("$ids\n\n"); + } if (exists($show{'proctor'})) { $r->print(<