Checkstyle

This commit is contained in:
Laurent Destailleur 2012-01-22 21:17:02 +01:00
parent 47c83603f4
commit bacf2003f1
21 changed files with 47 additions and 44 deletions

View File

@ -201,7 +201,7 @@ if ($id || $ref)
// Number of subproducts // Number of subproducts
$prodsfather = $product->getFather(); //Parent Products $prodsfather = $product->getFather(); //Parent Products
$product->get_sousproduits_arbo (); $product->get_sousproduits_arbo();
print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.count($product->get_arbo_each_prod()).'</td>'; print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.count($product->get_arbo_each_prod()).'</td>';
dol_fiche_end(); dol_fiche_end();
@ -287,7 +287,7 @@ if ($id || $ref)
// Number of subproducts // Number of subproducts
$prodsfather = $product->getFather(); //Parent Products $prodsfather = $product->getFather(); //Parent Products
$product->get_sousproduits_arbo (); $product->get_sousproduits_arbo();
print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.count($product->get_arbo_each_prod()).'</td>'; print '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.count($product->get_arbo_each_prod()).'</td>';
print '</tr>'; print '</tr>';

View File

@ -154,12 +154,12 @@ if ($product->id)
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>';
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
print $product->getLibStatut(2,0); print $product->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';

View File

@ -226,7 +226,7 @@ if ($id || $ref)
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';

View File

@ -162,7 +162,7 @@ else
$sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte"; $sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte";
//if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1 ,$offset); $sql.= $db->plimit($limit + 1, $offset);
dol_syslog("sql=".$sql); dol_syslog("sql=".$sql);
$resql = $db->query($sql); $resql = $db->query($sql);
@ -202,7 +202,7 @@ else
if (isset($catid)) if (isset($catid))
{ {
print "<div id='ways'>"; print "<div id='ways'>";
$c = new Categorie ($db, $catid); $c = new Categorie($db, $catid);
$ways = $c->print_all_ways(' &gt; ','product/liste.php'); $ways = $c->print_all_ways(' &gt; ','product/liste.php');
print " &gt; ".$ways[0]."<br>\n"; print " &gt; ".$ways[0]."<br>\n";
print "</div><br>"; print "</div><br>";

View File

@ -123,12 +123,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>'; print '</tr>';
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
print $product->getLibStatut(2,0); print $product->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';

View File

@ -104,7 +104,7 @@ $sql.= " AND p.entity = ".$conf->entity;
if (isset($_GET['type'])) $sql.= " AND fk_product_type = ".$_GET['type']; if (isset($_GET['type'])) $sql.= " AND fk_product_type = ".$_GET['type'];
$sql.= " GROUP BY (p.rowid)"; $sql.= " GROUP BY (p.rowid)";
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit ,$offset); $sql.= $db->plimit($limit, $offset);
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result)

View File

@ -264,7 +264,7 @@ else
} }
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
print $object->getLibStatut(2,0); print $object->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
@ -327,7 +327,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Price // Price
print '<tr><td width="20%">'; print '<tr><td width="20%">';
$text=$langs->trans('SellingPrice'); $text=$langs->trans('SellingPrice');
print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1); print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),1,1);
print '</td><td>'; print '</td><td>';
if ($object->price_base_type == 'TTC') if ($object->price_base_type == 'TTC')
{ {
@ -342,7 +342,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Price minimum // Price minimum
print '<tr><td>' ; print '<tr><td>' ;
$text=$langs->trans('MinPrice'); $text=$langs->trans('MinPrice');
print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1); print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),1,1);
if ($object->price_base_type == 'TTC') if ($object->price_base_type == 'TTC')
{ {
print '<td><input name="price_min" size="10" value="'.price($object->price_min_ttc).'">'; print '<td><input name="price_min" size="10" value="'.price($object->price_min_ttc).'">';
@ -385,7 +385,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Selling price // Selling price
print '<tr><td width="20%">'; print '<tr><td width="20%">';
$text=$langs->trans('SellingPrice').' '.$i; $text=$langs->trans('SellingPrice').' '.$i;
print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1); print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),1,1);
print '</td><td>'; print '</td><td>';
if ($object->multiprices_base_type["$i"] == 'TTC') if ($object->multiprices_base_type["$i"] == 'TTC')
{ {
@ -401,7 +401,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Min price // Min price
print '<tr><td>'; print '<tr><td>';
$text=$langs->trans('MinPrice').' '.$i; $text=$langs->trans('MinPrice').' '.$i;
print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1); print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),1,1);
if ($object->multiprices_base_type["$i"] == 'TTC') if ($object->multiprices_base_type["$i"] == 'TTC')
{ {
print '<td><input name="price_min_'.$i.'" size="10" value="'.price($object->multiprices_min_ttc["$i"]).'">'; print '<td><input name="price_min_'.$i.'" size="10" value="'.price($object->multiprices_min_ttc["$i"]).'">';

View File

@ -148,7 +148,7 @@ $sql.= " p.fk_product_type, p.tms,";
$sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte"; $sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte";
if ($toolowstock) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet if ($toolowstock) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1 ,$offset); $sql.= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)

