9369881016ec0c9b4753ebdc7b406c202adea782
hiram
  Tue Feb 8 13:53:13 2011 -0800
proper display of data last updated time for trackUi information
diff --git src/hg/hgTrackUi/hgTrackUi.c src/hg/hgTrackUi/hgTrackUi.c
index 0e0a44d..e62d2e1 100644
--- src/hg/hgTrackUi/hgTrackUi.c
+++ src/hg/hgTrackUi/hgTrackUi.c
@@ -26,30 +26,31 @@
 #include "oregannoUi.h"
 #include "chromGraph.h"
 #include "hgConfig.h"
 #include "customTrack.h"
 #include "dbRIP.h"
 #include "tfbsConsSites.h"
 #include "hapmapSnps.h"
 #include "nonCodingUi.h"
 #include "expRecord.h"
 #include "wikiTrack.h"
 #include "hubConnect.h"
 #include "trackHub.h"
 #include "pcrResult.h"
 #include "dgv.h"
 #include "transMapStuff.h"
+#include "bbiFile.h"
 
 #define MAIN_FORM "mainForm"
 #define WIGGLE_HELP_PAGE  "../goldenPath/help/hgWiggleTrackHelp.html"
 
 static char const rcsid[] = "$Id: hgTrackUi.c,v 1.527 2010/06/04 21:54:56 angie Exp $";
 
 struct cart *cart = NULL;	/* Cookie cart with UI settings */
 char *database = NULL;		/* Current database. */
 char *chromosome = NULL;        /* Chromosome. */
 struct hash *trackHash = NULL;	/* Hash of all tracks in database. */
 
 void tfbsConsSitesUi(struct trackDb *tdb)
 {
 float tfbsConsSitesCutoff =
     sqlFloat(cartUsualString(cart,TFBS_SITES_CUTOFF,TFBS_SITES_CUTOFF_DEFAULT));
@@ -2708,53 +2709,55 @@
     filesDownloadUi(database,cart,tdb);  // Composites without tracks but with files to download are tdb->type: downloadsOnly
 else
     specificUi(tdb, ct, ajax);
 puts("</FORM>");
 
 if (ajax)
     return;
 
 if (ct)
     {
     /* hidden form for custom tracks CGI */
     printf("<FORM ACTION='%s' NAME='customTrackForm'>", hgCustomName());
     cartSaveSession(cart);
     cgiMakeHiddenVar(CT_SELECTED_TABLE_VAR, tdb->track);
     puts("</FORM>\n");
+    if (ct->bbiFile)
+	{
+	time_t timep = bbiUpdateTime(ct->bbiFile);
+	printBbiUpdateTime(&timep);
+	}
+    else
+	printUpdateTime(CUSTOM_TRASH, ct->tdb, ct);
     }
 
 if (!ct)
     {
     /* Print data version trackDB setting, if any */
     char *version = trackDbSetting(tdb, "dataVersion");
     if (version)
         printf("<B>Data version:</B> %s<BR>\n", version);
 
    /* Print lift information from trackDb, if any */
    trackDbPrintOrigAssembly(tdb, database);
+   /* this old prohibition on avoiding wigMaf types is probably
+    * out of date.  The more general case is probably to do something
+    * special for composite tracks of all types.
+    */
 
-   if (hTableOrSplitExists(database, tdb->table))
-        {
-        /* Print update time of the table (or one of the components if split) */
-        char *tableName = hTableForTrack(database, tdb->table);
-	struct sqlConnection *conn = hAllocConnProfile(getTrackProfileName(tdb), database);
-
-	char *date = firstWordInLine(sqlTableUpdate(conn, tableName));
-	if (date != NULL && !startsWith("wigMaf", tdb->type))
-	    printf("<B>Data last updated:</B> %s<BR>\n", date);
-	hFreeConn(&conn);
-	}
+    if (!startsWith("wigMaf", tdb->type))
+	printUpdateTime(database, tdb, NULL);
     }
 
 if (tdb->html != NULL && tdb->html[0] != 0)
     {
     htmlHorizontalLine();
     // include anchor for Description link
     puts("<A NAME=TRACK_HTML></A>");
     printf("<table class='windowSize'><tr valign='top'><td>");
 
     // Add pennantIcon
     printPennantIconNote(tdb);
 
     puts(tdb->html);
     printf("</td><td>");
     makeTopLink(tdb);