version 1.19, 2005/10/07 19:44:06
|
version 1.21, 2005/10/14 19:30:36
|
Line 466 sub show_table {
|
Line 466 sub show_table {
|
<input type="submit" name="start" value="'.&mt('Upload Slot List').'" /> |
<input type="submit" name="start" value="'.&mt('Upload Slot List').'" /> |
</form>'); |
</form>'); |
} |
} |
|
my $linkstart='<a href="/adm/slotrequest?command=showslots&order='; |
$r->print('<table border="1"> |
$r->print('<table border="1"> |
<tr> |
<tr> |
<th></th> |
<th></th> |
<th>Slot name</th> |
<th>'.$linkstart.'name" >Slot name</a></th> |
<th>Type</th> |
<th>'.$linkstart.'type" >Type</a></th> |
<th>Description</th> |
<th>'.$linkstart.'description">Description</a></th> |
<th>Start Time</th> |
<th>'.$linkstart.'starttime" >Start Time</a></th> |
<th>End Time</th> |
<th>'.$linkstart.'endtime" >End Time</a></th> |
<th>Max space</th> |
<th>'.$linkstart.'maxspace" >Max space</a></th> |
<th>Scheduled Students</th> |
<th> Scheduled Students</th> |
<th>Proctors</th> |
<th>'.$linkstart.'unique" >Unique Period</a></th> |
<th>Unique Period</th> |
|
</tr>'); |
</tr>'); |
foreach my $slot (sort |
my %name_cache; |
{ return $slots{$a}->{'starttime'} <=> $slots{$b}->{'starttime'} } |
my $slotsort = sub { |
(keys(%slots))) { |
if ($env{'form.order'}=~/^(type|name|description|endtime|maxspace)$/) { |
|
if (lc($slots{$a}->{$env{'form.order'}}) |
|
ne lc($slots{$b}->{$env{'form.order'}})) { |
|
return (lc($slots{$a}->{$env{'form.order'}}) |
|
cmp lc($slots{$b}->{$env{'form.order'}})); |
|
} |
|
} elsif ($env{'form.order'} eq 'unique') { |
|
|
|
if ($slots{$a}->{'uniqueperiod'}[0] |
|
ne $slots{$b}->{'uniqueperiod'}[0]) { |
|
return ($slots{$a}->{'uniqueperiod'}[0] |
|
cmp $slots{$b}->{'uniqueperiod'}[0]); |
|
} |
|
if ($slots{$a}->{'uniqueperiod'}[1] |
|
ne $slots{$b}->{'uniqueperiod'}[1]) { |
|
return ($slots{$a}->{'uniqueperiod'}[1] |
|
cmp $slots{$b}->{'uniqueperiod'}[1]); |
|
} |
|
} |
|
return $slots{$a}->{'starttime'} <=> $slots{$b}->{'starttime'}; |
|
}; |
|
foreach my $slot (sort $slotsort (keys(%slots))) { |
if (defined($slots{$slot}->{'type'}) |
if (defined($slots{$slot}->{'type'}) |
&& $slots{$slot}->{'type'} ne 'schedulable_student') { |
&& $slots{$slot}->{'type'} ne 'schedulable_student') { |
#next; |
#next; |
Line 501 sub show_table {
|
Line 522 sub show_table {
|
$unique=localtime($slots{$slot}{'uniqueperiod'}[0]).','. |
$unique=localtime($slots{$slot}{'uniqueperiod'}[0]).','. |
localtime($slots{$slot}{'uniqueperiod'}[1]); |
localtime($slots{$slot}{'uniqueperiod'}[1]); |
} |
} |
|
my @proctors = map { |
|
my ($uname,$udom)=split(/@/,$_); |
|
my $fullname=$name_cache{$_}; |
|
if (!defined($fullname)) { |
|
&Apache::lonnet::logthis("Gettign $uname $udom"); |
|
$fullname = &Apache::loncommon::plainname($uname,$udom); |
|
$fullname =~s/\s/ /g; |
|
$name_cache{$_} = $fullname; |
|
} |
|
&Apache::loncommon::aboutmewrapper($fullname,$uname,$udom); |
|
} (split(/\s*,\s*/,$slots{$slot}->{'proctor'})); |
|
|
|
my $proctors=join(', ',@proctors); |
|
|
my $edit=(<<EDITFORM); |
my $edit=(<<EDITFORM); |
<form method="POST"> |
<form method="POST"> |
Line 511 sub show_table {
|
Line 545 sub show_table {
|
EDITFORM |
EDITFORM |
$r->print(<<STUFF); |
$r->print(<<STUFF); |
<tr> |
<tr> |
<td>$edit</td> |
<td rowspan="2">$edit</td> |
<td>$slot</td> |
<td>$slot</td> |
<td>$slots{$slot}->{'type'}</td> |
<td>$slots{$slot}->{'type'}</td> |
<td>$description</td> |
<td>$description</td> |
Line 519 EDITFORM
|
Line 553 EDITFORM
|
<td>$end</td> |
<td>$end</td> |
<td>$slots{$slot}->{'maxspace'}</td> |
<td>$slots{$slot}->{'maxspace'}</td> |
<td>$ids</td> |
<td>$ids</td> |
<td>$slots{$slot}->{'proctor'}</td> |
|
<td>$unique</td> |
<td>$unique</td> |
</tr> |
</tr> |
|
<tr> |
|
<td colspan="8">$proctors</td> |
|
</tr> |
STUFF |
STUFF |
} |
} |
$r->print('</table>'); |
$r->print('</table>'); |