33606b7bddc63ccc03b3e50cd6f4b27a3dab04c3
chinhli
  Wed May 14 16:24:30 2014 -0700
When display geneReviews related article on refGene and UCSC gene detail page,Associated the NBKid link to gr-short name only, for example, for SOD1, display

GeneReviews article(s) related to gene SOD1:
als-overview (Amyotrophic Lateral Sclerosis Overview)
/|\                     /|\
|                       |
NBKid link             No Link

diff --git src/hg/hgGene/geneReviews.c src/hg/hgGene/geneReviews.c
index e82eb41..469aa36 100644
--- src/hg/hgGene/geneReviews.c
+++ src/hg/hgGene/geneReviews.c
@@ -1,89 +1,89 @@
 /* GeneReviews - print out GeneReviews for this gene. */
 
 #include "common.h"
 #include "hash.h"
 #include "hdb.h"
 #include "linefile.h"
 #include "dystring.h"
 #include "hgGene.h"
 
 static void geneReviewsPrint(struct section *section, 
 	struct sqlConnection *conn, char *itemName)
 /* print GeneReviews short label associated to this refGene item */
 {
 char query[256];
 char * geneSymbol;
 if (sqlTableExists(conn, "geneReviewsDetail"))
     {
     sqlSafef(query, sizeof(query), "select geneSymbol from kgXref where kgId = '%s'", itemName);
     geneSymbol = sqlQuickString(conn, query);
     if (geneSymbol != NULL)
         {
            prGRShortKg(conn,geneSymbol);
         } else {
            hPrintf("<B>No GeneReview for this gene </B><BR>" );
     }
   }
 }
 
 void prGRShortKg(struct sqlConnection *conn, char *itemName)
 /* print GeneReviews short label associated to this refGene item */
 {
 
 struct sqlResult *sr;
 char **row;
 char query[512];
 boolean firstTime = TRUE;
 
 sqlSafef(query, sizeof(query), "select geneSymbol, grShort, NBKid, grTitle from geneReviewsDetail where geneSymbol='%s'", itemName);
 sr = sqlGetResult(conn, query);
 while ((row = sqlNextRow(sr)) != NULL)
     {
       if (firstTime)
         {
           printf("<B>GeneReviews article(s) related to gene  </B>%s:<BR>", row[0]);    
           firstTime = FALSE;
         }
        printf("<A HREF=\"http://www.ncbi.nlm.nih.gov/books/%s\" TARGET=_blank><B>%s</B></A>",row[2], row[1]);
        printf(" ("); 
-       printf("<A HREF=\"http://www.ncbi.nlm.nih.gov/books/%s\" TARGET=_blank>%s</A>", row[2], row[3]);
+       printf("%s", row[3]);
        printf(")<BR>");
      }
      sqlFreeResult(&sr);
 }
 
 static boolean geneReviewsExists(struct section *section,
         struct sqlConnection *conn, char *geneId)
 /* Return TRUE if geneReviewsDetail table exist and have GeneReviews articles
  * on this one. */
 {
 char query[256];
 char * geneSymbol;
 char * grSymbol;
 
 if (sqlTableExists(conn, "geneReviewsDetail"))
     {
        sqlSafef(query, sizeof(query), "select geneSymbol from kgXref where kgId = '%s'", geneId);
        geneSymbol = sqlQuickString(conn, query);
        if (geneSymbol != NULL)
           {
              sqlSafef(query, sizeof(query), "select  geneSymbol from geneReviewsDetail where geneSymbol='%s'", geneSymbol);
              grSymbol = sqlQuickString(conn, query);
              if (grSymbol != NULL)
                 {
                   return TRUE;
                 }
            }
      }
 return FALSE;
 }
 
 struct section *geneReviewsSection(struct sqlConnection *conn,
 	struct hash *sectionRa)
 /* Create geneReviews section. */
 {
 struct section *section = sectionNew(sectionRa, "geneReviews");
 section->exists = geneReviewsExists;
 section->print = geneReviewsPrint;
 return section;
 }