diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index e2b8ace4783..ca5757dc452 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -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'); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index ec8ebdd67e6..3e388677605 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -584,7 +584,7 @@ if ($object->id > 0) { print ''; } - if (!empty($conf->intracommreport->enabled)) { + if (isModEnabled('intracommreport')) { // Transport mode by default print ''; print ''; @@ -1146,7 +1146,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index d5c0d333d03..6d66f70ceeb 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -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 ''; } -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 ''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5b5de36406a..2c438fdd98c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -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) { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 17235576394..a1446bf6964 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -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"); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 65b512ec18e..19578ec9fe3 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -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; diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index e70cdad999e..2e31bdef7db 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -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"; } diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index c11c37d11ef..7e7d010ed5d 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -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)) { diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 49bd25d0b90..c37ce4690f4 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -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"))); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 6bbca0026e1..7572dd3f3d8 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -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")) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ddf54ba0727..f5ed12fd984 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2465,7 +2465,7 @@ if ($action == 'create') { } // Intracomm report - if (!empty($conf->intracommreport->enabled)) { + if (isModEnabled('intracommreport')) { $langs->loadLangs(array("intracommreport")); print '
'; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d7eb7f53d82..ff7c0051a29 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -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 '
'.dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks).'
'.$langs->trans('IntracommReportTransportMode').''; $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 '
'; print ''; // Social networks - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; @@ -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 ''; // Social network - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 424d18c2058..b8111274969 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -249,7 +249,7 @@ print ''; 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 { diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index fed40e6a1bd..0dd8a7f9d08 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -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 ''; // Social networks - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; @@ -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 ''; - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active']) { print ''; @@ -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 diff --git a/htdocs/user/list.php b/htdocs/user/list.php index e98922f7e01..e22f95d1055 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -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; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 49dc7e7f7a3..6d5a27cd8ba 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -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")) {
'; diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 861bde0fb51..dfa47df91a3 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -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 '
'; 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 '
'; // 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"; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 06fdbfba0a5..d5ccb96eaf7 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -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 '
'.img_picto('', 'globe', 'class="pictofixedwidth"').'
'.img_picto('', 'globe', 'class="pictofixedwidth"').'
'; $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"; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index c4e2715f664..45d7c91a8bb 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -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 '
'; $text = $langs->trans("ForceUserHolidayValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -1128,7 +1128,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'.$langs->trans($value['label']).'
'; $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 '
'; $text = $langs->trans("ForceUserHolidayValidator"); print $form->textwithpicto($text, $langs->trans("ValidatorIsSupervisorByDefault"), 1, 'help'); @@ -2507,7 +2507,7 @@ if ($action == 'create' || $action == 'adduserldap') { } print '
'.$langs->trans($value['label']).'