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

banghart lon-capa-cvs@mail.lon-capa.org
Sat, 12 Aug 2006 06:18:45 -0000


banghart		Sat Aug 12 02:18:45 2006 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  	Way stupid, but it shows handback info for versioned files.
  	Saving work in progress.
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.153 loncom/interface/portfolio.pm:1.154
--- loncom/interface/portfolio.pm:1.153	Fri Aug 11 19:45:18 2006
+++ loncom/interface/portfolio.pm	Sat Aug 12 02:18:44 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # portfolio browser
 #
-# $Id: portfolio.pm,v 1.153 2006/08/11 23:45:18 banghart Exp $
+# $Id: portfolio.pm,v 1.154 2006/08/12 06:18:44 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -174,7 +174,32 @@
         $r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>');
         $r->print('<td>'.$$version_flag{$filename}.'</td>');
     } else { # this is a graded or handed back file
-        $r->print('<td colspan="2">&nbsp;</td>');
+        my ($user,$domain) = &get_name_dom();
+        my $permissions_hash = &Apache::lonnet::get_portfile_permissions($domain,$user);
+        my $lock_info;
+        foreach my $key (keys(%$permissions_hash)) {
+            $key =~ s|^/||;
+            if ($key =~ /$filename/) {
+                &Apache::lonnet::logthis("filename match");
+                my $value = $$permissions_hash{$key};
+                if (ref($value) eq 'ARRAY') {
+                    my $info = pop(@$value);
+                    my $info2 = pop(@$info);
+                    &Apache::lonnet::logthis("the info2 is $info2");
+                    $lock_info = $info2;
+                    #foreach my $key2(keys(%hash)){
+                     #   &Apache::lonnet::logthis("a key2 is $key2");
+                    #}
+                    foreach my $value_element (@$value) {
+                        #&Apache::lonnet::logthis("and the array element is $value_element");
+                        foreach my $sub_value (@$value_element) {
+                            #&Apache::lonnet::logthis("subvalue is $sub_value");
+                        }
+                    }
+                }
+            }
+        }
+        $r->print('<td colspan="2">'.$lock_info.'</td>');
     }
     # $r->print('<td>'.$$version_flag{$filename}.'</td><td>');
     $r->print('<td>'.&make_anchor($href_location.$filename,undef,$filename).'</td>');