[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonparmset.pm

www lon-capa-cvs@mail.lon-capa.org
Tue, 09 May 2006 20:25:08 -0000


www		Tue May  9 16:25:08 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonparmset.pm 
  Log:
  Raeburnesque parameter log table
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.366 loncom/interface/loncommon.pm:1.367
--- loncom/interface/loncommon.pm:1.366	Tue May  9 11:09:27 2006
+++ loncom/interface/loncommon.pm	Tue May  9 16:25:05 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.366 2006/05/09 15:09:27 albertel Exp $
+# $Id: loncommon.pm,v 1.367 2006/05/09 20:25:05 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3646,6 +3646,14 @@
     sub end_data_table_row {
 	return '</tr>';
     }
+
+    sub start_data_table_header_row {
+	return  '<tr class="LC_header_row">';
+    }
+
+    sub end_data_table_header_row {
+	return '</tr>';
+    }
 }
 
 ###############################################
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.300 loncom/interface/lonparmset.pm:1.301
--- loncom/interface/lonparmset.pm:1.300	Tue May  9 11:09:27 2006
+++ loncom/interface/lonparmset.pm	Tue May  9 16:25:06 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.300 2006/05/09 15:09:27 albertel Exp $
+# $Id: lonparmset.pm,v 1.301 2006/05/09 20:25:06 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3341,12 +3341,15 @@
     my %parmlog=&Apache::lonnet::dump('nohist_parameterlog',
 				      $env{'course.'.$env{'request.course.id'}.'.domain'},
 				      $env{'course.'.$env{'request.course.id'}.'.num'});
+    if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); }
+
     my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'},
 						     $env{'course.'.$env{'request.course.id'}.'.domain'});
-    $r->print('<table border="2">');
-    my $bgcolor='#EEEEEE';
+    $r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row().
+	      '<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Extent').'</th><th>'.&mt('Users').'</th><th>'.
+	      &mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th><th>'.&mt('Announce').'</th>'.
+	      &Apache::loncommon::end_data_table_header_row());
     foreach my $id (sort { $parmlog{$b}{'exe_time'}<=>$parmlog{$a}{'exe_time'} } (keys(%parmlog))) {
-	if ($bgcolor eq '#EEEEEE') { $bgcolor='#FFFFCC'; } else { $bgcolor='#EEEEEE'; }
         my @changes=keys(%{$parmlog{$id}{'logentry'}});
 	my $count=$#changes+1;
 	my $time =
@@ -3366,7 +3369,8 @@
 						   $parmlog{$id}{'exe_uname'},
 						   $parmlog{$id}{'exe_udom'});
 	}
-	$r->print('<tr bgcolor="'.$bgcolor.'"><td rowspan="'.$count.'">'.$time.'</td>
+	my $row_start=&Apache::loncommon::start_data_table_row();
+	$r->print($row_start.'<td rowspan="'.$count.'">'.$time.'</td>
                        <td rowspan="'.$count.'">'.$about_me_link.
 		  '<br /><tt>'.$parmlog{$id}{'exe_uname'}.
 			          ':'.$parmlog{$id}{'exe_udom'}.'</tt>'.
@@ -3378,7 +3382,7 @@
             my ($realm,$section,$parmname,$part,$typeflag,$what,$middle,$uname,$udom,$issection)=
 		&components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'});
 	    if ($typeflag) { $istype{$parmname}=$value; }
-	    if ($makenewrow) { $r->print('<tr bgcolor="'.$bgcolor.'">'); } else { $makenewrow=1; }
+	    if ($makenewrow) { $r->print($row_start); } else { $makenewrow=1; }
 	    $r->print('<td>'.$realm.'</td><td>'.$section.'</td><td>'.
 		      &standard_parameter_names($parmname).'</td><td>'.
 		      ($part?&mt('Part: [_1]',$part):&mt('All Parts')).'</td><td>');
@@ -3413,10 +3417,10 @@
 	    } else {
 		$r->print('<td>&nbsp;</td>');
 	    }
-	    $r->print('</tr>');
+	    $r->print(&Apache::loncommon::end_data_table_row());
 	}
     }
-    $r->print('</table>');
+    $r->print(&Apache::loncommon::end_data_table());
     $r->print(&Apache::loncommon::end_page());
 }