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

banghart lon-capa-cvs@mail.lon-capa.org
Fri, 29 Apr 2005 16:51:42 -0000


banghart		Fri Apr 29 12:51:42 2005 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  	Suppress display of versioned files.
  	Begin display of reason a file is locked.
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.83 loncom/interface/portfolio.pm:1.84
--- loncom/interface/portfolio.pm:1.83	Mon Apr 11 21:15:46 2005
+++ loncom/interface/portfolio.pm	Fri Apr 29 12:51:42 2005
@@ -125,7 +125,7 @@
     	#$dom 
     	my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); 
     	$filename =~ s/\s+$//;
-    	if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ )) {
+    	if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(.*)\.(.*)/)) {
             if ($dirptr&$testdir) {
                 if ($select_mode eq 'true'){
                     $r->print('<tr bgcolor="#FFAA99"><td><img src="'.$iconpath.'folder_closed.gif"></td>');
@@ -449,7 +449,23 @@
 }
 sub lock_info {
     my ($r) = @_;
-    $r->print("lock info here");
+    my %current_permissions = &Apache::lonnet::dump('file_permissions',$env{'user.domain'},$env{'user.name'});
+    my $file_name = $env{'form.lockinfo'};
+    #my %locked_files = &Apache::lonnet::get_marked_as_readonly_hash ($env{'user.domain'},$env{'user.name'});
+    foreach my $key (keys(%current_permissions)) {
+        if ($file_name eq $key) {
+        $r->print("$key = ");
+        foreach my $array_item (@{$current_permissions{$key}}) {
+            if (ref($array_item)) {
+            $r->print(&Apache::lonnet::gettitle($$array_item[0]).' is the problem<br>');
+            $r->print(&Apache::lonnet::coursedescription($$array_item[1]).' is the course<br>');
+            # $r->print('the third is '.$$array_item[2].'<br>');
+            # $r->print("item is $$array_item[0]<br> and $$array_item[0]");
+        }
+        }
+        }    
+    }
+    #$r->print("lock info here");
     return 'ok';
 }
 sub createdir {