version 1.21, 2005/10/14 19:30:36
|
version 1.25, 2005/10/17 21:21:39
|
Line 470 sub show_table {
|
Line 470 sub show_table {
|
$r->print('<table border="1"> |
$r->print('<table border="1"> |
<tr> |
<tr> |
<th></th> |
<th></th> |
<th>'.$linkstart.'name" >Slot name</a></th> |
<th>'.$linkstart.'name" >Slot name</a></th> |
<th>'.$linkstart.'type" >Type</a></th> |
<th>'.$linkstart.'type" >Type</a></th> |
<th>'.$linkstart.'description">Description</a></th> |
<th>'.$linkstart.'description" >Description</a></th> |
<th>'.$linkstart.'starttime" >Start Time</a></th> |
<th>'.$linkstart.'starttime" >Start Time</a></th> |
<th>'.$linkstart.'endtime" >End Time</a></th> |
<th>'.$linkstart.'endtime" >End Time</a></th> |
<th>'.$linkstart.'maxspace" >Max space</a></th> |
<th>'.$linkstart.'startreserve">Time Students Can Start Reserving</a></th> |
<th> Scheduled Students</th> |
<th>'.$linkstart.'secret" >Secret</a></th> |
<th>'.$linkstart.'unique" >Unique Period</a></th> |
<th>'.$linkstart.'maxspace" >Max space</a></th> |
|
<th> Scheduled Students</th> |
|
<th>'.$linkstart.'unique" >Unique Period</a></th> |
</tr>'); |
</tr>'); |
my %name_cache; |
my %name_cache; |
my $slotsort = sub { |
my $slotsort = sub { |
if ($env{'form.order'}=~/^(type|name|description|endtime|maxspace)$/) { |
if ($env{'form.order'}=~/^(type|description|endtime|maxspace)$/) { |
if (lc($slots{$a}->{$env{'form.order'}}) |
if (lc($slots{$a}->{$env{'form.order'}}) |
ne lc($slots{$b}->{$env{'form.order'}})) { |
ne lc($slots{$b}->{$env{'form.order'}})) { |
return (lc($slots{$a}->{$env{'form.order'}}) |
return (lc($slots{$a}->{$env{'form.order'}}) |
cmp lc($slots{$b}->{$env{'form.order'}})); |
cmp lc($slots{$b}->{$env{'form.order'}})); |
} |
} |
|
} elsif ($env{'form.order'} eq 'name') { |
|
if (lc($a) cmp lc($b)) { |
|
return lc($a) cmp lc($b); |
|
} |
} elsif ($env{'form.order'} eq 'unique') { |
} elsif ($env{'form.order'} eq 'unique') { |
|
|
if ($slots{$a}->{'uniqueperiod'}[0] |
if ($slots{$a}->{'uniqueperiod'}[0] |
Line 515 sub show_table {
|
Line 521 sub show_table {
|
my (undef,$id)=split("\0",$entry); |
my (undef,$id)=split("\0",$entry); |
$ids.= $id.'-> '.$consumed{$entry}->{'name'}.'<br />'; |
$ids.= $id.'-> '.$consumed{$entry}->{'name'}.'<br />'; |
} |
} |
my $start=localtime($slots{$slot}->{'starttime'}); |
my $start=($slots{$slot}->{'starttime'}? |
my $end=localtime($slots{$slot}->{'endtime'}); |
&Apache::lonlocal::locallocaltime($slots{$slot}->{'starttime'}):''); |
|
my $end=($slots{$slot}->{'endtime'}? |
|
&Apache::lonlocal::locallocaltime($slots{$slot}->{'endtime'}):''); |
|
my $start_reserve=($slots{$slot}->{'endtime'}? |
|
&Apache::lonlocal::locallocaltime($slots{$slot}->{'startreserve'}):''); |
|
|
my $unique; |
my $unique; |
if (ref($slots{$slot}{'uniqueperiod'})) { |
if (ref($slots{$slot}{'uniqueperiod'})) { |
$unique=localtime($slots{$slot}{'uniqueperiod'}[0]).','. |
$unique=localtime($slots{$slot}{'uniqueperiod'}[0]).','. |
Line 537 sub show_table {
|
Line 548 sub show_table {
|
my $proctors=join(', ',@proctors); |
my $proctors=join(', ',@proctors); |
|
|
my $edit=(<<EDITFORM); |
my $edit=(<<EDITFORM); |
<form method="POST"> |
<form method="POST" action="/adm/helper/newslot.helper"> |
<input type="hidden" name="command" value="editslot" /> |
<input type="hidden" name="name" value="$slot" /> |
<input type="hidden" name="slot" value="$slot" /> |
|
<input type="submit" name="Edit" value="Edit" /> |
<input type="submit" name="Edit" value="Edit" /> |
</form> |
</form> |
EDITFORM |
EDITFORM |
Line 551 EDITFORM
|
Line 561 EDITFORM
|
<td>$description</td> |
<td>$description</td> |
<td>$start</td> |
<td>$start</td> |
<td>$end</td> |
<td>$end</td> |
|
<td>$start_reserve</td> |
|
<td>$slots{$slot}->{'secret'}</td> |
<td>$slots{$slot}->{'maxspace'}</td> |
<td>$slots{$slot}->{'maxspace'}</td> |
<td>$ids</td> |
<td>$ids</td> |
<td>$unique</td> |
<td>$unique</td> |
</tr> |
</tr> |
<tr> |
<tr> |
<td colspan="8">$proctors</td> |
<td colspan="10">$proctors</td> |
</tr> |
</tr> |
STUFF |
STUFF |
} |
} |
Line 761 sub csv_upload_assign {
|
Line 773 sub csv_upload_assign {
|
if ($entries{$fields{'endtime'}}) { |
if ($entries{$fields{'endtime'}}) { |
$slot{'endtime'}=&UnixDate($entries{$fields{'endtime'}},"%s"); |
$slot{'endtime'}=&UnixDate($entries{$fields{'endtime'}},"%s"); |
} |
} |
|
if ($entries{$fields{'startreserve'}}) { |
|
$slot{'startreserve'}= |
|
&UnixDate($entries{$fields{'startreserve'}},"%s"); |
|
} |
foreach my $key ('ip','proctor','description','maxspace', |
foreach my $key ('ip','proctor','description','maxspace', |
'secret','symb') { |
'secret','symb') { |
if ($entries{$fields{$key}}) { |
if ($entries{$fields{$key}}) { |