use isModEnabled function

This commit is contained in:
Frédéric France 2022-06-09 22:49:48 +02:00
parent 5dcfc28913
commit 0b8179d7ef
7 changed files with 13 additions and 13 deletions

View File

@ -38,7 +38,7 @@ $validatemonth = GETPOST('validatemonth', 'int');
$validateyear = GETPOST('validateyear', 'int');
// Security check
if (empty($conf->accounting->enabled)) {
if (!isModEnabled('accounting')) {
accessforbidden();
}
if ($user->socid > 0) {
@ -75,7 +75,7 @@ $action = GETPOST('action', 'aZ09');
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
// Security check
if (empty($conf->accounting->enabled)) {
if (!isModEnabled('accounting')) {
accessforbidden();
}
if ($user->socid > 0) {

View File

@ -188,7 +188,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<br>';
// For thirdparty
if ($conf->societe->enabled) {
if (isModEnabled('societe')) {
$nbno = $nbtotal = 0;
print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"), '', 'company');

View File

@ -343,11 +343,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme
$sql.= " rp.rowid as jobid, rp.ref as jobref, rp.label";
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as rp ON rc.fk_recruitmentjobposition = rp.rowid";
if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) {
if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentcandidature->element).")";
if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) {
if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) {
$sql .= " AND rp.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {

View File

@ -592,7 +592,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref = '<div class="refidno">';
// Thirdparty
if ($conf->societe->enabled) {
if (isModEnabled('societe')) {
$morehtmlref .= $langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '').'<br>';
}
// Project

View File

@ -602,7 +602,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
}
// Thirdparty
if ($conf->societe->enabled) {
if (isModEnabled('societe')) {
print '<tr><td>';
print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : '<span class="fieldrequired">');
print $langs->trans("ThirdParty");
@ -898,7 +898,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '</td></tr>';
// Thirdparty
if ($conf->societe->enabled) {
if (isModEnabled('societe')) {
print '<tr><td>';
print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : '<span class="fieldrequired">');
print $langs->trans("ThirdParty");

View File

@ -331,11 +331,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status, COUNT(rc.rowid) as nbapplications";
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = s.rowid";
if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) {
if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE s.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) {
if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) {
$sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
@ -402,11 +402,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme
$sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status";
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid";
if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) {
if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) {
if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) {
$sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {

View File

@ -2860,7 +2860,7 @@ class Ticket extends CommonObject
$sql = "SELECT p.rowid, p.ref, p.datec as datec";
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as p";
if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$user->socid) {
if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$user->socid) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc";
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
$clause = " AND";