View File

@ -97,12 +97,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>'; print '</tr>';
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0); print $product->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';

View File

@ -92,12 +92,12 @@ if ($_GET["id"] || $_GET["ref"])
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>';
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0); print $product->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';

View File

@ -97,12 +97,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>'; print '</tr>';
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0); print $product->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';

View File

@ -99,12 +99,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>'; print '</tr>';
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0); print $product->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';

View File

@ -100,12 +100,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>'; print '</tr>';
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0); print $product->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';

View File

@ -80,12 +80,12 @@ if (! empty($id) || ! empty($ref))
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->libelle.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->libelle.'</td></tr>';
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
print $object->getLibStatut(2,0); print $object->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $object->getLibStatut(2,1); print $object->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';

View File

@ -94,12 +94,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>'; print '</tr>';
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0); print $product->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';

View File

@ -124,7 +124,7 @@ class Entrepot extends CommonObject
* Update properties of a warehouse * Update properties of a warehouse
* *
* @param int $id id of warehouse to modify * @param int $id id of warehouse to modify
* @param User $user * @param User $user User object
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function update($id, $user) function update($id, $user)
@ -225,7 +225,7 @@ class Entrepot extends CommonObject
/** /**
* Load warehouse data * Load warehouse data
* *
* @param int $id Warehouse id * @param int $id Warehouse id
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function fetch($id) function fetch($id)
@ -287,6 +287,7 @@ class Entrepot extends CommonObject
* Load warehouse info data * Load warehouse info data
* *
* @param int $id warehouse id * @param int $id warehouse id
* @return void
*/ */
function info($id) function info($id)
{ {
@ -333,8 +334,9 @@ class Entrepot extends CommonObject
/** /**
* Return list of all warehouses * Return list of all warehouses
* *
* @return array Array list of warehouses * @param int $status Status
* @return array Array list of warehouses
*/ */
function list_array($status=1) function list_array($status=1)
{ {
@ -407,9 +409,9 @@ class Entrepot extends CommonObject
/** /**
* Return label of a given status * Return label of a given status
* *
* @param status Statut * @param int $statut Status
* @param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label of status * @return string Label of status
*/ */
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {

View File

@ -325,6 +325,7 @@ class MouvementStock
* @param int $qty Quantity * @param int $qty Quantity
* @param int $price Price * @param int $price Price
* @param string $label Label of stock movement * @param string $label Label of stock movement
* @return int <0 if KO, >0 if OK
*/ */
function reception($user, $fk_product, $entrepot_id, $qty, $price=0, $label='') function reception($user, $fk_product, $entrepot_id, $qty, $price=0, $label='')
{ {

View File

@ -62,8 +62,8 @@ $sql = "SELECT e.label, e.rowid, e.statut";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " WHERE e.statut in (0,1)"; $sql.= " WHERE e.statut in (0,1)";
$sql.= " AND e.entity = ".$conf->entity; $sql.= " AND e.entity = ".$conf->entity;
$sql.= " ORDER BY e.statut DESC "; $sql.= $db->order('e.statut','DESC');
$sql.= $db->plimit(15 ,0); $sql.= $db->plimit(15, 0);
$result = $db->query($sql); $result = $db->query($sql);

View File

@ -44,7 +44,7 @@ if ($page < 0) $page = 0;
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
$offset = $limit * $page; $offset = $limit * $page;
$sql = "SELECT e.rowid, e.label as ref, e.statut, e.lieu, e.address, e.cp, e.ville, e.fk_pays"; $sql = "SELECT e.rowid, e.label as ref, e.statut, e.lieu, e.address, e.cp, e.ville, e.fk_pays";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " WHERE e.entity = ".$conf->entity; $sql.= " WHERE e.entity = ".$conf->entity;
@ -57,7 +57,7 @@ if ($sall)
$sql.= " AND (e.description like '%".$sall."%' OR e.lieu like '%".$sall."%' OR e.address like '%".$sall."%' OR e.ville like '%".$sall."%')"; $sql.= " AND (e.description like '%".$sall."%' OR e.lieu like '%".$sall."%' OR e.address like '%".$sall."%' OR e.ville like '%".$sall."%')";
} }
$sql.= " ORDER BY $sortfield $sortorder"; $sql.= " ORDER BY $sortfield $sortorder";
$sql.= $db->plimit($limit + 1 ,$offset); $sql.= $db->plimit($limit+1, $offset);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)

View File

@ -122,7 +122,7 @@ if (! empty($_GET['idproduct']))
$sql.= " AND p.rowid = '".$_GET['idproduct']."'"; $sql.= " AND p.rowid = '".$_GET['idproduct']."'";
} }
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit + 1 ,$offset); $sql.= $db->plimit($conf->liste_limit+1, $offset);
//print $sql; //print $sql;
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@ -191,12 +191,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>'; print '</tr>';
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
print $product->getLibStatut(2,0); print $product->getLibStatut(2,0);
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);
print '</td></tr>'; print '</td></tr>';