From c8a455edf4887618b8d38619014a132909ef9c0a Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sat, 27 Mar 2021 13:14:59 +0100 Subject: [PATCH 01/12] add excluded memer on graph --- htdocs/core/boxes/box_members_by_type.php | 38 ++++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 79610a3e988..c975cb5e230 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -93,12 +93,14 @@ class box_members_by_type extends ModeleBoxes $MembersToValidate = array(); $MembersValidated = array(); $MemberUpToDate = array(); + $MembersExcluded = array(); $MembersResiliated = array(); - $SommeA = 0; - $SommeB = 0; - $SommeC = 0; - $SommeD = 0; + $SumToValidate = 0; + $SumValidated = 0; + $SumUpToDate = 0; + $SumResiliated = 0; + $SumExcluded = 0; $AdherentType = array(); @@ -132,6 +134,9 @@ class box_members_by_type extends ModeleBoxes if ($objp->statut == 1) { $MembersValidated[$objp->rowid] = $objp->somme; } + if ($objp->statut == -2) { + $MembersExcluded[$objp->rowid] = $objp->somme; + } if ($objp->statut == 0) { $MembersResiliated[$objp->rowid] = $objp->somme; } @@ -181,16 +186,23 @@ class box_members_by_type extends ModeleBoxes 'td' => 'class="right"', 'text' => $langs->trans("UpToDate"), ); + $this->info_box_contents[$line][] = array( + 'td' => 'class="right"', + 'text' => $langs->trans("MembersStatusExcluded"), + ); $this->info_box_contents[$line][] = array( 'td' => 'class="right"', 'text' => $langs->trans("MembersStatusResiliated"), ); $line++; foreach ($AdherentType as $key => $adhtype) { - $SommeA += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; - $SommeB += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : 0; - $SommeC += isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0; - $SommeD += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; + + $SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; + $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; + $SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; + $SumExcluded += isset($MembersExcluded[$key]) ? $MembersExcluded [$key] : 0; + $SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; + $this->info_box_contents[$line][] = array( 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $adhtype->getNomUrl(1, dol_size(32)), @@ -211,6 +223,11 @@ class box_members_by_type extends ModeleBoxes 'text' => (isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key] : '') . ' ' . $staticmember->LibStatut(1, 1, $now, 3), 'asis' => 1, ); + $this->info_box_contents[$line][] = array( + 'td' => 'class="right"', + 'text' => (isset($MembersExcluded[$key]) && $MembersExcluded[$key] > 0 ? $MembersExcluded[$key] : '') . ' ' . $staticmember->LibStatut(-2, 1, $now, 3), + 'asis' => 1, + ); $this->info_box_contents[$line][] = array( 'td' => 'class="right"', 'text' => (isset($MembersResiliated[$key]) && $MembersResiliated[$key] > 0 ? $MembersResiliated[$key] : '') . ' ' . $staticmember->LibStatut(0, 1, 0, 3), @@ -245,6 +262,11 @@ class box_members_by_type extends ModeleBoxes 'text' => $SommeC.' '.$staticmember->LibStatut(1, 1, $now, 3), 'asis' => 1 ); + $this->info_box_contents[$line][] = array( + 'td' => 'class="liste_total right"', + 'text' => $SommeD.' '.$staticmember->LibStatut(-2, 1, 0, 3), + 'asis' => 1 + ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', 'text' => $SommeD.' '.$staticmember->LibStatut(0, 1, 0, 3), From bad5aa64688ad350af5c0b858b38e93a02271ec1 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sat, 27 Mar 2021 13:39:15 +0100 Subject: [PATCH 02/12] fix excluded member color in graph --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/adherents/index.php | 2 +- htdocs/core/boxes/box_members_by_type.php | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index cf6f9d54649..0315b90df9d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2279,7 +2279,7 @@ class Adherent extends CommonObject $labelStatus = $langs->trans("MemberStatusResiliated"); $labelStatusShort = $langs->trans("MemberStatusResiliatedShort"); } elseif ($status == -2) { - $statusType = 'status10'; + $statusType = 'status8'; $labelStatus = $langs->trans("MemberStatusExcluded"); $labelStatusShort = $langs->trans("MemberStatusExcludedShort"); } diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 803ef89bb22..517649c4b61 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -233,7 +233,7 @@ if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->SetDataColor(array($badgeStatus1, $badgeStatus4, '-'.$badgeStatus8, $badgeStatus6, '-'.$badgeStatus0)); + $dolgraph->SetDataColor(array($badgeStatus1, $badgeStatus4, $badgeStatus8, $badgeStatus6, '-'.$badgeStatus0)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index c975cb5e230..5bc92cc39bb 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -236,7 +236,7 @@ class box_members_by_type extends ModeleBoxes $line++; } - + if ($num == 0) { $this->info_box_contents[$line][0] = array( 'td' => 'class="center"', @@ -249,27 +249,27 @@ class box_members_by_type extends ModeleBoxes ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', - 'text' => $SommeA.' '.$staticmember->LibStatut(-1, 1, 0, 3), + 'text' => $SumToValidate.' '.$staticmember->LibStatut(-1, 1, 0, 3), 'asis' => 1 ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', - 'text' => $SommeB.' '.$staticmember->LibStatut(1, 1, 0, 3), + 'text' => $SumValidated.' '.$staticmember->LibStatut(1, 1, 0, 3), 'asis' => 1 ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', - 'text' => $SommeC.' '.$staticmember->LibStatut(1, 1, $now, 3), + 'text' => $SumUpToDate.' '.$staticmember->LibStatut(1, 1, $now, 3), 'asis' => 1 ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', - 'text' => $SommeD.' '.$staticmember->LibStatut(-2, 1, 0, 3), + 'text' => $SumExcluded.' '.$staticmember->LibStatut(-2, 1, 0, 3), 'asis' => 1 ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', - 'text' => $SommeD.' '.$staticmember->LibStatut(0, 1, 0, 3), + 'text' => $SumResiliated.' '.$staticmember->LibStatut(0, 1, 0, 3), 'asis' => 1 ); } From 6a9d6a8634d0b41bc6e1d08144e22a57404fa7f6 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 27 Mar 2021 12:44:34 +0000 Subject: [PATCH 03/12] Fixing style errors. --- htdocs/core/boxes/box_members_by_type.php | 41 +++++++++++------------ 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 5bc92cc39bb..1819c7f47c5 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -135,7 +135,7 @@ class box_members_by_type extends ModeleBoxes $MembersValidated[$objp->rowid] = $objp->somme; } if ($objp->statut == -2) { - $MembersExcluded[$objp->rowid] = $objp->somme; + $MembersExcluded[$objp->rowid] = $objp->somme; } if ($objp->statut == 0) { $MembersResiliated[$objp->rowid] = $objp->somme; @@ -187,8 +187,8 @@ class box_members_by_type extends ModeleBoxes 'text' => $langs->trans("UpToDate"), ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => $langs->trans("MembersStatusExcluded"), + 'td' => 'class="right"', + 'text' => $langs->trans("MembersStatusExcluded"), ); $this->info_box_contents[$line][] = array( 'td' => 'class="right"', @@ -196,13 +196,12 @@ class box_members_by_type extends ModeleBoxes ); $line++; foreach ($AdherentType as $key => $adhtype) { - - $SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; - $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; - $SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; - $SumExcluded += isset($MembersExcluded[$key]) ? $MembersExcluded [$key] : 0; - $SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; - + $SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; + $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; + $SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; + $SumExcluded += isset($MembersExcluded[$key]) ? $MembersExcluded [$key] : 0; + $SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; + $this->info_box_contents[$line][] = array( 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', 'text' => $adhtype->getNomUrl(1, dol_size(32)), @@ -224,9 +223,9 @@ class box_members_by_type extends ModeleBoxes 'asis' => 1, ); $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => (isset($MembersExcluded[$key]) && $MembersExcluded[$key] > 0 ? $MembersExcluded[$key] : '') . ' ' . $staticmember->LibStatut(-2, 1, $now, 3), - 'asis' => 1, + 'td' => 'class="right"', + 'text' => (isset($MembersExcluded[$key]) && $MembersExcluded[$key] > 0 ? $MembersExcluded[$key] : '') . ' ' . $staticmember->LibStatut(-2, 1, $now, 3), + 'asis' => 1, ); $this->info_box_contents[$line][] = array( 'td' => 'class="right"', @@ -236,7 +235,7 @@ class box_members_by_type extends ModeleBoxes $line++; } - + if ($num == 0) { $this->info_box_contents[$line][0] = array( 'td' => 'class="center"', @@ -249,27 +248,27 @@ class box_members_by_type extends ModeleBoxes ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', - 'text' => $SumToValidate.' '.$staticmember->LibStatut(-1, 1, 0, 3), + 'text' => $SumToValidate.' '.$staticmember->LibStatut(-1, 1, 0, 3), 'asis' => 1 ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', - 'text' => $SumValidated.' '.$staticmember->LibStatut(1, 1, 0, 3), + 'text' => $SumValidated.' '.$staticmember->LibStatut(1, 1, 0, 3), 'asis' => 1 ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', - 'text' => $SumUpToDate.' '.$staticmember->LibStatut(1, 1, $now, 3), + 'text' => $SumUpToDate.' '.$staticmember->LibStatut(1, 1, $now, 3), 'asis' => 1 ); $this->info_box_contents[$line][] = array( - 'td' => 'class="liste_total right"', - 'text' => $SumExcluded.' '.$staticmember->LibStatut(-2, 1, 0, 3), - 'asis' => 1 + 'td' => 'class="liste_total right"', + 'text' => $SumExcluded.' '.$staticmember->LibStatut(-2, 1, 0, 3), + 'asis' => 1 ); $this->info_box_contents[$line][] = array( 'td' => 'class="liste_total right"', - 'text' => $SumResiliated.' '.$staticmember->LibStatut(0, 1, 0, 3), + 'text' => $SumResiliated.' '.$staticmember->LibStatut(0, 1, 0, 3), 'asis' => 1 ); } From 8b1d4a60245b4012baa01204cf5bd654a3a78759 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sun, 28 Mar 2021 22:40:41 +0200 Subject: [PATCH 04/12] Copyright adherents/index.php --- htdocs/adherents/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 517649c4b61..1d899324b33 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2021 Frédéric France + * Copyright (C) 2021 Waël Almoman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 39933f97be659d3e8793c190e8116071f9236518 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sun, 28 Mar 2021 22:46:19 +0200 Subject: [PATCH 05/12] Copyright adherent.class.php --- htdocs/adherents/class/adherent.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 0315b90df9d..34fce36b4c6 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -13,6 +13,7 @@ * Copyright (C) 2018-2019 Thibault FOUCART * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2021 Waël Almoman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 28ff0f2bc3b54f86fd2f231168ac8def943686a0 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sun, 28 Mar 2021 22:50:27 +0200 Subject: [PATCH 06/12] Copyright adherent_type.class.php --- htdocs/adherents/class/adherent_type.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b4347277b5d..e8ccb57504e 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2009-2017 Regis Houssin * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2019 Thibault Foucart + * Copyright (C) 2021 Waël Almoman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From c700767b549938445b69ab80db6683083a957572 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Mon, 29 Mar 2021 03:28:32 +0200 Subject: [PATCH 07/12] Update copyright --- htdocs/adherents/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 1d899324b33..dd6f2473102 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2021 Frédéric France - * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Waël Almoman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From f83cf3a17b6aea7a4bae974700cad78b97480add Mon Sep 17 00:00:00 2001 From: daraelmin Date: Mon, 29 Mar 2021 03:29:21 +0200 Subject: [PATCH 08/12] Update copyright --- htdocs/adherents/class/adherent.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 34fce36b4c6..a80818981c2 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -13,7 +13,7 @@ * Copyright (C) 2018-2019 Thibault FOUCART * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Waël Almoman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From ae94ce594ec4bf6b1e9f6e867a483e3e23538116 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Mon, 29 Mar 2021 03:30:44 +0200 Subject: [PATCH 09/12] Update copyright --- htdocs/adherents/class/adherent_type.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index e8ccb57504e..460cefdeed3 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2009-2017 Regis Houssin * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2019 Thibault Foucart - * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Waël Almoman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 8a43d6547650b4d066c5b94cb4f780b3c2f14626 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Mon, 29 Mar 2021 07:49:15 +0200 Subject: [PATCH 10/12] Copyright box_members_by_type.php --- htdocs/core/boxes/box_members_by_type.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 1819c7f47c5..5bc05b6fabd 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015-2020 Frederic France + * Copyright (C) 2021 Waël Almoman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From cdc1ae6f59297fbbc68ecef2490d22587996c997 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Mar 2021 17:38:37 +0200 Subject: [PATCH 11/12] Update adherent.class.php --- htdocs/adherents/class/adherent.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a80818981c2..eca8668e308 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2280,7 +2280,7 @@ class Adherent extends CommonObject $labelStatus = $langs->trans("MemberStatusResiliated"); $labelStatusShort = $langs->trans("MemberStatusResiliatedShort"); } elseif ($status == -2) { - $statusType = 'status8'; + $statusType = 'status10'; $labelStatus = $langs->trans("MemberStatusExcluded"); $labelStatusShort = $langs->trans("MemberStatusExcludedShort"); } From 64b925a5d85a9cbc6d5f05ea83b63790bb22046f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Mar 2021 17:39:11 +0200 Subject: [PATCH 12/12] Update index.php --- htdocs/adherents/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index dd6f2473102..0340af431f7 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -234,7 +234,7 @@ if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->SetDataColor(array($badgeStatus1, $badgeStatus4, $badgeStatus8, $badgeStatus6, '-'.$badgeStatus0)); + $dolgraph->SetDataColor(array($badgeStatus1, $badgeStatus4, '-'.$badgeStatus8, $badgeStatus6, '-'.$badgeStatus0)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie'));