From 787125cf125cee968ef49797546157d896fc88a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Wed, 12 Jun 2013 11:55:28 +0200 Subject: [PATCH] reformat --- htdocs/product/stock/replenish.php | 40 ++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 368b12141bf..2e0335a9bde 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -34,9 +34,12 @@ $langs->load("stocks"); $langs->load("orders"); // Security check -if ($user->societe_id) $socid=$user->societe_id; +if ($user->societe_id) { + $socid = $user->societe_id; +} $result=restrictedArea($user,'produit|service'); +//checks if a product has been ordered function ordered($product_id) { global $db; $sql = 'SELECT DISTINCT cfd.fk_product, SUM(cfd.qty) from '; @@ -58,7 +61,7 @@ function ordered($product_id) { } } else { - $error=$db->lasterror(); + $error = $db->lasterror(); dol_print_error($db); dol_syslog('replenish.php: ' . $error, LOG_ERROR); return $langs->trans('error'); @@ -77,8 +80,14 @@ $tobuy = GETPOST('tobuy'); $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); -if (! $sortfield) $sortfield = 'stock_physique'; -if (! $sortorder) $sortorder = 'ASC'; + +if (!$sortfield) { + $sortfield = 'stock_physique'; +} + +if (!$sortorder) { + $sortorder = 'ASC'; +} $limit = $conf->liste_limit; $offset = $limit * $page ; @@ -279,10 +288,12 @@ if ($resql) { $head[1][2] = 'replenishorders'; dol_fiche_head($head, 'replenish', $title, 0, 'stock'); if ($sref || $snom || $sall || GETPOST('search')) { + $filters = '&sref=' . $sref . '&snom=' . $snom; + $filters .= '&sall=' . $sall; print_barre_liste($texte, $page, 'replenish.php', - '&sref=' . $sref . '&snom=' . $snom . '&sall=' . $sall, + $filters, $sortfield, $sortorder, '', @@ -290,10 +301,13 @@ if ($resql) { ); } else { + $filters = '&sref=' . $sref . '&snom=' . $snom; + $filters .= '&fourn_id=' . $fourn_id; + $filters .= (isset($type)?'&type=' . $type:''); print_barre_liste($texte, $page, 'replenish.php', - '&sref=$sref&snom=$snom&fourn_id=$fourn_id' . (isset($type)?'&type=$type':''), + $filters, $sortfield, $sortorder, '', @@ -336,8 +350,9 @@ if ($resql) { print ''; } - $param = (isset($type)? '&type=$type' : ''); - $param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&sref=' . $sref; + $param = (isset($type)? '&type=' . $type : ''); + $param .= '&fourn_id=' . $fourn_id . '&snom='. $snom; + $param .= '&sref=' . $sref; // Lignes des titres print ''; @@ -566,10 +581,12 @@ if ($resql) { if ($num > $conf->liste_limit) { if ($sref || $snom || $sall || GETPOST('search')) { + $filters = '&sref=' . $sref . '&snom=' . $snom; + $filters .= '&sall=' . $sall; print_barre_liste('', $page, 'replenish.php', - '&sref=' . $sref . '&snom=' . $snom . '&sall=' . $sall, + $filters, $sortfield, $sortorder, '', @@ -579,10 +596,13 @@ if ($resql) { ); } else { + $filters = '&sref=' . $sref . '&snom=' . $snom; + $filters .= '&fourn_id=' . $fourn_id; + $filters .= (isset($type)? '&type=' . $type : ''); print_barre_liste('', $page, 'replenish.php', - "&sref=$sref&snom=$snom&fourn_id=$fourn_id" . (isset($type)?"&type=$type":""), + $filters, $sortfield, $sortorder, '',