[LON-CAPA-cvs] cvs: loncom /interface lonchart.pm
stredwic
lon-capa-cvs@mail.lon-capa.org
Wed, 17 Jul 2002 12:36:17 -0000
stredwic Wed Jul 17 08:36:17 2002 EDT
Modified files:
/loncom/interface lonchart.pm
Log:
Changing the names of the status form element from ChartStatus to Status.
Hopefully, this will make it more compatable with lonstatistic's forms.
Index: loncom/interface/lonchart.pm
diff -u loncom/interface/lonchart.pm:1.59 loncom/interface/lonchart.pm:1.60
--- loncom/interface/lonchart.pm:1.59 Tue Jul 9 11:43:49 2002
+++ loncom/interface/lonchart.pm Wed Jul 17 08:36:17 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# (Publication Handler
#
-# $Id: lonchart.pm,v 1.59 2002/07/09 15:43:49 stredwic Exp $
+# $Id: lonchart.pm,v 1.60 2002/07/17 12:36:17 stredwic Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -150,12 +150,13 @@
sub FormatStudentInformation {
my ($cache,$name,$studentInformation,$spacePadding)=@_;
my $Str='';
+ my $data;
for(my $index=0; $index<(scalar @$studentInformation); $index++) {
if(!&ShouldShowColumn($cache, 'ChartHeading'.$index)) {
next;
}
- my $data=$cache->{$name.':'.$studentInformation->[$index]};
+ $data=$cache->{$name.':'.$studentInformation->[$index]};
$Str .= $data;
my @dataLength=split(//,$data);
@@ -211,6 +212,14 @@
unless(tie(%CacheData,'GDBM_File',$ChartDB,&GDBM_READER,0640)) {
return '';
}
+
+# my $section = &Apache::loncoursedata::CheckStatus($name, \%CacheData,
+# $CacheData{'form.Status'});
+# if($section eq 'not found') {
+# untie(%CacheData);
+# return;
+# }
+
# Handle Student information ------------------------------------------
# Handle user data
$Str=&FormatStudentInformation(\%CacheData, $name, $studentInformation,
@@ -586,7 +595,7 @@
my $OpSel1='';
my $OpSel2='';
my $OpSel3='';
- my $Status = $CacheData->{'form.ChartStatus'};
+ my $Status = $CacheData->{'form.Status'};
if ( $Status eq 'Any' ) { $OpSel3='selected'; }
elsif ($Status eq 'Expired' ) { $OpSel2 = 'selected'; }
else { $OpSel1 = 'selected'; }
@@ -614,7 +623,7 @@
$Ptr .= '</td></tr><tr><td align="right">';
$Ptr .= '<b> Student Status: </b>'."\n".
'</td><td align="left">'.
- '<select name="ChartStatus">'.
+ '<select name="Status">'.
'<option '.$OpSel1.' >Active</option>'."\n".
'<option '.$OpSel2.' >Expired</option>'."\n".
'<option '.$OpSel3.' >Any</option> </select> '."\n";
@@ -723,10 +732,10 @@
$CacheData{'form.ChartSort'}='username';
}
- if(defined($ENV{'form.ChartStatus'})) {
- $CacheData{'form.ChartStatus'}=$ENV{'form.ChartStatus'};
- } elsif(!defined($CacheData{'form.ChartStatus'})) {
- $CacheData{'form.ChartStatus'}='Active';
+ if(defined($ENV{'form.Status'})) {
+ $CacheData{'form.Status'}=$ENV{'form.Status'};
+ } elsif(!defined($CacheData{'form.Status'})) {
+ $CacheData{'form.Status'}='Active';
}
# $found checks for any instances of form data in the ENV. If it is
@@ -768,7 +777,7 @@
# on the remote was pressed and needs to reset all the selections
if(defined($ENV{'form.ChartReset'}) || (!$found && !$isCached)) {
$CacheData{'form.ChartReset'}='true';
- $CacheData{'form.ChartStatus'}='Active';
+ $CacheData{'form.Status'}='Active';
$CacheData{'form.ChartSort'}='username';
$CacheData{'form.ChartHeadings'}='ALLHEADINGS';
$CacheData{'form.ChartSequences'}='ALLSEQUENCES';
@@ -864,7 +873,7 @@
my ($end,$start)=split(/\:/,$CacheData->{$_.':date'});
my $active=1;
my $now=time;
- my $Status=$CacheData->{'form.ChartStatus'};
+ my $Status=$CacheData->{'form.Status'};
$Status = ($Status) ? $Status : 'Active';
if((($end) && $now > $end) && (($Status eq 'Active'))) {
$active=0;
@@ -1056,9 +1065,9 @@
@students=&Apache::loncoursedata::ProcessClassList(\%CacheData,
- $classlist, $cid,
- $CacheData{'form.ChartStatus'},
- $c);
+ $classlist, $cid,
+ $CacheData{'form.Status'},
+ $c);
if($c->aborted()) {
untie(%CacheData);