Avoid warnings

This commit is contained in:
Laurent Destailleur 2017-09-01 15:20:29 +02:00
parent ba3581354a
commit ac08dec2c3

View File

@ -57,7 +57,7 @@ $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { $page = 0; } if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
@ -127,9 +127,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$search_number=''; $search_number='';
$search_statut=''; $search_statut='';
} }
/* /*
* View * View
*/ */
@ -299,9 +299,9 @@ if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titr
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
foreach($extrafields->attribute_label as $key => $val) foreach($extrafields->attribute_label as $key => $val)
{ {
if (! empty($arrayfields["ef.".$key]['checked'])) if (! empty($arrayfields["ef.".$key]['checked']))
{ {
$align=$extrafields->getAlignFlag($key); $align=$extrafields->getAlignFlag($key);
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
@ -435,7 +435,7 @@ $var=true;
foreach ($accounts as $key=>$type) foreach ($accounts as $key=>$type)
{ {
if ($i >= $limit) break; if ($i >= $limit) break;
$found++; $found++;
$acc = new Account($db); $acc = new Account($db);
@ -452,7 +452,7 @@ foreach ($accounts as $key=>$type)
{ {
$lastcurrencycode=$acc->currency_code; $lastcurrencycode=$acc->currency_code;
} }
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
// Ref // Ref
@ -461,14 +461,14 @@ foreach ($accounts as $key=>$type)
print '<td>'.$acc->getNomUrl(1).'</td>'; print '<td>'.$acc->getNomUrl(1).'</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Label // Label
if (! empty($arrayfields['b.label']['checked'])) if (! empty($arrayfields['b.label']['checked']))
{ {
print '<td>'.$acc->label.'</td>'; print '<td>'.$acc->label.'</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Account type // Account type
if (! empty($arrayfields['accountype']['checked'])) if (! empty($arrayfields['accountype']['checked']))
{ {
@ -477,14 +477,14 @@ foreach ($accounts as $key=>$type)
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Number // Number
if (! empty($arrayfields['b.number']['checked'])) if (! empty($arrayfields['b.number']['checked']))
{ {
print '<td>'.$acc->number.'</td>'; print '<td>'.$acc->number.'</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Account number // Account number
if (! empty($arrayfields['b.account_number']['checked'])) if (! empty($arrayfields['b.account_number']['checked']))
{ {
@ -492,7 +492,7 @@ foreach ($accounts as $key=>$type)
print '<td>'.length_accountg($acc->account_number).'</td>'; print '<td>'.length_accountg($acc->account_number).'</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Accountancy journal // Accountancy journal
if (! empty($arrayfields['b.accountancy_journal']['checked'])) if (! empty($arrayfields['b.accountancy_journal']['checked']))
{ {
@ -500,7 +500,7 @@ foreach ($accounts as $key=>$type)
print '<td>'.length_accountg($acc->accountancy_journal).'</td>'; print '<td>'.length_accountg($acc->accountancy_journal).'</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Transactions to reconcile // Transactions to reconcile
if (! empty($arrayfields['toreconcile']['checked'])) if (! empty($arrayfields['toreconcile']['checked']))
{ {
@ -519,13 +519,13 @@ foreach ($accounts as $key=>$type)
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
foreach($extrafields->attribute_label as $key => $val) foreach($extrafields->attribute_label as $key => $val)
{ {
if (! empty($arrayfields["ef.".$key]['checked'])) if (! empty($arrayfields["ef.".$key]['checked']))
{ {
print '<td'; print '<td';
$align=$extrafields->getAlignFlag($key); $align=$extrafields->getAlignFlag($key);
@ -558,14 +558,14 @@ foreach ($accounts as $key=>$type)
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Statut // Statut
if (! empty($arrayfields['b.clos']['checked'])) if (! empty($arrayfields['b.clos']['checked']))
{ {
print '<td align="center">'.$acc->getLibStatut(5).'</td>'; print '<td align="center">'.$acc->getLibStatut(5).'</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Balance // Balance
if (! empty($arrayfields['balance']['checked'])) if (! empty($arrayfields['balance']['checked']))
{ {
@ -576,7 +576,7 @@ foreach ($accounts as $key=>$type)
if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield']; if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield'];
$totalarray['totalbalance'] += $solde; $totalarray['totalbalance'] += $solde;
} }
// Action column // Action column
print '<td class="nowrap" align="center">'; print '<td class="nowrap" align="center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
@ -587,7 +587,7 @@ foreach ($accounts as $key=>$type)
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
print '</tr>'; print '</tr>';
$total[$acc->currency_code] += $solde; $total[$acc->currency_code] += $solde;