merge conflict

This commit is contained in:
jpb
2021-08-12 09:36:34 +02:00
80 changed files with 1237 additions and 472 deletions

View File

@@ -234,6 +234,7 @@ $arrayfields = array(
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140),
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150), // Not enabled by default because slow
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>165),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>166),
'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>170),
'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>171),
'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>180),
@@ -1257,6 +1258,9 @@ if ($resql) {
print '<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'">';
print '</td>';
}
if (!empty($arrayfields['sale_representative']['checked'])) {
print '<td class="liste_titre"></td>';
}
if (!empty($arrayfields['f.retained_warranty']['checked'])) {
print '<td class="liste_titre" align="right">';
print '</td>';
@@ -1449,6 +1453,9 @@ if ($resql) {
if (!empty($arrayfields['u.login']['checked'])) {
print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder);
}
if (!empty($arrayfields['sale_representative']['checked'])) {
print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
}
if (!empty($arrayfields['f.retained_warranty']['checked'])) {
print_liste_field_titre($arrayfields['f.retained_warranty']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder);
}
@@ -1939,6 +1946,53 @@ if ($resql) {
}
}
if (!empty($arrayfields['sale_representative']['checked'])) {
// Sales representatives
print '<td>';
if ($obj->socid > 0) {
$listsalesrepresentatives = $thirdpartystatic->getSalesRepresentatives($user);
if ($listsalesrepresentatives < 0) {
dol_print_error($db);
}
$nbofsalesrepresentative = count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 6) {
// We print only number
print $nbofsalesrepresentative;
} elseif ($nbofsalesrepresentative > 0) {
$j = 0;
foreach ($listsalesrepresentatives as $val) {
$userstatic->id = $val['id'];
$userstatic->lastname = $val['lastname'];
$userstatic->firstname = $val['firstname'];
$userstatic->email = $val['email'];
$userstatic->statut = $val['statut'];
$userstatic->entity = $val['entity'];
$userstatic->photo = $val['photo'];
$userstatic->login = $val['login'];
$userstatic->office_phone = $val['office_phone'];
$userstatic->office_fax = $val['office_fax'];
$userstatic->user_mobile = $val['user_mobile'];
$userstatic->job = $val['job'];
$userstatic->gender = $val['gender'];
//print '<div class="float">':
print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2);
$j++;
if ($j < $nbofsalesrepresentative) {
print ' ';
}
//print '</div>';
}
}
//else print $langs->trans("NoSalesRepresentativeAffected");
} else {
print '&nbsp;';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
if (!empty($arrayfields['f.retained_warranty']['checked'])) {
print '<td align="right amount">'.(!empty($obj->retained_warranty) ?price($obj->retained_warranty).'%' : '&nbsp;').'</td>';
}