fix php8 warnings

This commit is contained in:
Frédéric France 2022-08-31 21:49:10 +02:00
parent 194c76727e
commit ece2f5553a
19 changed files with 61 additions and 61 deletions

View File

@ -506,24 +506,24 @@ $tabcond[20] = (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW
$tabcond[21] = isModEnabled("propal");
$tabcond[22] = (!empty($conf->commande->enabled) || isModEnabled("propal"));
$tabcond[23] = true;
$tabcond[24] = !empty($conf->resource->enabled);
$tabcond[25] = !empty($conf->website->enabled);
$tabcond[24] = isModEnabled('resource');
$tabcond[25] = isModEnabled('website');
//$tabcond[26]= isModEnabled("product");
$tabcond[27] = isModEnabled("societe");
$tabcond[28] = !empty($conf->holiday->enabled);
$tabcond[28] = isModEnabled('holiday');
$tabcond[29] = !empty($conf->project->enabled);
$tabcond[30] = !empty($conf->label->enabled);
$tabcond[30] = isModEnabled('label');
//$tabcond[31]= !empty($conf->accounting->enabled);
$tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled));
$tabcond[33] = !empty($conf->hrm->enabled);
$tabcond[34] = !empty($conf->hrm->enabled);
$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm'));
$tabcond[33] = isModEnabled('hrm');
$tabcond[34] = isModEnabled('hrm');
$tabcond[35] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK);
$tabcond[36] = !empty($conf->expensereport->enabled) && !empty($conf->global->MAIN_USE_EXPENSE_IK);
$tabcond[37] = isModEnabled("product");
$tabcond[38] = !empty($conf->socialnetworks->enabled);
$tabcond[38] = isModEnabled('socialnetworks');
$tabcond[39] = (isModEnabled("societe") && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
$tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES));
$tabcond[41] = !empty($conf->intracommreport->enabled);
$tabcond[41] = isModEnabled('intracommreport');
$tabcond[42] = isModEnabled("product");
$tabcond[43] = isModEnabled("product") && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2;
$tabcond[44] = isModEnabled('asset');

View File

