--- loncom/interface/slotrequest.pm 2009/08/05 13:40:10 1.100
+++ loncom/interface/slotrequest.pm 2010/06/06 02:40:30 1.108
@@ -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.100 2009/08/05 13:40:10 bisitz Exp $
+# $Id: slotrequest.pm,v 1.108 2010/06/06 02:40:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -847,7 +847,7 @@ sub show_choices {
(keys(%slots))) {
&Apache::lonxml::debug("Checking Slot $slot");
- next if (!&allowed_slot($slot,$slots{$slot},undef,\%slots,
+ next if (!&allowed_slot($slot,$slots{$slot},$symb,\%slots,
$consumed_uniqueperiods));
push(@available,$slot);
@@ -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',
@@ -1160,11 +1169,11 @@ sub show_table {
6,\%stu_display_fields,
\@stu_display_order).'
-
'.&Apache::loncommon::select_form($name_filter_type,
'name_filter_type',
- %name_filter_type_fields).
+ \%name_filter_type_fields).
' '.
&Apache::lonhtmlcommon::textbox('name_filter_value',
$env{'form.name_filter_value'},
@@ -1429,21 +1438,23 @@ 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.')
.' '
.&mt('One example is for management of laboratory space, which is only available at certain times, and has a limited number of seats.')
- .'
'
- .&mt('Your reservation status for any such assignments is listed below:')
.'
'
);
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);
@@ -1451,7 +1462,11 @@ sub manage_reservations {
my @backgrounds = ("LC_odd_row","LC_even_row");
my $numcolors = scalar(@backgrounds);
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace_21.gif");
- $r->print('
'."\n");
+ my $slotheader = '
'.
+ &mt('Your reservation status for any such assignments is listed below:').
+ '
'.
+ '
'."\n";
+ my $shownheader = 0;
my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef);
while (my $resource = $it->next()) {
if ($resource == $it->BEGIN_MAP()) {
@@ -1546,11 +1561,19 @@ sub manage_reservations {
foreach my $item (@maprows) {
$rownum ++;
my $bgcolor = $backgrounds[$rownum % $numcolors];
+ if (!$shownheader) {
+ $r->print($slotheader);
+ $shownheader = 1;
+ }
$r->print('
'."\n");
for (my $i=0; $i<$depth; $i++) {
$r->print('');
@@ -1585,11 +1608,19 @@ sub manage_reservations {
}
}
}
+ if ($shownheader) {
+ $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('
');
}
@@ -1620,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('
');
}
$r->print(''
+ );
}
sub csvuploadmap_header {
@@ -2104,7 +2165,7 @@ sub csvuploadmap_header {
Total number of records found in file: $distotal
Enter as many fields as you can. The system will inform you and bring you back
to this page if the data selected is insufficient to create the slots.
-
+
@@ -2129,7 +2190,7 @@ sub csvuploadmap_footer {
-
+
ENDPICK
}