[LON-CAPA-cvs] cvs: loncom /interface slotrequest.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Wed, 02 Nov 2005 22:46:13 -0000
albertel Wed Nov 2 17:46:13 2005 EDT
Modified files:
/loncom/interface slotrequest.pm
Log:
- fix a typo
- change title for slot management
- add new slot button
- improve proctor display
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.27 loncom/interface/slotrequest.pm:1.28
--- loncom/interface/slotrequest.pm:1.27 Thu Oct 27 11:11:03 2005
+++ loncom/interface/slotrequest.pm Wed Nov 2 17:46:12 2005
@@ -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.28 2005/11/02 22:46:12 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -53,11 +53,10 @@
}
sub start_page {
- my ($r)=@_;
+ my ($r,$title)=@_;
my $html=&Apache::lonxml::xmlbegin();
- $r->print($html.'<head><title>'.
- &mt('Request another Worktime').'</title></head>');
- $r->print(&Apache::loncommon::bodytag('Requesting another Worktime'));
+ $r->print($html.'<head><title>'.&mt($title).'</title></head>');
+ $r->print(&Apache::loncommon::bodytag($title));
}
sub end_page {
@@ -465,6 +464,9 @@
<input type="hidden" name="command" value="uploadstart" />
<input type="submit" name="start" value="'.&mt('Upload Slot List').'" />
</form>');
+ $r->print('<form method="POST" action="/adm/helper/newslot.helper">
+<input type="submit" name="newslot" value="'.&mt('Create a New Slot').'" />
+</form>');
}
my $linkstart='<a href="/adm/slotrequest?command=showslots&order=';
$r->print('<table border="1">
@@ -525,7 +527,7 @@
&Apache::lonlocal::locallocaltime($slots{$slot}->{'starttime'}):'');
my $end=($slots{$slot}->{'endtime'}?
&Apache::lonlocal::locallocaltime($slots{$slot}->{'endtime'}):'');
- my $start_reserve=($slots{$slot}->{'endtime'}?
+ my $start_reserve=($slots{$slot}->{'startreserve'}?
&Apache::lonlocal::locallocaltime($slots{$slot}->{'startreserve'}):'');
my $unique;
@@ -543,7 +545,7 @@
$name_cache{$_} = $fullname;
}
&Apache::loncommon::aboutmewrapper($fullname,$uname,$udom);
- } (split(/\s*,\s*/,$slots{$slot}->{'proctor'}));
+ } (sort(split(/\s*,\s*/,$slots{$slot}->{'proctor'})));
my $proctors=join(', ',@proctors);
@@ -805,9 +807,15 @@
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 +833,6 @@
}
&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);