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

Loading…
Cancel
Save