Browse Source

Fixed bug with rerunning a job. Changed Tripal panel close link to be [x]. Adjusted some text

Stephen Ficklin 8 years ago
parent
commit
7e5f828d66

+ 2 - 1
tripal/api/tripal.jobs.api.inc

@@ -250,11 +250,12 @@ function tripal_rerun_job($job_id, $goto_jobs_page = TRUE) {
   // separating them.  But as of Tripal v2.0 the arguments are stored as
   // a serialized array.  To be backwards compatible, we should check for serialization
   // and if not then we will use the old style
+  $includes = unserialize($job->includes);
   $args = unserialize($job->arguments);
   if (!$args) {
     $args = explode("::", $job->arguments);
   }
-  $job_id = tripal_add_job($job->job_name, $job->modulename, $job->callback, $args, $user_id, $job->priority);
+  $job_id = tripal_add_job($job->job_name, $job->modulename, $job->callback, $args, $user_id, $job->priority, $includes);
 
   if ($goto_jobs_page) {
     drupal_goto("admin/tripal/tripal_jobs");

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

@@ -302,7 +302,7 @@ function tripal_get_dbxref_url($dbxref) {
     // If no replacements were made above then tokens weren't used and we can
     // default to just appending the db name and accession to the end.
     if (!$db_count and !$acc_count) {
-      $final_url .= $dbxref->db_id->name . ':' . $dbxref->accession;
+      $final_url = $dbxref->db_id->urlprefix . $dbxref->db_id->name . ':' . $dbxref->accession;
     }
 
     // If the URL prefix is relative then convert it to a full URL.

+ 13 - 1
tripal_chado/includes/tripal_chado.db.inc

@@ -186,7 +186,18 @@ function tripal_chado_add_db_form_fields(&$form, $form_state, $dbid = NULL) {
   $form['fields']['urlprefix']= array(
     '#type'          => 'textfield',
     '#title'         => t('URL prefix'),
-    '#description'   => t('Tripal can provide links to external databases when accession numbers or unique identifiers are known.  Typically, a database will provide a unique web address for each accession and the accession usually is the last component of the page address.  Please enter the web address, minus the accession number for this database.  When an accession number is present, Tripal will combine this web address with the accession and provide a link to the external site.'),
+    '#description'   => t('Tripal can provide links to external databases
+        when accession numbers or unique identifiers are known.  Typically,
+        a database will provide a unique web address for each accession and
+        the accession usually is the last component of the page address.
+        Please enter the web address, minus the accession number for this
+        database.  By default, Tripal will
+        combine this "URL prefix" with the database short name and
+        accession to create a link to the external site. But, you can
+        also use the tokens {db} and {accession} within the URL prefix
+        to specify exactly where the database short name and the accession
+        should be added.  Tripal will substitute the actual values in
+        place of these tokens to create the link. (e.g. URL prefix: https://phytozome.jgi.doe.gov/phytomine/portal.do?externalid=PAC:{accession}).'),
     '#default_value' => $default_urlprefix,
     '#maxlength'     => 255,
   );
@@ -251,6 +262,7 @@ function tripal_chado_db_add_form_submit($form, &$form_state) {
   $success = chado_insert_record('db', $values);
   if ($success) {
     drupal_set_message(t("External database added"));
+    drupal_goto('admin/tripal/storage/chado/db');
   }
   else {
     drupal_set_message(t("Failed to add external database."));

+ 1 - 1
tripal_chado/includes/tripal_chado.semweb.inc

@@ -1194,7 +1194,7 @@ function tripal_chado_populate_vocab_TPUB() {
         'name' => 'PMID',
         'description' => 'PubMed',
         'url' => 'http://www.ncbi.nlm.nih.gov/pubmed',
-        'urlprefix' => 'http://www.ncbi.nlm.nih.gov/pubmed/'
+        'urlprefix' => 'http://www.ncbi.nlm.nih.gov/pubmed/{accession}'
       ),
       array('update_existing' => TRUE)
   );

+ 1 - 1
tripal_ds/theme/js/tripal_ds.js

@@ -5,7 +5,7 @@
 
       // Add a close button for each pane except for the te_base
       $('.field-group-fieldset .fieldset-legend').each(function (i) {
-        $(this).append('<div class="tripal_pane-fieldset-close_button"><div id="tripal-pane-close-button" class="tripal-pane-button">CLOSE</div></div>');
+        $(this).append('<div class="tripal_pane-fieldset-close_button"><div id="tripal-pane-close-button" class="tripal-pane-button">[x]</div></div>');
         var id = '.tripal_pane-fieldset-' + $(this).attr('id');
       });
       // Hide the pane when the close button is clicked