Clean code from $var = True

This commit is contained in:
Laurent Destailleur 2018-04-22 19:27:37 +02:00
parent f513e3a179
commit 69adf73f4f
46 changed files with 39 additions and 150 deletions

View File

@ -248,40 +248,24 @@ before_script:
- sudo apt-get install apache2 libapache2-mod-fastcgi - sudo apt-get install apache2 libapache2-mod-fastcgi
# enable php-fpm # enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
# Copy the included pool
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
fi
- sudo a2enmod rewrite actions fastcgi alias - sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars - sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi - sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts # configure apache virtual hosts for precise
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/apache2/sites-available/default
- sudo cat /etc/apache2/sites-available/default
# configure apache virtual hosts for trusty
- sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf - sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo cat /etc/apache2/sites-available/000-default.conf - sudo cat /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart - sudo service apache2 restart
- |
echo "Setting up Apache + FPM (old)"
# enable php-fpm
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
# Copy the included pool
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
fi
if [ "$DEBUG" = true ]; then
cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
fi
sudo a2enmod rewrite actions fastcgi alias
echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
if [ "$DEBUG" = true ]; then
cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
fi
~/.phpenv/versions/$PHP_VERSION_NAME/sbin/php-fpm
# configure apache virtual hosts
sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/default
sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/apache2/sites-available/default
sudo cat /etc/apache2/sites-available/default
sudo service apache2 restart sudo service apache2 restart
echo echo

View File

