diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 9b28cc6473e..3f92efe0e72 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1747,12 +1747,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print $langs->trans("SubscriptionNotNeeded");
} elseif (!$adht->subscription) {
print $langs->trans("SubscriptionNotRecorded");
- if ($object->statut > 0) {
+ if (Adherent::STATUS_VALIDATED == $object->statut) {
print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
}
} else {
print $langs->trans("SubscriptionNotReceived");
- if ($object->statut > 0) {
+ if (Adherent::STATUS_VALIDATED == $object->statut) {
print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
}
}
@@ -1862,7 +1862,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($action != 'editlogin' && $action != 'editthirdparty') {
// Send
if (empty($user->socid)) {
- if ($object->statut == 1) {
+ if (Adherent::STATUS_VALIDATED == $object->statut) {
print '
'."\n";
}
}
@@ -1870,20 +1870,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Send card by email
// TODO Remove this to replace with a template
/*
- if ($user->rights->adherent->creer)
- {
- if ($object->statut >= 1)
- {
+ if ($user->rights->adherent->creer) {
+ if (Adherent::STATUS_VALIDATED == $object->statut) {
if ($object->email) print '\n";
else print '\n";
- }
- else
- {
+ } else {
print ''.$langs->trans("SendCardByMail")."
";
}
- }
- else
- {
+ } else {
print ''.$langs->trans("SendCardByMail")."
";
}*/
@@ -1895,7 +1889,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Validate
- if ($object->statut == -1) {
+ if (Adherent::STATUS_DRAFT == object->statut) {
if ($user->rights->adherent->creer) {
print ''."\n";
} else {
@@ -1904,7 +1898,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Reactivate
- if ($object->statut == 0 || $object->statut == -2) {
+ if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $Object->statut) {
if ($user->rights->adherent->creer) {
print '\n";
} else {
@@ -1913,7 +1907,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Resiliate
- if ($object->statut >= 1) {
+ if (Adherent::STATUS_VALIDATED == $object->statut) {
if ($user->rights->adherent->supprimer) {
print '\n";
} else {
@@ -1922,7 +1916,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Exclude
- if ($object->statut >= 1) {
+ if (Adherent::STATUS_VALIDATED == $object->statut) {
if ($user->rights->adherent->supprimer) {
print '\n";
} else {
@@ -1933,7 +1927,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Create third party
if (!empty($conf->societe->enabled) && !$object->socid) {
if ($user->rights->societe->creer) {
- if ($object->statut != -1) {
+ if (Adherent::STATUS_DRAFT != $object->statut) {
print ''."\n";;
} else {
print ''."\n";
@@ -1946,7 +1940,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Create user
if (!$user->socid && !$object->user_id) {
if ($user->rights->user->user->creer) {
- if ($object->statut != -1) {
+ if (Adherent::STATUS_DRAFT != $object->statut) {
print ''."\n";
} else {
print ''."\n";