Fix: Solve phpcodesniffer errors and warning

This commit is contained in:
Laurent Destailleur 2011-09-14 21:50:17 +00:00
parent 5a22b01468
commit 3a7285ae12
7 changed files with 23 additions and 30 deletions

View File

@ -289,7 +289,7 @@ if ($resql)
$box=new $boxname($db,$obj->note);
$enabled=true;
if ($box->depends && sizeof($box->depends) > 0)
if ($box->depends && count($box->depends) > 0)
{
foreach($box->depends as $module)
{
@ -446,7 +446,7 @@ if ($resql)
print '</table><br>';
# Other parameters
// Other parameters
print_titre($langs->trans("Other"));
print '<table class="noborder" width="100%">';

View File

@ -63,7 +63,7 @@ if ($action == 'update' || $action == 'add')
$consttype = GETPOST("consttype");
$constnote = GETPOST("constnote");
$res = dolibarr_set_const($db, $constname, $constvalue, $consttype, 0, $constnote ,$conf->entity);
$res = dolibarr_set_const($db, $constname, $constvalue, $consttype, 0, $constnote, $conf->entity);
if (! $res > 0) $error++;
@ -157,8 +157,7 @@ if ($result)
}
}*/
$num=sizeof($list);
$num=count($list);
if ($num)
{
print '<table class="noborder" width="100%">';

View File

@ -185,7 +185,7 @@ print "\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
# Affiche lignes des constantes
// Show constants
$sql = "SELECT";
$sql.= " rowid";
$sql.= ", ".$db->decrypt('name')." as name";

View File

@ -693,7 +693,7 @@ if ($_GET["id"])
// There is several pages
if ($num > $listlimit)
{
print '<tr class="none"><td align="right" colspan="'.(3+sizeof($fieldlist)).'">';
print '<tr class="none"><td align="right" colspan="'.(3+count($fieldlist)).'">';
print_fleche_navigation($page,$_SERVER["PHP_SELF"],'&id='.GETPOST('id'),($num > $listlimit),$langs->trans("Page").' '.($page+1));
print '</td></tr>';
}
@ -899,9 +899,11 @@ llxFooter();
/**
* \brief Show field
* \param fieldlist Array of fields
* \param obj If we show a particular record, obj is filled with record fields
* Show field
*
* @param array $fieldlist Array of fields
* @param Object $obj If we show a particular record, obj is filled with record fields
* @return void
*/
function fieldList($fieldlist,$obj='')
{

View File

@ -110,10 +110,7 @@ if ($_GET["action"] == 'set')
$sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
$sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
$sql.= ")";
if ($db->query($sql))
{
}
$resql=$db->query($sql);
}
if ($_GET["action"] == 'del')
@ -121,10 +118,7 @@ if ($_GET["action"] == 'del')
$type='donation';
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
if ($db->query($sql))
{
}
$resql=$db->query($sql);
}

View File

@ -208,9 +208,9 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'sendhtml')
$body=make_substitutions($body,$substitutionarrayfortest);
require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php");
$mailfile = new CMailFile($subject,$sendto,$email_from,$body,
$filepath,$mimetype,$filename,
$sendtocc, $sendtoccc, $deliveryreceipt, $msgishtml,$errors_to);
$mailfile = new CMailFile($subject, $sendto, $email_from, $body,
$filepath, $mimetype, $filename,
$sendtocc, $sendtoccc, $deliveryreceipt, $msgishtml, $errors_to);
$result=$mailfile->sendfile();

View File

@ -123,11 +123,9 @@ if ($action == 'set')
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
$sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null");
$sql.= ")";
if ($db->query($sql))
{
}
else dol_print_error($db);
$resql=$db->query($sql);
if (! $resql) dol_print_error($db);
}
// Disable a document generator module
@ -505,13 +503,13 @@ print '<td align="center">'.$langs->trans("MustBeUnique").'</td>';
print "</tr>\n";
$profid[0][0]=$langs->trans("ProfId1");
$profid[0][1]=$langs->transcountry('ProfId1' ,$mysoc->pays_code);
$profid[0][1]=$langs->transcountry('ProfId1', $mysoc->pays_code);
$profid[1][0]=$langs->trans("ProfId2");
$profid[1][1]=$langs->transcountry('ProfId2' ,$mysoc->pays_code);
$profid[1][1]=$langs->transcountry('ProfId2', $mysoc->pays_code);
$profid[2][0]=$langs->trans("ProfId3");
$profid[2][1]=$langs->transcountry('ProfId3' ,$mysoc->pays_code);
$profid[2][1]=$langs->transcountry('ProfId3', $mysoc->pays_code);
$profid[3][0]=$langs->trans("ProfId4");
$profid[3][1]=$langs->transcountry('ProfId4' ,$mysoc->pays_code);
$profid[3][1]=$langs->transcountry('ProfId4', $mysoc->pays_code);
$var = true;
$i=0;