@ -584,7 +584,7 @@ if ($object->id > 0) {
print '</tr>';
}
if (!empty($conf->intracommreport->enabled)) {
if (isModEnabled('intracommreport')) {
// Transport mode by default
print '<tr><td class="nowrap">';
print '<table class="centpercent nobordernopadding"><tr><td class="nowrap">';

View File

@ -215,7 +215,7 @@ if (empty($reshook)) {
//$object->facebook = GETPOST("facebook", 'alpha');
//$object->linkedin = GETPOST("linkedin", 'alpha');
$object->socialnetworks = array();
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
$object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml');
@ -427,7 +427,7 @@ if (empty($reshook)) {
//$object->facebook = GETPOST("facebook", 'alpha');
//$object->linkedin = GETPOST("linkedin", 'alpha');
$object->socialnetworks = array();
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
$object->socialnetworks[$key] = (string) GETPOST($key, 'alphanohtml');
@ -859,7 +859,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
print '<tr>';
@ -1146,7 +1146,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</tr>';
}
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
print '<tr>';

View File

@ -83,7 +83,7 @@ if (!empty($conf->mailing->enabled)) {
} else {
$search_no_email = -1;
}
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
$search_[$key] = GETPOST("search_".$key, 'alpha');
@ -221,7 +221,7 @@ $arrayfields['unsubscribed'] = array(
'enabled'=>(!empty($conf->mailing->enabled)),
'position'=>111);
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
$arrayfields['p.'.$key] = array(
@ -289,7 +289,7 @@ if (empty($reshook)) {
$search_fax = "";
$search_email = "";
$search_no_email = -1;
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
$search_[$key] = "";
@ -499,7 +499,7 @@ if (strlen($search_phone_mobile)) {
if (strlen($search_fax)) {
$sql .= natural_search('p.fax', $search_fax);
}
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active'] && strlen($search_[$key])) {
$sql .= " AND p.socialnetworks LIKE '%\"".$key."\":\"".$search_[$key]."%'";
@ -880,7 +880,7 @@ if (!empty($arrayfields['unsubscribed']['checked'])) {
print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email);
print '</td>';
}
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
if (!empty($arrayfields['p.'.$key]['checked'])) {
@ -1004,7 +1004,7 @@ if (!empty($arrayfields['p.email']['checked'])) {
if (!empty($arrayfields['unsubscribed']['checked'])) {
print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center ');
}
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
print_liste_field_titre($arrayfields['p.'.$key]['label'], $_SERVER["PHP_SELF"], "p.".$key, $begin, $param, '', $sortfield, $sortorder);
@ -1219,7 +1219,7 @@ while ($i < min($num, $limit)) {
$totalarray['nbfield']++;
}
}
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
print '<td>'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).'</td>';

View File

@ -968,7 +968,7 @@ abstract class CommonObject
$outdone++;
}
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
$outsocialnetwork = '';
if (!empty($this->socialnetworks) && is_array($this->socialnetworks) && count($this->socialnetworks) > 0) {

View File

@ -124,7 +124,7 @@ function product_prepare_head($object)
}
// Tab to link resources
if (!empty($conf->resource->enabled)) {
if (isModEnabled('resource')) {
if ($object->isProduct() && !empty($conf->global->RESOURCE_ON_PRODUCTS)) {
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=product&ref='.$object->ref;
$head[$h][1] = $langs->trans("Resources");

View File

@ -142,9 +142,9 @@ function user_prepare_head(User $object)
complete_head_from_modules($conf, $langs, $object, $head, $h, 'user');
if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
|| (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))
|| (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read))
|| (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
|| (!empty($conf->holiday->enabled) && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall))
|| (isModEnabled('holiday') && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall))
) {
// Bank
$head[$h][0] = DOL_URL_ROOT.'/user/bank.php?id='.$object->id;

View File

@ -160,7 +160,7 @@ class modCategorie extends DolibarrModules
if (isModEnabled('agenda')) {
$typeexample .= ($typeexample ? " / " : "")."10=Agenda event";
}
if (!empty($conf->website->enabled)) {
if (isModEnabled('website')) {
$typeexample .= ($typeexample ? " / " : "")."11=Website page";
}

View File

@ -520,7 +520,7 @@ class modSociete extends DolibarrModules
$this->import_fields_array[$r] += array('s.accountancy_code_sell'=>'ProductAccountancySellCode', 's.accountancy_code_buy'=>'ProductAccountancyBuyCode');
}
// Add social networks fields
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) {
@ -693,7 +693,7 @@ class modSociete extends DolibarrModules
's.code_compta' => 'CustomerAccountancyCode',
's.code_compta_fournisseur' => 'SupplierAccountancyCode'
);
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) {
@ -757,7 +757,7 @@ class modSociete extends DolibarrModules
's.note_public' => "NotePublic"
);
// Add social networks fields
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) {
@ -835,7 +835,7 @@ class modSociete extends DolibarrModules
's.rowid' => 'Id',
's.lastname' => "Lastname",
);
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) {

View File

@ -359,7 +359,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$langs->load("trips");
$rowspan++; $sectionauto[] = array('position'=>160, 'level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
}
if (!empty($conf->holiday->enabled)) {
if (isModEnabled('holiday')) {
$langs->load("holiday");
$rowspan++; $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
}

View File

@ -152,7 +152,7 @@ if (!empty($conf->ficheinter->enabled)) {
if (!empty($conf->expensereport->enabled)) {
$langs->load("trips"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ExpenseReports")));
}
if (!empty($conf->holiday->enabled)) {
if (isModEnabled('holiday')) {
$langs->load("holiday"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays")));
}
if (isModEnabled("banque")) {

View File

@ -2465,7 +2465,7 @@ if ($action == 'create') {
}
// Intracomm report
if (!empty($conf->intracommreport->enabled)) {
if (isModEnabled('intracommreport')) {
$langs->loadLangs(array("intracommreport"));
print '<tr><td>'.$langs->trans('IntracommReportTransportMode').'</td><td>';
$form->selectTransportMode(GETPOSTISSET('transport_mode_id') ? GETPOST('transport_mode_id') : $transport_mode_id, 'transport_mode_id');
@ -3137,7 +3137,7 @@ if ($action == 'create') {
}
// Intracomm report
if (!empty($conf->intracommreport->enabled)) {
if (isModEnabled('intracommreport')) {
$langs->loadLangs(array("intracommreport"));
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';

View File

@ -47,7 +47,7 @@ if (!empty($conf->recruitment->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
}
if (!empty($conf->holiday->enabled)) {
if (isModEnabled('holiday')) {
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
}
@ -79,7 +79,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
*/
// Update sold
if (!empty($conf->holiday->enabled) && !empty($setupcompanynotcomplete)) {
if (isModEnabled('holiday') && !empty($setupcompanynotcomplete)) {
$holidaystatic = new Holiday($db);
$result = $holidaystatic->updateBalance();
}
@ -112,7 +112,7 @@ if (!empty($setupcompanynotcomplete)) {
print '<div class="fichecenter"><div class="fichethirdleft">';
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo
if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) {
if (isModEnabled('holiday') && $user->rights->holiday->read) {
$langs->load("holiday");
$listofsearchfields['search_holiday'] = array('text'=>'TitreRequestCP');
}
@ -150,7 +150,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel
}
if (!empty($conf->holiday->enabled)) {
if (isModEnabled('holiday')) {
if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) {
$holidaystatic = new Holiday($db);
$user_id = $user->id;
@ -187,7 +187,7 @@ print '</div><div class="fichetwothirdright">';
// Latest leave requests
if (!empty($conf->holiday->enabled) && $user->rights->holiday->read) {
if (isModEnabled('holiday') && $user->rights->holiday->read) {
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut as user_status,";
$sql .= " x.rowid, x.ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";

View File

@ -463,7 +463,7 @@ if (empty($reshook)) {
$object->state_id = GETPOST('state_id', 'int');
$object->socialnetworks = array();
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
@ -1083,7 +1083,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$object->state_id = GETPOST('state_id', 'int');
$object->socialnetworks = array();
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
@ -1600,7 +1600,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<td colspan="3">'.img_picto('', 'globe', 'class="pictofixedwidth"').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="url" id="url" value="'.$object->url.'"></td></tr>';
// Social networks
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
print '<tr>';
@ -1929,7 +1929,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$object->state_id = GETPOST('state_id', 'int');
$object->socialnetworks = array();
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') {
$object->socialnetworks[$key] = GETPOST($key, 'alphanohtml');
@ -2287,7 +2287,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '<td colspan="3">'.img_picto('', 'globe', 'class="pictofixedwidth"').' <input type="text" name="url" id="url" class="maxwidth200onsmartphone maxwidth500 widthcentpercentminusx " value="'.(GETPOSTISSET('url') ?GETPOST('url', 'alpha') : $object->url).'"></td></tr>';
// Social network
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
print '<tr>';

View File

@ -249,7 +249,7 @@ print '</div>';
print dol_get_fiche_end();
$newcardbutton = '';
if (!empty($conf->website->enabled)) {
if (isModEnabled('website')) {
if (!empty($user->rights->societe->lire)) {
$newcardbutton .= dolGetButtonTitle($langs->trans("AddWebsiteAccount"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id));
} else {

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php';
if (!empty($conf->holiday->enabled)) {
if (isModEnabled('holiday')) {
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
}
if (!empty($conf->expensereport->enabled)) {
@ -377,7 +377,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
}
// Holiday request validator
if (!empty($conf->holiday->enabled)) {
if (isModEnabled('holiday')) {
print '<tr><td>';
$text = $langs->trans("ForceUserHolidayValidator");
print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help');
@ -407,7 +407,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
// Sensitive salary/value information
if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates
|| (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall))
|| (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) {
|| (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read))) {
$langs->load("salaries");
// Salary
@ -635,7 +635,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
}
// Latest leave requests
if (!empty($conf->holiday->enabled) && ($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id))) {
if (isModEnabled('holiday') && ($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id))) {
$holiday = new Holiday($db);
$sql = "SELECT h.rowid, h.statut as status, h.fk_type, h.date_debut, h.date_fin, h.halfday";

View File

@ -262,7 +262,7 @@ if (empty($reshook)) {
$object->office_fax = GETPOST("office_fax", 'alphanohtml');
$object->user_mobile = GETPOST("user_mobile", 'alphanohtml');
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
$object->socialnetworks = array();
foreach ($socialnetworks as $key => $value) {
if (GETPOST($key, 'alphanohtml')) {
@ -432,7 +432,7 @@ if (empty($reshook)) {
$object->office_fax = GETPOST("office_fax", 'alphanohtml');
$object->user_mobile = GETPOST("user_mobile", 'alphanohtml');
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
$object->socialnetworks = array();
foreach ($socialnetworks as $key => $value) {
if (GETPOST($key, 'alphanohtml')) {
@ -962,7 +962,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// Holiday request validator
if (!empty($conf->holiday->enabled)) {
if (isModEnabled('holiday')) {
print '<tr><td class="titlefieldcreate">';
$text = $langs->trans("ForceUserHolidayValidator");
print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help');
@ -1128,7 +1128,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '</td></tr>';
// Social networks
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
print '<tr><td>'.$langs->trans($value['label']).'</td>';
@ -1242,7 +1242,7 @@ if ($action == 'create' || $action == 'adduserldap') {
if ((!empty($conf->salaries->enabled) && $user->hasRight("salaries", "read") && in_array($id, $childids))
|| (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall"))
|| (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) {
|| (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) {
$langs->load("salaries");
// THM
@ -1514,7 +1514,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// Holiday request validator
if (!empty($conf->holiday->enabled)) {
if (isModEnabled('holiday')) {
print '<tr><td>';
$text = $langs->trans("ForceUserHolidayValidator");
print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help');
@ -1544,7 +1544,7 @@ if ($action == 'create' || $action == 'adduserldap') {
// Sensitive salary/value information
if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates
|| (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall"))
|| (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) {
|| (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) {
$langs->load("salaries");
// Salary
@ -2258,7 +2258,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// Holiday request validator
if (!empty($conf->holiday->enabled)) {
if (isModEnabled('holiday')) {
print '<tr><td class="titlefield">';
$text = $langs->trans("ForceUserHolidayValidator");
print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help');
@ -2507,7 +2507,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
print '</td></tr>';
if (!empty($conf->socialnetworks->enabled)) {
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
print '<tr><td>'.$langs->trans($value['label']).'</td>';
@ -2721,7 +2721,7 @@ if ($action == 'create' || $action == 'adduserldap') {
// Sensitive salary/value information
if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates
|| (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall"))
|| (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) {
|| (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) {
$langs->load("salaries");
// Salary

View File

@ -941,7 +941,7 @@ while ($i < $imaxinloop) {
$canreadhrmdata = 0;
if ((!empty($conf->salaries->enabled) && $user->hasRight("salaries", "read") && in_array($obj->rowid, $childids))
|| (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall"))
|| (!empty($conf->hrm->enabled) && $user->hasRight("hrm", "employee", "read"))) {
|| (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) {
$canreadhrmdata = 1;
}
$canreadsecretapi = 0;

View File

@ -192,7 +192,7 @@ if (isModEnabled("societe")) {
if (!empty($conf->project->enabled)) {
$tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea';
}
if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) {
if (isModEnabled('holiday') || !empty($conf->expensereport->enabled)) {
$tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus
}
if (isModEnabled("product") || isModEnabled("service")) {