diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 58997d4384d..dc4d9b0717b 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -70,13 +70,14 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print "
"; } +$max = 15; -$sql = "SELECT e.ref as label, e.rowid, e.statut"; +$sql = "SELECT e.rowid, e.ref as label, e.lieu, e.statut as status"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " WHERE e.statut in (0,1)"; $sql.= " AND e.entity IN (".getEntity('stock').")"; $sql.= $db->order('e.statut', 'DESC'); -$sql.= $db->plimit(15, 0); +$sql.= $db->plimit($max + 1, 0); $result = $db->query($sql); @@ -92,20 +93,31 @@ if ($result) if ($num) { - $entrepot=new Entrepot($db); + $warehouse=new Entrepot($db); - while ($i < $num) + while ($i < min($max, $num)) { $objp = $db->fetch_object($result); + $warehouse->id = $objp->rowid; + $warehouse->statut = $objp->status; + $warehouse->label = $objp->label; + $warehouse->lieu = $objp->lieu; + print ''; - print "rowid\">".img_object($langs->trans("ShowStock"), "stock")." ".$objp->label."\n"; - print ''.$entrepot->LibStatut($objp->statut, 5).''; + print ''; + print $warehouse->getNomUrl(1); + print ''."\n"; + print ''.$warehouse->getLibStatut(5).''; print "\n"; $i++; } $db->free($result); } + if ($num > $max) { + print ''.$langs->trans("More").'...'; + } + print ""; print ''; }