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

www lon-capa-cvs@mail.lon-capa.org
Wed, 29 Nov 2006 22:02:47 -0000


www		Wed Nov 29 17:02:47 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm londocs.pm lonparmset.pm 
  Log:
  Bug #4781: filter DOCS and PARM log
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.477 loncom/interface/loncommon.pm:1.478
--- loncom/interface/loncommon.pm:1.477	Wed Nov 29 16:00:35 2006
+++ loncom/interface/loncommon.pm	Wed Nov 29 17:02:47 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.477 2006/11/29 21:00:35 www Exp $
+# $Id: loncommon.pm,v 1.478 2006/11/29 22:02:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1385,14 +1385,14 @@
     return '<nobr><label>'.&mt('Records [_1]',
 			       &Apache::lonmeta::selectbox('show',$env{'form.show'},undef,
 							   (&mt('all'),10,20,50,100,1000,10000))).
-	   '</label></nobr> <nobr><label>'.
+	   '</label></nobr> <nobr>'.
            &mt('Filter [_1]',
 	   &select_form($env{'form.displayfilter'},
 			'displayfilter',
 			('currentfolder' => 'Current folder/page',
 			 'containing' => 'Containing phrase',
 			 'none' => 'None'))).
-			 '<input type="text" name="containingphrase" size="30" /></label></nobr>';
+			 '<input type="text" name="containingphrase" size="30" value="'.&HTML::Entities::encode($env{'form.containingphrase'}).'" /></nobr>';
 }
 
 sub gradeleveldescription {
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.260 loncom/interface/londocs.pm:1.261
--- loncom/interface/londocs.pm:1.260	Wed Nov 29 16:00:35 2006
+++ loncom/interface/londocs.pm	Wed Nov 29 17:02:47 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.260 2006/11/29 21:00:35 www Exp $
+# $Id: londocs.pm,v 1.261 2006/11/29 22:02:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1100,6 +1100,14 @@
 	    if ($docslog{$id}{'logentry'}{'currentfolder'} ne $folder) { next; }
 	}
         my @changes=keys(%{$docslog{$id}{'logentry'}});
+        if ($env{'form.displayfilter'} eq 'containing') {
+	    my $wholeentry=$docslog{$id}{'exe_uname'}.':'.$docslog{$id}{'exe_udom'}.':'.
+		&Apache::loncommon::plainname($docslog{$id}{'exe_uname'},$docslog{$id}{'exe_udom'});
+	    foreach my $key (@changes) {
+		$wholeentry.=':'.$docslog{$id}{'logentry'}{$key};
+	    }
+	    if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; }         
+	}
         my $count = 0;
         my $time =
             &Apache::lonlocal::locallocaltime($docslog{$id}{'exe_time'});
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.348 loncom/interface/lonparmset.pm:1.349
--- loncom/interface/lonparmset.pm:1.348	Wed Nov 29 10:38:22 2006
+++ loncom/interface/lonparmset.pm	Wed Nov 29 17:02:47 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.348 2006/11/29 15:38:22 www Exp $
+# $Id: lonparmset.pm,v 1.349 2006/11/29 22:02:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3718,6 +3718,16 @@
 	      &mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th><th>'.&mt('Announce').'</th>'.
 	      &Apache::loncommon::end_data_table_header_row());
     my $shown=0;
+    my $folder='';
+    if ($env{'form.displayfilter'} eq 'currentfolder') {
+	my $last='';
+	if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db',
+		&GDBM_READER(),0640)) {
+	    $last=$hash{'last_known'};
+	    untie(%hash);
+	}
+	if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); }
+    }
     foreach my $id (sort { $parmlog{$b}{'exe_time'}<=>$parmlog{$a}{'exe_time'} } (keys(%parmlog))) {
         my @changes=keys(%{$parmlog{$id}{'logentry'}});
 	my $count = 0;
@@ -3739,7 +3749,6 @@
 						   $parmlog{$id}{'exe_udom'});
 	}
 	my $row_start=&Apache::loncommon::start_data_table_row();
-	$r->print($row_start);
 	my $makenewrow=0;
 	my %istype=();
 	my $output;
@@ -3749,6 +3758,11 @@
 			    !exists($parmlog{$id}{'logentry'}{$changed.'.type'}));
             my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)=
 		&components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag);
+	    if ($env{'form.displayfilter'} eq 'currentfolder') {
+		if ($folder) {
+		    if ($middle!~/^\Q$folder\E/) { next; }
+		}
+	    }
 	    if ($typeflag) {
 		$istype{$parmname}=$value; 
 		if (!$env{'form.includetypes'}) { next; } 
@@ -3801,13 +3815,20 @@
 	    }
 	    $output .= '</td>'.&Apache::loncommon::end_data_table_row();
 	}
-	$r->print('<td rowspan="'.$count.'">'.$time.'</td>
+        if ($env{'form.displayfilter'} eq 'containing') {
+	    my $wholeentry=$about_me_link.':'.
+		$parmlog{$id}{'exe_uname'}.':'.$parmlog{$id}{'exe_udom'}.':'.
+		$output;
+	    if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; }        
+	}
+        if ($count) {
+	    $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>'.$output);
-
-	$shown++;
+	    $shown++;
+	}
 	if (!($env{'form.show'} eq &mt('all') 
 	      || $shown<=$env{'form.show'})) { last; }
     }