diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f71fa705c3f..999c275368d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2470,19 +2470,19 @@ class Adherent extends CommonObject } elseif ($status >= self::STATUS_VALIDATED) { if ($need_subscription === 0) { $statusType = 'status4'; - $labelStatus = $langs->trans("MemberStatusNoSubscription"); + $labelStatus = $langs->trans("Validated").' - '.$langs->trans("MemberStatusNoSubscription"); $labelStatusShort = $langs->trans("MemberStatusNoSubscriptionShort"); } elseif (!$date_end_subscription) { $statusType = 'status1'; - $labelStatus = $langs->trans("WaitingSubscription"); + $labelStatus = $langs->trans("Validated").' - '.$langs->trans("WaitingSubscription"); $labelStatusShort = $langs->trans("WaitingSubscriptionShort"); } elseif ($date_end_subscription < dol_now()) { // expired $statusType = 'status8'; - $labelStatus = $langs->trans("MemberStatusActiveLate"); + $labelStatus = $langs->trans("Validated").' - '.$langs->trans("MemberStatusActiveLate"); $labelStatusShort = $langs->trans("MemberStatusActiveLateShort"); } else { $statusType = 'status4'; - $labelStatus = $langs->trans("MemberStatusPaid"); + $labelStatus = $langs->trans("Validated").' - '.$langs->trans("MemberStatusPaid"); $labelStatusShort = $langs->trans("MemberStatusPaidShort"); } } elseif ($status == self::STATUS_RESILIATED) { diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 47bded0df29..f99b6c0aef4 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -72,12 +72,14 @@ $search_phone_perso = GETPOST("search_phone_perso", 'alpha'); $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha'); $search_type = GETPOST("search_type", 'alpha'); $search_email = GETPOST("search_email", 'alpha'); -$search_categ = GETPOSTINT("search_categ"); +$search_categ = GETPOST("search_categ", 'intcomma'); $search_morphy = GETPOST("search_morphy", 'alpha'); $search_import_key = trim(GETPOST("search_import_key", 'alpha')); -$catid = GETPOSTINT("catid"); $socid = GETPOSTINT('socid'); +if (GETPOSTINT('catid') && empty($search_categ)) { + $search_categ = GETPOSTINT('catid'); +} $search_filter = GETPOST("search_filter", 'alpha'); $search_status = GETPOST("search_status", 'intcomma'); // status @@ -400,7 +402,7 @@ $morecss = array(); // Build and execute select // -------------------------------------------------------------------- -if ((!empty($search_categ) && $search_categ > 0) || !empty($catid)) { +if (!empty($search_categ) && $search_categ > 0) { $sql = "SELECT DISTINCT"; } else { $sql = "SELECT"; @@ -443,10 +445,6 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on (s.rowid = d.fk_soc)"; $sql .= ", ".MAIN_DB_PREFIX."adherent_type as t"; $sql .= " WHERE d.fk_adherent_type = t.rowid"; -if ($catid && empty($search_categ)) { - $search_categ = $catid; -} - $searchCategoryContactList = $search_categ ? array($search_categ) : array(); $searchCategoryContactOperator = 0; // Search for tag/category ($searchCategoryContactList is an array of ID) @@ -492,6 +490,8 @@ if ($search_filter == 'waitingsubscription') { $sql .= " AND (datefin IS NULL AND t.subscription = '1')"; } if ($search_filter == 'uptodate') { + //$sql .= " AND (datefin >= '".$db->idate($now)."')"; + // Up to date subscription OR no subscription required $sql .= " AND (datefin >= '".$db->idate($now)."' OR (datefin IS NULL AND t.subscription = '0'))"; } if ($search_filter == 'outofdate') { @@ -1207,12 +1207,11 @@ while ($i < $imaxinloop) { $memberstatic->id = $obj->rowid; $memberstatic->ref = $obj->ref; - $memberstatic->civility_id = $obj->civility; + $memberstatic->civility_code = $obj->civility; $memberstatic->login = $obj->login; $memberstatic->lastname = $obj->lastname; $memberstatic->firstname = $obj->firstname; $memberstatic->gender = $obj->gender; - $memberstatic->statut = $obj->status; $memberstatic->status = $obj->status; $memberstatic->datefin = $datefin; $memberstatic->socid = $obj->fk_soc; @@ -1288,10 +1287,10 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Civility + // Title/Civility if (!empty($arrayfields['d.civility']['checked'])) { print ""; - print $obj->civility; + print dol_escape_htmltag($obj->civility); print "\n"; if (!$i) { $totalarray['nbfield']++; @@ -1364,7 +1363,7 @@ while ($i < $imaxinloop) { // Address if (!empty($arrayfields['d.address']['checked'])) { print ''; - print $obj->address; + print dol_escape_htmltag($obj->address); print ''; if (!$i) { $totalarray['nbfield']++; @@ -1373,7 +1372,7 @@ while ($i < $imaxinloop) { // Zip if (!empty($arrayfields['d.zip']['checked'])) { print ''; - print $obj->zip; + print dol_escape_htmltag($obj->zip); print ''; if (!$i) { $totalarray['nbfield']++; @@ -1382,7 +1381,7 @@ while ($i < $imaxinloop) { // Town if (!empty($arrayfields['d.town']['checked'])) { print ''; - print $obj->town; + print dol_escape_htmltag($obj->town); print ''; if (!$i) { $totalarray['nbfield']++; @@ -1390,7 +1389,9 @@ while ($i < $imaxinloop) { } // State / County / Departement if (!empty($arrayfields['state.nom']['checked'])) { - print "".$obj->state_name."\n"; + print ""; + print dol_escape_htmltag($obj->state_name); + print "\n"; if (!$i) { $totalarray['nbfield']++; } @@ -1408,7 +1409,7 @@ while ($i < $imaxinloop) { // Phone pro if (!empty($arrayfields['d.phone']['checked'])) { print ''; - print $obj->phone; + print dol_print_phone($obj->phone); print ''; if (!$i) { $totalarray['nbfield']++; @@ -1417,7 +1418,7 @@ while ($i < $imaxinloop) { // Phone perso if (!empty($arrayfields['d.phone_perso']['checked'])) { print ''; - print $obj->phone_perso; + print dol_print_phone($obj->phone_perso); print ''; if (!$i) { $totalarray['nbfield']++; @@ -1426,7 +1427,7 @@ while ($i < $imaxinloop) { // Phone mobile if (!empty($arrayfields['d.phone_mobile']['checked'])) { print ''; - print $obj->phone_mobile; + print dol_print_phone($obj->phone_mobile); print ''; if (!$i) { $totalarray['nbfield']++; @@ -1444,23 +1445,25 @@ while ($i < $imaxinloop) { // End of subscription date $datefin = $db->jdate($obj->datefin); if (!empty($arrayfields['d.datefin']['checked'])) { - print ''; + $s = ''; if ($datefin) { - print dol_print_date($datefin, 'day'); + $s .= dol_print_date($datefin, 'day'); if ($memberstatic->hasDelay()) { $textlate = ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24).' '.$langs->trans("days").')'; - print " ".img_warning($langs->trans("SubscriptionLate").$textlate); + $s .= " ".img_warning($langs->trans("SubscriptionLate").$textlate); } } else { if (!empty($obj->subscription)) { - print ''.$langs->trans("SubscriptionNotReceived").''; + $s .= ''.$langs->trans("SubscriptionNotReceived").''; if ($obj->status > 0) { - print " ".img_warning(); + $s .= " ".img_warning(); } } else { - print ' '; + $s .= ''.$langs->trans("SubscriptionNotNeeded").''; } } + print ''; + print $s; print ''; if (!$i) { $totalarray['nbfield']++;