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

www lon-capa-cvs@mail.lon-capa.org
Wed, 29 Nov 2006 21:00:38 -0000


www		Wed Nov 29 16:00:38 2006 EDT

  Modified files:              
    /loncom/interface	loncommon.pm londocs.pm 
  Log:
  Folder filter on DOCS
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.476 loncom/interface/loncommon.pm:1.477
--- loncom/interface/loncommon.pm:1.476	Wed Nov 29 14:33:29 2006
+++ loncom/interface/loncommon.pm	Wed Nov 29 16:00:35 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.476 2006/11/29 19:33:29 raeburn Exp $
+# $Id: loncommon.pm,v 1.477 2006/11/29 21:00:35 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1381,17 +1381,18 @@
 
 sub display_filter {
     if (!$env{'form.show'}) { $env{'form.show'}=10; }
+    if (!$env{'form.displayfilter'}) { $env{'form.displayfilter'}='currentfolder'; }
     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>'.
            &mt('Filter [_1]',
-	   &select_form(($env{'form.displayfilter'}?$env{'form.displayfilter'}:'currentfolder'),
-					'displayfilter',
-					('currentfolder' => 'Current folder',
-					 'containing' => 'Containing phrase',
-					 'none' => 'None'))).
-	   '<input type="text" name="containingphrase" size="30" /></label></nobr>';
+	   &select_form($env{'form.displayfilter'},
+			'displayfilter',
+			('currentfolder' => 'Current folder/page',
+			 'containing' => 'Containing phrase',
+			 'none' => 'None'))).
+			 '<input type="text" name="containingphrase" size="30" /></label></nobr>';
 }
 
 sub gradeleveldescription {
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.259 loncom/interface/londocs.pm:1.260
--- loncom/interface/londocs.pm:1.259	Wed Nov 29 10:38:22 2006
+++ loncom/interface/londocs.pm	Wed Nov 29 16:00:35 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.259 2006/11/29 15:38:22 www Exp $
+# $Id: londocs.pm,v 1.260 2006/11/29 21:00:35 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1028,7 +1028,8 @@
 
     sub log_differences {
         my ($plain)=@_;
-        my %storehash=('folder' => $plain);
+        my %storehash=('folder' => $plain,
+                       'currentfolder' => $env{'form.folder'});
         if ($parmidx) {
            $storehash{'parameter_res'}=$oldresources[$parmidx];
            foreach my $parm (keys %parmaction) {
@@ -1063,9 +1064,9 @@
 #
 sub docs_change_log {
     my ($r)=@_;
+    my $folder=$env{'form.folder'};
     $r->print(&Apache::loncommon::start_page('Course Document Change Log'));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs('Course Document Change Log'));
-
     my %docslog=&Apache::lonnet::dump('nohist_docslog',
                                       $env{'course.'.$env{'request.course.id'}.'.domain'},
                                       $env{'course.'.$env{'request.course.id'}.'.num'});
@@ -1087,6 +1088,7 @@
 	    'set'            => 'set to',
 	    'del'            => 'deleted');
     $r->print(&Apache::loncommon::display_filter().
+              '<input type="hidden" name="folder" value="'.$folder.'" />'.
               '<input type="submit" value="'.&mt('Display').'" /></form>');
     $r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row().
               '<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Folder').'</th><th>'.&mt('Before').'</th><th>'.
@@ -1094,6 +1096,9 @@
               &Apache::loncommon::end_data_table_header_row());
     my $shown=0;
     foreach my $id (sort { $docslog{$b}{'exe_time'}<=>$docslog{$a}{'exe_time'} } (keys(%docslog))) {
+	if ($env{'form.displayfilter'} eq 'currentfolder') {
+	    if ($docslog{$id}{'logentry'}{'currentfolder'} ne $folder) { next; }
+	}
         my @changes=keys(%{$docslog{$id}{'logentry'}});
         my $count = 0;
         my $time =
@@ -2636,6 +2641,7 @@
 </td><td bgcolor="#DDDDCC">
     <input type="submit" name="listsymbs" value="$lt{'ls'}" />
 </td><td bgcolor="#DDDDCC">
+    <input type="hidden" name="folder" value="$env{'form.folder'}" />
     <input type="submit" name="docslog" value="$lt{'sl'}" />
 </td></tr></table>
 </form>