37 global $db, $langs, $conf, $user;
42 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/card.php', [
'id' =>
$object->id]);
43 $head[$h][1] = $langs->trans(
"Member");
44 $head[$h][2] =
'general';
51 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/ldap.php', [
'id' =>
$object->id]);
52 $head[$h][1] = $langs->trans(
"LDAPCard");
53 $head[$h][2] =
'ldap';
57 if ($user->hasRight(
'adherent',
'cotisation',
'lire')) {
58 $nbSubscription = is_array(
$object->subscriptions) ? count(
$object->subscriptions) : 0;
59 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/subscription.php', [
'id' =>
$object->id]);
60 $head[$h][1] = $langs->trans(
"Subscriptions");
61 $head[$h][2] =
'subscription';
62 if ($nbSubscription > 0) {
63 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbSubscription.
'</span>';
69 if ($user->hasRight(
'partnership',
'read')) {
70 $nbPartnership = is_array(
$object->partnerships) ? count(
$object->partnerships) : 0;
71 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/partnership/partnership_list.php', [
'id' =>
$object->id]);
72 $head[$h][1] = $langs->trans(
"Partnerships");
74 $sql =
"SELECT COUNT(n.rowid) as nb";
75 $sql .=
" FROM ".MAIN_DB_PREFIX.
"partnership as n";
76 $sql .=
" WHERE fk_member = ".((int)
$object->id);
77 $resql = $db->query($sql);
79 $obj = $db->fetch_object($resql);
85 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
87 $head[$h][2] =
'partnerships';
88 if ($nbPartnership > 0) {
89 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbPartnership.
'</span>';
102 if (!empty(
$object->note_private)) {
105 if (!empty(
$object->note_public)) {
108 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/note.php', [
'id' =>
$object->id]);
109 $head[$h][1] = $langs->trans(
"Note");
110 $head[$h][2] =
'note';
112 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
117 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
118 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
119 $upload_dir = $conf->adherent->multidir_output[
$object->entity ?? $conf->entity].
'/'.
get_exdir(0, 0, 0, 1,
$object,
'member');
120 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
122 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/document.php', [
'id' =>
$object->id]);
123 $head[$h][1] = $langs->trans(
'Documents');
124 if (($nbFiles + $nbLinks) > 0) {
125 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
127 $head[$h][2] =
'document';
131 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/agenda.php', [
'id' =>
$object->id]);
132 $head[$h][1] = $langs->trans(
"Events");
133 if (
isModEnabled(
'agenda') && ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
136 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
137 $cachekey =
'count_events_member_'.$object->id;
139 if (!is_null($dataretrieved)) {
140 $nbEvent = $dataretrieved;
142 $sql =
"SELECT COUNT(id) as nb";
143 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm";
144 $sql .=
" WHERE elementtype = 'member' AND fk_element = ".((int)
$object->id);
145 $resql = $db->query($sql);
147 $obj = $db->fetch_object($resql);
150 dol_syslog(
'Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
156 $head[$h][1] .= $langs->trans(
"Agenda");
158 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbEvent.
'</span>';
161 $head[$h][2] =
'agenda';
179 global $langs, $conf, $user;
184 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/type.php', [
'rowid' =>
$object->id]);
185 $head[$h][1] = $langs->trans(
"MemberType");
186 $head[$h][2] =
'card';
191 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/type_translation.php', [
'rowid' =>
$object->id]);
192 $head[$h][1] = $langs->trans(
"Translation");
193 $head[$h][2] =
'translation';
199 $langs->load(
"ldap");
201 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/type_ldap.php', [
'rowid' =>
$object->id]);
202 $head[$h][1] = $langs->trans(
"LDAPCard");
203 $head[$h][2] =
'ldap';
225 global $langs, $conf, $user, $db;
228 $extrafields->fetch_name_optionals_label(
'adherent');
229 $extrafields->fetch_name_optionals_label(
'adherent_type');
234 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/admin/member.php');
235 $head[$h][1] = $langs->trans(
"Miscellaneous");
236 $head[$h][2] =
'general';
239 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/admin/member_emails.php');
240 $head[$h][1] = $langs->trans(
"EMails");
241 $head[$h][2] =
'emails';
250 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/admin/member_extrafields.php');
251 $head[$h][1] = $langs->trans(
"ExtraFieldsMember");
252 $nbExtrafields = $extrafields->attributes[
'adherent'][
'count'];
253 if ($nbExtrafields > 0) {
254 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
256 $head[$h][2] =
'attributes';
259 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/admin/member_type_extrafields.php');
260 $head[$h][1] = $langs->trans(
"ExtraFieldsMemberType");
261 $nbExtrafields = $extrafields->attributes[
'adherent_type'][
'count'];
262 if ($nbExtrafields > 0) {
263 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
265 $head[$h][2] =
'attributes_type';
268 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/admin/website.php');
269 $head[$h][1] = $langs->trans(
"BlankSubscriptionForm");
270 $head[$h][2] =
'website';
287 global $langs, $conf, $user;
292 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/stats/index.php');
293 $head[$h][1] = $langs->trans(
"Subscriptions");
294 $head[$h][2] =
'statssubscription';
297 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/stats/geo.php', [
'mode' =>
'memberbycountry']);
298 $head[$h][1] = $langs->trans(
"Country");
299 $head[$h][2] =
'statscountry';
302 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/stats/geo.php', [
'mode' =>
'memberbyregion']);
303 $head[$h][1] = $langs->trans(
"Region");
304 $head[$h][2] =
'statsregion';
307 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/stats/geo.php', [
'mode' =>
'memberbystate']);
308 $head[$h][1] = $langs->trans(
"State");
309 $head[$h][2] =
'statsstate';
312 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/stats/geo.php', [
'mode' =>
'memberbytown']);
313 $head[$h][1] = $langs->trans(
'Town');
314 $head[$h][2] =
'statstown';
317 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/stats/byproperties.php');
318 $head[$h][1] = $langs->trans(
'ByProperties');
319 $head[$h][2] =
'statsbyproperties';
341 global $db, $langs, $conf, $user;
346 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/subscription/card.php', [
'rowid' =>
$object->id]);
347 $head[$h][1] = $langs->trans(
"Subscription");
348 $head[$h][2] =
'general';
351 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT .
'/adherents/subscription/info.php', [
'rowid' =>
$object->id]);
352 $head[$h][1] = $langs->trans(
"Info");
353 $head[$h][2] =
'info';
if(! $sortfield) if(! $sortorder) $object
Class to manage members of a foundation.
Class to manage members type.
static count($dbs, $objecttype, $objectid)
Return nb of links.
Class to manage subscriptions of foundation members.
dol_dir_list($utf8_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.
dolBuildUrl($url, $params=[], $addtoken=false)
Return path of url.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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.
subscription_prepare_head(Subscription $object)
Return array head with list of tabs to view object information.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object information.
member_type_prepare_head(AdherentType $object)
Return array head with list of tabs to view object information.
member_admin_prepare_head()
Return array head with list of tabs to view object information.
member_stats_prepare_head($object)
Return array head with list of tabs to view object stats information.
dol_setcache($memoryid, $data, $expire=0, $filecache=0, $replace=0)
Save data into a memory area shared by all users, all sessions on server.
dol_getcache($memoryid, $filecache=0)
Read a memory area shared by all users, all sessions on server.