'Job Name',
'header' => TRUE,
'width' => '20%',
],
$node->loader_name,
];
// Submitted By
$rows[] = [
[
'data' => 'Submitted By',
'header' => TRUE,
],
$node->uid,
];
// Job Creation Date
$rows[] = [
[
'data' => 'Job Creation Date',
'header' => TRUE,
],
format_date($node->created, 'custom', "F j, Y, g:i a"),
];
// Last Updated
$rows[] = [
[
'data' => 'Last Updated',
'header' => TRUE,
],
format_date($node->changed, 'custom', "F j, Y, g:i a"),
];
// Template Name
$rows[] = [
[
'data' => 'Template Name',
'header' => TRUE,
],
$node->template->name,
];
// Data File
$rows[] = [
[
'data' => 'Data File',
'header' => TRUE,
],
$node->file,
];
// Job Status
$rows[] = [
[
'data' => 'Job Status',
'header' => TRUE,
],
$node->job_status,
];
//Job Progress
if (isset($node->job)) {
if (isset($node->job->progress)) {
$rows[] = [
[
'data' => 'Job Progress',
'header' => TRUE,
],
$node->job->progress . '% (' . l('view job', 'admin/tripal/tripal_jobs/view/' . $node->job_id) . ')',
];
}
}
// the $table array contains the headers and rows array as well as other
// options for controlling the display of the table. Additional
// documentation can be found here:
// https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
$table = [
'header' => $headers,
'rows' => $rows,
'attributes' => [
'id' => 'tripal_bulk_loader-table-base',
'class' => 'tripal-data-table',
],
'sticky' => FALSE,
'caption' => '',
'colgroups' => [],
'empty' => '',
];
// once we have our table array structure defined, we call Drupal's theme_table()
// function to generate the table.
print theme_table($table);
// add the "submit" button for adding a loading job to the Tripal jobs management system
$form = drupal_get_form('tripal_bulk_loader_add_loader_job_form', $node);
print drupal_render($form);
// if we have inserted records then load the summary:
if (!empty($node->inserted_records)) {
print 'Loading Summary
';
// the $headers array is an array of fields to use as the colum headers.
// additional documentation can be found here
// https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
$headers = ['Chado Table', 'Number of Records Inserted'];
// the $rows array contains an array of rows where each row is an array
// of values for each column of the table in that row. Additional documentation
// can be found here:
// https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
$rows = [];
$total = 0;
foreach ($node->inserted_records as $r) {
$row = [];
$row[] = $r->table_inserted_into;
$row[] = $r->num_inserted;
$rows[] = $row;
$total = $total + $r->num_inserted;
}
$rows[] = ['TOTAL', '' . $total . ''];
// the $table array contains the headers and rows array as well as other
// options for controlling the display of the table. Additional
// documentation can be found here:
// https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
$table = [
'header' => $headers,
'rows' => $rows,
'attributes' => [],
'sticky' => FALSE,
'caption' => '',
'colgroups' => [],
'empty' => '',
];
// once we have our table array structure defined, we call Drupal's theme_table()
// function to generate the table.
print theme_table($table);
} ?>
$node->template->template_id]);