diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php
index 2f360dce5c5..58a681693e1 100644
--- a/htdocs/hrm/index.php
+++ b/htdocs/hrm/index.php
@@ -36,38 +36,35 @@ if ($conf->deplacement->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/deplace
if ($conf->expensereport->enabled) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
-$langs->load('users');
-$langs->load('holidays');
-$langs->load('trips');
+$langs->loadLangs(array('users','holidays','trips'));
-$socid=GETPOST("socid");
+$socid=GETPOST("socid","int");
// Protection if external user
if ($user->societe_id > 0) accessforbidden();
+if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
+
+$holiday = new Holiday($db);
+$holidaystatic=new Holiday($db);
+
/*
* Actions
*/
-// None
-
+// Update sold
+if (! empty($conf->holiday->enabled) && ! empty($setupcompanynotcomplete))
+{
+ $result = $holiday->updateBalance();
+}
/*
* View
*/
-$holiday = new Holiday($db);
-$holidaystatic=new Holiday($db);
-
-// Update sold
-if (! empty($conf->holiday->enabled))
-{
- $result = $holiday->updateBalance();
-}
-
$childids = $user->getAllChildIds();
$childids[]=$user->id;
@@ -76,13 +73,13 @@ llxHeader('', $langs->trans('HRMArea'));
print load_fiche_titre($langs->trans("HRMArea"),'', 'title_hrm.png');
-if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
if (! empty($setupcompanynotcomplete))
{
$langs->load("errors");
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
print '