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

www lon-capa-cvs@mail.lon-capa.org
Fri, 26 Dec 2003 21:17:37 -0000


www		Fri Dec 26 16:17:37 2003 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonmeta.pm 
    /loncom/publisher	lonpublisher.pm 
  Log:
  No need to have the same subroutine unsqltime twice - lonmysql is the better
  place for it.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.163 loncom/interface/loncommon.pm:1.164
--- loncom/interface/loncommon.pm:1.163	Fri Dec 26 11:27:20 2003
+++ loncom/interface/loncommon.pm	Fri Dec 26 16:17:37 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.163 2003/12/26 16:27:20 www Exp $
+# $Id: loncommon.pm,v 1.164 2003/12/26 21:17:37 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1925,21 +1925,6 @@
     return POSIX::mktime(
         ($th{'seconds'},$th{'minutes'},$th{'hours'},
          $th{'day'},$th{'month'}-1,$th{'year'}-1900,0,0,$th{'dlsav'}));
-}
-
-
-#########################################
-#
-# Retro-fixing of un-backward-compatible time format
-
-sub unsqltime {
-    my $timestamp=shift;
-    if ($timestamp=~/^(\d+)\-(\d+)\-(\d+)\s+(\d+)\:(\d+)\:(\d+)$/) {
-       $timestamp=&maketime(
-	   'year'=>$1,'month'=>$2,'day'=>$3,
-           'hours'=>$4,'minutes'=>$5,'seconds'=>$6);
-    }
-    return $timestamp;
 }
 
 #########################################
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.42 loncom/interface/lonmeta.pm:1.43
--- loncom/interface/lonmeta.pm:1.42	Fri Dec 26 11:27:20 2003
+++ loncom/interface/lonmeta.pm	Fri Dec 26 16:17:37 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.42 2003/12/26 16:27:20 www Exp $
+# $Id: lonmeta.pm,v 1.43 2003/12/26 21:17:37 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -40,6 +40,7 @@
 use Apache::lonmsg;
 use Apache::lonpublisher;
 use Apache::lonlocal;
+use Apache::lonmysql;
 
 # ----------------------------------------- Fetch and evaluate dynamic metadata
 
@@ -235,9 +236,9 @@
 # --------------------------------------------------------------- Render Output
   my ($thisversion)=($uri=~/\.(\d+)\.(\w+)\.meta$/);
 my $creationdate=&Apache::lonlocal::locallocaltime(
- &Apache::loncommon::unsqltime($content{'creationdate'}));
+ &Apache::lonmysql::unsqltime($content{'creationdate'}));
 my $lastrevisiondate=&Apache::lonlocal::locallocaltime(
- &Apache::loncommon::unsqltime($content{'lastrevisiondate'}));
+ &Apache::lonmysql::unsqltime($content{'lastrevisiondate'}));
 my $language=&Apache::loncommon::languagedescription($content{'language'});
 my $mime=&Apache::loncommon::filedescription($content{'mime'}); 
 my $disuri=&Apache::lonnet::declutter($uri);
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.152 loncom/publisher/lonpublisher.pm:1.153
--- loncom/publisher/lonpublisher.pm:1.152	Fri Dec 26 14:12:51 2003
+++ loncom/publisher/lonpublisher.pm	Fri Dec 26 16:17:37 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.152 2003/12/26 19:12:51 www Exp $
+# $Id: lonpublisher.pm,v 1.153 2003/12/26 21:17:37 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1178,7 +1178,7 @@
 	    $metadatafields{'creationdate'}=time;
 	}
 	$scrout.=&hiddenfield('creationdate',
-			      &Apache::loncommon::unsqltime($metadatafields{'creationdate'}));
+			      &Apache::lonmysql::unsqltime($metadatafields{'creationdate'}));
 
 	$scrout.=&hiddenfield('lastrevisiondate',time);