function tripal_jobs_report_form
2.x tripal_core.jobs.inc | tripal_jobs_report_form($form, &$form_state = NULL) |
3.x tripal.jobs.inc | tripal_jobs_report_form($form, &$form_state = NULL) |
1.x jobs.inc | tripal_jobs_report_form($form, &$form_state = NULL) |
Related topics
1 string reference to 'tripal_jobs_report_form'
- tripal_jobs_report in tripal_core/
includes/ jobs.inc - Returns the Tripal Job Report
File
- tripal_core/
includes/ jobs.inc, line 13 - Contains functions related to the display of Tripal jobs in a Tripal website.
Code
function tripal_jobs_report_form($form, &$form_state = NULL) {
$form = array();
// set the default values
$default_status = $form_state['values']['job_status'];
$default_job_name = $form_state['values']['job_name'];
if (!$default_status) {
$default_status = $_SESSION['tripal_job_filter']['job_status'];
}
if (!$default_job_name) {
$default_job_name = $_SESSION['tripal_job_filter']['job_name'];
}
$form['job_status'] = array(
'#type' => 'select',
'#title' => t('Filter by Job Status'),
'#default_value' => $default_status,
'#options' => array(
0 => 'All Jobs',
'Running' => 'Running',
'Waiting' => 'Waiting',
'Completed' => 'Completed',
'Cancelled' => 'Cancelled',
'Error' => 'Error',
),
);
$form['job_name'] = array(
'#type' => 'textfield',
'#title' => t('Filter by Job Name'),
'#description' => t('The jobs will be filtered if text provided is contained in the job name'),
'#default_value' => $default_job_name,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Filter'),
);
return $form;
}