diff --git a/htdocs/includes/boxes/box_produits.php b/htdocs/includes/boxes/box_produits.php index 56b9503a333..ed1c2163b98 100644 --- a/htdocs/includes/boxes/box_produits.php +++ b/htdocs/includes/boxes/box_produits.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -21,7 +21,7 @@ /** * \file htdocs/includes/boxes/box_produits.php * \ingroup produits,services - * \brief Module de generation de l'affichage de la box produits + * \brief Module to generate box of last products/services * \version $Id$ */ @@ -71,7 +71,7 @@ class box_produits extends ModeleBoxes { if ($user->rights->produit->lire || $user->rights->service->lire) { - $sql = "SELECT p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell"; + $sql = "SELECT p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE p.entity = ".$conf->entity; if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; @@ -136,9 +136,12 @@ class box_produits extends ModeleBoxes { 'text' => dol_print_date($datem,'day')); $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', - 'text' => $productstatic->LibStatut($objp->tosell,3)); + 'text' => $productstatic->LibStatut($objp->tosell,3,0)); - $i++; + $this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"', + 'text' => $productstatic->LibStatut($objp->tobuy,3,1)); + + $i++; } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProducts")); } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c10e97cd80e..630c7d743e9 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2231,8 +2231,8 @@ class Product extends CommonObject } if ($mode == 3) { - if ($status == 0) return img_picto($langs->trans('ProductStatusNotOnSell'),'statut5'); - if ($status == 1) return img_picto($langs->trans('ProductStatusOnSell'),'statut4'); + if ($status == 0) return img_picto(($type==0 ? $langs->trans('ProductStatusNotOnSell') : $langs->trans('ProductStatusNotOnBuy')),'statut5'); + if ($status == 1) return img_picto(($type==0 ? $langs->trans('ProductStatusOnSell') : $langs->trans('ProductStatusOnBuy')),'statut4'); } if ($mode == 4) {