From aa8e43cd1beb0f37dab7481f804c9f17404e3719 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 16 Jul 2013 01:09:19 +0200 Subject: [PATCH] Task 149 : Add number of notes and attached files into tab. Started with thirdparty --- htdocs/core/lib/company.lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 64d8f50c9c7..1d938cee9e3 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -86,9 +86,13 @@ function societe_prepare_head($object) if ($user->societe_id == 0) { - // Notes + // Notes + $nbNote = 0; + if(!empty($object->note_private)) $nbNote++; + if(!empty($object->note_public)) $nbNote++; $head[$h][0] = DOL_URL_ROOT.'/societe/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Note"); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'note'; $h++; @@ -101,8 +105,10 @@ function societe_prepare_head($object) } // Attached files + $nbFiles = count(dol_dir_list($upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id)); $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; $head[$h][1] = $langs->trans("Documents"); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; $head[$h][2] = 'document'; $h++;