--- loncom/interface/slotrequest.pm 2009/10/15 23:53:46 1.104
+++ loncom/interface/slotrequest.pm 2009/11/04 15:37:23 1.106
@@ -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.104 2009/10/15 23:53:46 raeburn Exp $
+# $Id: slotrequest.pm,v 1.106 2009/11/04 15:37:23 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1026,6 +1026,7 @@ sub show_table {
my ($r,$mgr)=@_;
my ($cnum,$cdom)=&get_course();
+ my $crstype=&Apache::loncommon::course_type($cdom.'_'.$cnum);
my %slots=&Apache::lonnet::dump('slots',$cdom,$cnum);
if ( (keys(%slots))[0] =~ /^error: 2 /) {
undef(%slots);
@@ -1049,7 +1050,11 @@ sub show_table {
}
if (!keys(%slots)) {
- $r->print('
'.&mt('No slots have been created in this course.').'
');
+ if ($crstype eq 'Community') {
+ $r->print(''.&mt('No slots have been created in this community.').'
');
+ } else {
+ $r->print(''.&mt('No slots have been created in this course.').'
');
+ }
return;
}
@@ -1085,6 +1090,10 @@ sub show_table {
'uniqueperiod' => 'Period of time slot is unique',
'scheduled' => 'Scheduled Students',
'proctor' => 'List of proctors');
+ if ($crstype eq 'Community') {
+ $show_fields{'startreserve'} = &mt('Time members can start reserving');
+ $show_fields{'scheduled'} = &mt('Scheduled Members');
+ }
my @show_order=('name','description','type','starttime','endtime',
'startreserve','secret','space','ip','symb',
'allowedsections','allowedusers','uniqueperiod',
@@ -1429,7 +1438,7 @@ STUFF
}
sub manage_reservations {
- my ($r,$type) = @_;
+ my ($r,$crstype) = @_;
my $navmap = Apache::lonnavmaps::navmap->new();
$r->print(''
.&mt('Instructors may use a reservation system to place restrictions on when and where assignments can be worked on.')
@@ -1438,10 +1447,14 @@ sub manage_reservations {
.'
'
);
if (!defined($navmap)) {
- $r->print(''.
- &mt('Unable to retrieve information about course contents').
- '
');
- &Apache::lonnet::logthis('Manage Reservations - could not create navmap object in '.lc($type).':'.$env{'request.course.id'});
+ $r->print('');
+ if ($crstype eq 'Community') {
+ $r->print(&mt('Unable to retrieve information about community contents'));
+ } else {
+ $r->print(&mt('Unable to retrieve information about course contents'));
+ }
+ $r->print('
');
+ &Apache::lonnet::logthis('Manage Reservations - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});
return;
}
my (%parent,%shownparent,%container,%container_title,%contents);
@@ -1599,7 +1612,13 @@ sub manage_reservations {
$r->print('');
}
if (!$reservable) {
- $r->print(''.&mt('No course items currently require a reservation to gain access.').'');
+ $r->print('');
+ if ($crstype eq 'Community') {
+ $r->print(&mt('No community items currently require a reservation to gain access.'));
+ } else {
+ $r->print(&mt('No course items currently require a reservation to gain access.'));
+ }
+ $r->print('');
}
$r->print(''.
&mt('Reservation History').'
');
@@ -1632,12 +1651,21 @@ sub show_reservations {
my $formname = 'slotlog';
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $crstype = &Apache::loncommon::course_type();
my %log=&Apache::lonnet::dump('nohist_'.$cdom.'_'.$cnum.'_slotlog',$udom,$uname);
if ($env{'form.origin'} eq 'aboutme') {
- $r->print(''.
- &mt('History of student-reservable slots for: [_1]',
- &Apache::loncommon::plainname($env{'form.uname'},$env{'form.udom'},
- 'firstname')).'
');
+ $r->print('');
+ my $name = &Apache::loncommon::plainname($env{'form.uname'},$env{'form.udom'},
+ 'firstname');
+ if ($crstype eq 'Community') {
+ $r->print(&mt('History of member-reservable slots for: [_1]',
+ $name));
+ } else {
+ $r->print(&mt('History of student-reservable slots for: [_1]',
+ $name));
+
+ }
+ $r->print('
');
}
$r->print('