--- loncom/interface/slotrequest.pm 2005/10/14 19:30:36 1.21
+++ loncom/interface/slotrequest.pm 2005/10/26 23:37:51 1.26
@@ -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.21 2005/10/14 19:30:36 albertel Exp $
+# $Id: slotrequest.pm,v 1.26 2005/10/26 23:37:51 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -34,7 +34,7 @@ use Apache::Constants qw(:common :http :
use Apache::loncommon();
use Apache::lonlocal;
use Apache::lonnet;
-use Date::Manip;
+# use Date::Manip;
sub fail {
my ($r,$code)=@_;
@@ -470,23 +470,29 @@ sub show_table {
$r->print('
-
'.$linkstart.'name" >Slot name
-
'.$linkstart.'type" >Type
-
'.$linkstart.'description">Description
-
'.$linkstart.'starttime" >Start Time
-
'.$linkstart.'endtime" >End Time
-
'.$linkstart.'maxspace" >Max space
-
Scheduled Students
-
'.$linkstart.'unique" >Unique Period
+
'.$linkstart.'name" >Slot name
+
'.$linkstart.'type" >Type
+
'.$linkstart.'description" >Description
+
'.$linkstart.'starttime" >Start Time
+
'.$linkstart.'endtime" >End Time
+
'.$linkstart.'startreserve">Time Students Can Start Reserving
+
'.$linkstart.'secret" >Secret
+
'.$linkstart.'maxspace" >Max space
+
Scheduled Students
+
'.$linkstart.'unique" >Unique Period
');
my %name_cache;
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'}})
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 'name') {
+ if (lc($a) cmp lc($b)) {
+ return lc($a) cmp lc($b);
+ }
} elsif ($env{'form.order'} eq 'unique') {
if ($slots{$a}->{'uniqueperiod'}[0]
@@ -515,8 +521,13 @@ sub show_table {
my (undef,$id)=split("\0",$entry);
$ids.= $id.'-> '.$consumed{$entry}->{'name'}.' ';
}
- my $start=localtime($slots{$slot}->{'starttime'});
- my $end=localtime($slots{$slot}->{'endtime'});
+ my $start=($slots{$slot}->{'starttime'}?
+ &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;
if (ref($slots{$slot}{'uniqueperiod'})) {
$unique=localtime($slots{$slot}{'uniqueperiod'}[0]).','.
@@ -537,9 +548,8 @@ sub show_table {
my $proctors=join(', ',@proctors);
my $edit=(<
-
-
+
EDITFORM
@@ -551,12 +561,14 @@ EDITFORM
$description
$start
$end
+
$start_reserve
+
$slots{$slot}->{'secret'}
$slots{$slot}->{'maxspace'}
$ids
$unique
-
$proctors
+
$proctors
STUFF
}
@@ -761,6 +773,10 @@ sub csv_upload_assign {
if ($entries{$fields{'endtime'}}) {
$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',
'secret','symb') {
if ($entries{$fields{$key}}) {