diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 12ce3973c32..2ffed8b8d97 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -111,7 +111,7 @@ if ($action == 'set_default') { if (isModEnabled('facture')) { $res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); $res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { $res6 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); } } @@ -269,7 +269,7 @@ if (isModEnabled('facture')) { } print "\n"; - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { print ''.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").''; print ''; $selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 185213db838..1f93e87f1ab 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1773,7 +1773,7 @@ class Adherent extends CommonObject if (!$error) { // Add line to draft invoice $idprodsubscription = 0; - if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (isModEnabled("product") || !empty($conf->service->enabled))) { + if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (isModEnabled("product") || isModEnabled("service"))) { $idprodsubscription = $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS; } diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index afeaa98d77e..40c86d79e13 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -278,7 +278,7 @@ if ($action == 'edit') { include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); } elseif ($val['type'] == 'product') { - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $form->select_produits($selected, $constname, '', 0); } diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index c74645439bd..25386388020 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -62,7 +62,7 @@ $conditions = array( 'NOTE_PUBLIC' => 1, 'NOTE_PRIVATE' => 1, 'SOCIETE' => 1, - 'PRODUCTDESC' => (isModEnabled("product") || !empty($conf->service->enabled)), + 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")), 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)), 'USERSIGN' => 1, 'MAILING' => !empty($conf->mailing->enabled), diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 2f90d6e9a77..3bc1e3a12d4 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -545,7 +545,7 @@ if ($action == 'edit') { include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); } elseif ($val['type'] == 'product') { - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $form->select_produits($selected, $constname, '', 0); } diff --git a/htdocs/admin/webhook.php b/htdocs/admin/webhook.php index 4527df95d89..b589eac4079 100644 --- a/htdocs/admin/webhook.php +++ b/htdocs/admin/webhook.php @@ -343,7 +343,7 @@ if ($action == 'edit') { include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); } elseif ($val['type'] == 'product') { - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $form->select_produits($selected, $constname, '', 0); } diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 64025c9b18a..4f8f06ca160 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -524,7 +524,7 @@ if ($action == 'edit') { include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; print dolJSToSetRandomPassword($constname, 'generate_token'.$constname); } elseif ($val['type'] == 'product') { - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); $form->select_produits($selected, $constname, '', 0); } diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index cd29623af8c..e895d534fac 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -87,7 +87,7 @@ $coldisplay++; print ''; // Predefined product/service -if (isModEnabled("product") || !empty($conf->service->enabled)) { +if (isModEnabled("product") || isModEnabled("service")) { if (!empty($conf->global->BOM_SUB_BOM)) { print $langs->trans("Product"); } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c88ffdad6eb..52fc2a296e4 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2814,7 +2814,7 @@ if ($action == 'create') { } // Create an intervention - if (!empty($conf->service->enabled) && !empty($conf->ficheinter->enabled) && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled("service") && !empty($conf->ficheinter->enabled) && $object->statut == Propal::STATUS_SIGNED) { if ($usercancreateintervention) { $langs->load("interventions"); print ''.$langs->trans("AddIntervention").''; diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index ed4dea21cc1..7a9518d345e 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -62,7 +62,7 @@ class box_produits extends ModeleBoxes $this->db = $db; $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); - $tmpentry = array('enabled'=>(isModEnabled("product") || !empty($conf->service->enabled)), 'perms'=>(!empty($user->rights->produit->lire) || !empty($user->rights->service->lire)), 'module'=>'product|service'); + $tmpentry = array('enabled'=>(isModEnabled("product") || isModEnabled("service")), 'perms'=>(!empty($user->rights->produit->lire) || !empty($user->rights->service->lire)), 'module'=>'product|service'); $showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $this->hidden = ($showmode != 1); } diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 16370917dbd..203d42c7eed 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -64,7 +64,7 @@ class box_produits_alerte_stock extends ModeleBoxes $this->db = $db; $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); - $tmpentry = array('enabled'=>((isModEnabled("product") || !empty($conf->service->enabled)) && !empty($conf->stock->enabled)), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock'); + $tmpentry = array('enabled'=>((isModEnabled("product") || isModEnabled("service")) && !empty($conf->stock->enabled)), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock'); $showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $this->hidden = ($showmode != 1); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b6da0e8822e..6755bd29c14 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1104,7 +1104,7 @@ class Form global $langs, $conf; // If product & services are enabled or both disabled. - if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && !empty($conf->service->enabled)) + if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) || (empty($forceall) && empty($conf->product->enabled) && empty($conf->service->enabled))) { if (empty($hidetext)) { print $langs->trans("Type").': '; @@ -1134,7 +1134,7 @@ class Form print ajax_combobox('select_'.$htmlname); //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } - if ((empty($forceall) && empty($conf->product->enabled) && !empty($conf->service->enabled)) || $forceall == 3) { + if ((empty($forceall) && empty($conf->product->enabled) && isModEnabled("service")) || $forceall == 3) { print $langs->trans("Service"); print ''; } @@ -2278,10 +2278,10 @@ class Form $ajaxoptions = array(); } - if (strval($filtertype) === '' && (isModEnabled("product") || !empty($conf->service->enabled))) { + if (strval($filtertype) === '' && (isModEnabled("product") || isModEnabled("service"))) { if (isModEnabled("product") && empty($conf->service->enabled)) { $filtertype = '0'; - } elseif (empty($conf->product->enabled) && !empty($conf->service->enabled)) { + } elseif (empty($conf->product->enabled) && isModEnabled("service")) { $filtertype = '1'; } } diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index def8be3cd40..9b2b9082a53 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -80,7 +80,7 @@ class FormBarCode } // We check if barcode is already selected by default - if (((isModEnabled("product") || !empty($conf->service->enabled)) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || + if (((isModEnabled("product") || isModEnabled("service")) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || (isModEnabled("societe") && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) { $disable = 'disabled'; } diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 8f6c911a095..38ec91ff143 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -270,7 +270,7 @@ class FormMargin print ''; } - if (!empty($conf->service->enabled)) { + if (isModEnabled("service")) { print ''; print '' . $langs->trans('MarginOnServices') . ''; print '' . price($marginInfo['pv_services']) . ''; @@ -285,7 +285,7 @@ class FormMargin print ''; } - if (isModEnabled("product") && !empty($conf->service->enabled)) { + if (isModEnabled("product") && isModEnabled("service")) { print ''; print '' . $langs->trans('TotalMargin') . ''; print '' . price($marginInfo['pv_total']) . ''; diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 67d07cb6992..c2183653686 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -851,7 +851,7 @@ class FormSetupItem } elseif ($this->type == 'securekey') { $out.= $this->generateInputFieldSecureKey(); } elseif ($this->type == 'product') { - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { $selected = (empty($this->fieldValue) ? '' : $this->fieldValue); $out.= $this->form->select_produits($selected, $this->confKey, '', 0, 0, 1, 2, '', 0, array(), 0, '1', 0, $this->cssClass, 0, '', null, 1); } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ce33ed2553b..d306990daaa 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2923,7 +2923,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } if (isModEnabled("product")) { $original_file = $conf->product->multidir_output[$entity].'/'.$original_file; - } elseif (!empty($conf->service->enabled)) { + } elseif (isModEnabled("service")) { $original_file = $conf->service->multidir_output[$entity].'/'.$original_file; } } elseif ($modulepart == 'product_batch' || $modulepart == 'produitlot') { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index c6ddf3b756d..be12e5c81d1 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -174,7 +174,7 @@ function product_prepare_head($object) if (isModEnabled("product") && ($object->type == Product::TYPE_PRODUCT)) { $upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); } - if (!empty($conf->service->enabled) && ($object->type == Product::TYPE_SERVICE)) { + if (isModEnabled("service") && ($object->type == Product::TYPE_SERVICE)) { $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); } $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); @@ -182,7 +182,7 @@ function product_prepare_head($object) if (isModEnabled("product") && ($object->type == Product::TYPE_PRODUCT)) { $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id.'/photos'; } - if (!empty($conf->service->enabled) && ($object->type == Product::TYPE_SERVICE)) { + if (isModEnabled("service") && ($object->type == Product::TYPE_SERVICE)) { $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'product').$object->id.'/photos'; } $nbFiles += count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index e7fbb0420fe..2076c6a348e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1368,7 +1368,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // For the moment, we manage this with hard coded exception //print "Remove box ".$file.'
'; if ($file == 'box_graph_product_distribution.php') { - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { dol_syslog("We discard deleting module ".$file." because another module still active requires it."); continue; } diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index bee6f95f00d..eb9c4fe8779 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -127,7 +127,7 @@ class modCategorie extends DolibarrModules $this->export_permission[$r] = array(array("categorie", "lire")); $typeexample = ""; - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { $typeexample .= ($typeexample ? " / " : "")."0=Product-Service"; } if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 91cc9010f18..bb6389a2e67 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -817,13 +817,13 @@ class pdf_azur extends ModelePDFPropales if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { if (isModEnabled("product")) { $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos"; - } elseif (!empty($conf->service->enabled)) { + } elseif (isModEnabled("service")) { $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos"; } } else { if (isModEnabled("product")) { $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product'); - } elseif (!empty($conf->service->enabled)) { + } elseif (isModEnabled("service")) { $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product'); } } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index b8e002196a9..7be7170edb2 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -942,13 +942,13 @@ class pdf_cyan extends ModelePDFPropales if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { if (isModEnabled("product")) { $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos"; - } elseif (!empty($conf->service->enabled)) { + } elseif (isModEnabled("service")) { $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir($product->id, 2, 0, 0, $product, 'product').$product->id."/photos"; } } else { if (isModEnabled("product")) { $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product'); - } elseif (!empty($conf->service->enabled)) { + } elseif (isModEnabled("service")) { $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].'/'.get_exdir(0, 0, 0, 0, $product, 'product'); } } diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index c641cdf68de..cb38d7a3546 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -193,7 +193,7 @@ if ($nolinesbefore) { // Free line echo ''; // Show radio free line - if ($forceall >= 0 && (isModEnabled("product") || !empty($conf->service->enabled))) { + if ($forceall >= 0 && (isModEnabled("product") || isModEnabled("service"))) { echo ''; } // Predefined product/service - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { if ($forceall >= 0 && $freelines) { echo '
'; } else { @@ -232,7 +232,7 @@ if ($nolinesbefore) { if (empty($senderissupplier)) { if (isModEnabled("product") && empty($conf->service->enabled)) { $labelforradio = $langs->trans('PredefinedProductsToSell'); - } elseif ((empty($conf->product->enabled) && !empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) { + } elseif ((empty($conf->product->enabled) && isModEnabled("service")) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) { $labelforradio = $langs->trans('PredefinedServicesToSell'); } else { $labelforradio = $langs->trans('PredefinedProductsAndServicesToSell'); @@ -240,7 +240,7 @@ if ($nolinesbefore) { } else { if (isModEnabled("product") && empty($conf->service->enabled)) { $labelforradio = $langs->trans('PredefinedProductsToPurchase'); - } elseif (empty($conf->product->enabled) && !empty($conf->service->enabled)) { + } elseif (empty($conf->product->enabled) && isModEnabled("service")) { $labelforradio = $langs->trans('PredefinedServicesToPurchase'); } else { $labelforradio = $langs->trans('PredefinedProductsAndServicesToPurchase'); @@ -336,7 +336,7 @@ if ($nolinesbefore) { print $hookmanager->resPrint; } } - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { echo '
'; if (!empty($conf->variants->enabled)) { echo '
'; @@ -356,7 +356,7 @@ if ($nolinesbefore) { $doleditor = new DolEditor('dp_desc', GETPOST('dp_desc', 'restricthtml'), '', (empty($conf->global->MAIN_DOLEDITOR_HEIGHT) ? 100 : $conf->global->MAIN_DOLEDITOR_HEIGHT), $toolbarname, '', false, true, $enabled, $nbrows, '98%'); $doleditor->Create(); // Show autofill date for recurring invoices - if (!empty($conf->service->enabled) && ($object->element == 'facturerec' || $object->element == 'invoice_supplier_rec')) { + if (isModEnabled("service") && ($object->element == 'facturerec' || $object->element == 'invoice_supplier_rec')) { echo '

'; echo $langs->trans('AutoFillDateFrom').' '; if (!empty($conf->global->INVOICE_REC_DATE_TO_YES)) { @@ -446,7 +446,7 @@ if ($nolinesbefore) { ?> - service->enabled)) { ?> + @@ -471,7 +471,7 @@ if ($nolinesbefore) { service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0') { // We show date field if required +if ((isModEnabled("service") || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0') { // We show date field if required print ''."\n"; if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print ''; diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 83e6ff2da7c..21e82d306a8 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -176,7 +176,7 @@ $coldisplay++; } // Show autofill date for recuring invoices - if (!empty($conf->service->enabled) && $line->product_type == 1 && ($line->element == 'facturedetrec' || $line->element == 'invoice_supplier_det_rec')) { + if (isModEnabled("service") && $line->product_type == 1 && ($line->element == 'facturedetrec' || $line->element == 'invoice_supplier_det_rec')) { if ($line->element == 'invoice_supplier_det_rec') { $line->date_start_fill = $line->date_start; $line->date_end_fill = $line->date_end; @@ -290,7 +290,7 @@ $coldisplay++; ?> - service->enabled)) { ?> + @@ -330,7 +330,7 @@ $coldisplay++; -service->enabled) && $line->product_type == 1 && $dateSelector) { ?> +product_type == 1 && $dateSelector) { ?> global->MAIN_VIEW_LINE_NUMBER)) { ?> diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 667ab889547..ac2aaa9b4e9 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.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 (!empty($conf->expedition_bon->enabled)) { diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index ffc1d1b7dd7..c488ff901bd 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -309,9 +309,9 @@ llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $m $rowspan = 0; $sectionauto = array(); if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { $langs->load("products"); - $rowspan++; $sectionauto[] = array('position'=>10, 'level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || !empty($conf->service->enabled)), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); + $rowspan++; $sectionauto[] = array('position'=>10, 'level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } if (isModEnabled("societe")) { $rowspan++; $sectionauto[] = array('position'=>20, 'level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties"))); diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index f52ea3233ab..4ada152d9ce 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -113,8 +113,8 @@ $userstatic = new User($db); // Ajout rubriques automatiques $rowspan = 0; $sectionauto = array(); -if (isModEnabled("product") || !empty($conf->service->enabled)) { - $langs->load("products"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || !empty($conf->service->enabled)), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); +if (isModEnabled("product") || isModEnabled("service")) { + $langs->load("products"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } if (isModEnabled("societe")) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties"))); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 30806231916..62e8b4337d3 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -47,7 +47,7 @@ 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'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.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/expedition/shipment.php b/htdocs/expedition/shipment.php index c42ae6ec296..0be623ab6bf 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -43,7 +43,7 @@ if (!empty($conf->stock->enabled)) { if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.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/fourn/card.php b/htdocs/fourn/card.php index 2f44253579a..ba72cd352be 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -514,7 +514,7 @@ if ($object->id > 0) { /* * List of products */ - if (isModEnabled("product") || !empty($conf->service->enabled)) { + if (isModEnabled("product") || isModEnabled("service")) { $langs->load("products"); //Query from product/liste.php $sql = 'SELECT p.rowid, p.ref, p.label, p.fk_product_type, p.entity, p.tosell as status, p.tobuy as status_buy, p.tobatch as status_batch,'; diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 1478dbea83f..2c47ab3c7a2 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -121,7 +121,7 @@ $isInEEC = isInEEC($mysoc); $arrayfields = array( 'i.ref' => array('label'=>$langs->trans("Ref"), 'checked'=>1), 'i.label' => array('label'=>$langs->trans("Label"), 'checked'=>1), - 'i.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(!empty($conf->produit->enabled) && !empty($conf->service->enabled))), + 'i.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(!empty($conf->produit->enabled) && isModEnabled("service"))), ); /* // Extra fields diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 23699875474..9f709a86e47 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2521,7 +2521,7 @@ function printDropdownQuickadd() "title" => "NewService@products", "name" => "Service@products", "picto" => "object_service", - "activation" => !empty($conf->service->enabled) && $user->hasRight("service", "write"), // vs hooking + "activation" => isModEnabled("service") && $user->hasRight("service", "write"), // vs hooking "position" => 110, ), array( diff --git a/htdocs/product/card.php b/htdocs/product/card.php index ed921208624..761fe2a148f 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { } if (isModEnabled("product")) { $upload_dir = $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref); - } elseif (!empty($conf->service->enabled)) { + } elseif (isModEnabled("service")) { $upload_dir = $conf->service->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 0, $object, 'product').dol_sanitizeFileName($object->ref); } @@ -2298,7 +2298,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { 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/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 ''; } 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 ''; // Duration - if (!empty($conf->service->enabled) && $type == 1) { + if (isModEnabled("service") && $type == 1) { 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 ''; - if (!empty($conf->service->enabled) && $type == 1) { + if (isModEnabled("service") && $type == 1) { print ''; print ''; -if (!empty($conf->service->enabled) && $type == 1) { +if (isModEnabled("service") && $type == 1) { 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 ''; - if (!empty($conf->service->enabled) && $type == 1) { + if (isModEnabled("service") && $type == 1) { 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 '
'; 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 ''; print ' '; print '
'.$product->label.''; 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 ' '; print '
'.$objp->label.''; 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 ''; print ''; print ''; -if (!empty($conf->service->enabled) && $type == 1) { +if (isModEnabled("service") && $type == 1) { print ''; } print ''; @@ -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 (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 '
  '.$form->textwithpicto($langs->trans('IncludeEmptyDesiredStock'), $langs->trans('IncludeProductWithUndefinedAlerts')).' 
'; 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)',