diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index cb6dcfc94b8..0f911e55ae3 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -2191,17 +2191,34 @@ if ($action == 'create') {
$( ".auploadnewfilenow" ).click(function() {
jQuery(".truploadnewfilenow").toggle();
jQuery(".trattachnewfilenow").hide();
+ if (jQuery(".truploadnewfilenow").is(":hidden")) {
+ jQuery("input[name=\"sendit\"]").prop("disabled", true);
+ } else {
+ jQuery("input[name=\"sendit\"]").prop("disabled", false);
+ }
return false;
});
$( ".aattachtodoc" ).click(function() {
jQuery(".trattachnewfilenow").toggle();
jQuery(".truploadnewfilenow").hide();
+ if (jQuery(".truploadnewfilenow").is(":hidden")) {
+ jQuery("input[name=\"sendit\"]").prop("disabled", true);
+ } else {
+ jQuery("input[name=\"sendit\"]").prop("disabled", false);
+ }
return false;
});';
if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array'))) {
print 'jQuery(".trattachnewfilenow").toggle();'."\n";
}
print '
+ if (jQuery(".truploadnewfilenow").is(":hidden")) {
+ jQuery("input[name=\"sendit\"]").prop("disabled", true);
+ } else {
+ jQuery("input[name=\"sendit\"]").prop("disabled", false);
+ }
+ ';
+ print '
});
';
print ''."\n";
@@ -2337,17 +2354,34 @@ if ($action == 'create') {
$( ".auploadnewfilenow" ).click(function() {
jQuery(".truploadnewfilenow").toggle();
jQuery(".trattachnewfilenow").hide();
+ if (jQuery(".truploadnewfilenow").is(":hidden")) {
+ jQuery("input[name=\"sendit\"]").prop("disabled", true);
+ } else {
+ jQuery("input[name=\"sendit\"]").prop("disabled", false);
+ }
return false;
});
$( ".aattachtodoc" ).click(function() {
jQuery(".trattachnewfilenow").toggle();
jQuery(".truploadnewfilenow").hide();
+ if (jQuery(".truploadnewfilenow").is(":hidden")) {
+ jQuery("input[name=\"sendit\"]").prop("disabled", true);
+ } else {
+ jQuery("input[name=\"sendit\"]").prop("disabled", false);
+ }
return false;
});'."\n";
if (is_array(GETPOST('attachfile', 'array')) && count(GETPOST('attachfile', 'array')) && $action != 'updateline') {
print 'jQuery(".trattachnewfilenow").show();'."\n";
}
print '
+ if (jQuery(".truploadnewfilenow").is(":hidden")) {
+ jQuery("input[name=\"sendit\"]").prop("disabled", true);
+ } else {
+ jQuery("input[name=\"sendit\"]").prop("disabled", false);
+ }
+ ';
+ print '
});
';
print ''."\n";
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 1b04a77083c..3528d5ef299 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1188,11 +1188,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "";
- // Public URL
- print '
'.$langs->trans("PublicUrl").' ';
- print img_picto('', 'globe', 'class="pictofixedwidth"');
- print ' ';
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) {
+ // Public URL
+ print ''.$langs->trans("PublicUrl").' ';
+ print img_picto('', 'globe', 'class="pictofixedwidth"');
+ print ' ';
+ print ' ';
+ }
if ($type != 1 && !empty($conf->stock->enabled)) {
// Default warehouse
@@ -1205,20 +1207,24 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '';
print '';
- // Stock min level
- print ''.$form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1).' ';
- print ' ';
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_STOCK_LEVELS)) {
+ // Stock min level
+ print ''.$form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1).' ';
+ print ' ';
+ print ' ';
- print '';
+ print ' ';
- // Stock desired level
- print ' '.$form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1).' ';
- print ' ';
- print ' ';
+ // Stock desired level
+ print ''.$form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1).' ';
+ print ' ';
+ print ' ';
+ }
} else {
- print ' ';
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_STOCK_LEVELS)) {
+ print ' ';
+ print ' ';
+ }
}
// Duration
@@ -1230,17 +1236,21 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
if ($type != 1) { // Nature, Weight and volume only applies to products and not to services
- // Nature
- print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).' ';
- $statutarray = array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial"));
- print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1);
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_NATURE)) {
+ // Nature
+ print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).' ';
+ $statutarray = array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial"));
+ print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1);
+ print ' ';
+ }
- // Brut Weight
- print ''.$langs->trans("Weight").' ';
- print ' ';
- print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ?GETPOST('weight_units', 'alpha') : (empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2);
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
+ // Brut Weight
+ print ''.$langs->trans("Weight").' ';
+ print ' ';
+ print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ?GETPOST('weight_units', 'alpha') : (empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2);
+ print ' ';
+ }
// Brut Length
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) {
@@ -1349,170 +1359,174 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
- if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
- // We do no show price array on create when multiprices enabled.
- // We must set them on prices tab.
- print '';
- // VAT
- print ''.$langs->trans("VATRate").' ';
- $defaultva = get_default_tva($mysoc, $mysoc);
- print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1);
- print ' ';
- print '
';
+ if (empty($conf->global->PRODUCT_DISABLE_PRICES)) {
+ if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
+ // We do no show price array on create when multiprices enabled.
+ // We must set them on prices tab.
+ print '';
+ // VAT
+ print ''.$langs->trans("VATRate").' ';
+ $defaultva = get_default_tva($mysoc, $mysoc);
+ print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1);
+ print ' ';
+ print '
';
- print ' ';
- } else {
- print '';
+ print ' ';
+ } else {
+ print '';
- // Price
- print ''.$langs->trans("SellingPrice").' ';
- print ' ';
- print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_base_type");
- print ' ';
+ // Price
+ print ''.$langs->trans("SellingPrice").' ';
+ print ' ';
+ print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_base_type");
+ print ' ';
- // Min price
- print ''.$langs->trans("MinPrice").' ';
- print ' ';
- print ' ';
+ // Min price
+ print ''.$langs->trans("MinPrice").' ';
+ print ' ';
+ print ' ';
- // VAT
- print ''.$langs->trans("VATRate").' ';
- $defaultva = get_default_tva($mysoc, $mysoc);
- print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1);
- print ' ';
+ // VAT
+ print ''.$langs->trans("VATRate").' ';
+ $defaultva = get_default_tva($mysoc, $mysoc);
+ print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1);
+ print ' ';
- print '
';
+ print '
';
- print ' ';
+ print ' ';
+ }
}
// Accountancy codes
print ''."\n";
print '';
- if (!empty($conf->accounting->enabled)) {
- // Accountancy_code_sell
- print ''.$langs->trans("ProductAccountancySellCode").' ';
- print '';
- if ($type == 0) {
- $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
- } else {
- $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT);
- }
- print $formaccounting->select_account($accountancy_code_sell, 'accountancy_code_sell', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
- print ' ';
-
- // Accountancy_code_sell_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
+ if (!empty($conf->accounting->enabled)) {
+ // Accountancy_code_sell
+ print ''.$langs->trans("ProductAccountancySellCode").' ';
print '';
if ($type == 0) {
- $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT);
+ $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
} else {
- $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT);
+ $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT);
}
- print $formaccounting->select_account($accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print $formaccounting->select_account($accountancy_code_sell, 'accountancy_code_sell', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
print ' ';
- }
- // Accountancy_code_sell_export
- print ''.$langs->trans("ProductAccountancySellExportCode").' ';
- print '';
- if ($type == 0) {
- $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT);
- } else {
- $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT);
- }
- print $formaccounting->select_account($accountancy_code_sell_export, 'accountancy_code_sell_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
- print ' ';
+ // Accountancy_code_sell_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ print '';
+ if ($type == 0) {
+ $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT);
+ } else {
+ $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT);
+ }
+ print $formaccounting->select_account($accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print ' ';
+ }
- // Accountancy_code_buy
- print ''.$langs->trans("ProductAccountancyBuyCode").' ';
- print '';
- if ($type == 0) {
- $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT);
- } else {
- $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT);
- }
- print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
- print ' ';
-
- // Accountancy_code_buy_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ // Accountancy_code_sell_export
+ print ''.$langs->trans("ProductAccountancySellExportCode").' ';
print '';
if ($type == 0) {
- $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT);
+ $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT);
} else {
- $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT);
+ $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT);
}
- print $formaccounting->select_account($accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print $formaccounting->select_account($accountancy_code_sell_export, 'accountancy_code_sell_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print ' ';
+
+ // Accountancy_code_buy
+ print ''.$langs->trans("ProductAccountancyBuyCode").' ';
+ print '';
+ if ($type == 0) {
+ $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT);
+ } else {
+ $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT);
+ }
+ print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print ' ';
+
+ // Accountancy_code_buy_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ print '';
+ if ($type == 0) {
+ $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT);
+ } else {
+ $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT);
+ }
+ print $formaccounting->select_account($accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print ' ';
+ }
+
+ // Accountancy_code_buy_export
+ print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
+ print '';
+ if ($type == 0) {
+ $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT);
+ } else {
+ $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT);
+ }
+ print $formaccounting->select_account($accountancy_code_buy_export, 'accountancy_code_buy_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print ' ';
+ } else {// For external software
+ if (!empty($accountancy_code_sell)) {
+ $object->accountancy_code_sell = $accountancy_code_sell;
+ }
+ if (!empty($accountancy_code_sell_intra)) {
+ $object->accountancy_code_sell_intra = $accountancy_code_sell_intra;
+ }
+ if (!empty($accountancy_code_sell_export)) {
+ $object->accountancy_code_sell_export = $accountancy_code_sell_export;
+ }
+ if (!empty($accountancy_code_buy)) {
+ $object->accountancy_code_buy = $accountancy_code_buy;
+ }
+ if (!empty($accountancy_code_buy_intra)) {
+ $object->accountancy_code_buy_intra = $accountancy_code_buy_intra;
+ }
+ if (!empty($accountancy_code_buy_export)) {
+ $object->accountancy_code_buy_export = $accountancy_code_buy_export;
+ }
+
+ // Accountancy_code_sell
+ print ''.$langs->trans("ProductAccountancySellCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_sell_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ print ' ';
+ print ' ';
+ }
+
+ // Accountancy_code_sell_export
+ print ''.$langs->trans("ProductAccountancySellExportCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_buy
+ print ''.$langs->trans("ProductAccountancyBuyCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_buy_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ print ' ';
+ print ' ';
+ }
+
+ // Accountancy_code_buy_export
+ print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
+ print ' ';
print ' ';
}
-
- // Accountancy_code_buy_export
- print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
- print '';
- if ($type == 0) {
- $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT);
- } else {
- $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT);
- }
- print $formaccounting->select_account($accountancy_code_buy_export, 'accountancy_code_buy_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
- print ' ';
- } else {// For external software
- if (!empty($accountancy_code_sell)) {
- $object->accountancy_code_sell = $accountancy_code_sell;
- }
- if (!empty($accountancy_code_sell_intra)) {
- $object->accountancy_code_sell_intra = $accountancy_code_sell_intra;
- }
- if (!empty($accountancy_code_sell_export)) {
- $object->accountancy_code_sell_export = $accountancy_code_sell_export;
- }
- if (!empty($accountancy_code_buy)) {
- $object->accountancy_code_buy = $accountancy_code_buy;
- }
- if (!empty($accountancy_code_buy_intra)) {
- $object->accountancy_code_buy_intra = $accountancy_code_buy_intra;
- }
- if (!empty($accountancy_code_buy_export)) {
- $object->accountancy_code_buy_export = $accountancy_code_buy_export;
- }
-
- // Accountancy_code_sell
- print ''.$langs->trans("ProductAccountancySellCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_sell_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
- print ' ';
- print ' ';
- }
-
- // Accountancy_code_sell_export
- print ''.$langs->trans("ProductAccountancySellExportCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_buy
- print ''.$langs->trans("ProductAccountancyBuyCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_buy_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
- print ' ';
- print ' ';
- }
-
- // Accountancy_code_buy_export
- print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
- print ' ';
- print ' ';
}
print '
';
@@ -1708,9 +1722,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "\n";
// Public Url
- print ''.$langs->trans("PublicUrl").' ';
- print ' ';
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) {
+ print ''.$langs->trans("PublicUrl").' ';
+ print ' ';
+ print ' ';
+ }
// Stock
if ($object->isProduct() && !empty($conf->stock->enabled)) {
@@ -1743,16 +1759,20 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1);
print '';
} else {
- // Nature
- print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).' ';
- print $formproduct->selectProductNature('finished', $object->finished);
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_NATURE)) {
+ // Nature
+ print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).' ';
+ print $formproduct->selectProductNature('finished', $object->finished);
+ print ' ';
+ }
- // Brut Weight
- print ''.$langs->trans("Weight").' ';
- print ' ';
- print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2);
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
+ // Brut Weight
+ print ''.$langs->trans("Weight").' ';
+ print ' ';
+ print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2);
+ print ' ';
+ }
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) {
// Brut Length
@@ -1867,81 +1887,83 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '';
- if (!empty($conf->accounting->enabled)) {
- // Accountancy_code_sell
- print ''.$langs->trans("ProductAccountancySellCode").' ';
- print '';
- print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 1, 1, 'minwidth150 maxwidth300');
- print ' ';
-
- // Accountancy_code_sell_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
+ if (!empty($conf->accounting->enabled)) {
+ // Accountancy_code_sell
+ print ''.$langs->trans("ProductAccountancySellCode").' ';
print '';
- print $formaccounting->select_account($object->accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 1, 1, 'minwidth150 maxwidth300');
print ' ';
- }
- // Accountancy_code_sell_export
- print ''.$langs->trans("ProductAccountancySellExportCode").' ';
- print '';
- print $formaccounting->select_account($object->accountancy_code_sell_export, 'accountancy_code_sell_export', 1, '', 1, 1, 'minwidth150 maxwidth300');
- print ' ';
+ // Accountancy_code_sell_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ print '';
+ print $formaccounting->select_account($object->accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print ' ';
+ }
- // Accountancy_code_buy
- print ''.$langs->trans("ProductAccountancyBuyCode").' ';
- print '';
- print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1, 'minwidth150 maxwidth300');
- print ' ';
-
- // Accountancy_code_buy_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ // Accountancy_code_sell_export
+ print ''.$langs->trans("ProductAccountancySellExportCode").' ';
print '';
- print $formaccounting->select_account($object->accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print $formaccounting->select_account($object->accountancy_code_sell_export, 'accountancy_code_sell_export', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print ' ';
+
+ // Accountancy_code_buy
+ print ''.$langs->trans("ProductAccountancyBuyCode").' ';
+ print '';
+ print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print ' ';
+
+ // Accountancy_code_buy_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ print '';
+ print $formaccounting->select_account($object->accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print ' ';
+ }
+
+ // Accountancy_code_buy_export
+ print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
+ print '';
+ print $formaccounting->select_account($object->accountancy_code_buy_export, 'accountancy_code_buy_export', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print ' ';
+ } else {
+ // For external software
+ // Accountancy_code_sell
+ print ''.$langs->trans("ProductAccountancySellCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_sell_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ print ' ';
+ print ' ';
+ }
+
+ // Accountancy_code_sell_export
+ print ''.$langs->trans("ProductAccountancySellExportCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_buy
+ print ''.$langs->trans("ProductAccountancyBuyCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_buy_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ print ' ';
+ print ' ';
+ }
+
+ // Accountancy_code_buy_export
+ print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
+ print ' ';
print ' ';
}
-
- // Accountancy_code_buy_export
- print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
- print '';
- print $formaccounting->select_account($object->accountancy_code_buy_export, 'accountancy_code_buy_export', 1, '', 1, 1, 'minwidth150 maxwidth300');
- print ' ';
- } else {
- // For external software
- // Accountancy_code_sell
- print ''.$langs->trans("ProductAccountancySellCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_sell_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
- print ' ';
- print ' ';
- }
-
- // Accountancy_code_sell_export
- print ''.$langs->trans("ProductAccountancySellExportCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_buy
- print ''.$langs->trans("ProductAccountancyBuyCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_buy_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
- print ' ';
- print ' ';
- }
-
- // Accountancy_code_buy_export
- print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
- print ' ';
- print ' ';
}
print '
';
@@ -2170,9 +2192,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$langs->trans("Description").' '.(dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)).' ';
// Public URL
- print ''.$langs->trans("PublicUrl").' ';
- print dol_print_url($object->url);
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) {
+ print ''.$langs->trans("PublicUrl").' ';
+ print dol_print_url($object->url);
+ print ' ';
+ }
// Default warehouse
if ($object->isProduct() && !empty($conf->stock->enabled)) {
@@ -2218,19 +2242,23 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '';
} else {
- // Nature
- print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).' ';
- print $object->getLibFinished();
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_NATURE)) {
+ // Nature
+ print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).' ';
+ print $object->getLibFinished();
+ print ' ';
+ }
// Brut Weight
- print ''.$langs->trans("Weight").' ';
- if ($object->weight != '') {
- print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units);
- } else {
- print ' ';
+ if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
+ print ' '.$langs->trans("Weight").' ';
+ if ($object->weight != '') {
+ print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units);
+ } else {
+ print ' ';
+ }
+ print " \n";
}
- print "\n";
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) {
// Brut Length