This commit is contained in:
Frédéric FRANCE 2021-01-02 21:50:58 +01:00
parent 8f3e6df3e1
commit bd762bc58f
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
4 changed files with 27 additions and 15 deletions

View File

@ -310,9 +310,10 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
/*
* Latest modified members
*/
/*
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$sql = "SELECT a.rowid, a.statut as status, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql = "SELECT a.rowid, a.ref, a.statut as status, 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, a.datefin as date_end_subscription,";
$sql .= " ta.rowid as typeid, ta.libelle as label, ta.subscription as need_subscription";
@ -336,7 +337,7 @@ if ($resql) {
$obj = $db->fetch_object($resql);
$staticmember->id = $obj->rowid;
$staticmember->ref = $obj->rowid;
$staticmember->ref = $obj->ref;
$staticmember->lastname = $obj->lastname;
$staticmember->firstname = $obj->firstname;
$staticmember->gender = $obj->gender;
@ -372,7 +373,7 @@ if ($resql) {
} else {
dol_print_error($db);
}
*/
/*
* Last modified subscriptions

View File

@ -84,15 +84,17 @@ class box_last_modified_members extends ModeleBoxes
$this->max = $max;
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$memberstatic = new Adherent($this->db);
$statictype = new AdherentType($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedMembers", $max));
if ($user->rights->adherent->lire) {
$sql = "SELECT a.rowid, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql = "SELECT a.rowid, a.ref, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql .= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
$sql .= ' a.photo, a.email, a.gender, a.morphy,';
$sql .= " t.subscription";
$sql .= " t.rowid as typeid, t.subscription, t.libelle as label";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t";
$sql .= " WHERE a.entity IN (".getEntity('member').")";
$sql .= " AND a.fk_adherent_type = t.rowid";
@ -112,14 +114,15 @@ class box_last_modified_members extends ModeleBoxes
$memberstatic->lastname = $objp->lastname;
$memberstatic->firstname = $objp->firstname;
$memberstatic->id = $objp->rowid;
$memberstatic->ref = $objp->rowid;
$memberstatic->ref = $objp->ref;
$memberstatic->photo = $objp->photo;
$memberstatic->gender = $objp->gender;
$memberstatic->email = $objp->email;
$memberstatic->morphy = $objp->morphy;
$memberstatic->company = $objp->company;
$memberstatic->statut = $objp->status;
$memberstatic->need_subscription = $objp->subscription;
$memberstatic->datefin = $this->db->jdate($objp->date_end_subscription);
if (!empty($objp->fk_soc)) {
$memberstatic->socid = $objp->fk_soc;
$memberstatic->fetch_thirdparty();
@ -127,6 +130,9 @@ class box_last_modified_members extends ModeleBoxes
} else {
$memberstatic->name = $objp->company;
}
$statictype->id = $objp->typeid;
$statictype->label = $objp->label;
$statictype->subscription = $objp->subscription;
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
@ -136,8 +142,8 @@ class box_last_modified_members extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $memberstatic->company,
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid,
'text' => $statictype->getNomUrl(1, 32),
'asis' => 1,
);
$this->info_box_contents[$line][] = array(

View File

@ -63,7 +63,9 @@ class box_members extends ModeleBoxes
// disable module for such cases
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
if (!in_array('adherent', $listofmodulesforexternal) && !empty($user->socid)) $this->enabled = 0; // disabled for external users
if (!in_array('adherent', $listofmodulesforexternal) && !empty($user->socid)) {
$this->enabled = 0; // disabled for external users
}
$this->hidden = !($user->rights->adherent->lire);
}
@ -90,7 +92,7 @@ class box_members extends ModeleBoxes
$sql = "SELECT a.rowid, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql .= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
$sql .= ' a.photo, a.email, a.gender, a.morphy,';
$sql .= " t.subscription";
$sql .= " t.subscription, t.libelle as label";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t";
$sql .= " WHERE a.entity IN (".getEntity('member').")";
$sql .= " AND a.fk_adherent_type = t.rowid";
@ -117,7 +119,8 @@ class box_members extends ModeleBoxes
$memberstatic->morphy = $objp->morphy;
$memberstatic->company = $objp->company;
$memberstatic->statut = $objp->status;
$memberstatic->need_subscription = $objp->subscription;
$memberstatic->datefin = $this->db->jdate($objp->date_end_subscription);
if (!empty($objp->fk_soc)) {
$memberstatic->socid = $objp->fk_soc;
$memberstatic->fetch_thirdparty();
@ -151,11 +154,12 @@ class box_members extends ModeleBoxes
$line++;
}
if ($num == 0)
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text'=>$langs->trans("NoRecordedCustomers"),
);
}
$this->db->free($result);
} else {

View File

@ -17,6 +17,7 @@ BoxLastActions=Latest actions
BoxLastContracts=Latest contracts
BoxLastContacts=Latest contacts/addresses
BoxLastMembers=Latest members
BoxLastModifiedMembers=Latest modified members
BoxFicheInter=Latest interventions
BoxCurrentAccounts=Open accounts balance
BoxTitleMemberNextBirthdays=Birthdays of this month (members)
@ -86,8 +87,8 @@ BoxTitleLatestModifiedSupplierOrders=Vendor Orders: last %s modified
BoxTitleLastModifiedCustomerBills=Customer Invoices: last %s modified
BoxTitleLastModifiedCustomerOrders=Sales Orders: last %s modified
BoxTitleLastModifiedPropals=Latest %s modified proposals
BoxTitleLatestModifiedJobPositions=Latest %s modified jobs
BoxTitleLatestModifiedCandidatures=Latest %s modified candidatures
BoxTitleLatestModifiedJobPositions=Latest %s modified jobs
BoxTitleLatestModifiedCandidatures=Latest %s modified candidatures
ForCustomersInvoices=Customers invoices
ForCustomersOrders=Customers orders
ForProposals=Proposals