From f4973068555cb6b0df45eb0d2230b946ac72d97a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 9 Sep 2022 11:57:59 +0200 Subject: [PATCH 1/2] NEW : Supplier order list - Add column private and public note --- htdocs/fourn/commande/list.php | 39 +++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index c6401b0a70a..f1f65ed3fa8 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -188,7 +188,9 @@ $arrayfields = array( 'state.nom'=>array('label'=>"StateShort", 'enabled'=>1, 'position'=>48), 'country.code_iso'=>array('label'=>"Country", 'enabled'=>1, 'position'=>49), '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) { // If $val['visible']==0, then we never show the field @@ -1440,6 +1442,16 @@ if ($resql) { print ''; print ''; } + // Note public + if (!empty($arrayfields['cf.note_public']['checked'])) { + print ''; + print ''; + } + // Note private + if (!empty($arrayfields['cf.note_private']['checked'])) { + print ''; + print ''; + } // Action column print ''; $searchpicto = $form->showFilterButtons(); @@ -1540,6 +1552,12 @@ if ($resql) { 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 '); } + 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, 'right '); + } + 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, 'right '); + } print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; @@ -1867,6 +1885,25 @@ if ($resql) { $totalarray['nbfield']++; } } + // Note public + if (!empty($arrayfields['cf.note_public']['checked'])) { + print ''; + print dol_string_nohtmltag($obj->note_public); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Note private + if (!empty($arrayfields['cf.note_private']['checked'])) { + print ''; + print dol_string_nohtmltag($obj->note_private); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } // Action column print ''; From 9890965cfe7c8635da82dc3778f3266f9f756564 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 9 Sep 2022 12:03:42 +0200 Subject: [PATCH 2/2] rather center column title --- htdocs/fourn/commande/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index f1f65ed3fa8..f71126f60ed 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1553,10 +1553,10 @@ if ($resql) { 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, 'right '); + 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, 'right '); + 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 "\n";