|
@@ -434,7 +434,7 @@ function fgcf_filter_form($form_state) {
|
|
'#options' => array(
|
|
'#options' => array(
|
|
'1' => t('Inter-entreprises'),
|
|
'1' => t('Inter-entreprises'),
|
|
'2' => t('Intra-entreprise'),
|
|
'2' => t('Intra-entreprise'),
|
|
- '3' => t('Autres'),
|
|
|
|
|
|
+ '999' => t('Autres'),
|
|
),
|
|
),
|
|
'#default_value' => $modalite,
|
|
'#default_value' => $modalite,
|
|
);
|
|
);
|
|
@@ -453,7 +453,7 @@ function fgcf_filter_form($form_state) {
|
|
function fgcf_filter_form_submit($form, &$form_state) {
|
|
function fgcf_filter_form_submit($form, &$form_state) {
|
|
foreach (array('modalite', 'dif') as $key) {
|
|
foreach (array('modalite', 'dif') as $key) {
|
|
$value = $form_state['values'][$key];
|
|
$value = $form_state['values'][$key];
|
|
- //$form_state['storage'][$key] = $value;
|
|
|
|
|
|
+ $form_state['storage'][$key] = $value;
|
|
$_SESSION['fgcf'][$key] = $value;
|
|
$_SESSION['fgcf'][$key] = $value;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -475,10 +475,22 @@ function _fgcf_filter_form_translate_values() {
|
|
if (isset($_SESSION['fgcf']['modalite'])) {
|
|
if (isset($_SESSION['fgcf']['modalite'])) {
|
|
$modalites = array_filter($_SESSION['fgcf']['modalite']);
|
|
$modalites = array_filter($_SESSION['fgcf']['modalite']);
|
|
if (!empty($modalites)) {
|
|
if (!empty($modalites)) {
|
|
|
|
+ // 'Autres' (999) means 'all other values than 1 and 2'.
|
|
|
|
+ // Translate this into actual values.
|
|
|
|
+ if (isset($modalites[999])) {
|
|
|
|
+ // Get the actual possible values from the field definition.
|
|
|
|
+ $field = content_fields('field_fgcf_fiche_modalite', 'fgcf_fiche');
|
|
|
|
+ $allowed_values = content_allowed_values($field);
|
|
|
|
+ // Remove the first 2 options.
|
|
|
|
+ unset($allowed_values[1], $allowed_values[2]);
|
|
|
|
+ // Remove the 'proxy' 'Autres' choice.
|
|
|
|
+ unset($modalites[999]);
|
|
|
|
+ // Add the actual values.
|
|
|
|
+ $modalites += drupal_map_assoc(array_keys($allowed_values));
|
|
|
|
+ }
|
|
$values['modalites'] = implode('+', array_keys($modalites));
|
|
$values['modalites'] = implode('+', array_keys($modalites));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
return $values;
|
|
return $values;
|
|
}
|
|
}
|
|
|
|
|