';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type');
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 613ff2c3ca8..e6a3b3171bc 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -231,7 +231,7 @@ if ($id > 0 || !empty($ref)) {
print '';
// Type
- if (isModEnabled("product") && !empty($conf->service->enabled)) {
+ if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type');
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index b396041af83..d83a684a308 100644
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -81,7 +81,7 @@ if ($id > 0 || !empty($ref)) {
if (isModEnabled("product")) {
$upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product');
- } elseif (!empty($conf->service->enabled)) {
+ } elseif (isModEnabled("service")) {
$upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'product');
}
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index f5ee4cbf1c4..55cbbf8e34a 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -397,7 +397,7 @@ if ($id > 0 || $ref) {
print '';
// Type
- if (isModEnabled("product") && !empty($conf->service->enabled)) {
+ if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 540d685ca7e..f2b29926b21 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -90,7 +90,7 @@ print '';
if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be useless due to the global search combo
// Search contract
- if ((isModEnabled("product") || !empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) {
+ if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->produit->lire || $user->rights->service->lire)) {
$listofsearchfields['search_product'] = array('text'=>'ProductOrService');
}
@@ -123,7 +123,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be
/*
* Number of products and/or services
*/
-if ((isModEnabled("product") || !empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) {
+if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->produit->lire || $user->rights->service->lire)) {
$prodser = array();
$prodser[0][0] = $prodser[0][1] = $prodser[0][2] = $prodser[0][3] = 0;
$prodser[0]['sell'] = 0;
@@ -190,7 +190,7 @@ if ((isModEnabled("product") || !empty($conf->service->enabled)) && ($user->righ
$dataseries[] = array($langs->transnoentitiesnoconv("ProductsOnPurchase"), round($SommeB));
$dataseries[] = array($langs->transnoentitiesnoconv("ProductsNotOnSell"), round($SommeC));
}
- if (!empty($conf->service->enabled)) {
+ if (isModEnabled("service")) {
$dataseries[] = array($langs->transnoentitiesnoconv("ServicesOnSale"), round($SommeD));
$dataseries[] = array($langs->transnoentitiesnoconv("ServicesOnPurchase"), round($SommeE));
$dataseries[] = array($langs->transnoentitiesnoconv("ServicesNotOnSell"), round($SommeF));
@@ -281,7 +281,7 @@ print '
';
/*
* Latest modified products
*/
-if ((isModEnabled("product") || !empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) {
+if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->produit->lire || $user->rights->service->lire)) {
$max = 15;
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.tobatch, p.fk_price_expression,";
$sql .= " p.entity,";
@@ -411,7 +411,7 @@ if (!empty($conf->global->MAIN_SHOW_PRODUCT_ACTIVITY_TRIM)) {
if (isModEnabled("product")) {
activitytrim(0);
}
- if (!empty($conf->service->enabled)) {
+ if (isModEnabled("service")) {
activitytrim(1);
}
}
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 3299d8afcf1..043a6bc3db8 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -206,9 +206,9 @@ $arrayfields = array(
//'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))),
'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10),
'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10),
- 'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(isModEnabled("product") && !empty($conf->service->enabled)), 'position'=>11),
+ 'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service")), 'position'=>11),
'p.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(isModEnabled('barcode')), 'position'=>12),
- 'p.duration'=>array('label'=>"Duration", 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1'), 'position'=>13),
+ 'p.duration'=>array('label'=>"Duration", 'checked'=>($contextpage != 'productlist'), 'enabled'=>(isModEnabled("service") && (string) $type == '1'), 'position'=>13),
'p.finished'=>array('label'=>"Nature", 'checked'=>0, 'enabled'=>(isModEnabled("product") && $type != '1'), 'position'=>19),
'p.weight'=>array('label'=>'Weight', 'checked'=>0, 'enabled'=>(isModEnabled("product") && $type != '1'), 'position'=>20),
'p.weight_units'=>array('label'=>'WeightUnits', 'checked'=>0, 'enabled'=>(isModEnabled("product") && $type != '1'), 'position'=>21),
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 6acdafabcef..341b8a56e62 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -887,7 +887,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
$soc->fetch($socid);
// Type
- if (isModEnabled("product") && !empty($conf->service->enabled)) {
+ if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '
';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
@@ -971,7 +971,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
} else {
if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) { // using this option is a bug. kept for backward compatibility
// Type
- if (isModEnabled("product") && !empty($conf->service->enabled)) {
+ if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print ' ';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
@@ -986,7 +986,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_
print ' ';
} else {
// Type
- if (isModEnabled("product") && !empty($conf->service->enabled)) {
+ if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '
';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index f6065c9f744..10e70545af6 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -369,7 +369,7 @@ if ($resql) {
print ' ';
print ' ';
// Duration
- if (!empty($conf->service->enabled) && $type == 1) {
+ if (isModEnabled("service") && $type == 1) {
print '';
print ' ';
print ' ';
@@ -400,7 +400,7 @@ if ($resql) {
print "";
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", '', $param, "", $sortfield, $sortorder);
- if (!empty($conf->service->enabled) && $type == 1) {
+ if (isModEnabled("service") && $type == 1) {
print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration", '', $param, "", $sortfield, $sortorder, 'center ');
}
print_liste_field_titre("StockLimit", $_SERVER["PHP_SELF"], "p.seuil_stock_alerte", '', $param, "", $sortfield, $sortorder, 'right ');
@@ -445,7 +445,7 @@ if ($resql) {
print '';
print ''.$product->label.' ';
- if (!empty($conf->service->enabled) && $type == 1) {
+ if (isModEnabled("service") && $type == 1) {
print '';
if (preg_match('/([0-9]+)y/i', $objp->duration, $regs)) {
print $regs[1].' '.$langs->trans("DurationYear");
diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php
index 690d3f3f261..a39dc246772 100644
--- a/htdocs/product/reassortlot.php
+++ b/htdocs/product/reassortlot.php
@@ -511,7 +511,7 @@ print ' ';
print '';
print ' ';
print ' ';
-if (!empty($conf->service->enabled) && $type == 1) {
+if (isModEnabled("service") && $type == 1) {
print '';
print ' ';
print ' ';
@@ -564,7 +564,7 @@ $totalarray['nbfield'] = 0;
print ' ';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", '', $param, "", $sortfield, $sortorder);
-if (!empty($conf->service->enabled) && $type == 1) {
+if (isModEnabled("service") && $type == 1) {
print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration", '', $param, "", $sortfield, $sortorder, 'center ');
}
print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.ref", '', $param, "", $sortfield, $sortorder);
@@ -648,7 +648,7 @@ while ($i < $imaxinloop) {
// Label
print ''.$objp->label.' ';
- if (!empty($conf->service->enabled) && $type == 1) {
+ if (isModEnabled("service") && $type == 1) {
print '';
if (preg_match('/([0-9]+)y/i', $objp->duration, $regs)) {
print $regs[1].' '.$langs->trans("DurationYear");
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 2d9ec85303d..59ab97873da 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -622,7 +622,7 @@ if ($id > 0 || $ref) {
print '';
// Type
- if (isModEnabled("product") && !empty($conf->service->enabled)) {
+ if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type');
diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php
index b89554a18f7..91bb390e1f9 100644
--- a/htdocs/product/stock/replenish.php
+++ b/htdocs/product/stock/replenish.php
@@ -738,7 +738,7 @@ print ' ';
print ' ';
print ' ';
print ' ';
-if (!empty($conf->service->enabled) && $type == 1) {
+if (isModEnabled("service") && $type == 1) {
print ' ';
}
print ''.$form->textwithpicto($langs->trans('IncludeEmptyDesiredStock'), $langs->trans('IncludeProductWithUndefinedAlerts')).' ';
@@ -769,7 +769,7 @@ print ' ';
print_liste_field_titre(' ', $_SERVER["PHP_SELF"], '');
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder);
print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder);
-if (!empty($conf->service->enabled) && $type == 1) {
+if (isModEnabled("service") && $type == 1) {
print_liste_field_titre('Duration', $_SERVER["PHP_SELF"], 'p.duration', $param, '', '', $sortfield, $sortorder, 'center ');
}
print_liste_field_titre('DesiredStock', $_SERVER["PHP_SELF"], 'p.desiredstock', $param, '', '', $sortfield, $sortorder, 'right ');
@@ -899,7 +899,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
print ' '; // TODO Remove this and make a fetch to get description when creating order instead of a GETPOST
print '';
- if (!empty($conf->service->enabled) && $type == 1) {
+ if (isModEnabled("service") && $type == 1) {
$regs = array();
if (preg_match('/([0-9]+)y/i', $objp->duration, $regs)) {
$duration = $regs[1].' '.$langs->trans('DurationYear');
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 564ffbf899c..6fc1fd51349 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
-if (isModEnabled("product") || !empty($conf->service->enabled)) {
+if (isModEnabled("product") || isModEnabled("service")) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
}
if (isModEnabled("propal")) {
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index ab85041a650..b4f76a93ae3 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -33,7 +33,7 @@ if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
-if (isModEnabled("product") || !empty($conf->service->enabled)) {
+if (isModEnabled("product") || isModEnabled("service")) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
}
diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php
index a21bf3de219..13c3b6ae80e 100644
--- a/htdocs/takepos/admin/setup.php
+++ b/htdocs/takepos/admin/setup.php
@@ -263,7 +263,7 @@ print ' \n";
// Services
-if (!empty($conf->service->enabled)) {
+if (isModEnabled("service")) {
print '';
print $langs->trans("CashdeskShowServices");
print ' ';
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index 0043252c409..a00736fda44 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -195,7 +195,7 @@ if (!empty($conf->project->enabled)) {
if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) {
$tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus
}
-if (isModEnabled("product") || !empty($conf->service->enabled)) {
+if (isModEnabled("product") || isModEnabled("service")) {
$tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea';
}
if (isModEnabled("propal") || !empty($conf->commande->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) {
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index b95a19e70f7..fe058849899 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -395,7 +395,7 @@ if (!empty($id) || !empty($ref)) {
print '';
// Type
- if (isModEnabled("product") && !empty($conf->service->enabled)) {
+ if (isModEnabled("product") && isModEnabled("service")) {
$typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
print '';
print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type');
diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php
index d688c16b870..2188a27c32a 100644
--- a/htdocs/webservices/admin/index.php
+++ b/htdocs/webservices/admin/index.php
@@ -102,7 +102,7 @@ $webservices = array(
'user' => '',
'thirdparty' => 'isModEnabled("societe")',
'contact' => 'isModEnabled("societe")',
- 'productorservice' => '(isModEnabled("product") || !empty($conf->service->enabled))',
+ 'productorservice' => '(isModEnabled("product") || isModEnabled("service"))',
'order' => '!empty($conf->commande->enabled)',
'invoice' => 'isModEnabled("facture")',
'supplier_invoice' => '!empty($conf->fournisseur->enabled)',