From e1a6e6e4ab89e4f8669d2cf41b76e8800884ffdb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Feb 2017 12:37:38 +0100 Subject: [PATCH] Rename "attributes" into "variants" to avoid confusion with extrafields --- htdocs/comm/propal/card.php | 6 +- htdocs/commande/card.php | 6 +- htdocs/compta/facture.php | 6 +- htdocs/core/class/html.form.class.php | 4 +- htdocs/core/lib/product.lib.php | 6 +- ...ibutes.class.php => modVariants.class.php} | 20 +++---- htdocs/core/tpl/objectline_create.tpl.php | 2 +- htdocs/fourn/commande/card.php | 6 +- htdocs/fourn/facture/card.php | 6 +- .../install/mysql/migration/5.0.0-6.0.0.sql | 41 +++++++++++++ .../mysql/tables/llx_product_price_by_qty.sql | 1 - htdocs/langs/en_US/products.lang | 39 +++++++------ htdocs/product/card.php | 2 +- htdocs/product/class/product.class.php | 8 +-- htdocs/product/list.php | 10 ++-- .../{attributes => variants}/admin/admin.php | 0 .../{attributes => variants}/admin/index.html | 0 .../ajax/getCombinations.php | 2 +- .../ajax/get_attribute_values.php | 4 +- .../{attributes => variants}/ajax/index.html | 0 .../ajax/orderAttribute.php | 2 +- htdocs/{attributes => variants}/card.php | 25 +++++--- .../class/ProductAttribute.class.php | 37 ++++++------ .../class/ProductAttributeValue.class.php | 4 +- .../class/ProductCombination.class.php | 29 +++++----- .../ProductCombination2ValuePair.class.php | 4 +- .../{attributes => variants}/class/index.html | 0 .../{attributes => variants}/combinations.php | 58 +++++++++---------- htdocs/{attributes => variants}/create.php | 2 +- .../{attributes => variants}/create_val.php | 2 +- htdocs/{attributes => variants}/generator.php | 25 ++++---- htdocs/{attributes => variants}/index.html | 0 .../{attributes => variants}/lib/index.html | 0 .../lib/product_variants.lib.php} | 0 htdocs/{attributes => variants}/list.php | 25 +++++--- 35 files changed, 223 insertions(+), 159 deletions(-) rename htdocs/core/modules/{modAttributes.class.php => modVariants.class.php} (90%) rename htdocs/{attributes => variants}/admin/admin.php (100%) rename htdocs/{attributes => variants}/admin/index.html (100%) rename htdocs/{attributes => variants}/ajax/getCombinations.php (94%) rename htdocs/{attributes => variants}/ajax/get_attribute_values.php (90%) rename htdocs/{attributes => variants}/ajax/index.html (100%) rename htdocs/{attributes => variants}/ajax/orderAttribute.php (95%) rename htdocs/{attributes => variants}/card.php (89%) rename htdocs/{attributes => variants}/class/ProductAttribute.class.php (89%) rename htdocs/{attributes => variants}/class/ProductAttributeValue.class.php (97%) rename htdocs/{attributes => variants}/class/ProductCombination.class.php (93%) rename htdocs/{attributes => variants}/class/ProductCombination2ValuePair.class.php (95%) rename htdocs/{attributes => variants}/class/index.html (100%) rename htdocs/{attributes => variants}/combinations.php (89%) rename htdocs/{attributes => variants}/create.php (96%) rename htdocs/{attributes => variants}/create_val.php (97%) rename htdocs/{attributes => variants}/generator.php (93%) rename htdocs/{attributes => variants}/index.html (100%) rename htdocs/{attributes => variants}/lib/index.html (100%) rename htdocs/{attributes/lib/product_attributes.lib.php => variants/lib/product_variants.lib.php} (100%) rename htdocs/{attributes => variants}/list.php (93%) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 56a8f02e7e5..6139d54c799 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -51,8 +51,8 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } -if (!empty($conf->attributes->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/attributes/class/ProductCombination.class.php'; +if (!empty($conf->variants->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } $langs->load('companies'); @@ -729,7 +729,7 @@ if (empty($reshook)) $error ++; } - if (!$error && !empty($conf->attributes->enabled) && $prod_entry_mode != 'free') { + if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 4f049a1fe4e..497dd6292f2 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -51,8 +51,8 @@ if (! empty($conf->projet->enabled)) { } require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; -if (!empty($conf->attributes->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/attributes/class/ProductCombination.class.php'; +if (!empty($conf->variants->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } $langs->load('orders'); @@ -693,7 +693,7 @@ if (empty($reshook)) $error++; } - if (!$error && !empty($conf->attributes->enabled) && $prod_entry_mode != 'free') { + if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index f0ddace3e2e..b457c3f1187 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -56,8 +56,8 @@ if (! empty($conf->projet->enabled)) { } require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; -if (!empty($conf->attributes->enabled)) { - require_once DOL_DOCUMENT_ROOT.'/attributes/class/ProductCombination.class.php'; +if (!empty($conf->variants->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } $langs->load('bills'); @@ -1428,7 +1428,7 @@ if (empty($reshook)) $error ++; } - if (!$error && !empty($conf->attributes->enabled) && $prod_entry_mode != 'free') { + if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cec7aa2aede..5637d52ace7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1673,7 +1673,7 @@ class Form } print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); - if (!empty($conf->attributes->enabled)) { + if (!empty($conf->variants->enabled)) { ?>