72 global $user, $langs,
$conf;
73 $langs->load(
"boxes");
77 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
78 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
79 $memberstatic =
new Adherent($this->db);
82 $this->info_box_head = array(
'text' => $langs->trans(
"BoxTitleLastModifiedMembers", $max));
84 if ($user->hasRight(
'adherent',
'lire')) {
85 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherentstats.class.php';
86 $stats =
new AdherentStats($this->db, $user->socid, $user->id);
88 $listOfMembers = $stats->getLastModifiedMembers($max);
90 $num = count($listOfMembers);
91 foreach ($listOfMembers as $data) {
92 $memberstatic->lastname = $data[
'lastname'];
93 $memberstatic->firstname = $data[
'firstname'];
94 $memberstatic->id = $data[
'id'];
95 $memberstatic->ref = $data[
'ref'];
96 $memberstatic->photo = $data[
'photo'];
97 $memberstatic->gender = $data[
'gender'];
98 $memberstatic->email = $data[
'email'];
99 $memberstatic->morphy = $data[
'morphy'];
100 $memberstatic->company = $data[
'company'];
101 $memberstatic->status = $data[
'status'];
102 $memberstatic->date_creation = $data[
'datec'];
103 $memberstatic->date_modification = $data[
'datem'];
104 $memberstatic->need_subscription = (int) $data[
'need_subscription'];
105 $memberstatic->datefin = $data[
'date_end_subscription'];
106 if (!empty($data[
'fk_soc'])) {
107 $memberstatic->socid = $data[
'fk_soc'];
108 $memberstatic->fetch_thirdparty();
109 $memberstatic->name = $memberstatic->thirdparty->name;
111 $memberstatic->name = $data[
'company'];
113 $statictype->id = $data[
'typeid'];
114 $statictype->label = $data[
'label'];
115 $statictype->subscription = $data[
'subscription'];
117 $this->info_box_contents[$line][] = array(
118 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
119 'text' => $memberstatic->getNomUrl(-1),
123 $this->info_box_contents[$line][] = array(
124 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
125 'text' => $memberstatic->company,
128 $this->info_box_contents[$line][] = array(
129 'td' =>
'class="tdoverflowmax150 maxwidth150onsmartphone"',
130 'text' => $statictype->getNomUrl(1, 32),
134 $this->info_box_contents[$line][] = array(
135 'td' =>
'class="center nowraponall" title="'.
dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($data[
'datem'],
'dayhour',
'tzuserrel')).
'"',
139 $this->info_box_contents[$line][] = array(
140 'td' =>
'class="right" width="18"',
141 'text' => $memberstatic->LibStatut($data[
'status'], $data[
'need_subscription'], $data[
'date_end_subscription'], 3),
147 $this->info_box_contents[$line][0] = array(
148 'td' =>
'class="center"',
149 'text' => $langs->trans(
"NoRecordedCustomers"),
153 $this->info_box_contents[0][0] = array(
154 'td' =>
'class="nohover left"',
155 'text' =>
'<span class="opacitymedium">'.$langs->trans(
"ReadPermissionNotAllowed").
'</span>'