Browse Source

Fixed merged conflict

Stephen Ficklin 6 years ago
parent
commit
e1e7ec0c01

+ 14 - 5
tripal/includes/tripal.jobs.inc

@@ -279,12 +279,21 @@ function tripal_jobs_view($job_id) {
   }
 
   // build the links
-  $links  = l('Return to jobs list', "admin/tripal/tripal_jobs/") . ' | ';
-  $links .= l('Re-run this job', "admin/tripal/tripal_jobs/rerun/" . $job->job_id) . ' | ';
+  $items = [];
+  $items[] = l('Return to jobs list', "admin/tripal/tripal_jobs/");
+  $items[] = l('Re-run this job', "admin/tripal/tripal_jobs/rerun/" . $job->job_id);
   if ($job->start_time == 0 and $job->end_time == 0) {
-    $links .= l('Cancel this job', "admin/tripal/tripal_jobs/cancel/" . $job->job_id) . ' | ';
-    $links .= l('Execute this job', "admin/tripal/tripal_jobs/execute/".$job->job_id);
+    $items[] = l('Cancel this job', "admin/tripal/tripal_jobs/cancel/" . $job->job_id);
+    $items[] = l('Execute this job', "admin/tripal/tripal_jobs/execute/".$job->job_id);
   }
+  $links = theme_item_list([    
+    'items' => $items,
+    'title' => '',
+    'type' => 'ul',
+    'attributes' => [
+      'class' => ['action-links'],
+    ],
+  ]);
 
   // make our start and end times more legible
   $job->submit_date = tripal_get_job_submit_date($job);
@@ -320,7 +329,7 @@ function tripal_jobs_view($job_id) {
 
   $content['links'] = array(
     '#type' => 'markup',
-    '#markup' => '<p>' . substr($links, 0, -2) . '</p>',
+    '#markup' => $links,
   );
   $content['job_title'] = array(
     '#type' => 'item',

+ 5 - 1
tripal/theme/css/tripal.css

@@ -109,4 +109,8 @@ div.messages.tripal-site-admin-only {
   height: 500px;
   overflow: scroll;
   font-framily: Courier New, monospace;
-}
+}
+
+.item-list .action-links li {
+	list-style-type: none;
+} 

+ 1 - 1
tripal_chado/api/tripal_chado.api.inc

@@ -106,7 +106,7 @@ function chado_publish_records($values, $job = NULL) {
   }
 
   // Load the term for use in setting the alias for each entity created.
-  $term = entity_load('TripalTerm', array('id' => $entity->term_id));
+  $term = entity_load('TripalTerm', array('id' => $bundle->term_id));
   $cache['term'] = $term;
 
   $table = $chado_bundle->data_table;

+ 22 - 14
tripal_chado/includes/loaders/tripal_chado.pub_importers.inc

@@ -876,7 +876,7 @@ function tripal_pub_importer_delete($import_id) {
  *
  * @param $pubs
  *   An array containing a list of publications to add to Chado.  The
- *   array contains a set of details for the publication. 
+ *   array contains a set of details for the publication.
  * @param $do_contact
  *   Set to TRUE if authors should automatically have a contact record added
  *   to Chado.
@@ -961,7 +961,9 @@ function tripal_pub_add_publications($pubs, $do_contact, $update = FALSE, $job =
 }
 
 /**
- * Adds a new publication to the Chado, along with all properties and
+ * Adds a new publication to Chado.
+ * 
+ * In addition, all properties and
  * database cross-references. If the publication does not already exist
  * in Chado then it is added.  If it does exist nothing is done.  If
  * the $update parameter is TRUE then the publication is updated if it exists.
@@ -975,23 +977,23 @@ function tripal_pub_add_publications($pubs, $do_contact, $update = FALSE, $job =
  *   Optional. Set to TRUE if a contact entry should be added to the Chado 
  *   contact table for authors of the publication.
  * @param $update_if_exists
- *   Optional.  If the publication already exists then this function will return
- *   without adding a new publication.  However, set this value to TRUE to force
- *   the function to pudate the publication using the $pub_details that are 
- *   provided.
+ *   Optional.  If the publication already exists then this function will 
+ *   return without adding a new publication.  However, set this value to 
+ *   TRUE to force the function to pudate the publication using the 
+ *   $pub_details that are provided.   
  * @param $job
  *   The jobs management object for the job if this function is run as a job. 
  *   This argument is added by Tripal during a job run and is not needed if
  *   this function is run directly.
  * @return
  *   If the publication already exists, is inserted or updated then the 
- *   publication ID is returned, otherwise FALSE is returned. If the publication
- *   already exists and $update_if_exists is not TRUE then the $action variable 
- *   is set to 'skipped'. If the publication already exists and 
- *   $update_if_exists is TRUE and if the update was successful then $action 
- *   is set to 'updated'.  Otherwise on successful insert the $action variable 
- *   is set to 'inserted'.  If the function failes then the $action variable 
- *   is set to 'error'
+ *   publication ID is returned, otherwise FALSE is returned. If the 
+ *   publication already exists and $update_if_exists is not TRUE then the 
+ *   $action variable is set to 'skipped'. If the publication already exists 
+ *   and $update_if_exists is TRUE and if the update was successful then 
+ *   $action is set to 'updated'.  Otherwise on successful insert the 
+ *   $action variable is set to 'inserted'.  If the function failes then the
+ *   $action variable is set to 'error'
  *
  * @ingroup tripal_pub
  */
@@ -1159,6 +1161,12 @@ function tripal_pub_add_publication($pub_details, &$action, $do_contact = FALSE,
     if($key == 'raw') {
       continue;
     }
+    
+    // Since we're not updating the 'Publication Dbxref' on an update
+    // skip this property.
+    if ($update_if_exists and $key == 'Publication Dbxref') {
+      continue;
+    }
 
     // Get the cvterm by name.
     $identifiers = array(
@@ -1224,7 +1232,7 @@ function tripal_pub_add_publication($pub_details, &$action, $do_contact = FALSE,
     }
     if (!$success) {
       tripal_report_error($message_type, TRIPAL_ERROR, 
-        "Cannot add property '%prop' to publication. Skipping.",
+        "Cannot add property '%prop' to pubprop table. Skipping.",
         ['%prop' => $key], $error_opts);
       continue;
     }

+ 6 - 5
tripal_chado/tripal_chado.drush.inc

@@ -152,18 +152,19 @@ function drush_tripal_chado_trp_import_pubs() {
     $update = FALSE;
   }
   
+  
   if ($publish == 'Y' and $sync == 'Y' ) {
     $publish = 'both';
   }
-  elseif ($publish  != 'Y' and $sync == 'Y' ) {
+  elseif ($publish != 'Y' and $sync == 'Y') {
     $publish = 'sync';
   }
-  elseif ($publish  == 'Y'  and $sync  != 'Y' ) {
+  elseif ($publish == 'Y' and $sync != 'Y') {
     $publish = TRUE;
   }
   else {
-    $publish = TRUE;
-  } 
+    $publish = FALSE;
+  }
 
   module_load_include('inc', 'tripal_chado', 'includes/loaders/tripal_chado.pub_importers');
   if ($dbxref) {
@@ -199,7 +200,7 @@ function drush_tripal_chado_trp_update_pubs() {
     $publish = TRUE;
   }
   else {
-    $publish = TRUE;
+    $publish = FALSE;
   }
 
   module_load_include('inc', 'tripal_chado', 'includes/loaders/tripal_chado.pub_importers');