Merge pull request #15175 from frederic34/indexmembers

display last members like on list
This commit is contained in:
Laurent Destailleur 2020-10-27 01:24:54 +01:00 committed by GitHub
commit 1940d008a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 11 deletions

View File

@ -285,6 +285,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; $sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql .= " a.gender, a.email, a.photo, a.morphy,";
$sql .= " a.tms as datem, datefin as date_end_subscription,"; $sql .= " a.tms as datem, datefin as date_end_subscription,";
$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription"; $sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
@ -307,8 +308,13 @@ if ($resql) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr class="oddeven">'; print '<tr class="oddeven">';
$staticmember->id = $obj->rowid; $staticmember->id = $obj->rowid;
$staticmember->ref = $obj->rowid;
$staticmember->lastname = $obj->lastname; $staticmember->lastname = $obj->lastname;
$staticmember->firstname = $obj->firstname; $staticmember->firstname = $obj->firstname;
$staticmember->gender = $obj->gender;
$staticmember->email = $obj->email;
$staticmember->photo = $obj->photo;
$staticmember->morphy = $obj->morphy;
if (!empty($obj->fk_soc)) { if (!empty($obj->fk_soc)) {
$staticmember->fk_soc = $obj->fk_soc; $staticmember->fk_soc = $obj->fk_soc;
$staticmember->fetch_thirdparty(); $staticmember->fetch_thirdparty();
@ -316,10 +322,9 @@ if ($resql) {
} else { } else {
$staticmember->name = $obj->company; $staticmember->name = $obj->company;
} }
$staticmember->ref = $staticmember->getFullName($langs);
$statictype->id = $obj->typeid; $statictype->id = $obj->typeid;
$statictype->label = $obj->label; $statictype->label = $obj->label;
print '<td class="nowraponall">'.$staticmember->getNomUrl(1, 32).'</td>'; print '<td class="nowraponall">'.$staticmember->getNomUrl(-1, 32).'</td>';
print '<td>'.$statictype->getNomUrl(1, 32).'</td>'; print '<td>'.$statictype->getNomUrl(1, 32).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>'; print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
print '<td class="right">'.$staticmember->LibStatut($obj->statut, ($obj->subscription == 'yes' ? 1 : 0), $db->jdate($obj->date_end_subscription), 3).'</td>'; print '<td class="right">'.$staticmember->LibStatut($obj->statut, ($obj->subscription == 'yes' ? 1 : 0), $db->jdate($obj->date_end_subscription), 3).'</td>';
@ -340,7 +345,8 @@ if ($resql) {
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; $sql = "SELECT a.rowid, a.statut, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql .= " datefin as date_end_subscription,"; $sql .= " a.gender, a.email, a.photo, a.morphy,";
$sql .= " a.datefin as date_end_subscription,";
$sql .= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.subscription"; $sql .= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.subscription";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."subscription as c";
$sql .= " WHERE a.entity IN (".getEntity('adherent').")"; $sql .= " WHERE a.entity IN (".getEntity('adherent').")";
@ -364,8 +370,13 @@ if ($resql) {
$subscriptionstatic->id = $obj->cid; $subscriptionstatic->id = $obj->cid;
$subscriptionstatic->ref = $obj->cid; $subscriptionstatic->ref = $obj->cid;
$staticmember->id = $obj->rowid; $staticmember->id = $obj->rowid;
$staticmember->ref = $obj->rowid;
$staticmember->lastname = $obj->lastname; $staticmember->lastname = $obj->lastname;
$staticmember->firstname = $obj->firstname; $staticmember->firstname = $obj->firstname;
$staticmember->gender = $obj->gender;
$staticmember->email = $obj->email;
$staticmember->photo = $obj->photo;
$staticmember->morphy = $obj->morphy;
if (!empty($obj->fk_soc)) { if (!empty($obj->fk_soc)) {
$staticmember->fk_soc = $obj->fk_soc; $staticmember->fk_soc = $obj->fk_soc;
$staticmember->fetch_thirdparty(); $staticmember->fetch_thirdparty();
@ -373,9 +384,8 @@ if ($resql) {
} else { } else {
$staticmember->name = $obj->company; $staticmember->name = $obj->company;
} }
$staticmember->ref = $staticmember->getFullName($langs);
print '<td class="nowraponall">'.$subscriptionstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall">'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td class="nowraponall">'.$staticmember->getNomUrl(1, 32, 'subscription').'</td>'; print '<td class="nowraponall">'.$staticmember->getNomUrl(-1, 32, 'subscription').'</td>';
print '<td class="nowraponall">'.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).'</td>'; print '<td class="nowraponall">'.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).'</td>';
print '<td class="right">'.price($obj->subscription).'</td>'; print '<td class="right">'.price($obj->subscription).'</td>';
//print '<td class="right">'.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>'; //print '<td class="right">'.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';

View File

@ -656,6 +656,7 @@ while ($i < min($num, $limit)) {
$memberstatic->datefin = $datefin; $memberstatic->datefin = $datefin;
$memberstatic->socid = $obj->fk_soc; $memberstatic->socid = $obj->fk_soc;
$memberstatic->photo = $obj->photo; $memberstatic->photo = $obj->photo;
$memberstatic->email = $obj->email;
$memberstatic->morphy = $obj->morphy; $memberstatic->morphy = $obj->morphy;
$memberstatic->note_public = $obj->note_public; $memberstatic->note_public = $obj->note_public;
$memberstatic->note_private = $obj->note_private; $memberstatic->note_private = $obj->note_private;
@ -725,12 +726,10 @@ while ($i < min($num, $limit)) {
if (!empty($arrayfields['d.morphy']['checked'])) { if (!empty($arrayfields['d.morphy']['checked'])) {
print '<td class="center">'; print '<td class="center">';
$s = ''; $s = '';
if ($obj->morphy == 'phy') if ($obj->morphy == 'phy') {
{
$s .= '<span class="customer-back" title="'.$langs->trans("Physical").'">'.dol_substr($langs->trans("Physical"), 0, 1).'</span>'; $s .= '<span class="customer-back" title="'.$langs->trans("Physical").'">'.dol_substr($langs->trans("Physical"), 0, 1).'</span>';
} }
if ($obj->morphy == 'mor') if ($obj->morphy == 'mor') {
{
$s .= '<span class="vendor-back" title="'.$langs->trans("Moral").'">'.dol_substr($langs->trans("Moral"), 0, 1).'</span>'; $s .= '<span class="vendor-back" title="'.$langs->trans("Moral").'">'.dol_substr($langs->trans("Moral"), 0, 1).'</span>';
} }
print $s; print $s;

View File

@ -142,6 +142,7 @@ $now = dol_now();
// List of subscriptions // List of subscriptions
$sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut,"; $sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut,";
$sql .= " d.gender, d.email, d.morphy,";
$sql .= " c.rowid as crowid, c.fk_type, c.subscription,"; $sql .= " c.rowid as crowid, c.fk_type, c.subscription,";
$sql .= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,"; $sql .= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,";
$sql .= " c.fk_bank as bank, c.note,"; $sql .= " c.fk_bank as bank, c.note,";
@ -151,8 +152,7 @@ $sql .= " JOIN ".MAIN_DB_PREFIX."subscription as c on d.rowid = c.fk_adherent";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank=b.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank=b.rowid";
$sql .= " WHERE d.entity IN (".getEntity('adherent').")"; $sql .= " WHERE d.entity IN (".getEntity('adherent').")";
if (isset($date_select) && $date_select != '') if (isset($date_select) && $date_select != '') {
{
$sql .= " AND c.dateadh >= '".((int) $date_select)."-01-01 00:00:00'"; $sql .= " AND c.dateadh >= '".((int) $date_select)."-01-01 00:00:00'";
$sql .= " AND c.dateadh < '".((int) $date_select + 1)."-01-01 00:00:00'"; $sql .= " AND c.dateadh < '".((int) $date_select + 1)."-01-01 00:00:00'";
} }
@ -403,6 +403,9 @@ while ($i < min($num, $limit)) {
$adherent->statut = $obj->statut; $adherent->statut = $obj->statut;
$adherent->login = $obj->login; $adherent->login = $obj->login;
$adherent->photo = $obj->photo; $adherent->photo = $obj->photo;
$adherent->gender = $obj->gender;
$adherent->morphy = $obj->morphy;
$adherent->email = $obj->email;
$adherent->typeid = $obj->type; $adherent->typeid = $obj->type;
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid); $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);