';
+ $label.= '
' . $langs->trans('Ref') . ': ' . $this->ref;
+
+ $link = '
';
+ $linkend='';
+
+ if ($withpicto)
+ {
+ $result.=($link.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend);
+ if ($withpicto != 2) $result.=' ';
+ }
+ $result.= $link . $this->ref . $linkend;
+ return $result;
+ }
+
+ /**
+ * Retourne le libelle du status d'un user (actif, inactif)
+ *
+ * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @return string Label of status
+ */
+ function getLibStatut($mode=0)
+ {
+ return $this->LibStatut($this->status,$mode);
+ }
+
+ /**
+ * Renvoi le libelle d'un status donne
+ *
+ * @param int $status Id status
+ * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @return string Label of status
+ */
+ function LibStatut($status,$mode=0)
+ {
+ global $langs;
+
+ if ($mode == 0)
+ {
+ $prefix='';
+ if ($status == 1) return $langs->trans('Enabled');
+ if ($status == 0) return $langs->trans('Disabled');
+ }
+ if ($mode == 1)
+ {
+ if ($status == 1) return $langs->trans('Enabled');
+ if ($status == 0) return $langs->trans('Disabled');
+ }
+ if ($mode == 2)
+ {
+ if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
+ if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
+ }
+ if ($mode == 3)
+ {
+ if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
+ if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
+ }
+ if ($mode == 4)
+ {
+ if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
+ if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
+ }
+ if ($mode == 5)
+ {
+ if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
+ if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
+ }
+ }
+
+
+ /**
+ * Initialise object with example values
+ * Id must be 0 if object instance is a specimen
+ *
+ * @return void
+ */
+ public function initAsSpecimen()
+ {
+ $this->id = 0;
+
+ $this->tms = '';
+ $this->fk_product = '';
+ $this->fk_entrepot = '';
+ $this->seuil_stock_alerte = '';
+ $this->desiredstock = '';
+ $this->import_key = '';
+
+
+ }
+
+}
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 2411dde51e4..1f90c473248 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -69,6 +69,13 @@ $result=restrictedArea($user,'produit&stock',$id,'product&product','','',$fieldi
if ($cancel) $action='';
+if($action == 'addlimitstockwarehouse') {
+
+ //var_dump($_REQUEST);exit;
+ $action='';
+
+}
+
// Set stock limit
if ($action == 'setseuil_stock_alerte')
{
@@ -824,6 +831,28 @@ print '';
print "";
print "";
+if(!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) {
+
+ print '
';
+ print_titre('Indiquer une limite pour alerte et un stock optimal');
+ //print '
';
+
+ print '
';
+
+}
llxFooter();