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

banghart lon-capa-cvs@mail.lon-capa.org
Wed, 13 Sep 2006 20:12:21 -0000


banghart		Wed Sep 13 16:12:21 2006 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  	Echo edited metadata content (instead of returning to portfolio)
  	Discarding edits returns properly to group or individual portfolio.
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.174 loncom/interface/lonmeta.pm:1.175
--- loncom/interface/lonmeta.pm:1.174	Mon Sep 11 18:48:47 2006
+++ loncom/interface/lonmeta.pm	Wed Sep 13 16:12:20 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.174 2006/09/11 22:48:47 banghart Exp $
+# $Id: lonmeta.pm,v 1.175 2006/09/13 20:12:20 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -744,7 +744,6 @@
         $r->print(&Apache::loncommon::start_page('Edit Group Portfolio File Catalog Information',
 						 undef,
 						 {'domain' => $resdomain,}));
-						 
         &present_editable_metadata($r,$uri,'groups');    
     } elsif ($uri=~m|^/~|) { 
         # Construction space
@@ -1278,7 +1277,6 @@
 		$Apache::lonpublisher::metadatafields{'keywords'} = 
 		    join (',', &Apache::loncommon::get_env_multiple('form.new_keywords'));
 	    }
-
 	    foreach my $field (sort keys %Apache::lonpublisher::metadatafields) {
 		next if ($field =~ /\./);
 		my $unikey=$field;
@@ -1293,7 +1291,6 @@
 			$Apache::lonpublisher::metadatafields{$unikey.'.'.$key};
 		    $value=~s/\"/\'\'/g;
 		    $file_content.=' '.$key.'="'.$value.'"' ;
-		    # print $mfh ' '.$key.'="'.$value.'"';
 		}
 		$file_content.= '>'.
 		    &HTML::Entities::encode
@@ -1310,10 +1307,6 @@
 	        }
                 $r->print(&store_portfolio_metadata($formname,$file_content,$path,
                                                     $new_fn));
-                if (! $env{'form.associate'}) {
-                    $r->print(&Apache::portfolio::done("Return to Portfolio",'/adm/portfolio'));
-                    return;
-                }  
             } else {
 		if (!  ($mfh=Apache::File->new('>'.$fn))) {
 		    $r->print('<p><font color="red">'.
@@ -1325,13 +1318,8 @@
 			      ' '.&Apache::lonlocal::locallocaltime(time).
 			      '</font></p>');
 		}
-                if (! $env{'form.associate'}) {
-                    $r->print(&Apache::portfolio::done("Return to Portfolio",'/adm/portfolio'));
-                    return;
-                }  
 	    }
 	}
-	
 	$r->print($output.'<br /><input type="submit" name="store" value="'.
                   &mt('Store Catalog Information').'" />');
 
@@ -1341,10 +1329,11 @@
                 $r->print('<input type="hidden" name="group" value="'.$group.'" />');
             }
             $r->print('<input type="hidden" name="currentpath" value="'.$env{'form.currentpath'}.'" />');
-	    $r->print('</form>
-               <br /><br /><form method="post" action="'.$port_path.'">'.
-		      '<input type="hidden" name="group" value="'.$group.'" />'.
-		      '<input type="hidden" name="currentpath" value="'.$path.'" />'.
+	    $r->print('</form><br /><br /><form method="post" action="'.$port_path.'">');
+	    if ($group) {
+	        $r->print('<input type="hidden" name="group" value="'.$group.'" />');
+	    }
+	    $r->print('<input type="hidden" name="currentpath" value="'.$path.'" />'.
 		      '<input type="submit" name="cancel" value="'.&mt('Discard Edits and Return to Portfolio').'" />');
 	}
     }