Checkstyle

This commit is contained in:
Laurent Destailleur 2013-09-10 13:45:39 +02:00
parent ee65a193c2
commit 72557437ef
9 changed files with 350 additions and 347 deletions

View File

@ -219,7 +219,7 @@
<severity>0</severity>
</rule>
<!-- some phpcs have a typo error in rule, so we add it too -->
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCaptial">
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCaptial">
<severity>0</severity>
</rule>

View File

@ -287,7 +287,6 @@ class Propal extends CommonObject
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,'',produit)
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
*
* @param int $propalid Id de la propale
* @param string $desc Description de la ligne
* @param double $pu_ht Prix unitaire
* @param double $qty Quantite
@ -1603,9 +1602,7 @@ class Propal extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql.= " SET fk_statut = ".$this->statut.",";
if (! empty ( $note )) {
$sql .= " note_private = '" . $this->db->escape ( $note ) . "',";
}
if (! empty($note)) $sql.= " note_private = '".$this->db->escape($note)."',";
$sql.= " date_cloture=NULL, fk_user_cloture=NULL";
$sql.= " WHERE rowid = ".$this->id;

View File

@ -576,8 +576,8 @@ class BonPrelevement extends CommonObject
/**
* Get invoice list
*
* @param $amounts If you want to get the amount of the order for each invoice
* @return array id of invoices
* @param int $amounts If you want to get the amount of the order for each invoice
* @return array Id of invoices
*/
private function getListInvoices($amounts=0)
{

View File

@ -906,21 +906,16 @@ class Contact extends CommonObject
}
/**
* Retourne le libelle du statut du contact
* Return label of contact 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 Libelle
* @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 contact status
*/
function getLibStatut($mode)
{
return $this->LibStatut($this->statut,$mode);
}
function getLibStatutcontact()
{
return $this->LibStatutcontact($this->statut);
}
/**
* Renvoi le libelle d'un statut donne
*
@ -928,7 +923,7 @@ class Contact extends CommonObject
* @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 Libelle
*/
function LibStatut($statut)
function LibStatut($statut,$mode)
{
global $langs;
@ -977,12 +972,7 @@ class Contact extends CommonObject
}
function LibStatutcontact($statut)
{
global $langs;
if ($statut==0) return '<span class="hideonsmartphone">'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('StatusContactDraftShort'),'statut0');
else return '<span class="hideonsmartphone">'.$langs->trans('Enabled').' </span>'.img_picto($langs->trans('StatusContactValidatedShort'),'statut1');
}
/**
* Return translated label of Public or Private
*

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
@ -739,7 +739,7 @@ else
// Statut
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>';
print $object->getLibStatutcontact();
print $object->getLibStatut(5);
print '</td></tr>';
// Other attributes
@ -946,10 +946,10 @@ else
print nl2br($object->note);
print '</td></tr>';
// Statut
// Statut
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>';
print $object->getLibStatutcontact();
print $object->getLibStatut(5);
print '</td>';
print '</tr>'."\n";
// Other attributes

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
@ -3223,16 +3223,23 @@ abstract class CommonObject
print '</table>';
}
/**
* Overwrite magic function to solve problem of cloning object that are kept as references
*
* @return void
*/
function __clone()
{
// Force a copy of this->lines, otherwise it will point to same object.
if (isset($this->lines) && is_array($this->lines))
{
for($i=0; $i < count($this->lines); $i++)
$nboflines=count($this->lines);
for($i=0; $i < $nboflines; $i++)
{
$this->lines[$i] = dol_clone($this->lines[$i]);
}
}
}
}
?>

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (c) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (c) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -235,37 +235,40 @@ if ($resql) {
$filters = '&sref=' . $sref . '&snom=' . $snom;
$filters .= '&sall=' . $sall;
$filters .= '&salert=' . $salert;
print_barre_liste($texte,
$page,
'replenish.php',
$filters,
$sortfield,
$sortorder,
'',
$num
);
print_barre_liste(
$texte,
$page,
'replenish.php',
$filters,
$sortfield,
$sortorder,
'',
$num
);
} else {
$filters = '&sref=' . $sref . '&snom=' . $snom;
$filters .= '&fourn_id=' . $fourn_id;
$filters .= (isset($type)?'&type=' . $type:'');
$filters .= '&salert=' . $salert;
print_barre_liste($texte,
$page,
'replenish.php',
$filters,
$sortfield,
$sortorder,
'',
$num);
print_barre_liste(
$texte,
$page,
'replenish.php',
$filters,
$sortfield,
$sortorder,
'',
$num
);
}
echo '<form action="replenish.php" method="post" name="formulaire">',
'<input type="hidden" name="token" value="' .$_SESSION['newtoken'] . '">',
'<input type="hidden" name="sortfield" value="' . $sortfield . '">',
'<input type="hidden" name="sortorder" value="' . $sortorder . '">',
'<input type="hidden" name="type" value="' . $type . '">',
'<input type="hidden" name="linecount" value="' . $num . '">',
'<input type="hidden" name="action" value="order">',
print '<form action="replenish.php" method="post" name="formulaire">'.
'<input type="hidden" name="token" value="' .$_SESSION['newtoken'] . '">'.
'<input type="hidden" name="sortfield" value="' . $sortfield . '">'.
'<input type="hidden" name="sortorder" value="' . $sortorder . '">'.
'<input type="hidden" name="type" value="' . $type . '">'.
'<input type="hidden" name="linecount" value="' . $num . '">'.
'<input type="hidden" name="action" value="order">'.
'<table class="liste" width="100%">';
@ -274,115 +277,128 @@ if ($resql) {
$param .= '&sref=' . $sref;
// Lignes des titres
echo '<tr class="liste_titre">',
print '<tr class="liste_titre">'.
'<td><input type="checkbox" onClick="toggle(this)" /></td>';
print_liste_field_titre($langs->trans('Ref'),
'replenish.php',
'p.ref',
$param,
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('Label'),
'replenish.php',
'p.label',
$param,
'',
'',
$sortfield,
$sortorder
);
if (!empty($conf->service->enabled) && $type == 1) {
print_liste_field_titre($langs->trans('Duration'),
'replenish.php',
'p.duration',
$param,
'',
'align="center"',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('Ref'),
'replenish.php',
'p.ref',
$param,
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('Label'),
'replenish.php',
'p.label',
$param,
'',
'',
$sortfield,
$sortorder
);
if (!empty($conf->service->enabled) && $type == 1)
{
print_liste_field_titre(
$langs->trans('Duration'),
'replenish.php',
'p.duration',
$param,
'',
'align="center"',
$sortfield,
$sortorder
);
}
print_liste_field_titre($langs->trans('DesiredStock'),
'replenish.php',
'p.desiredstock',
$param,
'',
'align="right"',
$sortfield,
$sortorder
);
if ($conf->global->USE_VIRTUAL_STOCK) {
print_liste_field_titre(
$langs->trans('DesiredStock'),
'replenish.php',
'p.desiredstock',
$param,
'',
'align="right"',
$sortfield,
$sortorder
);
if ($conf->global->USE_VIRTUAL_STOCK)
{
$stocklabel = $langs->trans('VirtualStock');
} else {
}
else
{
$stocklabel = $langs->trans('PhysicalStock');
}
print_liste_field_titre($stocklabel,
'replenish.php',
'stock_physique',
$param,
'',
'align="right"',
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('Ordered'),
'replenish.php',
'',
$param,
'',
'align="right"',
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('StockToBuy'),
'replenish.php',
'',
$param,
'',
'align="right"',
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('Supplier'),
'replenish.php',
'',
$param,
'',
'align="right"',
$sortfield,
$sortorder
);
echo '<td>&nbsp;</td>',
'</tr>',
print_liste_field_titre(
$stocklabel,
'replenish.php',
'stock_physique',
$param,
'',
'align="right"',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('Ordered'),
'replenish.php',
'',
$param,
'',
'align="right"',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('StockToBuy'),
'replenish.php',
'',
$param,
'',
'align="right"',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('Supplier'),
'replenish.php',
'',
$param,
'',
'align="right"',
$sortfield,
$sortorder
);
print '<td>&nbsp;</td>'.
'</tr>'.
// Lignes des champs de filtre
'<tr class="liste_titre">',
'<td class="liste_titre">&nbsp;</td>',
'<td class="liste_titre">',
'<input class="flat" type="text" name="sref" value="' . $sref . '">',
'</td>',
'<td class="liste_titre">',
'<input class="flat" type="text" name="snom" value="' . $snom . '">',
// Lignes des champs de filtre
'<tr class="liste_titre">'.
'<td class="liste_titre">&nbsp;</td>'.
'<td class="liste_titre">'.
'<input class="flat" type="text" name="sref" value="' . $sref . '">'.
'</td>'.
'<td class="liste_titre">'.
'<input class="flat" type="text" name="snom" value="' . $snom . '">'.
'</td>';
if (!empty($conf->service->enabled) && $type == 1) {
echo '<td class="liste_titre">',
'&nbsp;',
if (!empty($conf->service->enabled) && $type == 1)
{
print '<td class="liste_titre">'.
'&nbsp;'.
'</td>';
}
echo '<td class="liste_titre">&nbsp;</td>',
'<td class="liste_titre" align="right">' . $langs->trans('AlertOnly') . '&nbsp;<input type="checkbox" name="salert" ' . $alertchecked . '></td>',
'<td class="liste_titre" align="right">&nbsp;</td>',
'<td class="liste_titre">&nbsp;</td>',
'<td class="liste_titre">&nbsp;</td>',
'<td class="liste_titre" align="right">',
'<input type="image" class="liste_titre" name="button_search"',
'src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" alt="' . $langs->trans("Search") . '">',
print '<td class="liste_titre">&nbsp;</td>'.
'<td class="liste_titre" align="right">' . $langs->trans('AlertOnly') . '&nbsp;<input type="checkbox" name="salert" ' . $alertchecked . '></td>'.
'<td class="liste_titre" align="right">&nbsp;</td>'.
'<td class="liste_titre">&nbsp;</td>'.
'<td class="liste_titre">&nbsp;</td>'.
'<td class="liste_titre" align="right">'.
'<input type="image" class="liste_titre" name="button_search"'.
'src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" alt="' . $langs->trans("Search") . '">'.
'<input type="image" class="liste_titre" name="button_removefilter"
src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">',
'</td>',
src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'.
'</td>'.
'</tr>';
$prod = new Product($db);
@ -452,12 +468,12 @@ if ($resql) {
} else {
$picto = img_picto('', './img/no', '', 1);
}
echo '<tr ' . $bc[$var] . '>',
'<td><input type="checkbox" class="check" name="' . $i . '"' . $disabled . '></td>',
'<td class="nowrap">',
$prod->getNomUrl(1, '', 16),
'</td>',
'<td>' . $objp->label . '</td>',
print '<tr ' . $bc[$var] . '>'.
'<td><input type="checkbox" class="check" name="' . $i . '"' . $disabled . '></td>'.
'<td class="nowrap">'.
$prod->getNomUrl(1, '', 16).
'</td>'.
'<td>' . $objp->label . '</td>'.
'<input type="hidden" name="desc' . $i . '" value="' . $objp->label . '" >';
if (!empty($conf->service->enabled) && $type == 1) {
@ -470,80 +486,81 @@ if ($resql) {
} else {
$duration = $objp->duration;
}
echo '<td align="center">',
$duration,
print '<td align="center">'.
$duration.
'</td>';
}
echo '<td align="right">' . $objp->desiredstock . '</td>',
'<td align="right">',
$warning, $stock,
'</td>',
'<td align="right">',
'<a href="replenishorders.php?sproduct=' , $prod->id, '">',
$ordered, '</a> ', $picto,
'</td>',
'<td align="right">',
print '<td align="right">' . $objp->desiredstock . '</td>'.
'<td align="right">'.
$warning . $stock.
'</td>'.
'<td align="right">'.
'<a href="replenishorders.php?sproduct=' . $prod->id . '">'.
$ordered . '</a> ' . $picto.
'</td>'.
'<td align="right">'.
'<input type="text" name="tobuy' . $i .
'" value="' . $stocktobuy . '" ' . $disabled . '>',
'</td>',
'<td align="right">',
$form->select_product_fourn_price($prod->id,
'fourn' . $i,
1
),
'</td>',
'<td>&nbsp</td>',
'" value="' . $stocktobuy . '" ' . $disabled . '>'.
'</td>'.
'<td align="right">'.
$form->select_product_fourn_price($prod->id, 'fourn'.$i, 1).
'</td>'.
'<td>&nbsp</td>'.
'</tr>';
}
$i++;
}
$value = $langs->trans("CreateOrders");
echo '</table>',
'</div>',
'<table width="100%">',
'<tr><td align="right">',
'<input class="butAction" type="submit" name="valid" value="' . $value . '">',
'</td></tr></table>',
print '</table>'.
'</div>'.
'<table width="100%">'.
'<tr><td align="right">'.
'<input class="butAction" type="submit" name="valid" value="' . $value . '">'.
'</td></tr></table>'.
'</form>';
if ($num > $conf->liste_limit) {
if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) {
if ($num > $conf->liste_limit)
{
if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha'))
{
$filters = '&sref=' . $sref . '&snom=' . $snom;
$filters .= '&sall=' . $sall;
$filters .= '&salert=' . $salert;
print_barre_liste('',
$page,
'replenish.php',
$filters,
$sortfield,
$sortorder,
'',
$num,
0,
''
);
print_barre_liste(
'',
$page,
'replenish.php',
$filters,
$sortfield,
$sortorder,
'',
$num,
0,
''
);
} else {
$filters = '&sref=' . $sref . '&snom=' . $snom;
$filters .= '&fourn_id=' . $fourn_id;
$filters .= (isset($type)? '&type=' . $type : '');
$filters .= '&salert=' . $salert;
print_barre_liste('',
$page,
'replenish.php',
$filters,
$sortfield,
$sortorder,
'',
$num,
0,
''
);
print_barre_liste(
'',
$page,
'replenish.php',
$filters,
$sortfield,
$sortorder,
'',
$num,
0,
''
);
}
}
$db->free($resql);
echo ' <script type="text/javascript">
print ' <script type="text/javascript">
function toggle(source)
{
checkboxes = document.getElementsByClassName("check");
@ -558,4 +575,6 @@ echo ' <script type="text/javascript">
}
llxFooter();
$db->close();
?>

View File

@ -48,11 +48,7 @@ $head[0][2] = 'replenish';
$head[1][0] = DOL_URL_ROOT.'/product/stock/replenishorders.php';
$head[1][1] = $texte;
$head[1][2] = 'replenishorders';
dol_fiche_head($head,
'replenishorders',
$langs->trans('Replenishment'),
0,
'stock');
dol_fiche_head($head, 'replenishorders', $langs->trans('Replenishment'), 0, 'stock');
$commandestatic = new CommandeFournisseur($db);
$sref = GETPOST('search_ref', 'alpha');
$snom = GETPOST('search_nom', 'alpha');
@ -121,33 +117,17 @@ if ($suser) {
if ($sttc) {
$sql .= ' AND cf.total_ttc = ' . price2num($sttc);
}
if ($sdate) {
if(GETPOST('search_datemonth', 'int') && GETPOST('search_dateday', 'int')
&& GETPOST('search_dateyear', 'int')) {
$date = date('Y-m-d',
dol_mktime(0,
0,
0,
GETPOST('search_datemonth', 'int'),
GETPOST('search_dateday', 'int'),
GETPOST('search_dateyear', 'int')
)
);
} else {
$elts = explode('/', $sdate);
$datearray = array();
if ($elts[2]) {
$datearray[0] = $elts[2];
}
if ($elts[1]) {
$datearray[1] = $elts[1];
}
if ($elts[0]) {
$datearray[2] = $elts[0];
}
$date = implode('-', $datearray);
if ($sdate)
{
if (GETPOST('search_datemonth', 'int') && GETPOST('search_dateday', 'int') && GETPOST('search_dateyear', 'int'))
{
$date = dol_mktime(0, 0, 0, GETPOST('search_datemonth', 'int'), GETPOST('search_dateday', 'int'), GETPOST('search_dateyear', 'int'));
}
$sql .= ' AND cf.date_creation LIKE "%' . $date . '%"';
else
{
$date = dol_stringtotime($sdate);
}
$sql .= " AND cf.date_creation = '" . $db->idate($date) . "'";
}
if ($sall) {
$sql .= ' AND (cf.ref LIKE "%' . $db->escape($sall) . '%" ';
@ -165,122 +145,132 @@ $sql .= ', cf.total_ttc, cf.fk_user_author, u.login, s.rowid, s.nom';
$sql .= ' ORDER BY ' . $sortfield . ' ' . $sortorder . ' ';
$sql .= $db->plimit($conf->liste_limit+1, $offset);
$resql = $db->query($sql);
if ($resql) {
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
print_barre_liste($langs->trans('ReplenishmentOrders'),
$page,
'replenishorders.php',
'',
$sortfield,
$sortorder,
'',
$num
);
echo '<form action="replenishorders.php" method="GET">',
'<table class="noborder" width="100%">',
print_barre_liste(
$langs->trans('ReplenishmentOrders'),
$page,
'replenishorders.php',
'',
$sortfield,
$sortorder,
'',
$num
);
print '<form action="replenishorders.php" method="GET">'.
'<table class="noborder" width="100%">'.
'<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),
$_SERVER['PHP_SELF'],
'cf.ref',
'',
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('Company'),
$_SERVER['PHP_SELF'],
's.nom',
'',
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('Author'),
$_SERVER['PHP_SELF'],
'u.login',
'',
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('AmountTTC'),
$_SERVER['PHP_SELF'],
'cf.total_ttc',
'',
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('OrderCreation'),
$_SERVER['PHP_SELF'],
'cf.date_creation',
'',
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre($langs->trans('Status'),
$_SERVER['PHP_SELF'],
'cf.fk_statut',
'',
'',
'align="right"',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('Ref'),
$_SERVER['PHP_SELF'],
'cf.ref',
'',
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('Company'),
$_SERVER['PHP_SELF'],
's.nom',
'',
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('Author'),
$_SERVER['PHP_SELF'],
'u.login',
'',
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('AmountTTC'),
$_SERVER['PHP_SELF'],
'cf.total_ttc',
'',
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('OrderCreation'),
$_SERVER['PHP_SELF'],
'cf.date_creation',
'',
'',
'',
$sortfield,
$sortorder
);
print_liste_field_titre(
$langs->trans('Status'),
$_SERVER['PHP_SELF'],
'cf.fk_statut',
'',
'',
'align="right"',
$sortfield,
$sortorder
);
$form = new Form($db);
echo '</tr>',
'<tr class="liste_titre">',
'<td class="liste_titre">',
'<input type="text" class="flat" name="search_ref" value="' . $sref . '">',
'</td>',
'<td class="liste_titre">',
'<input type="text" class="flat" name="search_nom" value="' . $snom . '">',
'</td>',
'<td class="liste_titre">',
'<input type="text" class="flat" name="search_user" value="' . $suser . '">',
'</td>',
'<td class="liste_titre">',
'<input type="text" class="flat" name="search_ttc" value="' . $sttc . '">',
'</td>',
'<td class="liste_titre">',
$form->select_date('', 'search_date', 0, 0, 1, "", 1, 0, 1, 0, ''),
'</td>',
print '</tr>'.
'<tr class="liste_titre">'.
'<td class="liste_titre">'.
'<input type="text" class="flat" name="search_ref" value="' . $sref . '">'.
'</td>'.
'<td class="liste_titre">'.
'<input type="text" class="flat" name="search_nom" value="' . $snom . '">'.
'</td>'.
'<td class="liste_titre">'.
'<input type="text" class="flat" name="search_user" value="' . $suser . '">'.
'</td>'.
'<td class="liste_titre">'.
'<input type="text" class="flat" name="search_ttc" value="' . $sttc . '">'.
'</td>'.
'<td class="liste_titre">'.
$form->select_date('', 'search_date', 0, 0, 1, '', 1, 0, 1, 0, '').
'</td>'.
'<td class="liste_titre" align="right">';
$src = DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png';
$value = dol_escape_htmltag($langs->trans('Search'));
echo '<input type="image" class="liste_titre" name="button_search" src="' . $src . '" value="' . $value . '" title="' . $value . '">',
'</td>',
print '<input type="image" class="liste_titre" name="button_search" src="' . $src . '" value="' . $value . '" title="' . $value . '">'.
'</td>'.
'</tr>';
$var = true;
$userstatic = new User($db);
while ($i < min($num,$conf->liste_limit)) {
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($resql);
$var = !$var;
if(!dispatched($obj->rowid) &&
(!$sproduct || in_array($sproduct, getProducts($obj->rowid)))) {
if (!dispatched($obj->rowid) &&
(!$sproduct || in_array($sproduct, getProducts($obj->rowid))))
{
$href = DOL_URL_ROOT . '/fourn/commande/fiche.php?id=' . $obj->rowid;
echo '<tr ' . $bc[$var] . '>',
print '<tr ' . $bc[$var] . '>'.
// Ref
'<td>',
'<a href="' . $href . '">',
img_object($langs->trans('ShowOrder'), 'order') . ' ' . $obj->ref,
'<td>'.
'<a href="' . $href . '">'.
img_object($langs->trans('ShowOrder'), 'order') . ' ' . $obj->ref.
'</a></td>';
// Company
$href = DOL_URL_ROOT . '/fourn/fiche.php?socid=' . $obj->socid;
echo '<td>',
'<a href="' . $href .'">',
img_object($langs->trans('ShowCompany'), 'company'), ' ',
print '<td>'.
'<a href="' . $href .'">'.
img_object($langs->trans('ShowCompany'), 'company'). ' '.
$obj->nom . '</a></td>';
// Author
@ -291,12 +281,12 @@ if ($resql) {
} else {
$txt = '&nbsp;';
}
echo '<td>',
$txt,
'</td>',
print '<td>'.
$txt.
'</td>'.
// Amount
'<td>',
price($obj->total_ttc),
'<td>'.
price($obj->total_ttc).
'</td>';
// Date
if ($obj->dc) {
@ -304,18 +294,18 @@ if ($resql) {
} else {
$date = '-';
}
echo '<td>',
$date,
'</td>',
print '<td>'.
$date.
'</td>'.
// Statut
'<td align="right">',
$commandestatic->LibStatut($obj->fk_statut, 5),
'</td>',
'<td align="right">'.
$commandestatic->LibStatut($obj->fk_statut, 5).
'</td>'.
'</tr>';
}
$i++;
}
echo '</table>',
print '</table>'.
'</form>';
$db->free($resql);