summaryrefslogtreecommitdiff
path: root/run.inc
diff options
context:
space:
mode:
Diffstat (limited to 'run.inc')
-rwxr-xr-xrun.inc25
1 files changed, 18 insertions, 7 deletions
diff --git a/run.inc b/run.inc
index 4ad250b..713ceb8 100755
--- a/run.inc
+++ b/run.inc
@@ -5,6 +5,7 @@ function lab_migration_run_form($form, &$form_state)
$options_two = _ajax_get_experiment_list();
$select_two = isset($form_state['values']['lab_experiment_list']) ? $form_state['values']['lab_experiment_list'] : key($options_two);
$url_lab_id = (int) arg(2);
+ $url_experiment_id = (int) arg(3);
if (!$url_lab_id)
{
$selected = isset($form_state['values']['lab']) ? $form_state['values']['lab'] : key($options_first);
@@ -16,7 +17,18 @@ function lab_migration_run_form($form, &$form_state)
else
{
$selected = $url_lab_id;
- ;
+ }
+ if (!$url_experiment_id)
+ {
+ $selected_experiment = isset($form_state['values']['lab_experiment_list']) ? $form_state['values']['lab_experiment_list'] : key($options_two);
+ }
+ elseif ($url_experiment_id == '')
+ {
+ $selected_experiment = 0;
+ }
+ else
+ {
+ $selected_experiment = $url_experiment_id;
}
$form = array();
$form['lab'] = array(
@@ -24,9 +36,8 @@ function lab_migration_run_form($form, &$form_state)
'#title' => t('Title of the lab'),
'#options' => _list_of_labs(),
'#default_value' => $selected,
- '#ajax' => array(
- 'callback' => 'ajax_experiment_list_callback'
- )
+ '#disabled' => TRUE,
+
);
if (!$url_lab_id)
{
@@ -48,7 +59,7 @@ function lab_migration_run_form($form, &$form_state)
);
$form['lab_experiment_list'] = array(
'#type' => 'select',
- '#title' => t('Titile of the experiment'),
+ '#title' => t('Title of the experiment'),
'#options' => _ajax_get_experiment_list($selected),
//'#default_value' => isset($form_state['values']['lab_experiment_list']) ? $form_state['values']['lab_experiment_list'] : '',
'#ajax' => array(
@@ -135,7 +146,7 @@ function lab_migration_run_form($form, &$form_state)
'#type' => 'select',
'#title' => t('Titile of the experiment'),
'#options' => _ajax_get_experiment_list($selected),
- // '#default_value' => isset($form_state['values']['lab_experiment_list']) ? $form_state['values']['lab_experiment_list'] : '',
+ '#default_value' => $selected_experiment,
'#ajax' => array(
'callback' => 'ajax_solution_list_callback'
),
@@ -156,7 +167,7 @@ function lab_migration_run_form($form, &$form_state)
$form['lab_solution_list'] = array(
'#type' => 'select',
'#title' => t('Solution'),
- '#options' => _ajax_get_solution_list($select_two),
+ '#options' => _ajax_get_solution_list($selected_experiment),
'#default_value' => isset($form_state['values']['lab_solution_list']) ? $form_state['values']['lab_solution_list'] : '',
'#ajax' => array(
'callback' => 'ajax_solution_files_callback'