From 7c7626e445e1845577e2f3925415bbac786ff34e Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Sat, 10 Dec 2016 13:19:33 +0100 Subject: [PATCH] allow to change height and width --- htdocs/product/class/product.class.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3df1393628a..56b9fc527a6 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -636,6 +636,10 @@ class Product extends CommonObject $this->weight_units = trim($this->weight_units); $this->length = price2num($this->length); $this->length_units = trim($this->length_units); + $this->width = price2num($this->width); + $this->width_units = trim($this->width_units); + $this->height = price2num($this->height); + $this->height_units = trim($this->height_units); $this->surface = price2num($this->surface); $this->surface_units = trim($this->surface_units); $this->volume = price2num($this->volume); @@ -750,6 +754,10 @@ class Product extends CommonObject $sql.= ", weight_units = " . ($this->weight_units!='' ? "'".$this->weight_units."'": 'null'); $sql.= ", length = " . ($this->length!='' ? "'".$this->length."'" : 'null'); $sql.= ", length_units = " . ($this->length_units!='' ? "'".$this->length_units."'" : 'null'); + $sql.= ", width= " . ($this->width!='' ? "'".$this->width."'" : 'null'); + $sql.= ", width_units = " . ($this->width_units!='' ? "'".$this->width_units."'" : 'null'); + $sql.= ", height = " . ($this->height!='' ? "'".$this->height."'" : 'null'); + $sql.= ", height_units = " . ($this->height_units!='' ? "'".$this->height_units."'" : 'null'); $sql.= ", surface = " . ($this->surface!='' ? "'".$this->surface."'" : 'null'); $sql.= ", surface_units = " . ($this->surface_units!='' ? "'".$this->surface_units."'" : 'null'); $sql.= ", volume = " . ($this->volume!='' ? "'".$this->volume."'" : 'null'); @@ -1671,8 +1679,9 @@ class Product extends CommonObject $sql = "SELECT rowid, ref, ref_ext, label, description, url, note as note_private, customcode, fk_country, price, price_ttc,"; $sql.= " price_min, price_min_ttc, price_base_type, cost_price, default_vat_code, tva_tx, recuperableonly as tva_npr, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, tosell,"; - $sql.= " tobuy, fk_product_type, duration, seuil_stock_alerte, canvas,"; - $sql.= " weight, weight_units, length, length_units, surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,"; + $sql.= " tobuy, fk_product_type, duration, seuil_stock_alerte, canvas, weight, weight_units,"; + $sql.= " length, length_units, width, width_units, height, height_units,"; + $sql.= " surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished,"; $sql.= " accountancy_code_buy, accountancy_code_sell, stock, pmp,"; $sql.= " datec, tms, import_key, entity, desiredstock, tobatch, fk_unit,"; $sql.= " fk_price_expression, price_autogen"; @@ -1734,6 +1743,11 @@ class Product extends CommonObject $this->weight_units = $obj->weight_units; $this->length = $obj->length; $this->length_units = $obj->length_units; + $this->width = $obj->width; + $this->width_units = $obj->width_units; + $this->height = $obj->height; + $this->height_units = $obj->height_units; + $this->surface = $obj->surface; $this->surface_units = $obj->surface_units; $this->volume = $obj->volume;