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 node_update Updates the data submitted by the node form on edit
Related topics
File
- tripal_bulk_loader/
tripal_bulk_loader.module, line 484 - The functions for the Tripal bulk loader.
Code
function tripal_bulk_loader_update($node) {
// Update tripal_bulk_loader
$sql = "UPDATE {tripal_bulk_loader} SET nid = %d, loader_name = '%s', template_id = %d, file = '%s', file_has_header = '%s', keep_track_inserted = %d WHERE nid = %d";
db_query($sql, $node->nid, $node->loader_name, $node->template_id, $node->file, $node->has_header, $node->keep_track_inserted, $node->nid);
// Add a job if the user want to load the data
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)));
}
}
}