This commit is contained in:
Frédéric FRANCE 2021-01-02 22:12:19 +01:00
parent bd762bc58f
commit dc6c1b8d3b
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
3 changed files with 16 additions and 10 deletions

View File

@ -89,7 +89,7 @@ class box_members extends ModeleBoxes
$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, t.libelle as label";
@ -112,7 +112,7 @@ class box_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;

View File

@ -1157,16 +1157,19 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$note = isset($this->boxes[$key]['note']) ? $this->boxes[$key]['note'] : '';
$enabledbydefaulton = isset($this->boxes[$key]['enabledbydefaulton']) ? $this->boxes[$key]['enabledbydefaulton'] : 'Home';
if (empty($file)) { $file = isset($this->boxes[$key][1]) ? $this->boxes[$key][1] : ''; // For backward compatibility
if (empty($file)) {
$file = isset($this->boxes[$key][1]) ? $this->boxes[$key][1] : ''; // For backward compatibility
}
if (empty($note)) { $note = isset($this->boxes[$key][2]) ? $this->boxes[$key][2] : ''; // For backward compatibility
if (empty($note)) {
$note = isset($this->boxes[$key][2]) ? $this->boxes[$key][2] : ''; // For backward compatibility
}
// Search if boxes def already present
$sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."boxes_def";
$sql .= " WHERE file = '".$this->db->escape($file)."'";
$sql .= " AND entity = ".$conf->entity;
if ($note) { $sql .= " AND note ='".$this->db->escape($note)."'";
if ($note) {
$sql .= " AND note ='".$this->db->escape($note)."'";
}
$result = $this->db->query($sql);
@ -1192,8 +1195,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
foreach ($pos_name as $key2 => $val2)
{
//print 'key2='.$key2.'-val2='.$val2."<br>\n";
if ($enabledbydefaulton && $val2 != $enabledbydefaulton) { continue; // Not enabled by default onto this page.
//print 'key2='.$key2.'-val2='.$val2."<br>\n";
if ($enabledbydefaulton && $val2 != $enabledbydefaulton) {
continue; // Not enabled by default onto this page.
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id,position,box_order,fk_user,entity)";
@ -1201,7 +1205,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
dol_syslog(get_class($this)."::insert_boxes onto page ".$key2."=".$val2."", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) { $err++;
if (!$resql) {
$err++;
}
}
}
@ -1209,8 +1214,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
if (!$err) {
$this->db->commit();
} else {
$this->error = $this->db->lasterror();
$this->db->rollback();
$this->error = $this->db->lasterror();
$this->db->rollback();
}
}
// else box already registered into database

View File

@ -195,6 +195,7 @@ class modAdherent extends DolibarrModules
0=>array('file'=>'box_members.php', 'enabledbydefaulton'=>'Home'),
2=>array('file'=>'box_birthdays_members.php', 'enabledbydefaulton'=>'Home'),
3=>array('file'=>'box_last_modified_members', 'enabledbydefaulton'=>'membersindex'),
4=>array('file'=>'box_last_members_subscriptions', 'enabledbydefaulton'=>'membersindex'),
);
// Permissions