From 3bc4dadc7f82a79d46c802c894dc4028d8a642e9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 25 Mar 2010 16:37:57 +0000 Subject: [PATCH] Works on canvas capability Works on custom list --- htdocs/install/mysql/migration/2.8.0-2.9.0.sql | 9 ++++++--- htdocs/product/canvas/default/product.default.class.php | 7 ++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/install/mysql/migration/2.8.0-2.9.0.sql b/htdocs/install/mysql/migration/2.8.0-2.9.0.sql index 78c7086c563..5ab7721eec3 100755 --- a/htdocs/install/mysql/migration/2.8.0-2.9.0.sql +++ b/htdocs/install/mysql/migration/2.8.0-2.9.0.sql @@ -133,6 +133,7 @@ ALTER TABLE llx_adherent ADD COLUMN civilite varchar(6) after entity; ALTER TABLE llx_deplacement ADD COLUMN fk_projet integer DEFAULT 0 after fk_soc; -- custom list +DROP TABLE llx_c_field_list; create table llx_c_field_list ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -154,6 +155,8 @@ INSERT INTO `llx_c_field_list` (`rowid`, `element`, `entity`, `name`, `alias`, ` (2, 'product_default', 1, 'label', NULL, 'Label', 'left', 1, 1, '1', 2), (3, 'product_default', 1, 'barcode', NULL, 'BarCode', 'center', 1, 1, '$conf->barcode->enabled', 3), (4, 'product_default', 1, 'tms', 'datem', 'DateModification', 'center', 1, 0, '1', 4), -(5, 'product_default', 1, 'price', 'sellingprice', 'SellingPrice', 'right', 1, 0, '1', 5), -(6, 'product_default', 1, 'stock', NULL, 'Stock', 'right', 0, 0, '$conf->stock->enabled', 6), -(7, 'product_default', 1, 'envente', 'status', 'Status', 'right', 1, 0, '1', 7); \ No newline at end of file +(5, 'product_default', 1, 'price', NULL, 'SellingPriceHT', 'right', 1, 0, '1', 5), +(6, 'product_default', 1, 'price_ttc', NULL, 'SellingPriceTTC', 'right', 1, 0, '1', 6), +(7, 'product_default', 1, 'stock', NULL, 'Stock', 'right', 0, 0, '$conf->stock->enabled', 7), +(8, 'product_default', 1, 'envente', 'status', 'Status', 'right', 1, 0, '1', 8); + diff --git a/htdocs/product/canvas/default/product.default.class.php b/htdocs/product/canvas/default/product.default.class.php index 4590997a6f8..fd1b214164d 100644 --- a/htdocs/product/canvas/default/product.default.class.php +++ b/htdocs/product/canvas/default/product.default.class.php @@ -171,17 +171,14 @@ class ProductDefault extends Product $this->type = $obj->fk_product_type; $datas[$alias] = $this->getNomUrl(1,'',24); } - else if ($alias == 'sellingprice') - { - if ($obj->price_base_type == 'TTC') $datas[$alias] = price($obj->price_ttc).' '.$langs->trans("TTC"); - else $datas[$alias] = price($obj->$alias).' '.$langs->trans("HT"); - } else if ($alias == 'stock') { $this->load_stock(); if ($this->stock_reel < $obj->seuil_stock_alerte) $datas[$alias] = $this->stock_reel.' '.img_warning($langs->trans("StockTooLow")); else $datas[$alias] = $this->stock_reel; } + else if ($alias == 'label') $datas[$alias] = dol_trunc($obj->$alias,40); + else if (preg_match('/price/i',$alias)) $datas[$alias] = price($obj->$alias); else if ($alias == 'datem') $datas[$alias] = dol_print_date($this->db->jdate($obj->$alias),'day'); else if ($alias == 'status') $datas[$alias] = $this->LibStatut($obj->$alias,5); else $datas[$alias] = $obj->$alias;