Fix fatal errors

ofaj
jmontoyaa 9 years ago
parent dea8b82350
commit 4a1f9956cd
  1. 15
      load_search.php
  2. 37
      search.php

@ -294,16 +294,11 @@ $domaine1 = $form->getElementByName('extra_domaine[0]');
$domaine2 = $form->getElementByName('extra_domaine[1]'); $domaine2 = $form->getElementByName('extra_domaine[1]');
$domaine3 = $form->getElementByName('extra_domaine[2]'); $domaine3 = $form->getElementByName('extra_domaine[2]');
$userForm->setDefaults($defaults); $userForm->setDefaults($defaults);
$domainList = []; $domainList = array_merge(
if ($domaine1) { $domaine1->getValue(),
$domainList[] = $domaine1->getValue(); $domaine3->getValue(),
} $domaine2->getValue()
if ($domaine2) { );
$domainList[] = $domaine2->getValue();
}
if ($domaine3) {
$domainList[] = $domaine3->getValue();
}
$themeList = []; $themeList = [];
$extraField = new ExtraField('session'); $extraField = new ExtraField('session');
$resultOptions = $extraField->searchOptionsFromTags('extra_domaine', 'extra_'.$theme, $domainList); $resultOptions = $extraField->searchOptionsFromTags('extra_domaine', 'extra_'.$theme, $domainList);

@ -41,8 +41,8 @@ $diagnosisComplete = $extraFieldValue->get_values_by_handler_and_field_variable(
if ($diagnosisComplete && isset($diagnosisComplete['value']) && $diagnosisComplete['value'] == 1) { if ($diagnosisComplete && isset($diagnosisComplete['value']) && $diagnosisComplete['value'] == 1) {
if (!isset($_GET['result'])) { if (!isset($_GET['result'])) {
header('Location:'.api_get_self().'?result=1'); //header('Location:'.api_get_self().'?result=1');
exit; //exit;
} }
} }
@ -530,25 +530,26 @@ $(document).ready(function(){
</script>'; </script>';
$userForm->addButtonSave(get_lang('Save')); $userForm->addButtonSave(get_lang('Save'));
$userForm->setDefaults($defaults);
/** @var HTML_QuickForm_select $element */ /** @var HTML_QuickForm_select $element */
$domaine1 = $form->getElementByName('extra_domaine[0]'); $domaine1 = $userForm->getElementByName('extra_domaine[0]');
$domaine2 = $form->getElementByName('extra_domaine[1]'); $domaine2 = $userForm->getElementByName('extra_domaine[1]');
$domaine3 = $form->getElementByName('extra_domaine[2]'); $domaine3 = $userForm->getElementByName('extra_domaine[2]');
$userForm->setDefaults($defaults);
$domainList = []; $domainList = array_merge(
if ($domaine1) { $domaine1->getValue(),
$domainList[] = $domaine1->getValue(); $domaine3->getValue(),
} $domaine2->getValue()
if ($domaine2) { );
$domainList[] = $domaine2->getValue();
}
if ($domaine3) {
$domainList[] = $domaine3->getValue();
}
$themeList = []; $themeList = [];
$extraField = new ExtraField('session'); $extraField = new ExtraField('session');
$resultOptions = $extraField->searchOptionsFromTags('extra_domaine', 'extra_'.$theme, $domainList); $resultOptions = $extraField->searchOptionsFromTags(
'extra_domaine',
'extra_'.$theme,
$domainList
);
if ($resultOptions) { if ($resultOptions) {
$resultOptions = array_column($resultOptions, 'tag', 'id'); $resultOptions = array_column($resultOptions, 'tag', 'id');
@ -556,7 +557,7 @@ if ($resultOptions) {
for ($i = 0; $i < 5; $i++) { for ($i = 0; $i < 5; $i++) {
/** @var HTML_QuickForm_select $theme */ /** @var HTML_QuickForm_select $theme */
$themeElement = $form->getElementByName('extra_'.$theme.'['.$i.']'); $themeElement = $userForm->getElementByName('extra_'.$theme.'['.$i.']');
foreach ($resultOptions as $key => $value) { foreach ($resultOptions as $key => $value) {
$themeElement->addOption($value, $value); $themeElement->addOption($value, $value);
} }

Loading…
Cancel
Save