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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 10 Aug 2006 15:36:50 -0000


albertel		Thu Aug 10 11:36:50 2006 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  - it's delflag not deleteflag
  - count the rows that we'll need to rowspan rather than guess
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.331 loncom/interface/lonparmset.pm:1.332
--- loncom/interface/lonparmset.pm:1.331	Wed Aug  9 17:11:34 2006
+++ loncom/interface/lonparmset.pm	Thu Aug 10 11:36:49 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.331 2006/08/09 21:11:34 albertel Exp $
+# $Id: lonparmset.pm,v 1.332 2006/08/10 15:36:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3425,9 +3425,7 @@
     my $shown=0;
     foreach my $id (sort { $parmlog{$b}{'exe_time'}<=>$parmlog{$a}{'exe_time'} } (keys(%parmlog))) {
         my @changes=keys(%{$parmlog{$id}{'logentry'}});
-	my $count=$#changes+1;
-	if (!$env{'form.includetypes'}) { $count=int($count/2); }
-	if ($count == 0) { $count = 1; }
+	my $count = 0;
 	my $time =
 	    &Apache::lonlocal::locallocaltime($parmlog{$id}{'exe_time'});
 	my $plainname = 
@@ -3446,13 +3444,10 @@
 						   $parmlog{$id}{'exe_udom'});
 	}
 	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>'.
-		  $send_msg_link.'</td>');
+	$r->print($row_start);
 	my $makenewrow=0;
 	my %istype=();
+	my $output;
 	foreach my $changed (reverse(sort(@changes))) {
             my $value=$parmlog{$id}{'logentry'}{$changed};
 	    my $typeflag = ($changed =~/\.type$/ &&
@@ -3463,50 +3458,60 @@
 		$istype{$parmname}=$value; 
 		if (!$env{'form.includetypes'}) { next; } 
 	    }
-	    if ($makenewrow) { $r->print($row_start); } else { $makenewrow=1; }
-	    $r->print('<td>'.$realm.'</td><td>'.$section.'</td><td>'.
+	    $count++;
+	    if ($makenewrow) {
+		$output .= $row_start;
+	    } else {
+		$makenewrow=1;
+	    }
+	    $output .='<td>'.$realm.'</td><td>'.$section.'</td><td>'.
 		      &standard_parameter_names($parmname).'</td><td>'.
-		      ($part?&mt('Part: [_1]',$part):&mt('All Parts')).'</td><td>');
+		      ($part?&mt('Part: [_1]',$part):&mt('All Parts')).'</td><td>';
 	    my $stillactive=0;
-	    if ($parmlog{$id}{'deleteflag'}) {
-		$r->print(&mt('Deleted'));
+	    if ($parmlog{$id}{'delflag'}) {
+		$output .= &mt('Deleted');
 	    } else {
 		if ($typeflag) {
-		    $r->print(&mt('Type: [_1]',&standard_parameter_names($value)));
+		    $output .= &mt('Type: [_1]',&standard_parameter_names($value));
 		} else {
 		    my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what),
 						      $uname,$udom,$issection,$issection,$courseopt);
 		    if (&isdateparm($istype{$parmname})) {
-			$r->print(&Apache::lonlocal::locallocaltime($value));
+			$output .= &Apache::lonlocal::locallocaltime($value);
 		    } else {
-			$r->print($value);
+			$output .= $value;
 		    }
 		    if ($value ne $all[$level]) {
-			$r->print('<br /><span class="LC_warning">'.&mt('Not active anymore').'</span>');
+			$output .= '<br /><span class="LC_warning">'.&mt('Not active anymore').'</span>';
 		    } else {
 			$stillactive=1;
 		    }
 		}
 	    }
-	    $r->print('</td>');
+	    $output .= '</td><td>';
 	    if ($stillactive) {
 		my $title=&mt('Changed [_1]',&standard_parameter_names($parmname));
                 my $description=&mt('Changed [_1] for [_2] to [_3]',&standard_parameter_names($parmname),$realmdescription,
 				    (&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value));
 		if (($uname) && ($udom)) {
-		    $r->print('<td>'.
-			      &Apache::loncommon::messagewrapper('Notify User',$uname,$udom,$title,$description).
-			      '</td>');
+		    $output .= 
+			&Apache::loncommon::messagewrapper('Notify User',
+							   $uname,$udom,$title,
+							   $description);
 		} else {
-		    $r->print('<td>'.
-			      &Apache::lonrss::course_blog_link($id,$title,$description).
-			      '</td>');
+		    $output .= 
+			&Apache::lonrss::course_blog_link($id,$title,
+							  $description);
 		}
-	    } else {
-		$r->print('<td>&nbsp;</td>');
 	    }
-	    $r->print(&Apache::loncommon::end_data_table_row());
+	    $output .= '</td>'.&Apache::loncommon::end_data_table_row();
 	}
+	$r->print('<td rowspan="'.$count.'">'.$time.'</td>
+                       <td rowspan="'.$count.'">'.$about_me_link.
+		  '<br /><tt>'.$parmlog{$id}{'exe_uname'}.
+			          ':'.$parmlog{$id}{'exe_udom'}.'</tt>'.
+		  $send_msg_link.'</td>'.$output);
+
 	$shown++;
 	if (!($env{'form.show'} eq &mt('all') 
 	      || $shown<=$env{'form.show'})) { last; }