function tripal_bulk_loader_update

2.x tripal_bulk_loader.chado_node.inc tripal_bulk_loader_update($node)
3.x tripal_bulk_loader.chado_node.inc tripal_bulk_loader_update($node)
1.x tripal_bulk_loader.module tripal_bulk_loader_update($node)

Implements hook_update(). Updates the data submitted by the node form on edit

Related topics

File

tripal_bulk_loader/includes/tripal_bulk_loader.chado_node.inc, line 284
Tripal Bulk Loader Node functionality (jobs).

Code

function tripal_bulk_loader_update($node) {

  // Update tripal_bulk_loader
  db_update('tripal_bulk_loader')->fields(array(
    'nid' => $node->nid,
    'loader_name' => trim($node->loader_name),
    'template_id' => $node->template_id,
    'file' => trim($node->file),
    'file_has_header' => $node->has_header,
    'keep_track_inserted' => $node->keep_track_inserted
  ))->condition('nid', $node->nid)->execute();

  // Add a job if the user want to load the data
  /**
  No job checkbox in the form
  global $user;
  if ($node->job) {
    $job_args[0] =$node->loader_name;
    $job_args[1] = $node->template_id;
    $job_args[2] = $node->file;
    if (is_readable($node->file)) {
      $fname = preg_replace("/.*\/(.*)/", "$1", $node->file);
      tripal_add_job("Bulk Load: $fname", 'tripal_bulk_loader', 'tripal_bulk_loader_load_data', $job_args, $user->uid);
    }
    else {
      drupal_set_message(t("Can not open %file. Job not scheduled.", array('%file' => $node->file)));
    }
  }
  */

}