@ -284,8 +284,6 @@ foreach ($dirmodels as $reldir)
$handle = opendir($dir); $handle = opendir($dir);
if (is_resource($handle)) if (is_resource($handle))
{ {
$var=true;
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (! is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) if (! is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS'))
@ -316,7 +314,6 @@ foreach ($dirmodels as $reldir)
if ($module->isEnabled()) if ($module->isEnabled())
{ {
$var = !$var;
print '<tr class="oddeven"><td width="100">'; print '<tr class="oddeven"><td width="100">';
echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file))); echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file)));
print "</td><td>\n"; print "</td><td>\n";
@ -470,7 +467,6 @@ print "</tr>\n";
clearstatcache(); clearstatcache();
$var=true;
foreach ($dirmodels as $reldir) foreach ($dirmodels as $reldir)
{ {
foreach (array('','/doc') as $valdir) foreach (array('','/doc') as $valdir)
@ -507,7 +503,6 @@ foreach ($dirmodels as $reldir)
if ($modulequalified) if ($modulequalified)
{ {
$var = !$var;
print '<tr class="oddeven"><td width="100">'; print '<tr class="oddeven"><td width="100">';
print (empty($module->name)?$name:$module->name); print (empty($module->name)?$name:$module->name);
print "</td><td>\n"; print "</td><td>\n";
@ -598,7 +593,6 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
$var=True;
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'; print '<td>';
@ -662,7 +656,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE clos = 0"; $sql.= " WHERE clos = 0";
$sql.= " AND courant = 1"; $sql.= " AND courant = 1";
$sql.= " AND entity IN (".getEntity('bank_account').")"; $sql.= " AND entity IN (".getEntity('bank_account').")";
$var=True;
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
@ -670,7 +664,6 @@ if ($resql)
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
print '<option value="'.$row[0].'"'; print '<option value="'.$row[0].'"';
@ -695,10 +688,8 @@ print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>'; print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td width="80">&nbsp;</td>'; print '<td width="80">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
$var=true;
// Force date validation // Force date validation
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<input type="hidden" name="action" value="setforcedate" />'; print '<input type="hidden" name="action" value="setforcedate" />';
@ -717,7 +708,6 @@ $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>'; foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
$htmltext.='</i>'; $htmltext.='</i>';
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<input type="hidden" name="action" value="set_INVOICE_FREE_TEXT" />'; print '<input type="hidden" name="action" value="set_INVOICE_FREE_TEXT" />';

View File

@ -66,7 +66,6 @@ else
if ($resql) if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$var=True;
$i=0; $i=0;
while ($i < $num) while ($i < $num)
{ {

View File

@ -86,7 +86,7 @@ if (empty($xmlremote)) $xmlremote = 'https://www.dolibarr.org/files/stable/signa
// Test if remote test is ok // Test if remote test is ok
$enableremotecheck = True; $enableremotecheck = true;
if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False; if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False;
$enableremotecheck = true; $enableremotecheck = true;

View File

@ -137,12 +137,8 @@ if ($savehandler == 'files')
print_liste_field_titre(''); print_liste_field_titre('');
print "</tr>\n"; print "</tr>\n";
$var=True;
foreach ($listofsessions as $key => $sessionentry) foreach ($listofsessions as $key => $sessionentry)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Login // Login

View File

@ -65,10 +65,8 @@ print getTitleFieldOfList($langs->trans("Active"), 0, $_SERVER["PHP_SELF"], 'act
print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n"; print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, ($align?'align="'.$align.'"':''), $sortfield, $sortorder, '', 1)."\n";
print '</tr>'; print '</tr>';
$var=True;
foreach ($triggers as $trigger) foreach ($triggers as $trigger)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td valign="top" width="14" align="center">'.$trigger['picto'].'</td>'; print '<td valign="top" width="14" align="center">'.$trigger['picto'].'</td>';
print '<td class="tdtop">'.$trigger['file'].'</td>'; print '<td class="tdtop">'.$trigger['file'].'</td>';

View File

@ -125,12 +125,10 @@ if ($resql)
print_liste_field_titre(''); print_liste_field_titre('');
print "</tr>\n"; print "</tr>\n";
$var=True;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Id // Id

View File

@ -144,14 +144,11 @@ if ($resql)
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>'; print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
print "</tr>\n"; print "</tr>\n";
$var=True;
$i = 0; $i = 0;
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td><a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact"); print '<td><a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact");
print '</a>&nbsp;<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->name.'</a></td>'; print '</a>&nbsp;<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.$obj->name.'</a></td>';

View File

@ -52,7 +52,6 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
//if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo //if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
//{ //{
// Recherche emails // Recherche emails
$var=false;
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/mailing/list.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/comm/mailing/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
@ -74,7 +73,6 @@ print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("TargetsStatistic
$dir=DOL_DOCUMENT_ROOT."/core/modules/mailings"; $dir=DOL_DOCUMENT_ROOT."/core/modules/mailings";
$handle=opendir($dir); $handle=opendir($dir);
$var=True;
if (is_resource($handle)) if (is_resource($handle))
{ {
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
@ -106,8 +104,6 @@ if (is_resource($handle))
// Si le module mailing est qualifi<66> // Si le module mailing est qualifi<66>
if ($qualified) if ($qualified)
{ {
$var = !$var;
foreach ($mailmodule->getSqlArrayForStats() as $sql) foreach ($mailmodule->getSqlArrayForStats() as $sql)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -169,15 +165,13 @@ if ($result)
$num = $db->num_rows($result); $num = $db->num_rows($result);
if ($num > 0) if ($num > 0)
{ {
$var = true;
$i = 0; $i = 0;
while ($i < $num ) while ($i < $num )
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td class="nowrap"><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.'</a></td>'; print '<td class="nowrap"><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.'</a></td>';
print '<td>'.dol_trunc($obj->titre,38).'</td>'; print '<td>'.dol_trunc($obj->titre,38).'</td>';

View File

@ -101,7 +101,6 @@ if ($result)
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $total = 0; $i = 0; $total = 0;
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);

View File

@ -395,7 +395,6 @@ if (empty($numref))
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$var=True;
$numrows = $db->num_rows($result); $numrows = $db->num_rows($result);
$i = 0; $i = 0;
@ -572,7 +571,6 @@ else
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$var=False;
$numrows = $db->num_rows($result); $numrows = $db->num_rows($result);
$i = 0; $i = 0;

View File

@ -2363,7 +2363,7 @@ class Facture extends CommonInvoice
if (!empty($conf->global->INVOICE_USE_SITUATION)) if (!empty($conf->global->INVOICE_USE_SITUATION))
{ {
$final = True; $final = true;
$nboflines = count($this->lines); $nboflines = count($this->lines);
while (($i < $nboflines) && $final) { while (($i < $nboflines) && $final) {
$final = ($this->lines[$i]->situation_percent == 100); $final = ($this->lines[$i]->situation_percent == 100);

View File

@ -94,7 +94,6 @@ if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
$var=True;
print_barre_liste($langs->trans("ReceivedCustomersPaymentsToValid"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans("ReceivedCustomersPaymentsToValid"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num);

View File

@ -245,13 +245,10 @@ if ($resql)
if ($num > 0) if ($num > 0)
{ {
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref
print '<td>'; print '<td>';

View File

@ -298,8 +298,6 @@ if ($result)
print '<td align="center">'.$langs->trans("Date").'</td><td align="right">'.$langs->trans("Amount").'</td>'; print '<td align="center">'.$langs->trans("Date").'</td><td align="right">'.$langs->trans("Amount").'</td>';
print '</tr>'; print '</tr>';
$var=True;
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);

View File

@ -241,11 +241,10 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
} }
print "</tr>\n"; print "</tr>\n";
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Sending id // Sending id

View File

@ -54,7 +54,6 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
$handle=opendir($dir); $handle=opendir($dir);
// Recherche des fichiers drivers exports disponibles // Recherche des fichiers drivers exports disponibles
$var=True;
$i=0; $i=0;
if (is_resource($handle)) if (is_resource($handle))
{ {

View File

@ -342,7 +342,7 @@ class pdf_crabe extends ModelePDFFactures
// Situation invoice handling // Situation invoice handling
if ($object->situation_cycle_ref) if ($object->situation_cycle_ref)
{ {
$this->situationinvoice = True; $this->situationinvoice = true;
$progress_width = 18; $progress_width = 18;
$this->posxtva -= $progress_width; $this->posxtva -= $progress_width;
$this->posxup -= $progress_width; $this->posxup -= $progress_width;

View File

@ -146,7 +146,6 @@ class ModeleImports
$handle=opendir($dir); $handle=opendir($dir);
// Recherche des fichiers drivers imports disponibles // Recherche des fichiers drivers imports disponibles
$var=True;
$i=0; $i=0;
if (is_resource($handle)) if (is_resource($handle))
{ {

View File

@ -248,13 +248,11 @@ class pdf_paiement
{ {
$num = $this->db->num_rows($result); $num = $this->db->num_rows($result);
$i = 0; $i = 0;
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
$lines[$i][0] = $objp->facnumber; $lines[$i][0] = $objp->facnumber;
$lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true); $lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true);
$lines[$i][2] = $langs->transnoentities("PaymentTypeShort".$objp->paiement_code); $lines[$i][2] = $langs->transnoentities("PaymentTypeShort".$objp->paiement_code);

View File

@ -226,13 +226,10 @@ if ($resql)
if ($num > 0) if ($num > 0)
{ {
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref
print '<td>'; print '<td>';

View File

@ -105,14 +105,11 @@ if ($result)
print_liste_field_titre("Phone"); print_liste_field_titre("Phone");
print "</tr>\n"; print "</tr>\n";
$var=True;
$i = 0; $i = 0;
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td><a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$obj->cidp.'">'.img_object($langs->trans("ShowContact"),"contact").' '.$obj->lastname.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$obj->cidp.'">'.img_object($langs->trans("ShowContact"),"contact").' '.$obj->lastname.'</a></td>';

View File

@ -223,7 +223,6 @@ if ($user->rights->fournisseur->facture->lire)
if ($num > 0) if ($num > 0)
{ {
$var=True;
$total_ht=0; $total_ht=0;
$total_ttc=0; $total_ttc=0;
$total_paid=0; $total_paid=0;

View File

@ -524,7 +524,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (!empty($conf->multicurrency->enabled)) print '<td align="center">'.$langs->trans('MulticurrencyPaymentAmount').'</td>'; if (!empty($conf->multicurrency->enabled)) print '<td align="center">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
print '</tr>'; print '</tr>';
$var=True;
$total=0; $total=0;
$total_ttc=0; $total_ttc=0;
$totalrecu=0; $totalrecu=0;
@ -794,7 +793,6 @@ if (empty($action))
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
$var=True;
$param=''; $param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;

View File

@ -288,8 +288,6 @@ if ($result > 0)
if ($num > 0) if ($num > 0)
{ {
$var=True;
$facturestatic=new FactureFournisseur($db); $facturestatic=new FactureFournisseur($db);
while ($i < $num) while ($i < $num)

View File

@ -253,7 +253,7 @@ if ($resql)
print "</tr>\n"; print "</tr>\n";
$oldid = ''; $oldid = '';
$var=True;
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);

View File

@ -702,7 +702,6 @@ if ($id > 0)
print '<td align="right">'.$langs->trans("LoanCapital").'</td>'; print '<td align="right">'.$langs->trans("LoanCapital").'</td>';
print '</tr>'; print '</tr>';
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);

View File

@ -220,13 +220,10 @@ if ($resql)
if ($num > 0) if ($num > 0)
{ {
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref
print '<td>'; print '<td>';

View File

@ -245,9 +245,6 @@ if ($action == 'create')
print '<td align="right">'.$langs->trans("Amount").'</td>'; print '<td align="right">'.$langs->trans("Amount").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=True;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
if ($loan->datestart > 0) if ($loan->datestart > 0)

View File

@ -283,8 +283,6 @@ if ($result)
if ($num > 0) if ($num > 0)
{ {
$var=True;
while ($i < $num /*&& $i < $conf->liste_limit*/) while ($i < $num /*&& $i < $conf->liste_limit*/)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
@ -304,8 +302,6 @@ if ($result)
$markRate = ($pv != 0)?(100 * $marge / $pv):'' ; $markRate = ($pv != 0)?(100 * $marge / $pv):'' ;
} }
print '<tr class="oddeven">'; print '<tr class="oddeven">';
if ($client) { if ($client) {
print '<td>'; print '<td>';

View File

@ -258,8 +258,6 @@ if ($result)
if ($num > 0) if ($num > 0)
{ {
$var=True;
while ($i < $num /*&& $i < $conf->liste_limit*/) while ($i < $num /*&& $i < $conf->liste_limit*/)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
@ -278,8 +276,6 @@ if ($result)
$markRate = ($pv != 0)?(100 * $marge / $pv):'' ; $markRate = ($pv != 0)?(100 * $marge / $pv):'' ;
} }
print '<tr class="oddeven">'; print '<tr class="oddeven">';
if ($id > 0) { if ($id > 0) {
print '<td>'; print '<td>';

View File

@ -193,11 +193,9 @@ if ($id > 0 || ! empty($ref))
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
if ($num > 0) { if ($num > 0) {
$var=True;
while ($i < $num /*&& $i < $conf->liste_limit*/) { while ($i < $num /*&& $i < $conf->liste_limit*/) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ; $marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ;
$markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ; $markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ;

View File

@ -199,7 +199,6 @@ if ($socid > 0)
if ($num > 0) if ($num > 0)
{ {
$var=True;
while ($i < $num /*&& $i < $conf->liste_limit*/) while ($i < $num /*&& $i < $conf->liste_limit*/)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
@ -207,8 +206,6 @@ if ($socid > 0)
$marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ; $marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ;
$markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ; $markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'; print '<td>';
$invoicestatic->id=$objp->facid; $invoicestatic->id=$objp->facid;

View File

@ -89,10 +89,9 @@ if (empty($conf) || ! is_object($conf))
<!-- FIELDS DATA --> <!-- FIELDS DATA -->
<?php <?php
$var=True;
foreach($datas as $line) { foreach($datas as $line) {
?> ?>
<tr <?php echo $bc[$var]; ?>> <tr class="oddeven">
<?php <?php
foreach($line as $key => $value) { foreach($line as $key => $value) {
foreach($fieldlist as $field) { foreach($fieldlist as $field) {

View File

@ -307,8 +307,6 @@ if ($result)
print '<tr class="liste_titre"><th colspan="'.$colnb.'">'.$transRecordedType.'</th></tr>'; print '<tr class="liste_titre"><th colspan="'.$colnb.'">'.$transRecordedType.'</th></tr>';
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);

View File

@ -211,12 +211,10 @@ if ($id > 0 || ! empty($ref))
if ($num > 0) if ($num > 0)
{ {
$var=True;
while ($i < $num && $i < $conf->liste_limit) while ($i < $num && $i < $conf->liste_limit)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'; print '<td>';
$orderstatic->id=$objp->commandeid; $orderstatic->id=$objp->commandeid;

View File

@ -177,7 +177,6 @@ if ($id > 0 || ! empty($ref))
if ($num > 0) if ($num > 0)
{ {
$var=True;
while ($i < $num && $i < $conf->liste_limit) while ($i < $num && $i < $conf->liste_limit)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);

View File

@ -234,7 +234,6 @@ if ($id > 0 || ! empty($ref))
if ($num > 0) if ($num > 0)
{ {
$var=True;
while ($i < min($num,$conf->liste_limit)) while ($i < min($num,$conf->liste_limit))
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);

View File

@ -460,7 +460,6 @@ else
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);

View File

@ -86,7 +86,6 @@ if ($result)
{ {
$entrepot=new Entrepot($db); $entrepot=new Entrepot($db);
$var=True;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);

View File

@ -73,14 +73,10 @@ if ($resql)
print "<td align=\"right\">".$langs->trans("Amount")."</TD>"; print "<td align=\"right\">".$langs->trans("Amount")."</TD>";
print "</TR>\n"; print "</TR>\n";
$var=True;
$bc[1]='bgcolor="#f5f5f5"';
$bc[0]='bgcolor="#f0f0f0"';
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
if ($objp->public) if ($objp->public)
{ {

View File

@ -139,7 +139,6 @@ if ($result)
print_liste_field_titre("Photo", $_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder,'public_'); print_liste_field_titre("Photo", $_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder,'public_');
print "</tr>\n"; print "</tr>\n";
$var=True;
while ($i < $num && $i < $conf->liste_limit) while ($i < $num && $i < $conf->liste_limit)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);

View File

@ -85,13 +85,11 @@ if ($result)
print_liste_field_titre("Contact",$_SERVER["PHP_SELF"],"c.lastname","","",'valign="center"',$sortfield,$sortorder); print_liste_field_titre("Contact",$_SERVER["PHP_SELF"],"c.lastname","","",'valign="center"',$sortfield,$sortorder);
print_liste_field_titre("Action",$_SERVER["PHP_SELF"],"a.titre","","",'valign="center"',$sortfield,$sortorder); print_liste_field_titre("Action",$_SERVER["PHP_SELF"],"a.titre","","",'valign="center"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
$var=True;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td><a href=\"card.php?socid=".$obj->socid."\">".$obj->name."</a></td>\n"; print "<td><a href=\"card.php?socid=".$obj->socid."\">".$obj->name."</a></td>\n";
print "<td>".dolGetFirstLastname($obj->firstname, $obj->lastname)."</td>\n"; print "<td>".dolGetFirstLastname($obj->firstname, $obj->lastname)."</td>\n";

View File

@ -253,7 +253,6 @@ if ($id > 0 || ! empty($ref))
print_liste_field_titre("EndSubscription",$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre("EndSubscription",$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
$var=True;
$i=0; $i=0;
while ($i < $num && $i < $conf->liste_limit) while ($i < $num && $i < $conf->liste_limit)
{ {
@ -269,7 +268,6 @@ if ($id > 0 || ! empty($ref))
$companyname=$objp->company; $companyname=$objp->company;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref

View File

@ -87,10 +87,8 @@ print '<td align="center">'.$langs->trans("Required").'</td>';
print '<td width="80">&nbsp;</td>'; print '<td width="80">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
$var=True;
foreach($extrafields->attribute_type as $key => $value) foreach($extrafields->attribute_type as $key => $value)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$extrafields->attribute_pos[$key]."</td>\n"; print "<td>".$extrafields->attribute_pos[$key]."</td>\n";
print "<td>".$extrafields->attribute_label[$key]."</td>\n"; print "<td>".$extrafields->attribute_label[$key]."</td>\n";

View File

@ -91,10 +91,8 @@ print '<td align="center">'.$langs->trans("Required").'</td>';
print '<td width="80">&nbsp;</td>'; print '<td width="80">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
$var=True;
foreach($extrafields->attribute_type as $key => $value) foreach($extrafields->attribute_type as $key => $value)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$extrafields->attribute_label[$key]."</td>\n"; print "<td>".$extrafields->attribute_label[$key]."</td>\n";
print "<td>".$key."</td>\n"; print "<td>".$key."</td>\n";