Use isModEnabled
This commit is contained in:
parent
ebba133880
commit
08bbe33379
@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ $arrayfields = array(
|
||||
'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110),
|
||||
);
|
||||
|
||||
if (!empty($conf->banque->enabled)) {
|
||||
if (isModEnabled('banque')) {
|
||||
$arrayfields['cs.fk_account'] = array('checked'=>-1, 'position'=>90, 'label'=>"DefaultBankAccount");
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ $formother = new FormOther($db);
|
||||
$bankstatic = new Account($db);
|
||||
$formsocialcontrib = new FormSocialContrib($db);
|
||||
$chargesociale_static = new ChargeSociales($db);
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$projectstatic = new Project($db);
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ llxHeader('', $langs->trans("SocialContributions"));
|
||||
|
||||
$sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,";
|
||||
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
|
||||
}
|
||||
$sql .= " c.libelle as type_label, c.accountancy_code as type_accountancy_code,";
|
||||
@ -197,7 +197,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (cs.fk_account = ba.rowid)";
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pay ON (cs.fk_mode_reglement = pay.id)';
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cs.fk_projet";
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||
@ -211,7 +211,7 @@ if ($search_ref) {
|
||||
if ($search_label) {
|
||||
$sql .= natural_search("cs.libelle", $search_label);
|
||||
}
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
if ($search_project_ref != '') {
|
||||
$sql .= natural_search("p.ref", $search_project_ref);
|
||||
}
|
||||
@ -247,7 +247,7 @@ if ($search_typeid > 0) {
|
||||
$sql .= " AND cs.fk_type = ".((int) $search_typeid);
|
||||
}
|
||||
$sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname";
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$sql .= ", p.rowid, p.ref, p.title";
|
||||
}
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
@ -553,7 +553,7 @@ while ($i < min($num, $limit)) {
|
||||
$chargesociale_static->label = $obj->label;
|
||||
$chargesociale_static->type_label = $obj->type_label;
|
||||
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$projectstatic->id = $obj->project_id;
|
||||
$projectstatic->ref = $obj->project_ref;
|
||||
$projectstatic->title = $obj->project_label;
|
||||
@ -589,7 +589,7 @@ while ($i < min($num, $limit)) {
|
||||
if (!empty($arrayfields['cs.fk_type']['checked'])) {
|
||||
$typelabeltoshow = $obj->type_label;
|
||||
$typelabelpopup = $obj->type_label;
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$typelabelpopup .= ' - '.$langs->trans("AccountancyCode").': '.$obj->type_accountancy_code;
|
||||
}
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($typelabelpopup).'">'.dol_escape_htmltag($typelabeltoshow).'</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user