--- loncom/interface/slotrequest.pm 2005/10/27 15:11:03 1.27
+++ loncom/interface/slotrequest.pm 2005/11/08 03:13:20 1.29
@@ -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.27 2005/10/27 15:11:03 albertel Exp $
+# $Id: slotrequest.pm,v 1.29 2005/11/08 03:13:20 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -53,11 +53,10 @@ sub fail {
}
sub start_page {
- my ($r)=@_;
+ my ($r,$title)=@_;
my $html=&Apache::lonxml::xmlbegin();
- $r->print($html.'
'.
- &mt('Request another Worktime').'');
- $r->print(&Apache::loncommon::bodytag('Requesting another Worktime'));
+ $r->print($html.''.&mt($title).'');
+ $r->print(&Apache::loncommon::bodytag($title));
}
sub end_page {
@@ -465,25 +464,56 @@ sub show_table {
');
+ $r->print('');
}
+
+ my %Saveable_Parameters = ('show' => 'array');
+
+ &Apache::loncommon::store_course_settings('chart',\%Saveable_Parameters);
+ &Apache::loncommon::restore_course_settings('chart',\%Saveable_Parameters);
+
+ my %fields=&Apache::lonlocal::texthash(
+ 'name' => 'Slot Name',
+ 'description' => 'Description',
+ 'type' => 'Type',
+ 'starttime' => 'Start time',
+ 'endtime' => 'End Time',
+ 'startreserve' => 'Time students can start reserving',
+ 'secret' => 'Secret Word',
+ 'maxspace' => 'Maxium # of students',
+ 'ip' => 'IP or DNS restrictions',
+ 'symb' => 'Resource slot is restricted to.',
+ 'uniqueperiod' => 'Period of time slot is unique',
+ 'proctor' => 'List of proctors');
+ my @order=('name','description','type','starttime','endtime',
+ 'startreserve','secret','maxspace','ip','symb',
+ 'uniqueperiod','proctor');
+ my @sel =
+ (exists($env{'form.show'})) ? &Apache::loncommon::get_env_multiple('form.show')
+ : keys(%fields);
+ my %sel = map { $_ => 1 } (@sel);
+
+ $r->print('
EDITFORM
- $r->print(<
-
$edit
-
$slot
-
$slots{$slot}->{'type'}
-
$description
-
$start
-
$end
-
$start_reserve
-
$slots{$slot}->{'secret'}
-
$slots{$slot}->{'maxspace'}
-
$ids
-
$unique
-
+
+ $r->print("
\n
$edit
\n");
+ if (exists($sel{'name'})) {
+ $colspan++;$r->print("
$slot
");
+ }
+ if (exists($sel{'type'})) {
+ $colspan++;$r->print("
$slots{$slot}->{'type'}
\n");
+ }
+ if (exists($sel{'description'})) {
+ $colspan++;$r->print("
$description
\n");
+ }
+ if (exists($sel{'starttime'})) {
+ $colspan++;$r->print("
$start
\n");
+ }
+ if (exists($sel{'endtime'})) {
+ $colspan++;$r->print("
$end
\n");
+ }
+ if (exists($sel{'startreserve'})) {
+ $colspan++;$r->print("
$start_reserve
\n");
+ }
+ if (exists($sel{'secret'})) {
+ $colspan++;$r->print("
$slots{$slot}{'secret'}
\n");
+ }
+ if (exists($sel{'maxspace'})) {
+ $colspan++;$r->print("
$slots{$slot}{'maxspace'}
\n");
+ }
+ if (exists($sel{'ip'})) {
+ $colspan++;$r->print("
$slots{$slot}{'ip'}
\n");
+ }
+ if (exists($sel{'symb'})) {
+ $colspan++;$r->print("
$title
\n");
+ }
+ if (exists($sel{'uniqueperiod'})) {
+ $colspan++;$r->print("
$unique
\n");
+ }
+ $colspan++;$r->print("
$ids
\n
\n");
+ if (exists($sel{'proctor'})) {
+ $r->print(<
-
$proctors
+
$proctors
STUFF
+ }
}
$r->print('');
}
@@ -805,9 +873,15 @@ sub handler {
my $r=shift;
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
- &start_page($r);
+
my $vgr=&Apache::lonnet::allowed('vgr',$env{'request.course.id'});
my $mgr=&Apache::lonnet::allowed('mgr',$env{'request.course.id'});
+ my $title='Requesting Another Worktime';
+ if ($env{'form.command'} =~ /^(showslots|uploadstart|csvuploadmap|csvuploadassign)$/ && $vgr eq 'F') {
+ $title = 'Managing Slots';
+ }
+ &start_page($r,$title);
+
if ($env{'form.command'} eq 'showslots' && $vgr eq 'F') {
&show_table($r,$mgr);
} elsif ($env{'form.command'} eq 'uploadstart' && $mgr eq 'F') {
@@ -825,8 +899,6 @@ sub handler {
}
&csv_upload_map($r);
}
- } elsif ($env{'form.command'} eq 'editslot' && $mgr eq 'F') {
- &show_slot_edit($r);
} else {
my $symb=&Apache::lonnet::unescape($env{'form.symb'});
my (undef,undef,$res)=&Apache::lonnet::decode_symb($symb);