Merge pull request #22173 from aspangaro/17p7

NEW : Supplier order list - Add column private and public note
This commit is contained in:
Laurent Destailleur 2022-09-09 15:55:15 +02:00 committed by GitHub
commit 05e8a7c954
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,7 +188,9 @@ $arrayfields = array(
'state.nom'=>array('label'=>"StateShort", 'enabled'=>1, 'position'=>48), 'state.nom'=>array('label'=>"StateShort", 'enabled'=>1, 'position'=>48),
'country.code_iso'=>array('label'=>"Country", 'enabled'=>1, 'position'=>49), 'country.code_iso'=>array('label'=>"Country", 'enabled'=>1, 'position'=>49),
'typent.code'=>array('label'=>"ThirdPartyType", 'enabled'=>$checkedtypetiers, 'position'=>50), 'typent.code'=>array('label'=>"ThirdPartyType", 'enabled'=>$checkedtypetiers, 'position'=>50),
'u.login'=>array('label'=>"AuthorRequest", 'enabled'=>1, 'position'=>51) 'u.login'=>array('label'=>"AuthorRequest", 'enabled'=>1, 'position'=>51),
'cf.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>100),
'cf.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>110),
); );
foreach ($object->fields as $key => $val) { foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field // If $val['visible']==0, then we never show the field
@ -1440,6 +1442,16 @@ if ($resql) {
print '</div>'; print '</div>';
print '</td>'; print '</td>';
} }
// Note public
if (!empty($arrayfields['cf.note_public']['checked'])) {
print '<td class="liste_titre">';
print '</td>';
}
// Note private
if (!empty($arrayfields['cf.note_private']['checked'])) {
print '<td class="liste_titre">';
print '</td>';
}
// Action column // Action column
print '<td class="liste_titre middle">'; print '<td class="liste_titre middle">';
$searchpicto = $form->showFilterButtons(); $searchpicto = $form->showFilterButtons();
@ -1540,6 +1552,12 @@ if ($resql) {
if (!empty($arrayfields['cf.date_approve']['checked'])) { if (!empty($arrayfields['cf.date_approve']['checked'])) {
print_liste_field_titre($arrayfields['cf.date_approve']['label'], $_SERVER["PHP_SELF"], 'cf.date_approve', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre($arrayfields['cf.date_approve']['label'], $_SERVER["PHP_SELF"], 'cf.date_approve', '', $param, '', $sortfield, $sortorder, 'center ');
} }
if (!empty($arrayfields['cf.note_public']['checked'])) {
print_liste_field_titre($arrayfields['cf.note_public']['label'], $_SERVER["PHP_SELF"], "cf.note_public", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (!empty($arrayfields['cf.note_private']['checked'])) {
print_liste_field_titre($arrayfields['cf.note_private']['label'], $_SERVER["PHP_SELF"], "cf.note_private", "", $param, '', $sortfield, $sortorder, 'center ');
}
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n"; print "</tr>\n";
@ -1867,6 +1885,25 @@ if ($resql) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
} }
} }
// Note public
if (!empty($arrayfields['cf.note_public']['checked'])) {
print '<td class="center">';
print dol_string_nohtmltag($obj->note_public);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Note private
if (!empty($arrayfields['cf.note_private']['checked'])) {
print '<td class="center">';
print dol_string_nohtmltag($obj->note_private);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Action column // Action column
print '<td class="nowrap center">'; print '<td class="nowrap center">';