diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index ec6bb85710c..20f36189862 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -609,7 +609,9 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a8e3d23565f..39ee93fd9cd 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -732,7 +732,9 @@ if ($resql) if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index daefc3c4cce..73fa9c5b66e 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1019,7 +1019,9 @@ if ($resql) if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index 5f50bf74c1b..d9dd8241248 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -407,7 +407,7 @@ if ($id > 0 || ! empty($ref)) dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); dol_fiche_end(); - + /* * Buttons actions */ @@ -521,10 +521,10 @@ if (($id > 0 || ! empty($ref)) && ((string) $page == '')) $offset = $limit * $page; if ($page < 0) $page = 0; } -if ($page >= $nbtotalofpages) +if ($page >= $nbtotalofpages) { // If we made a search and result has low page than the page number we were on - $page = ($nbtotalofpages -1); + $page = ($nbtotalofpages -1); $offset = $limit * $page; if ($page < 0) $page = 0; } @@ -598,7 +598,7 @@ if ($resql) print ''; print ' '.$langs->trans("or").' '; print ''; - + // Show last bank statements $nbmax=15; // We accept to show last 15 receipts (so we can have more than one year) $liste=""; @@ -703,8 +703,8 @@ if ($resql) $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; - - if ($moreforfilter) + + if ($moreforfilter) { print '
| '; print ''; @@ -821,7 +821,9 @@ if ($resql) if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } @@ -840,19 +842,19 @@ if ($resql) $sign = 1; $totalarray=array(); - while ($i < min($num,$limit)) + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); // If we are in a situation where we need/can show balance, we calculate the start of balance if (! $balancecalculated && ! empty($arrayfields['balance']['checked']) && $mode_balance_ok) { - if (! $account) + if (! $account) { dol_print_error('', 'account is not defined but $mode_balance_ok is true'); exit; } - + //Loop on each record $sign = 1; $i = 0; @@ -875,7 +877,7 @@ if ($resql) } } else dol_print_error($db); - + $balancecalculated=true; } @@ -896,7 +898,7 @@ if ($resql) print ' | |||||||
| '; print "rowid.'">'.img_object($langs->trans("ShowPayment").': '.$objp->rowid, 'account', 'class="classfortooltip"').' '.$objp->rowid." "; @@ -908,14 +910,14 @@ if ($resql) if (! empty($arrayfields['description']['checked'])) { print " | "; - + //print "rowid."&account=".$objp->fk_account."\">"; $reg=array(); preg_match('/\((.+)\)/i',$objp->label,$reg); // Si texte entoure de parenthee on tente recherche de traduction if ($reg[1] && $langs->trans($reg[1])!=$reg[1]) print $langs->trans($reg[1]); else print dol_trunc($objp->label,40); //print " "; - + // Add links after description $links = $bankaccountstatic->get_url($objp->rowid); $cachebankaccount=array(); @@ -1040,14 +1042,14 @@ if ($resql) } // Date ope - if (! empty($arrayfields['b.dateo']['checked'])) + if (! empty($arrayfields['b.dateo']['checked'])) { print ' | '.dol_print_date($db->jdate($objp->do),"day")." | \n"; if (! $i) $totalarray['nbfield']++; } // Date value - if (! empty($arrayfields['b.datev']['checked'])) + if (! empty($arrayfields['b.datev']['checked'])) { print ''; print ''.dol_print_date($db->jdate($objp->dv),"day").""; @@ -1063,7 +1065,7 @@ if ($resql) } // Payment type - if (! empty($arrayfields['type']['checked'])) + if (! empty($arrayfields['type']['checked'])) { print ' | '; $labeltype=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$langs->getLabelFromKey($db,$objp->fk_type,'c_paiement','code','libelle'); @@ -1081,7 +1083,7 @@ if ($resql) } // Third party - if (! empty($arrayfields['bu.label']['checked'])) + if (! empty($arrayfields['bu.label']['checked'])) { print " | "; if ($objp->url_id) @@ -1106,7 +1108,7 @@ if ($resql) } // Bank account - if (! empty($arrayfields['ba.ref']['checked'])) + if (! empty($arrayfields['ba.ref']['checked'])) { print ' | '; print $bankaccount->getNomUrl(1); @@ -1174,7 +1176,7 @@ if ($resql) print ''.$objp->num_releve.''; } else if ($action == 'reconcile') - { + { print 'rowid])?' checked':'').'>'; } } @@ -1229,8 +1231,8 @@ if ($resql) } } print ' | '; - if (! $i) $totalarray['nbfield']++; - + if (! $i) $totalarray['nbfield']++; + // Action column print ''; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 0c24d25e064..9d8cf29ee39 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -129,9 +129,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_number=''; $search_statut=''; } - - - + + + /* * View */ @@ -416,7 +416,9 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab if (! empty($arrayfields["ef.".$key]['checked'])) { $align=$extrafields->getAlignFlag($key); - print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + $sortonfield = "ef.".$key; + if (! empty($extrafields->attribute_computed[$key])) $sortonfield=''; + print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); } } } @@ -437,7 +439,7 @@ $var=true; foreach ($accounts as $key=>$type) { if ($i >= $limit) break; - + $found++; $acc = new Account($db); @@ -454,7 +456,7 @@ foreach ($accounts as $key=>$type) { $lastcurrencycode=$acc->currency_code; } - + print ' |
| '.$acc->getNomUrl(1).' | '; if (! $i) $totalarray['nbfield']++; } - + // Label if (! empty($arrayfields['b.label']['checked'])) { print ''.$acc->label.' | '; if (! $i) $totalarray['nbfield']++; } - + // Account type if (! empty($arrayfields['accountype']['checked'])) { @@ -479,14 +481,14 @@ foreach ($accounts as $key=>$type) print ''; if (! $i) $totalarray['nbfield']++; } - + // Number if (! empty($arrayfields['b.number']['checked'])) { print ''.$acc->number.' | '; if (! $i) $totalarray['nbfield']++; } - + // Account number if (! empty($arrayfields['b.account_number']['checked'])) { @@ -499,7 +501,7 @@ foreach ($accounts as $key=>$type) if (! $i) $totalarray['nbfield']++; } - + // Accountancy journal if (! empty($arrayfields['b.fk_accountancy_journal']['checked'])) { @@ -509,7 +511,7 @@ foreach ($accounts as $key=>$type) print ''.$accountingjournal->getNomUrl(0,1,1,'',1).' | '; if (! $i) $totalarray['nbfield']++; } - + // Transactions to reconcile if (! empty($arrayfields['toreconcile']['checked'])) { @@ -528,13 +530,13 @@ foreach ($accounts as $key=>$type) print ''; if (! $i) $totalarray['nbfield']++; } - + // Extra fields 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 'getAlignFlag($key); @@ -567,14 +569,14 @@ foreach ($accounts as $key=>$type) print ' | '; if (! $i) $totalarray['nbfield']++; } - + // Statut if (! empty($arrayfields['b.clos']['checked'])) { print ''.$acc->getLibStatut(5).' | '; if (! $i) $totalarray['nbfield']++; } - + // Balance if (! empty($arrayfields['balance']['checked'])) { @@ -585,7 +587,7 @@ foreach ($accounts as $key=>$type) if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield']; $totalarray['totalbalance'] += $solde; } - + // Action column print ''; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined @@ -596,7 +598,7 @@ foreach ($accounts as $key=>$type) } print ' | '; if (! $i) $totalarray['nbfield']++; - + print '|
| '; print $contractstatic->getNomUrl(1,16); print ' | '; } // Service - if (! empty($arrayfields['p.description']['checked'])) + if (! empty($arrayfields['p.description']['checked'])) { print ''; if ($obj->pid) @@ -552,9 +554,9 @@ while ($i < min($num,$limit)) } print ' | '; } - + // Third party - if (! empty($arrayfields['s.nom']['checked'])) + if (! empty($arrayfields['s.nom']['checked'])) { print ''; $companystatic->id=$obj->socid; @@ -563,9 +565,9 @@ while ($i < min($num,$limit)) print $companystatic->getNomUrl(1,'customer',28); print ' | '; } - + // Start date - if (! empty($arrayfields['cd.date_ouverture_prevue']['checked'])) + if (! empty($arrayfields['cd.date_ouverture_prevue']['checked'])) { print ''; print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' '); @@ -574,15 +576,15 @@ while ($i < min($num,$limit)) else print ' '; print ' | '; } - if (! empty($arrayfields['cd.date_ouverture']['checked'])) + if (! empty($arrayfields['cd.date_ouverture']['checked'])) { print ''.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').' | '; } // End date - if (! empty($arrayfields['cd.date_fin_validite']['checked'])) + if (! empty($arrayfields['cd.date_fin_validite']['checked'])) { print ''.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' '); - if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) + if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) { $warning_delay=$conf->contrat->services->expires->warning_delay / 3600 / 24; $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); @@ -591,7 +593,7 @@ while ($i < min($num,$limit)) else print ' '; print ' | '; } - if (! empty($arrayfields['cd.date_cloture']['checked'])) + if (! empty($arrayfields['cd.date_cloture']['checked'])) { print ''.dol_print_date($db->jdate($obj->date_cloture)).' | '; } @@ -658,7 +660,7 @@ while ($i < min($num,$limit)) } print ''; if (! $i) $totalarray['nbfield']++; - + print "