diff --git a/htdocs/product/stock/entrepot.class.php b/htdocs/product/stock/entrepot.class.php index 2f2042cb041..ef09ebb762d 100644 --- a/htdocs/product/stock/entrepot.class.php +++ b/htdocs/product/stock/entrepot.class.php @@ -311,26 +311,64 @@ class Entrepot } - /** - * \brief Retourne le libellé du statut d'un entrepot (ouvert, fermé) - * \return string Libellé - */ - function getLibStatut() - { - return $this->LibStatut($this->statut); - } + /** + * \brief Retourne le libellé du statut d'un entrepot (ouvert, ferme) + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long + * \return string Libelle + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->statut,$mode); + } - /** - * \brief Renvoi le libellé d'un statut donné - * \param statut id statut - * \return string Libellé - */ - function LibStatut($statut) - { - return $this->statuts[$statut]; - } - - + /** + * \brief Renvoi le libellé d'un statut donné + * \param statut Id statut + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto + * \return string Libellé du statut + */ + function LibStatut($statut,$mode=0) + { + global $langs; + $langs->load('stocks'); + + if ($mode == 0) + { + $prefix=''; + if ($statut == 0) return $langs->trans('Closed2'); + if ($statut == 1) return $langs->trans('Opened'); + } + if ($mode == 1) + { + $prefix='Short'; + if ($statut == 0) return $langs->trans('Closed2'); + if ($statut == 1) return $langs->trans('Opened'); + } + if ($mode == 2) + { + $prefix='Short'; + if ($statut == 0) return img_picto($langs->trans('Closed2'),'statut5').' '.$langs->trans('Closed2'); + if ($statut == 1) return img_picto($langs->trans('Opened'),'statut4').' '.$langs->trans('Opened'); + } + if ($mode == 3) + { + $prefix='Short'; + if ($statut == 0) return img_picto($langs->trans('Closed2'),'statut5'); + if ($statut == 1) return img_picto($langs->trans('Opened'),'statut4'); + } + if ($mode == 4) + { + if ($statut == 0) return img_picto($langs->trans('Closed2'),'statut5').' '.$langs->trans('Closed2'); + if ($statut == 1) return img_picto($langs->trans('Opened'),'statut4').' '.$langs->trans('Opened'); + } + if ($mode == 5) + { + $prefix='Short'; + if ($statut == 0) return $langs->trans('Closed2').' '.img_picto($langs->trans('Closed2'),'statut5'); + if ($statut == 1) return $langs->trans('Opened').' '.img_picto($langs->trans('Opened'),'statut4'); + } + } + /** * \brief Renvoie nom clicable (avec eventuellement le picto) diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index 370022dd47b..fd97d92dae3 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -144,13 +144,27 @@ if ($_GET["action"] == 'create') } print '
| '.$langs->trans("Ref").' | |||
| '.$langs->trans("Description").' | '; - print ' | ||
| '.$langs->trans("Ref").' | |||
| '.$langs->trans("LocationSummary").' | |||
| '.$langs->trans("Description").' | '; + if ($conf->fckeditor->enabled) + { + // Editeur wysiwyg + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('desc',$entrepot->description,200,'dolibarr_notes','In',false); + $doleditor->Create(); + } + else + { + print ''; + } + print ' | ||
| '.$langs->trans('Address').' | |||
| '.$langs->trans("Status").' | '; print ''; print ' | ||
| '.$langs->trans("Ref").' | '.$entrepot->libelle.' | '; - print '||
| '.$langs->trans("Description").' | '.nl2br($entrepot->description).' | ||
| '.$langs->trans("LocationSummary").' | '.$entrepot->lieu.' | ||
| '.$langs->trans("Description").' | '.nl2br($entrepot->description).' | ||
| '.$langs->trans('Address').' | '; print $entrepot->address; print ' | ||
| '.$langs->trans("Status").' | '.$entrepot->statuts[$entrepot->statut].' | ||
| '.$langs->trans("Status").' | '.$entrepot->getLibStatut(4).' | ||
| '.$langs->trans("NumberOfProducts").' | '; print $entrepot->nb_products(); @@ -358,21 +378,34 @@ else */ if (($_GET["action"] == 'edit' || $_GET["action"] == 're-edit') && 1) { - print_fiche_titre('Edition de la fiche entrepot', $mesg); + print_fiche_titre($langs->trans("WarehouseEdit"), $mesg); print ' | ||