35 global $db, $langs, $conf, $user;
40 $head[$h][0] = DOL_URL_ROOT.
'/adherents/card.php?rowid='.$object->id;
41 $head[$h][1] = $langs->trans(
"Member");
42 $head[$h][2] =
'general';
49 $head[$h][0] = DOL_URL_ROOT.
'/adherents/ldap.php?id='.$object->id;
50 $head[$h][1] = $langs->trans(
"LDAPCard");
51 $head[$h][2] =
'ldap';
55 if ($user->hasRight(
'adherent',
'cotisation',
'lire')) {
56 $nbSubscription = is_array($object->subscriptions) ? count($object->subscriptions) : 0;
57 $head[$h][0] = DOL_URL_ROOT.
'/adherents/subscription.php?rowid='.$object->id;
58 $head[$h][1] = $langs->trans(
"Subscriptions");
59 $head[$h][2] =
'subscription';
60 if ($nbSubscription > 0) {
61 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbSubscription.
'</span>';
67 if ($user->hasRight(
'partnership',
'read')) {
68 $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
69 $head[$h][0] = DOL_URL_ROOT.
'/partnership/partnership_list.php?rowid='.$object->id;
70 $head[$h][1] = $langs->trans(
"Partnerships");
72 $sql =
"SELECT COUNT(n.rowid) as nb";
73 $sql .=
" FROM ".MAIN_DB_PREFIX.
"partnership as n";
74 $sql .=
" WHERE fk_member = ".((int) $object->id);
75 $resql = $db->query($sql);
77 $obj = $db->fetch_object($resql);
83 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
85 $head[$h][2] =
'partnerships';
86 if ($nbPartnership > 0) {
87 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbPartnership.
'</span>';
100 if (!empty($object->note_private)) {
103 if (!empty($object->note_public)) {
106 $head[$h][0] = DOL_URL_ROOT.
'/adherents/note.php?id='.$object->id;
107 $head[$h][1] = $langs->trans(
"Note");
108 $head[$h][2] =
'note';
110 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
115 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
116 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
117 $upload_dir = $conf->adherent->multidir_output[$object->entity].
'/'.
get_exdir(0, 0, 0, 1, $object,
'member');
118 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
119 $nbLinks =
Link::count($db, $object->element, $object->id);
120 $head[$h][0] = DOL_URL_ROOT.
'/adherents/document.php?id='.$object->id;
121 $head[$h][1] = $langs->trans(
'Documents');
122 if (($nbFiles + $nbLinks) > 0) {
123 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
125 $head[$h][2] =
'document';
129 $head[$h][0] = DOL_URL_ROOT.
'/adherents/agenda.php?id='.$object->id;
130 $head[$h][1] = $langs->trans(
"Events");
131 if (isModEnabled(
'agenda')&& ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
134 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
135 $cachekey =
'count_events_member_'.$object->id;
137 if (!is_null($dataretrieved)) {
138 $nbEvent = $dataretrieved;
140 $sql =
"SELECT COUNT(id) as nb";
141 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm";
142 $sql .=
" WHERE elementtype = 'member' AND fk_element = ".((int) $object->id);
143 $resql = $db->query($sql);
145 $obj = $db->fetch_object($resql);
148 dol_syslog(
'Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
154 $head[$h][1] .= $langs->trans(
"Agenda");
156 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbEvent.
'</span>';
159 $head[$h][2] =
'agenda';
177 global $langs, $conf, $user;
182 $head[$h][0] = DOL_URL_ROOT.
'/adherents/type.php?rowid='.$object->id;
183 $head[$h][1] = $langs->trans(
"MemberType");
184 $head[$h][2] =
'card';
189 $head[$h][0] = DOL_URL_ROOT.
"/adherents/type_translation.php?rowid=".$object->id;
190 $head[$h][1] = $langs->trans(
"Translation");
191 $head[$h][2] =
'translation';
197 $langs->load(
"ldap");
199 $head[$h][0] = DOL_URL_ROOT.
'/adherents/type_ldap.php?rowid='.$object->id;
200 $head[$h][1] = $langs->trans(
"LDAPCard");
201 $head[$h][2] =
'ldap';
223 global $langs, $conf, $user, $db;
226 $extrafields->fetch_name_optionals_label(
'adherent');
227 $extrafields->fetch_name_optionals_label(
'adherent_type');
232 $head[$h][0] = DOL_URL_ROOT.
'/adherents/admin/member.php';
233 $head[$h][1] = $langs->trans(
"Miscellaneous");
234 $head[$h][2] =
'general';
237 $head[$h][0] = DOL_URL_ROOT.
'/adherents/admin/member_emails.php';
238 $head[$h][1] = $langs->trans(
"EMails");
239 $head[$h][2] =
'emails';
248 $head[$h][0] = DOL_URL_ROOT.
'/adherents/admin/member_extrafields.php';
249 $head[$h][1] = $langs->trans(
"ExtraFieldsMember");
250 $nbExtrafields = $extrafields->attributes[
'adherent'][
'count'];
251 if ($nbExtrafields > 0) {
252 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
254 $head[$h][2] =
'attributes';
257 $head[$h][0] = DOL_URL_ROOT.
'/adherents/admin/member_type_extrafields.php';
258 $head[$h][1] = $langs->trans(
"ExtraFieldsMemberType");
259 $nbExtrafields = $extrafields->attributes[
'adherent_type'][
'count'];
260 if ($nbExtrafields > 0) {
261 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
263 $head[$h][2] =
'attributes_type';
266 $head[$h][0] = DOL_URL_ROOT.
'/adherents/admin/website.php';
267 $head[$h][1] = $langs->trans(
"BlankSubscriptionForm");
268 $head[$h][2] =
'website';
285 global $langs, $conf, $user;
290 $head[$h][0] = DOL_URL_ROOT.
'/adherents/stats/index.php';
291 $head[$h][1] = $langs->trans(
"Subscriptions");
292 $head[$h][2] =
'statssubscription';
295 $head[$h][0] = DOL_URL_ROOT.
'/adherents/stats/geo.php?mode=memberbycountry';
296 $head[$h][1] = $langs->trans(
"Country");
297 $head[$h][2] =
'statscountry';
300 $head[$h][0] = DOL_URL_ROOT.
'/adherents/stats/geo.php?mode=memberbyregion';
301 $head[$h][1] = $langs->trans(
"Region");
302 $head[$h][2] =
'statsregion';
305 $head[$h][0] = DOL_URL_ROOT.
'/adherents/stats/geo.php?mode=memberbystate';
306 $head[$h][1] = $langs->trans(
"State");
307 $head[$h][2] =
'statsstate';
310 $head[$h][0] = DOL_URL_ROOT.
'/adherents/stats/geo.php?mode=memberbytown';
311 $head[$h][1] = $langs->trans(
'Town');
312 $head[$h][2] =
'statstown';
315 $head[$h][0] = DOL_URL_ROOT.
'/adherents/stats/byproperties.php';
316 $head[$h][1] = $langs->trans(
'ByProperties');
317 $head[$h][2] =
'statsbyproperties';
339 global $db, $langs, $conf, $user;
344 $head[$h][0] = DOL_URL_ROOT.
'/adherents/subscription/card.php?rowid='.$object->id;
345 $head[$h][1] = $langs->trans(
"Subscription");
346 $head[$h][2] =
'general';
349 $head[$h][0] = DOL_URL_ROOT.
'/adherents/subscription/info.php?rowid='.$object->id;
350 $head[$h][1] = $langs->trans(
"Info");
351 $head[$h][2] =
'info';
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.