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 $moreforfilter; @@ -718,7 +718,7 @@ if ($resql) print ''."\n"; print ''; - if (! empty($arrayfields['b.rowid']['checked'])) + if (! empty($arrayfields['b.rowid']['checked'])) { print ''; // Ref - if (! empty($arrayfields['b.rowid']['checked'])) + if (! empty($arrayfields['b.rowid']['checked'])) { print '\n"; if (! $i) $totalarray['nbfield']++; } // Date value - if (! empty($arrayfields['b.datev']['checked'])) + if (! empty($arrayfields['b.datev']['checked'])) { print ''; - if (! $i) $totalarray['nbfield']++; - + if (! $i) $totalarray['nbfield']++; + // Action column print ''; // Ref @@ -463,14 +465,14 @@ foreach ($accounts as $key=>$type) print ''; if (! $i) $totalarray['nbfield']++; } - + // Label if (! empty($arrayfields['b.label']['checked'])) { print ''; 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 ''; 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 ''; 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 ''; 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 (! $i) $totalarray['nbfield']++; - + print ''; $total[$acc->currency_code] += $solde; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2716e3a87b1..513c6854eb8 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -975,7 +975,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/contrat/list.php b/htdocs/contrat/list.php index a82535bfbb7..a526a9bd78c 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -535,7 +535,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/contrat/services.php b/htdocs/contrat/services.php index 3d5db42495a..aea03a73df5 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -372,7 +372,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); } } } @@ -516,23 +518,23 @@ $var=True; $i=0; while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - + $contractstatic->id=$obj->cid; $contractstatic->ref=$obj->ref?$obj->ref:$obj->cid; - - + + print ''; - + // Ref - if (! empty($arrayfields['c.ref']['checked'])) + if (! empty($arrayfields['c.ref']['checked'])) { print ''; } // Service - if (! empty($arrayfields['p.description']['checked'])) + if (! empty($arrayfields['p.description']['checked'])) { print ''; } - + // Third party - if (! empty($arrayfields['s.nom']['checked'])) + if (! empty($arrayfields['s.nom']['checked'])) { print ''; } - + // Start date - if (! empty($arrayfields['cd.date_ouverture_prevue']['checked'])) + if (! empty($arrayfields['cd.date_ouverture_prevue']['checked'])) { print ''; } - if (! empty($arrayfields['cd.date_ouverture']['checked'])) + if (! empty($arrayfields['cd.date_ouverture']['checked'])) { print ''; } // End date - if (! empty($arrayfields['cd.date_fin_validite']['checked'])) + if (! empty($arrayfields['cd.date_fin_validite']['checked'])) { print ''; } - if (! empty($arrayfields['cd.date_cloture']['checked'])) + if (! empty($arrayfields['cd.date_cloture']['checked'])) { print ''; } @@ -658,7 +660,7 @@ while ($i < min($num,$limit)) } print ''; if (! $i) $totalarray['nbfield']++; - + print "\n"; $i++; } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index c4a07580a9a..22e11e6fd1e 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -158,9 +158,9 @@ if (empty($reshook)) } } - - - + + + /* * View @@ -271,9 +271,9 @@ if ($resql) $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } - + //$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); - + $i = 0; print ''."\n"; if ($optioncss != '') print ''; @@ -283,7 +283,7 @@ if ($resql) print ''; print ''; print ''; - + print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num, $nbtotalofrecords, '', 0, '', '', $limit); if ($sall) @@ -291,7 +291,7 @@ if ($resql) foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + $moreforfilter=''; if (! empty($moreforfilter)) { @@ -305,28 +305,28 @@ if ($resql) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
'; 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")."'; 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 ($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).''.$acc->label.''.$acc->number.''.$accountingjournal->getNomUrl(0,1,1,'',1).''.$acc->getLibStatut(5).''; 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 '
'; print $contractstatic->getNomUrl(1,16); print ''; if ($obj->pid) @@ -552,9 +554,9 @@ while ($i < min($num,$limit)) } print ''; $companystatic->id=$obj->socid; @@ -563,9 +565,9 @@ while ($i < min($num,$limit)) print $companystatic->getNomUrl(1,'customer',28); 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 ''.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').''.($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 ''.dol_print_date($db->jdate($obj->date_cloture)).'
'."\n"; // Lignes des champs de filtre print ''; // Ref - if (! empty($arrayfields['e.ref']['checked'])) + if (! empty($arrayfields['e.ref']['checked'])) { print ''; } // Ref customer - if (! empty($arrayfields['e.ref_customer']['checked'])) + if (! empty($arrayfields['e.ref_customer']['checked'])) { print ''; } // Thirdparty - if (! empty($arrayfields['s.nom']['checked'])) + if (! empty($arrayfields['s.nom']['checked'])) { print ''; } // Date delivery planned - if (! empty($arrayfields['e.date_delivery']['checked'])) + if (! empty($arrayfields['e.date_delivery']['checked'])) { print ''; } - if (! empty($arrayfields['l.ref']['checked'])) + if (! empty($arrayfields['l.ref']['checked'])) { // Delivery ref print ''; @@ -447,7 +447,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); } } } @@ -461,7 +463,7 @@ if ($resql) if (! empty($arrayfields['l.fk_statut']['checked'])) print_liste_field_titre($arrayfields['l.fk_statut']['label'], $_SERVER["PHP_SELF"],"l.fk_statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - + $i=0; $var=true; $totalarray=array(); @@ -471,15 +473,15 @@ if ($resql) $shipment->id=$obj->rowid; $shipment->ref=$obj->ref; - + $companystatic->id=$obj->socid; $companystatic->ref=$obj->name; $companystatic->name=$obj->name; - - + + print ''; - + // Ref if (! empty($arrayfields['e.ref']['checked'])) { @@ -488,7 +490,7 @@ if ($resql) print "\n"; if (! $i) $totalarray['nbfield']++; } - + // Ref customer if (! empty($arrayfields['e.ref_customer']['checked'])) { @@ -496,8 +498,8 @@ if ($resql) print $obj->ref_customer; print "\n"; if (! $i) $totalarray['nbfield']++; - } - + } + // Third party if (! empty($arrayfields['s.nom']['checked'])) { @@ -546,7 +548,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Date delivery planed if (! empty($arrayfields['e.date_delivery']['checked'])) { @@ -558,7 +560,7 @@ if ($resql) }*/ print "\n"; } - + if (! empty($arrayfields['l.ref']['checked']) || ! empty($arrayfields['l.date_delivery']['checked'])) { $shipment->fetchObjectLinked($shipment->id,$shipment->element); @@ -572,7 +574,7 @@ if ($resql) print !empty($receiving) ? $receiving->getNomUrl($db) : ''; print ''; } - + if (! empty($arrayfields['l.date_delivery']['checked'])) { // Date received @@ -629,7 +631,7 @@ if ($resql) // Action column print ''; if (! $i) $totalarray['nbfield']++; - + print "\n"; $i++; diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index bbf2266ab13..d2c5db3426d 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -486,7 +486,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/fichinter/list.php b/htdocs/fichinter/list.php index 0404f976328..78fd59ecb22 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -117,7 +117,7 @@ $arrayfields=array( // 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) { $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); } @@ -224,7 +224,7 @@ foreach ($search_array_options as $key => $val) $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -252,7 +252,7 @@ if ($resql) $num = $db->num_rows($resql); $arrayofselected=is_array($toselect)?$toselect:array(); - + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -270,7 +270,7 @@ if ($resql) $crit=$val; $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); - } + } // List of mass actions available $arrayofmassactions = array( @@ -281,7 +281,7 @@ if ($resql) if ($user->rights->ficheinter->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); //if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); - + // Lines of title fields print ''."\n"; if ($optioncss != '') print ''; @@ -292,9 +292,9 @@ if ($resql) print ''; print ''; print ''; - + print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); - + if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); @@ -302,23 +302,23 @@ if ($resql) } $moreforfilter=''; - + $parameters=array(); $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 (! empty($moreforfilter)) { print '
'; print $moreforfilter; print '
'; } - + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); - + print '
'; print '
'; print ''; print ''; print ''; print ''; print ''; @@ -358,18 +358,18 @@ if ($resql) print ' '; print ''; } - if (! empty($arrayfields['l.date_delivery']['checked'])) + if (! empty($arrayfields['l.date_delivery']['checked'])) { // Date received print ' 
'."\n"; @@ -357,9 +357,9 @@ if ($resql) // 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'])) { $align=$extrafields->getAlignFlag($key); $typeofextrafield=$extrafields->attribute_type[$key]; @@ -406,7 +406,7 @@ if ($resql) $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; - + print "\n"; print ''; @@ -424,7 +424,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); } } } @@ -437,24 +439,24 @@ if ($resql) if (! empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.fk_statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; - + $total = 0; $i = 0; $totalarray=array(); while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); - + $objectstatic->id=$obj->rowid; $objectstatic->ref=$obj->ref; $objectstatic->statut=$obj->fk_statut; - + print ''; - + if (! empty($arrayfields['f.ref']['checked'])) { print "\n"; if (! $i) $totalarray['nbfield']++; } @@ -525,9 +527,9 @@ if ($resql) // 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); @@ -576,7 +578,7 @@ if ($resql) } print ''; if (! $i) $totalarray['nbfield']++; - + print "\n"; $total += $obj->duree; @@ -603,14 +605,14 @@ if ($resql) } $db->free($resql); - + $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + print '
"; - + print ''; // Picto + Ref print '
'; @@ -484,7 +486,7 @@ if ($resql) $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print '
'; - + print "
'."\n"; print '
'; - + print "\n"; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) @@ -620,18 +622,18 @@ if ($resql) */ $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; $urlsource.=str_replace('&','&',$param); - + $filedir=$diroutputmassaction; $genallowed=$user->rights->ficheinter->lire; $delallowed=$user->rights->ficheinter->supprimer; - + print $formfile->showdocuments('massfilesarea_interventions','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); } else { print '
'.$langs->trans("ShowTempMassFilesArea").''; } - + } else { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index bafdeeab4db..0b988e4d96b 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1050,7 +1050,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/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 30d31c0ea02..a9e372a9709 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -888,7 +888,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/product/list.php b/htdocs/product/list.php index 1512fda7b4f..8a8eda5b65a 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -654,7 +654,9 @@ else 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/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 469c2f292e7..23df5282435 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -892,7 +892,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/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 61e9438c929..ef4a9bf70c9 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -112,7 +112,7 @@ $arrayfields=array( // 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) { $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); } @@ -129,7 +129,7 @@ if (($id > 0 || ! empty($ref)) && $action != 'add') /* - * Actions + * Actions */ if (GETPOST('cancel')) { $action='list'; $massaction=''; } @@ -245,7 +245,7 @@ foreach ($search_array_options as $key => $val) $typ=$extrafields->attribute_type[$tmpkey]; $mode=0; if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric - if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) { $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); } @@ -263,7 +263,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); -} +} $sql.= $db->plimit($limit+1, $offset); @@ -275,7 +275,7 @@ if ($resql) $num = $db->num_rows($resql); $arrayofselected=is_array($toselect)?$toselect:array(); - + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -292,7 +292,7 @@ if ($resql) $crit=$val; $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); - } + } $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), @@ -310,25 +310,25 @@ if ($resql) print ''; print ''; print ''; - + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit); - + if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + /*$moreforfilter = ''; $moreforfilter.='
'; $moreforfilter.= $langs->trans('MyFilter') . ': '; $moreforfilter.= '
';*/ - + $parameters=array(); $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 (! empty($moreforfilter)) { print '
'; @@ -338,7 +338,7 @@ if ($resql) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - + print '
'; print ''."\n"; @@ -404,7 +404,7 @@ if ($resql) print $searchpicto; print ''; print ''."\n"; - + // Fields title print ''; if (! empty($arrayfields['t.entity']['checked'])) print_liste_field_titre($arrayfields['t.entity']['label'],$_SERVER['PHP_SELF'],'t.entity','',$param,'',$sortfield,$sortorder); @@ -418,12 +418,14 @@ if ($resql) // 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'])) { $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); } } } @@ -438,7 +440,7 @@ if ($resql) print ''."\n"; $productlot = new Productlot($db); - + $i=0; $var=true; $totalarray=array(); @@ -448,23 +450,23 @@ if ($resql) if ($obj) { $var = !$var; - + $productlot->id = $obj->rowid; $productlot->batch = $obj->batch; - + // You can use here results print ''; - if (! empty($arrayfields['t.entity']['checked'])) + if (! empty($arrayfields['t.entity']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['t.batch']['checked'])) + if (! empty($arrayfields['t.batch']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['t.fk_product']['checked'])) + if (! empty($arrayfields['t.fk_product']['checked'])) { $productstatic->id=$obj->fk_product; $productstatic->type=$obj->product_type; @@ -473,22 +475,22 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['t.eatby']['checked'])) + if (! empty($arrayfields['t.eatby']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['t.sellby']['checked'])) + if (! empty($arrayfields['t.sellby']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['t.fk_user_creat']['checked'])) + if (! empty($arrayfields['t.fk_user_creat']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; } - if (! empty($arrayfields['t.fk_user_modif']['checked'])) + if (! empty($arrayfields['t.fk_user_modif']['checked'])) { print ''; if (! $i) $totalarray['nbfield']++; @@ -497,13 +499,13 @@ if ($resql) { 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); @@ -580,7 +582,7 @@ if ($resql) } print ''; } - + $db->free($resql); $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); @@ -589,20 +591,20 @@ if ($resql) print '
'.$obj->entity.''.$productlot->getNomUrl(1).''.$productstatic->getNomUrl(1).''.dol_print_date($db->jdate($obj->eatby), 'day').''.dol_print_date($db->jdate($obj->sellby), 'day').''.$obj->fk_user_creat.''.$obj->fk_user_modif.''.$obj->import_key.'
'."\n"; print '
'; - + print ''."\n"; - + /* if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { // Show list of available documents $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; $urlsource.=str_replace('&','&',$param); - + $filedir=$diroutputmassaction; $genallowed=$user->rights->facture->lire; $delallowed=$user->rights->facture->lire; - + print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); } else diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 2ace6736889..37331b000ab 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -805,7 +805,9 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) 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/resource/list.php b/htdocs/resource/list.php index 5ec9eabbfb1..11405d15acc 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -245,7 +245,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/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index e401fdbe710..f6d9c9510a0 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -363,11 +363,11 @@ if ($resql) { $title = $langs->trans('ListOfSupplierProposals'); } - + $num = $db->num_rows($resql); $arrayofselected=is_array($toselect)?$toselect:array(); - + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; @@ -401,7 +401,7 @@ if ($resql) if ($user->rights->supplier_proposal->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); if ($massaction == 'presend') $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); - + // Lignes des champs de filtre print '
'; if ($optioncss != '') print ''; @@ -411,13 +411,13 @@ if ($resql) print ''; print ''; print ''; - + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); if ($massaction == 'presend') { $langs->load("mails"); - + if (! GETPOST('cancel')) { $objecttmp=new SupplierProposal($db); @@ -436,17 +436,17 @@ if ($resql) } } } - + print ''; - + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); - + dol_fiche_head(null, '', ''); - + $topicmail="SendProposalRef"; $modelmail="propal_send"; - + // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); @@ -499,25 +499,25 @@ if ($resql) $formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']=''; - + // Tableau des parametres complementaires du post $formmail->param['action']=$action; $formmail->param['models']=$modelmail; $formmail->param['models_id']=GETPOST('modelmailselected','int'); $formmail->param['id']=join(',',$arrayofselected); //$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - + print $formmail->get_form(); - + dol_fiche_end(); } - + if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + $i = 0; $moreforfilter=''; @@ -553,30 +553,30 @@ 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 (! empty($moreforfilter)) { print '
'; print $moreforfilter; print '
'; } - + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); - + print '
'; print ''."\n"; - + print ''; - if (! empty($arrayfields['sp.ref']['checked'])) + if (! empty($arrayfields['sp.ref']['checked'])) { print ''; } if (! empty($arrayfields['s.nom']['checked'])) - { + { print ''; @@ -605,7 +605,7 @@ if ($resql) print ''; } // Date - if (! empty($arrayfields['sp.date_valid']['checked'])) + if (! empty($arrayfields['sp.date_valid']['checked'])) { print ''; + print ''; } // Date - if (! empty($arrayfields['sp.date_livraison']['checked'])) + if (! empty($arrayfields['sp.date_livraison']['checked'])) { print ''; - } + } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -693,7 +693,7 @@ if ($resql) { print ''; - } + } // Status if (! empty($arrayfields['sp.fk_statut']['checked'])) { @@ -727,12 +727,14 @@ if ($resql) // 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'])) { $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); } } } @@ -745,7 +747,7 @@ if ($resql) if (! empty($arrayfields['sp.fk_statut']['checked'])) print_liste_field_titre($arrayfields['sp.fk_statut']['label'],$_SERVER["PHP_SELF"],"sp.fk_statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print ''."\n"; - + $now = dol_now(); $i=0; $total=0; @@ -754,12 +756,12 @@ if ($resql) while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); - + $objectstatic->id=$obj->rowid; $objectstatic->ref=$obj->ref; print ''; - + if (! empty($arrayfields['sp.ref']['checked'])) { print '
'; print ''; print ''; print ''; print ''; //print $langs->trans('Month').': '; @@ -613,10 +613,10 @@ if ($resql) //print ' '.$langs->trans('Year').': '; $syearvalid = $yearvalid; $formother->select_year($syearvalid,'yearvalid',1, 20, 5); - print ''; //print $langs->trans('Month').': '; @@ -654,7 +654,7 @@ if ($resql) print ''; print ''; print ''; print '
'; @@ -792,11 +794,11 @@ if ($resql) $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print '
'; - + print "\n"; if (! $i) $totalarray['nbfield']++; } - + $url = DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid; // Company @@ -854,7 +856,7 @@ if ($resql) print ''; if (! $i) $totalarray['nbfield']++; } - + // Date proposal if (! empty($arrayfields['sp.date_valid']['checked'])) { @@ -863,7 +865,7 @@ if ($resql) print "\n"; if (! $i) $totalarray['nbfield']++; } - + // Date delivery if (! empty($arrayfields['sp.date_livraison']['checked'])) { @@ -897,7 +899,7 @@ if ($resql) if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; $totalarray['totalttc'] += $obj->total_ttc; } - + $userstatic->id=$obj->fk_user_author; $userstatic->login=$obj->login; @@ -910,7 +912,7 @@ if ($resql) print "\n"; if (! $i) $totalarray['nbfield']++; } - + // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -951,7 +953,7 @@ if ($resql) } // Status if (! empty($arrayfields['sp.fk_statut']['checked'])) - { + { print ''.$objectstatic->LibStatut($obj->fk_statut,5)."\n"; if (! $i) $totalarray['nbfield']++; } @@ -966,7 +968,7 @@ if ($resql) } print ''; if (! $i) $totalarray['nbfield']++; - + print "\n"; $total += $obj->total_ht; @@ -1002,16 +1004,16 @@ if ($resql) } $db->free($resql); - + $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - + print ''."\n"; print '
'."\n"; print '
'."\n"; - + if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { /* @@ -1019,18 +1021,18 @@ if ($resql) */ $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; $urlsource.=str_replace('&','&',$param); - + $filedir=$diroutputmassaction; $genallowed=$user->rights->supplier_proposal->lire; $delallowed=$user->rights->supplier_proposal->lire; - + print $formfile->showdocuments('massfilesarea_supplier_proposal','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'',''); } else { print '
'.$langs->trans("ShowTempMassFilesArea").''; } - + } else { diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 9c82216d5be..54fffcd3fb7 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -451,7 +451,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); } } }