Merge pull request #8545 from atm-florian/7.0_fix8436

fix #8436
This commit is contained in:
Laurent Destailleur 2018-04-11 17:23:40 +02:00 committed by GitHub
commit 693f0da2a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -461,6 +461,9 @@ else
// Type // Type
print '<td class="liste_titre">'; print '<td class="liste_titre">';
if (empty($mysoc->country_id)) {
setEventMessages(null, array($langs->trans("ErrorSetACountryFirst"),$langs->trans("CompanyFoundation")),'errors');
} else {
$typeleaves=$holidaystatic->getTypes(1,-1); $typeleaves=$holidaystatic->getTypes(1,-1);
$arraytypeleaves=array(); $arraytypeleaves=array();
foreach($typeleaves as $key => $val) foreach($typeleaves as $key => $val)
@ -470,6 +473,7 @@ foreach($typeleaves as $key => $val)
$arraytypeleaves[$val['rowid']]=$labeltoshow; $arraytypeleaves[$val['rowid']]=$labeltoshow;
} }
print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1); print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1);
}
print '</td>'; print '</td>';
// Duration // Duration
@ -524,7 +528,7 @@ if ($id && empty($user->rights->holiday->read_all) && ! in_array($id, $childids)
$result = 0; $result = 0;
} }
// Lines // Lines
elseif (! empty($holiday->holiday)) elseif (! empty($holiday->holiday) && !empty($mysoc->country_id))
{ {
$userstatic = new User($db); $userstatic = new User($db);
$approbatorstatic = new User($db); $approbatorstatic = new User($db);