Qual: Removed errors reported by PHPCodeSniffer

This commit is contained in:
Laurent Destailleur 2011-08-28 02:18:20 +00:00
parent fbe292a439
commit 482a205936
8 changed files with 278 additions and 259 deletions

View File

@ -322,12 +322,12 @@ else 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>';
@ -425,7 +425,12 @@ else if ($_GET["id"] || $_GET["ref"])
/** /**
* Fonction Barre d'actions * Function to output a HTML select for a category
*
* @param DoliDb $db Database handler
* @param Object $object Object we want to see categories it can be classified into
* @param int $typeid Type of category (0, 1, 2, 3)
* @return int 0
*/ */
function formCategory($db,$object,$typeid) function formCategory($db,$object,$typeid)
{ {
@ -468,7 +473,7 @@ function formCategory($db,$object,$typeid)
$c = new Categorie($db); $c = new Categorie($db);
$cats = $c->containing($object->id,$typeid); $cats = $c->containing($object->id,$typeid);
if (sizeof($cats) > 0) if (count($cats) > 0)
{ {
if ($typeid == 0) $title=$langs->trans("ProductIsInCategories"); if ($typeid == 0) $title=$langs->trans("ProductIsInCategories");
if ($typeid == 1) $title=$langs->trans("CompanyIsInSuppliersCategories"); if ($typeid == 1) $title=$langs->trans("CompanyIsInSuppliersCategories");
@ -530,6 +535,7 @@ function formCategory($db,$object,$typeid)
print $title; print $title;
print "<br/>"; print "<br/>";
} }
return 0;
} }
$db->close(); $db->close();

View File

@ -500,10 +500,11 @@ class Categorie
} }
/** /**
* \brief Return list of contents of a category * Return list of contents of a category
* \param field Field name for select in table. Full field name will be fk_field. *
* \param class PHP Class of object to store entity * @param field Field name for select in table. Full field name will be fk_field.
* \param table Table name for select in table. Full table name will be PREFIX_categorie_table. * @param class PHP Class of object to store entity
* @param table Table name for select in table. Full table name will be PREFIX_categorie_table.
*/ */
function get_type($field,$classname,$table='') function get_type($field,$classname,$table='')
{ {
@ -565,7 +566,10 @@ class Categorie
/** /**
* retourne la description d'une categorie * Return category description
*
* @param $cate
* @return string Description
*/ */
function get_desc ($cate) function get_desc ($cate)
{ {
@ -961,7 +965,7 @@ class Categorie
/** /**
* print_primary_way() affiche le chemin le plus court pour se rendre a un produit * print_primary_way() affiche le chemin le plus court pour se rendre a un produit
*/ */
function print_primary_way($id, $sep= " &gt;&gt; ", $url, $type="") function print_primary_way($id, $sep= " &gt;&gt; ", $url="", $type="")
{ {
$primary_way = Array(); $primary_way = Array();
$way = $this->get_primary_way($id,$type); $way = $this->get_primary_way($id,$type);
@ -1073,8 +1077,14 @@ class Categorie
/** /**
* \brief Retourne les categories dont l'id ou le nom correspond * Retourne les categories dont l'id ou le nom correspond
* ajoute des wildcards au nom sauf si $exact = true * ajoute des wildcards au nom sauf si $exact = true
*
* @param id
* @param nom
* @param type
* @param exact
* @return int or array
*/ */
function rechercher($id, $nom, $type, $exact = false) function rechercher($id, $nom, $type, $exact = false)
{ {
@ -1115,11 +1125,12 @@ class Categorie
} }
/** /**
* \brief Return name and link of category (with picto) * Return name and link of category (with picto)
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul *
* \param option Sur quoi pointe le lien ('', 'xyz') * @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \param maxlength Max length of text * @param option Sur quoi pointe le lien ('', 'xyz')
* \return string Chaine avec URL * @param maxlength Max length of text
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$option='',$maxlength=0) function getNomUrl($withpicto=0,$option='',$maxlength=0)
{ {
@ -1142,11 +1153,12 @@ class Categorie
/** /**
* \brief Deplace fichier uploade sous le nom $files dans le repertoire sdir * Deplace fichier uploade sous le nom $files dans le repertoire sdir
* \param sdir Repertoire destination finale *
* \param $file Nom du fichier uploade * @param sdir Repertoire destination finale
* \param maxWidth Largeur maximum que dois faire la miniature (160 par defaut) * @param $file Nom du fichier uploade
* \param maxHeight Hauteur maximum que dois faire la miniature (120 par defaut) * @param maxWidth Largeur maximum que dois faire la miniature (160 par defaut)
* @param maxHeight Hauteur maximum que dois faire la miniature (120 par defaut)
*/ */
function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120) function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120)
{ {
@ -1194,10 +1206,11 @@ class Categorie
/** /**
* \brief Retourne tableau de toutes les photos de la categorie * Return tableau de toutes les photos de la categorie
* \param dir Repertoire a scanner *
* \param nbmax Nombre maximum de photos (0=pas de max) * @param dir Repertoire a scanner
* \return array Tableau de photos * @param nbmax Nombre maximum de photos (0=pas de max)
* @return array Tableau de photos
*/ */
function liste_photos($dir,$nbmax=0) function liste_photos($dir,$nbmax=0)
{ {

View File

@ -168,7 +168,7 @@ else
} }
print "</td>"; print "</td>";
print "</tr>\n"; print "</tr>\n";
if (sizeof ($cats) > 0) if (count($cats) > 0)
{ {
$var=true; $var=true;
foreach ($cats as $cat) foreach ($cats as $cat)
@ -217,7 +217,7 @@ if ($object->type == 0)
print "<table class='noborder' width='100%'>\n"; print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ProductsAndServices")."</td></tr>\n"; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ProductsAndServices")."</td></tr>\n";
if (sizeof ($prods) > 0) if (count($prods) > 0)
{ {
$i = 0; $i = 0;
$var=true; $var=true;
@ -255,7 +255,7 @@ if ($object->type == 1)
print "<table class='noborder' width='100%'>\n"; print "<table class='noborder' width='100%'>\n";
print "<tr class='liste_titre'><td>".$langs->trans("Suppliers")."</td></tr>\n"; print "<tr class='liste_titre'><td>".$langs->trans("Suppliers")."</td></tr>\n";
if (sizeof ($socs) > 0) if (count($socs) > 0)
{ {
$i = 0; $i = 0;
$var=true; $var=true;
@ -293,7 +293,7 @@ if($object->type == 2)
print "<table class='noborder' width='100%'>\n"; print "<table class='noborder' width='100%'>\n";
print "<tr class='liste_titre'><td>".$langs->trans("Customers")."</td></tr>\n"; print "<tr class='liste_titre'><td>".$langs->trans("Customers")."</td></tr>\n";
if (sizeof ($socs) > 0) if (count($socs) > 0)
{ {
$i = 0; $i = 0;
$var=true; $var=true;
@ -333,7 +333,7 @@ if ($object->type == 3)
print "<table class='noborder' width='100%'>\n"; print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Member")."</td></tr>\n"; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Member")."</td></tr>\n";
if (sizeof ($prods) > 0) if (count($prods) > 0)
{ {
$i = 0; $i = 0;
$var=true; $var=true;