Browse Source

Add the value of type_id of the pub table to the 'Publication Types'.

Chun-Huai Cheng 11 years ago
parent
commit
dd142c27cb
2 changed files with 3 additions and 4 deletions
  1. 1 2
      tripal_pub/api/tripal_pub.api.inc
  2. 2 2
      tripal_pub/includes/pub_citation.inc

+ 1 - 2
tripal_pub/api/tripal_pub.api.inc

@@ -1014,6 +1014,7 @@ function tripal_pub_get_publication_array($pub_id, $skip_existing = TRUE) {
   if (trim($pub->uniquename)) {
     $pub_array['Uniquename'] = $pub->uniquename;
   }
+  $pub_array['Publication Type'][] = $pub->type_id->name;
 
   // ---------------------------------
   // get the citation
@@ -1053,8 +1054,6 @@ function tripal_pub_get_publication_array($pub_id, $skip_existing = TRUE) {
     foreach ($ptypes as $ptype) {
      $pub_array['Publication Type'][] = $ptype->value;
     }
-  } else {
-  	return FALSE;
   }
 
   // ---------------------------------

+ 2 - 2
tripal_pub/includes/pub_citation.inc

@@ -44,11 +44,11 @@ function tripal_pub_create_citations ($options) {
   $citation_type_id = db_result(chado_query("SELECT cvterm_id FROM {cvterm} WHERE name = 'Citation' AND cv_id = (SELECT cv_id FROM {cv} WHERE name = 'tripal_pub')"));
   // Create and replace citation for all pubs
   if ($options == 'all') {
-  	$sql = "SELECT pub_id FROM {pub} P";
+  	$sql = "SELECT pub_id FROM {pub} P WHERE pub_id <> 1";
     $skip_existing = FALSE;
   // Create citation for pubs that don't already have one
   } else if ($options == 'new') {
-  	$sql = "SELECT pub_id FROM {pub} P WHERE (SELECT value FROM {pubprop} PB WHERE type_id = $citation_type_id AND P.pub_id = PB.pub_id AND rank = 0) IS NULL";
+  	$sql = "SELECT pub_id FROM {pub} P WHERE (SELECT value FROM {pubprop} PB WHERE type_id = $citation_type_id AND P.pub_id = PB.pub_id AND rank = 0) IS NULL AND  pub_id <> 1";
   	$skip_existing = TRUE;
   }