mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Use isModEnabled
This commit is contained in:
parent
58e96a1db8
commit
c674f00cb2
|
|
@ -1441,7 +1441,7 @@ class Setup extends DolibarrApi
|
|||
{
|
||||
global $conf;
|
||||
|
||||
if (empty($conf->socialnetworks->enabled)) {
|
||||
if (!isModEnabled('socialnetworks')) {
|
||||
throw new RestException(400, 'API not available: this dictionary is not enabled by setup');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $
|
|||
|
||||
// Defined if module is enabled
|
||||
$enabled = true;
|
||||
if (empty($conf->$modulenameforenabled->enabled)) {
|
||||
if (!isModEnabled($modulenameforenabled)) {
|
||||
$enabled = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1376,7 +1376,7 @@ class BOM extends CommonObject
|
|||
$unit = measuringUnitString($line->fk_unit, '', '', 1);
|
||||
$qty = convertDurationtoHour($line->qty, $unit);
|
||||
|
||||
if ($conf->workstation->enabled && !empty($tmpproduct->fk_default_workstation)) {
|
||||
if (isModEnabled('workstation') && !empty($tmpproduct->fk_default_workstation)) {
|
||||
$workstation = new Workstation($this->db);
|
||||
$res = $workstation->fetch($tmpproduct->fk_default_workstation);
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ if ($nolinesbefore) {
|
|||
print '<td class="linecollost right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>';
|
||||
} else {
|
||||
print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>';
|
||||
if ($conf->workstation->enabled) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>';
|
||||
if (isModEnabled('workstation')) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>';
|
||||
print '<td class="linecoltotalcost right">' . $form->textwithpicto($langs->trans('TotalCost'), '') . '</td>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ if ($filtertype != 1) {
|
|||
} else {
|
||||
print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>';
|
||||
|
||||
if ($conf->workstation->enabled) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>';
|
||||
if (isModEnabled('workstation')) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>';
|
||||
|
||||
// Cost
|
||||
print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).'</td>';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user