[LON-CAPA-cvs] cvs: loncom /publisher lonpubdir.pm lonpublisher.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 20 May 2005 18:28:26 -0000


www		Fri May 20 14:28:26 2005 EDT

  Modified files:              
    /loncom/publisher	lonpubdir.pm lonpublisher.pm 
  Log:
  Bug #3956: force directory metadata to override existing
  Bug #3352: make obsolete
  Bug #3119: edit metadata now actually remembers things
  
  
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.80 loncom/publisher/lonpubdir.pm:1.81
--- loncom/publisher/lonpubdir.pm:1.80	Wed May 18 23:22:04 2005
+++ loncom/publisher/lonpubdir.pm	Fri May 20 14:28:22 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Directory Lister
 #
-# $Id: lonpubdir.pm,v 1.80 2005/05/19 03:22:04 www Exp $
+# $Id: lonpubdir.pm,v 1.81 2005/05/20 18:28:22 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -508,6 +508,7 @@
     my ($r, $udom, $uname, $filename, $thisdisfn, 
 	$resdir, $targetdir, $linkdir,
 	$cmtime,$bombs,$numres) = @_;
+    &Apache::lonnet::devalidate_cache_new('meta',$targetdir.'/'.$filename);
     my $pubstatus = 'unpublished';
     my $status=&mt('Unpublished');
     my $bgcolor='#FFAA99';
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.194 loncom/publisher/lonpublisher.pm:1.195
--- loncom/publisher/lonpublisher.pm:1.194	Wed May 18 23:22:04 2005
+++ loncom/publisher/lonpublisher.pm	Fri May 20 14:28:22 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.194 2005/05/19 03:22:04 www Exp $
+# $Id: lonpublisher.pm,v 1.195 2005/05/20 18:28:22 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1020,7 +1020,7 @@
     }
 
 # ------------------------------------------------ First, check out environment
-     unless (-e $source.'.meta') {
+     if ((!(-e $source.'.meta')) || ($env{'form.forceoverride'})) {
         $metadatafields{'author'}=$env{'environment.firstname'}.' '.
 	                          $env{'environment.middlename'}.' '.
 		                  $env{'environment.lastname'}.' '.
@@ -1070,10 +1070,18 @@
 		delete $metadatafields{$_};
             }
         }
+# ------------------------------------------------------------- Save some stuff
+        my %savemeta=();
+        foreach ('title') {
+            $savemeta{$_}=$metadatafields{$_};
+	}
 # ------------------------------------------ See if anything new in file itself
  
 	$allmeta=&parseformeta($source,$style);
-
+# ----------------------------------------------------------- Restore the stuff
+        foreach (keys %savemeta) {
+	    $metadatafields{$_}=$savemeta{$_};
+	}
    }
 
        
@@ -1335,6 +1343,7 @@
 	&hiddenfield('copyright',$metadatafields{'copyright'}).
 	&hiddenfield('sourceavail',$metadatafields{'sourceavail'}).
 	&hiddenfield('customdistributionfile',$metadatafields{'customdistributionfile'}).
+	&hiddenfield('obsolete',1).
 	&text_with_browse_field('Suggested Replacement for Obsolete File',
 				    'obsoletereplacement',
 				    $metadatafields{'obsoletereplacement'});
@@ -1739,17 +1748,9 @@
 		  &hiddenfield('filename',$env{'form.filename'}).
 		  &checkbox('pubrec','include subdirectories').
 		  &checkbox('forcerepub','force republication of previously published files').
-                  &checkbox('forceobsolete','make file(s) obsolete'));
-        my %allcopyrights=('keep','Keep current copyright');
-        my %ratcopyrights=%allcopyrights;
-        foreach (&Apache::loncommon::copyrightids) {
-            $allcopyrights{$_}=&Apache::loncommon::copyrightdescription($_);
-            unless ($_ eq 'public') { $ratcopyrights{$_}=$allcopyrights{$_}; }
-	}
-        $r->print('<br >'.&mt('Copyright for all files:').&Apache::loncommon::select_form('keep','forceallcopy',%allcopyrights));
-        $r->print('<br >'.&mt('Copyright for pages/sequences:').&Apache::loncommon::select_form('keep','forceratcopy',%ratcopyrights));
-	$r->print(&text_with_browse_field('Custom Distribution File','forcecustomfile'));
-        $r->print('<br /><input type="submit" value="'.&mt('Publish Directory').'" /></form>');
+                  &checkbox('forceobsolete','make file(s) obsolete').
+		  &checkbox('forceoverride','force directory level catalog information over existing').
+		  '<br /><input type="submit" value="'.&mt('Publish Directory').'" /></form>');
     } else {
 # actually publish things
 	opendir(DIR,$fn);