diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 749eacbbe10..7a4a7d5bc1f 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -473,28 +473,28 @@ llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adh&eacu
$titre = $langs->trans("MembersList");
if (GETPOSTISSET("search_status")) {
- if ($search_status == '-1,1') {
+ if ($search_status == '-1,1') { // TODO : check this test as -1 == Adherent::STATUS_DRAFT and -2 == Adherent::STATUS_EXLCUDED
$titre = $langs->trans("MembersListQualified");
}
- if ($search_status == '-1') {
+ if ($search_status == Adherent::STATUS_DRAFT) {
$titre = $langs->trans("MembersListToValid");
}
- if ($search_status == '1' && $filter == '') {
+ if ($search_status == Adherent::STATUS_VALIDATED && $filter == '') {
$titre = $langs->trans("MembersValidated");
}
- if ($search_status == '1' && $filter == 'withoutsubscription') {
+ if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'withoutsubscription') {
$titre = $langs->trans("MembersWithSubscriptionToReceive");
}
- if ($search_status == '1' && $filter == 'uptodate') {
+ if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'uptodate') {
$titre = $langs->trans("MembersListUpToDate");
}
- if ($search_status == '1' && $filter == 'outofdate') {
+ if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') {
$titre = $langs->trans("MembersListNotUpToDate");
}
- if ($search_status == '0') {
+ if ($search_status == Adherent::STATUS_RESILIATED) {
$titre = $langs->trans("MembersListResiliated");
}
- if ($search_status == '-2') {
+ if ($search_status == Adherent::STATUS_EXCLUDED) {
$titre = $langs->trans("MembersListExcluded");
}
} elseif ($action == 'search') {
@@ -571,7 +571,7 @@ if ($search_phone_mobile != '') {
if ($search_filter && $search_filter != '-1') {
$param .= "&search_filter=".urlencode($search_filter);
}
-if ($search_status != "" && $search_status != '-1') {
+if ($search_status != "" && $search_status != Adherent::STATUS_DRAFT) {
$param .= "&search_status=".urlencode($search_status);
}
if ($search_type > 0) {
@@ -796,10 +796,10 @@ if (!empty($arrayfields['d.tms']['checked'])) {
if (!empty($arrayfields['d.statut']['checked'])) {
print '
';
$liststatus = array(
- '-1'=>$langs->trans("Draft"),
- '1'=>$langs->trans("Validated"),
- '0'=>$langs->trans("MemberStatusResiliatedShort"),
- '-2'=>$langs->trans("MemberStatusExcludedShort")
+ Adherent::STATUS_DRAFT => $langs->trans("Draft"),
+ Adherent::STATUS_VALIDATED => $langs->trans("Validated"),
+ Adherent::STATUS_RESILIATED => $langs->trans("MemberStatusResiliatedShort"),
+ Adherent::STATUS_EXCLUDED =>$langs->trans("MemberStatusExcludedShort")
);
print $form->selectarray('search_status', $liststatus, $search_status, -3);
print ' | ';
diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php
index f934ebcf0af..63deec867ef 100644
--- a/htdocs/adherents/stats/byproperties.php
+++ b/htdocs/adherents/stats/byproperties.php
@@ -29,7 +29,7 @@ $graphwidth = 700;
$mapratio = 0.5;
$graphheight = round($graphwidth * $mapratio);
-$mode = GETPOST('mode') ?GETPOST('mode') : '';
+$mode = GETPOST('mode') ? GETPOST('mode') : '';
// Security check
@@ -69,7 +69,7 @@ $sql .= " d.morphy as code";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
-$sql .= " AND d.statut <> -1"; // Not draft
+$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
$sql .= " GROUP BY d.morphy";
$foundphy = $foundmor = 0;
@@ -104,7 +104,7 @@ $sql .= " d.morphy as code";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
-$sql .= " AND d.statut >= 1"; // Active (not draft=-1, not resiliated=0)
+$sql .= " AND d.statut >= 1"; // Active (not excluded=-2, not draft=-1, not resiliated=0)
$sql .= " GROUP BY d.morphy";
$foundphy = $foundmor = 0;
diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php
index e4a7816c002..16dfc3ccff6 100644
--- a/htdocs/adherents/stats/geo.php
+++ b/htdocs/adherents/stats/geo.php
@@ -92,7 +92,7 @@ if ($mode) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
- $sql .= " AND d.statut <> -1";
+ $sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
$sql .= " GROUP BY c.label, c.code";
//print $sql;
}
@@ -110,7 +110,7 @@ if ($mode) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
- $sql .= " AND d.statut != -1";
+ $sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
$sql .= " GROUP BY co.label, co.code, c.nom";
//print $sql;
}
@@ -127,7 +127,7 @@ if ($mode) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
- $sql .= " AND d.statut != -1";
+ $sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
$sql .= " GROUP BY co.label, co.code, r.nom"; //+
//print $sql;
}
@@ -142,7 +142,7 @@ if ($mode) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
- $sql .= " AND d.statut != -1";
+ $sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
$sql .= " GROUP BY c.label, c.code, d.town";
//print $sql;
}