This commit is contained in:
Laurent Destailleur 2022-01-06 10:54:19 +01:00
parent 949c154f15
commit 708f5e5cf1
2 changed files with 24 additions and 23 deletions

View File

@ -1632,7 +1632,7 @@ if ($resql) {
print '<td class="nobordernopadding nowraponall">'; print '<td class="nobordernopadding nowraponall">';
if ($contextpage == 'poslist') { if ($contextpage == 'poslist') {
print $obj->ref; print dol_escape_htmltag($obj->ref);
} else { } else {
print $facturestatic->getNomUrl(1, '', 200, 0, '', 0, 1); print $facturestatic->getNomUrl(1, '', 200, 0, '', 0, 1);
} }
@ -1654,7 +1654,7 @@ if ($resql) {
// Customer ref // Customer ref
if (!empty($arrayfields['f.ref_client']['checked'])) { if (!empty($arrayfields['f.ref_client']['checked'])) {
print '<td class="nowrap tdoverflowmax200">'; print '<td class="nowrap tdoverflowmax200">';
print $obj->ref_client; print dol_escape_htmltag($obj->ref_client);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@ -1719,7 +1719,7 @@ if ($resql) {
if (!empty($arrayfields['p.title']['checked'])) { if (!empty($arrayfields['p.title']['checked'])) {
print '<td class="nowraponall">'; print '<td class="nowraponall">';
if ($obj->project_id > 0) { if ($obj->project_id > 0) {
print $projectstatic->title; print dol_escape_htmltag($projectstatic->title);
} }
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
@ -1731,9 +1731,9 @@ if ($resql) {
if (!empty($arrayfields['s.nom']['checked'])) { if (!empty($arrayfields['s.nom']['checked'])) {
print '<td class="tdoverflowmax200">'; print '<td class="tdoverflowmax200">';
if ($contextpage == 'poslist') { if ($contextpage == 'poslist') {
print $companystatic->name; print dol_escape_htmltag($companystatic->name);
} else { } else {
print $companystatic->getNomUrl(1, 'customer'); print $companystatic->getNomUrl(1, 'customer', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
} }
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
@ -1742,8 +1742,8 @@ if ($resql) {
} }
// Alias // Alias
if (!empty($arrayfields['s.name_alias']['checked'])) { if (!empty($arrayfields['s.name_alias']['checked'])) {
print '<td class="tdoverflowmax150" title="'.$obj->name_alias.'">'; print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companystatic->name_alias).'">';
print $obj->name_alias; print dol_escape_htmltag($companystatic->name_alias);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@ -1752,7 +1752,7 @@ if ($resql) {
// Town // Town
if (!empty($arrayfields['s.town']['checked'])) { if (!empty($arrayfields['s.town']['checked'])) {
print '<td>'; print '<td>';
print $obj->town; print dol_escape_htmltag($obj->town);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@ -1761,7 +1761,7 @@ if ($resql) {
// Zip // Zip
if (!empty($arrayfields['s.zip']['checked'])) { if (!empty($arrayfields['s.zip']['checked'])) {
print '<td class="nowraponall">'; print '<td class="nowraponall">';
print $obj->zip; print dol_escape_htmltag($obj->zip);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@ -1799,10 +1799,10 @@ if ($resql) {
// Staff // Staff
if (!empty($arrayfields['staff.code']['checked'])) { if (!empty($arrayfields['staff.code']['checked'])) {
print '<td class="center">'; print '<td class="center">';
if (!is_array($staffArray) || count($staffArray) == 0) { if (!is_array($conf->cache['staff']) || count($conf->cache['staff']) == 0) {
$staffArray = $formcompany->effectif_array(1); $conf->cache['staff'] = $formcompany->effectif_array(1);
} }
print $staffArray[$obj->staff_code]; print $conf->cache['staff'][$obj->staff_code];
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@ -1832,7 +1832,7 @@ if ($resql) {
// Module Source // Module Source
if (!empty($arrayfields['f.module_source']['checked'])) { if (!empty($arrayfields['f.module_source']['checked'])) {
print '<td>'; print '<td>';
print $obj->module_source; print dol_escape_htmltag($obj->module_source);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@ -1842,7 +1842,7 @@ if ($resql) {
// POS Terminal // POS Terminal
if (!empty($arrayfields['f.pos_source']['checked'])) { if (!empty($arrayfields['f.pos_source']['checked'])) {
print '<td>'; print '<td>';
print $obj->pos_source; print dol_escape_htmltag($obj->pos_source);
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@ -1851,7 +1851,7 @@ if ($resql) {
// Amount HT // Amount HT
if (!empty($arrayfields['f.total_ht']['checked'])) { if (!empty($arrayfields['f.total_ht']['checked'])) {
print '<td class="right nowraponall amount">'.price($obj->total_ht)."</td>\n"; print '<td class="right nowraponall">'.price($obj->total_ht)."</td>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
@ -1934,11 +1934,11 @@ if ($resql) {
} }
if (!empty($arrayfields['f.retained_warranty']['checked'])) { if (!empty($arrayfields['f.retained_warranty']['checked'])) {
print '<td align="right amount">'.(!empty($obj->retained_warranty) ?price($obj->retained_warranty).'%' : '&nbsp;').'</td>'; print '<td align="right">'.(!empty($obj->retained_warranty) ? price($obj->retained_warranty).'%' : '&nbsp;').'</td>';
} }
if (!empty($arrayfields['dynamount_payed']['checked'])) { if (!empty($arrayfields['dynamount_payed']['checked'])) {
print '<td class="right nowraponall amount">'.(!empty($totalpay) ?price($totalpay, 0, $langs) : '&nbsp;').'</td>'; // TODO Use a denormalized field print '<td class="right nowraponall amount">'.(!empty($totalpay) ? price($totalpay, 0, $langs) : '&nbsp;').'</td>'; // TODO Use a denormalized field
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
@ -1965,7 +1965,7 @@ if ($resql) {
// Currency // Currency
if (!empty($arrayfields['f.multicurrency_code']['checked'])) { if (!empty($arrayfields['f.multicurrency_code']['checked'])) {
print '<td class="nowraponall">'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."</td>\n"; print '<td class="nowraponall">'.dol_escape_htmltag($obj->multicurrency_code).' - '.$langs->trans('Currency'.$obj->multicurrency_code)."</td>\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
@ -2059,7 +2059,7 @@ if ($resql) {
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Date creation // Date creation
if (!empty($arrayfields['f.datec']['checked'])) { if (!empty($arrayfields['f.datec']['checked'])) {
print '<td align="center" class="nowrap">'; print '<td class="nowrap center">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
@ -2068,7 +2068,7 @@ if ($resql) {
} }
// Date modification // Date modification
if (!empty($arrayfields['f.tms']['checked'])) { if (!empty($arrayfields['f.tms']['checked'])) {
print '<td align="center" class="nowrap">'; print '<td class="nowrap center">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
print '</td>'; print '</td>';
if (!$i) { if (!$i) {
@ -2077,7 +2077,7 @@ if ($resql) {
} }
// Date closing // Date closing
if (!empty($arrayfields['f.date_closing']['checked'])) { if (!empty($arrayfields['f.date_closing']['checked'])) {
print '<td align="center" class="nowrap">'; print '<td class="nowrap center">';
print dol_print_date($db->jdate($obj->date_closing), 'dayhour', 'tzuser'); print dol_print_date($db->jdate($obj->date_closing), 'dayhour', 'tzuser');
print '</td>'; print '</td>';
if (!$i) { if (!$i) {

View File

@ -2481,9 +2481,10 @@ class Societe extends CommonObject
* @param int $maxlen Max length of name * @param int $maxlen Max length of name
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @param int $noaliasinname 1=Do not add alias into the link ref
* @return string String with URL * @return string String with URL
*/ */
public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $notooltip = 0, $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $notooltip = 0, $save_lastsearch_value = -1, $noaliasinname = 0)
{ {
global $conf, $langs, $hookmanager; global $conf, $langs, $hookmanager;
@ -2521,7 +2522,7 @@ class Societe extends CommonObject
} }
} }
if (!empty($this->name_alias)) { if (!empty($this->name_alias) && empty($noaliasinname)) {
$name .= ' ('.$this->name_alias.')'; $name .= ' ('.$this->name_alias.')';
} }