Browse Source

Merge branch '6.x-1.x' of git.drupal.org:sandbox/spficklin/1337878 into 6.x-1.x

spficklin 12 years ago
parent
commit
90ec2cefd1

+ 2 - 2
tripal_bulk_loader/tripal_bulk_loader.loader.inc

@@ -513,8 +513,8 @@ function process_data_array_for_line($priority, &$data, &$default_data, $addt) {
     // Use prepared statement?
     if (variable_get('tripal_bulk_loader_prepare', TRUE)) {
       $options = array('statement_name' => 'record_' . $priority);
-      if ($addt->line_num == 1 && $addt->group_index == 1) {
-        $options['prepare'] = TRUE;
+      if (($addt->line_num > 1 && $addt->group_index == 1) OR $addt->group_index > 1) {
+        $options['is_prepared'] = TRUE;
       }
     }
     else {

+ 2 - 2
tripal_core/includes/jobs.php

@@ -54,7 +54,7 @@
  * tripal_add_job("Import FASTA file: $dfile", 'tripal_feature',
  *   'tripal_feature_load_fasta', $args, $user->uid);
  * @endcode
- * The code above is copied from the tripal_feature/fasta_loader.php file. The 
+ * The code above is copied from the tripal_feature/fasta_loader.php file. The
  * snipped first builds an array of arguments that will then be passed to the
  * tripal_add_job function.  The number of arguments provided in the $arguments
  * variable should match the argument set for the callback function provided
@@ -79,7 +79,7 @@ function tripal_add_job($job_name, $modulename, $callback, $arguments, $uid, $pr
   }
   if (drupal_write_record('tripal_jobs', $record)) {
     $jobs_url = url("admin/tripal/tripal_jobs");
-    drupal_set_message(t("Job '%job_name' submitted.  Check the %jobs_link for status", array('%job_name' => $job_name, '%jobs_link' => l($jobs_url, 'jobs page'))));
+    drupal_set_message(t("Job '%job_name' submitted.  Check the <a href='!jobs_url'>jobs page</a> for status", array('%job_name' => $job_name, '!jobs_url' => url($jobs_url))));
   }
   else {
     drupal_set_message(t("Failed to add job %job_name.", array('%job_name' => $job_name)), 'error');

+ 1 - 1
tripal_feature/includes/syncFeatures.inc

@@ -261,7 +261,7 @@ function tripal_feature_sync_features($max_sync = 0, $organism_id = NULL,
       # to avoid this problem we will call this script through an
       # independent system call
       print "$i of $num_ids Syncing feature id: $feature_id\n";
-      $cmd = "php " . drupal_get_path('module', 'tripal_feature') . "/syncFeatures.php -f $feature_id ";
+      $cmd = "php " . drupal_get_path('module', 'tripal_feature') . "/includes/syncFeatures.inc -f $feature_id ";
       system($cmd);
 
     }

+ 25 - 16
tripal_feature/includes/tripal_feature-relationships.inc

@@ -119,14 +119,17 @@ function tripal_feature_add_ONE_relationship_form_validate($form, &$form_state)
       $links= array();
       for ($i=0; $i<sizeof($subject_results); $i++) {
       $links[] = l($i+1, "node/" . $subject_results[$i]->nid); }
-      $message = "Too many stocks match '" . $form_state['values']['subject_id'] . "'! "
-                  . " Please refine your input to match ONLY ONE stock. <br />"
-     . "To aid in this process, here are the stocks that match your initial input: "
-     . join(', ', $links);
+      $message = t("Too many features match '%object'! Please refine your input to match
+        ONLY ONE feature. <br />To aid in this process, here are the features that
+        match your initial input: %features",
+        array('%object' => $form_state['values']['subject_id'],
+          '%features' => join(', ', $links)
+        )
+      );
       form_set_error('subject_id', $message);
     }
     elseif (sizeof($subject_results) < 1) {
-      form_set_error('subject_id', t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
+      form_set_error('subject_id', t("There are no features matching your input. Please check your input for typos and/or lookup the feature <a href='!url'>here</a>", array('!url' => url('features'))));
     }
     elseif (sizeof($subject_results) == 1) {
       $form_state['values']['subject_id'] = $subject_results[0]->stock_id;
@@ -140,14 +143,17 @@ function tripal_feature_add_ONE_relationship_form_validate($form, &$form_state)
       $links= array();
       for ($i=0; $i<sizeof($object_results); $i++) {
       $links[] = l($i+1, "node/" . $object_results[$i]->nid); }
-      $message = "Too many stocks match '" . $form_state['values']['object_id'] . "'! "
-                 . "Please refine your input to match ONLY ONE stock. <br />"
-                 . "To aid in this process, here are the stocks that match your initial input: "
-                 . join(', ', $links);
+      $message = t("Too many features match '%object'! Please refine your input to match
+        ONLY ONE stock. <br />To aid in this process, here are the stocks that match
+        your initial input: %features",
+        array('%object' => $form_state['values']['object_id'],
+        '%features' => join(', ', $links)
+        )
+      );
       form_set_error('object_id', $message);
     }
     elseif (sizeof($object_results) < 1) {
-      form_set_error('object_id', t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
+      form_set_error('object_id', t("There are no features matching your input. Please check your input for typos and/or lookup the feature <a href='!url'>here</a>", array('!url' => url('features'))));
     }
     elseif (sizeof($object_results) == 1) {
       $form_state['values']['object_id'] = $object_results[0]->stock_id;
@@ -351,14 +357,17 @@ function tripal_feature_edit_ALL_relationships_form_validate($form, &$form_state
         $links= array();
         for ($j=0; $j<sizeof($subject_results); $j++) {
         $links[] = l($j+1, "node/" . $subject_results[$j]->nid); }
-        $message = "Too many stocks match '" . $form_state['values']["subject_id-$i"] . "'! "
-                 . "Please refine your input to match ONLY ONE stock. <br />"
-                 . "To aid in this process, here are the stocks that match your initial input: "
-                 . join(', ', $links);
+        $message = t("Too many features match '%subject'!  Please refine your input to
+          match ONLY ONE feature. <br /> To aid in this process, here are the features that
+          match your initial input: %features",
+          array('%subject' => $form_state['values']["subject_id-$i"],
+            '%features' => join(', ', $links)
+          )
+        );
         form_set_error("subject_id-$i", $message);
       }
       elseif (sizeof($subject_results) < 1) {
-        form_set_error("subject_id-$i", t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
+        form_set_error("subject_id-$i", t("There are no features matching your input. Please check your input for typos and/or lookup the <a href='!url'>here</a>", array('!url' => url('features'))));
       }
       elseif (sizeof($subject_results) == 1) {
         $form_state['values']["subject_id-$i"] = $subject_results[0]->stock_id;
@@ -379,7 +388,7 @@ function tripal_feature_edit_ALL_relationships_form_validate($form, &$form_state
         form_set_error("object_id-$i", $message);
       }
       elseif (sizeof($object_results) < 1) {
-        form_set_error("object_id-$i", t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
+        form_set_error("object_id-$i", t("There are no features matching your input. Please check your input for typos and/or lookup the <a href='!url'>here</a>", array('!url' => url('features'))));
       }
       elseif (sizeof($object_results) == 1) {
         $form_state['values']["object_id-$i"] = $object_results[0]->stock_id;

+ 18 - 12
tripal_stock/tripal_stock-relationships.inc

@@ -121,7 +121,7 @@ function tripal_stock_add_ONE_relationship_form_validate($form, &$form_state) {
       form_set_error('subject_id', $message);
     }
     elseif (sizeof($subject_results) < 1) {
-      form_set_error('subject_id', t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
+      form_set_error('subject_id', t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock <a href='!url'>here</a>", array('!url' => url('stocks'))));
     }
     elseif (sizeof($subject_results) == 1) {
       $form_state['values']['subject_id'] = $subject_results[0]->stock->stock_id;
@@ -133,14 +133,17 @@ function tripal_stock_add_ONE_relationship_form_validate($form, &$form_state) {
       $links= array();
       for ($i=0; $i<sizeof($object_results); $i++) {
       $links[] = l($i+1, "node/" . $object_results[$i]->nid); }
-      $message = "Too many stocks match '" . $form_state['values']['object_id'] . "'! "
-                 . "Please refine your input to match ONLY ONE stock. <br />"
-                 . "To aid in this process, here are the stocks that match your initial input: "
-                 . join(', ', $links);
+      $message = t("Too many stocks match '%object'!  Please refine your input to match
+        ONLY ONE stock. <br /> To aid in this process, here are the stocks that match your
+        initial input: %stocks.",
+        array('%object' => $form_state['values']['object_id'],
+          '%stocks' => join(', ', $links)
+        )
+      );
       form_set_error('object_id', $message);
     }
     elseif (sizeof($object_results) < 1) {
-      form_set_error('object_id', t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
+      form_set_error('object_id', t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock <a href='!url'>here</a>", array('!url' => url('stocks'))));
     }
     elseif (sizeof($object_results) == 1) {
       $form_state['values']['object_id'] = $object_results[0]->stock->stock_id;
@@ -342,14 +345,17 @@ function tripal_stock_edit_ALL_relationships_form_validate($form, &$form_state)
         $links= array();
         for ($j=0; $j<sizeof($subject_results); $j++) {
         $links[] = l($j+1, "node/" . $subject_results[$j]->nid); }
-        $message = "Too many stocks match '" . $form_state['values']["subject_id-$i"] . "'! "
-                 . "Please refine your input to match ONLY ONE stock. <br />"
-                 . "To aid in this process, here are the stocks that match your initial input: "
-                 . join(', ', $links);
+        $message = t("Too many stocks match '%subject'!  Please refine your input to match
+          ONLY ONE stock. <br /> To aid in this process, here are the stocks that match
+          your initial input: %stocks",
+          array('%subject' => $form_state['values']["subject_id-$i"],
+          '%stocks' => join(', ', $links)
+          )
+        );
         form_set_error("subject_id-$i", $message);
       }
       elseif (sizeof($subject_results) < 1) {
-        form_set_error("subject_id-$i", t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
+        form_set_error("subject_id-$i", t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock <a href='!url'>here</a>", array('!url' => url('stocks'))));
       }
       elseif (sizeof($subject_results) == 1) {
         $form_state['values']["subject_id-$i"] = $subject_results[0]->stock->stock_id;
@@ -368,7 +374,7 @@ function tripal_stock_edit_ALL_relationships_form_validate($form, &$form_state)
         form_set_error("object_id-$i", $message);
       }
       elseif (sizeof($object_results) < 1) {
-        form_set_error("object_id-$i", t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock %link", array('%link' => l(t('here'), 'stocks'))));
+        form_set_error("object_id-$i", t("There are no stocks matching your input. Please check your input for typos and/or lookup the stock <a href='!url'>here</a>", array('!url' => url('stocks'))));
       }
       elseif (sizeof($object_results) == 1) {
         $form_state['values']["object_id-$i"] = $object_results[0]->stock->stock_id;