dolibarr 25.0.0-alpha
modAdherent.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003,2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
4 * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
5 * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
6 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
7 * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
8 * Copyright (C) 2014-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
9 * Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
10 * Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
11 * Copyright (C) 2026 MDW <mdeweerd@users.noreply.github.com>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 */
26
34include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
35
40{
46 public function __construct($db)
47 {
48 global $conf;
49
50 $this->db = $db;
51 $this->numero = 310;
52
53 $this->family = "hr";
54 $this->module_position = '06';
55 // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
56 $this->name = preg_replace('/^mod/i', '', get_class($this));
57 $this->description = "Management of members of a foundation or association";
58 // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
59 $this->version = 'dolibarr';
60 $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
61 $this->picto = 'member';
62
63 // Data directories to create when module is enabled
64 $this->dirs = array(
65 "/adherent/temp",
66 "/doctemplates/members",
67 );
68
69 // Config pages
70 $this->config_page_url = array("member.php@adherents");
71
72 // Dependencies
73 $this->hidden = false; // A condition to hide module
74 $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
75 $this->requiredby = array(); // List of module ids to disable if this one is disabled
76 $this->conflictwith = array('modMailmanSpip'); // List of module class names as string this module is in conflict with
77 $this->langfiles = array("members", "companies");
78 $this->phpmin = array(7, 0); // Minimum version of PHP required by module
79
80 // Constants
81 $this->const = [
82 [
83 "ADHERENT_ADDON_PDF",
84 "chaine",
85 "standard",
86 'Name of PDF model of member',
87 0
88 ],
89 // For emails
90 [
91 "ADHERENT_MAIL_FROM",
92 "chaine",
93 "",
94 "From des mails",
95 0,
96 ],
97 [
98 "ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER",
99 "emailtemplate:member",
100 "(SendingEmailOnAutoSubscription)",
101 "",
102 0,
103 ],
104 [
105 "ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION",
106 "emailtemplate:member",
107 "(SendingEmailOnNewSubscription)",
108 "",
109 0,
110 ],
111 [
112 "ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION",
113 "emailtemplate:member",
114 "(SendingReminderForExpiredSubscription)",
115 "",
116 0,
117 ],
118 [
119 "ADHERENT_EMAIL_TEMPLATE_CANCELATION",
120 "emailtemplate:member",
121 "(SendingEmailOnCancelation)",
122 "",
123 0,
124 ],
125 // For cards
126 [
127 "ADHERENT_CARD_HEADER_TEXT",
128 "chaine",
129 "__YEAR__",
130 "Texte imprimé sur le haut de la carte adhérent",
131 0,
132 ],
133 [
134 "ADHERENT_CARD_FOOTER_TEXT",
135 "chaine",
136 "__COMPANY__",
137 "Texte imprimé sur le bas de la carte adhérent",
138 0,
139 ],
140 [
141 "ADHERENT_CARD_TEXT",
142 "texte",
143 "__FULLNAME__\r\nID: __ID__\r\n__EMAIL__\r\n__ADDRESS__\r\n__ZIP__ __TOWN__\r\n__COUNTRY__",
144 "Text to print on member cards",
145 0,
146 ],
147 [
148 "ADHERENT_MAILMAN_ADMIN_PASSWORD",
149 "chaine",
150 "",
151 "Password admin mailman lists",
152 0,
153 ],
154 [
155 "ADHERENT_ETIQUETTE_TYPE",
156 "chaine",
157 "L7163",
158 "Type of address sheets",
159 0,
160 ],
161 [
162 "ADHERENT_ETIQUETTE_TEXT",
163 "texte",
164 "__FULLNAME__\n__ADDRESS__\n__ZIP__ __TOWN__\n__COUNTRY__",
165 "Text to print on member address sheets",
166 0,
167 ],
168 // For subscriptions
169 [
170 "ADHERENT_BANK_ACCOUNT",
171 "chaine",
172 "",
173 "ID of bank account to use",
174 0,
175 ],
176 [
177 "ADHERENT_BANK_CATEGORIE",
178 "chaine",
179 "",
180 "ID of bank transaction category to use",
181 0,
182 ],
183 [
184 "MEMBER_ADDON_PDF_ODT_PATH",
185 "chaine",
186 "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/members",
187 "",
188 0,
189 ],
190 ];
191
192 // Boxes
193 //-------
194 $this->boxes = array(
195 0 => array('file' => 'box_members.php', 'enabledbydefaulton' => 'Home'),
196 2 => array('file' => 'box_birthdays_members.php', 'enabledbydefaulton' => 'Home'),
197 3 => array('file' => 'box_members_last_modified.php', 'enabledbydefaulton' => 'membersindex'),
198 4 => array('file' => 'box_members_last_subscriptions.php', 'enabledbydefaulton' => 'membersindex'),
199 5 => array('file' => 'box_members_subscriptions_by_year.php', 'enabledbydefaulton' => 'membersindex'),
200 6 => array('file' => 'box_members_by_type.php', 'enabledbydefaulton' => 'membersindex'),
201 7 => array('file' => 'box_members_by_tags.php', 'enabledbydefaulton' => 'membersindex'),
202 );
203
204 // Permissions
205 //------------
206 $this->rights = array();
207 $this->rights_class = 'adherent';
208 $r = 0;
209
210 // $this->rights[$r][0] Id permission (unique tous modules confondus)
211 // $this->rights[$r][1] Default label if translation of key “PermissionXXX” not found (XXX = Permission ID)
212 // $this->rights[$r][2] Not used
213 // $this->rights[$r][3] 1=Allowed by default, 0=Not allowed by default
214 // $this->rights[$r][4] Level 1 for naming permission in code
215 // $this->rights[$r][5] Level 2 to name permission in code
216
217 $r++;
218 $this->rights[$r][0] = 71;
219 $this->rights[$r][1] = 'Read members\' card';
220 $this->rights[$r][2] = 'r';
221 $this->rights[$r][3] = 0;
222 $this->rights[$r][4] = 'lire';
223
224 $r++;
225 $this->rights[$r][0] = 72;
226 $this->rights[$r][1] = 'Create/modify members (need also user module permissions if member linked to a user)';
227 $this->rights[$r][2] = 'w';
228 $this->rights[$r][3] = 0;
229 $this->rights[$r][4] = 'creer';
230
231 $r++;
232 $this->rights[$r][0] = 74;
233 $this->rights[$r][1] = 'Remove members';
234 $this->rights[$r][2] = 'd';
235 $this->rights[$r][3] = 0;
236 $this->rights[$r][4] = 'supprimer';
237
238 $r++;
239 $this->rights[$r][0] = 76;
240 $this->rights[$r][1] = 'Export members';
241 $this->rights[$r][2] = 'r';
242 $this->rights[$r][3] = 0;
243 $this->rights[$r][4] = 'export';
244
245 $r++;
246 $this->rights[$r][0] = 75;
247 $this->rights[$r][1] = 'Setup types of membership';
248 $this->rights[$r][2] = 'w';
249 $this->rights[$r][3] = 0;
250 $this->rights[$r][4] = 'configurer';
251
252 $r++;
253 $this->rights[$r][0] = 78;
254 $this->rights[$r][1] = 'Read membership fees';
255 $this->rights[$r][2] = 'r';
256 $this->rights[$r][3] = 0;
257 $this->rights[$r][4] = 'cotisation';
258 $this->rights[$r][5] = 'lire';
259
260 $r++;
261 $this->rights[$r][0] = 79;
262 $this->rights[$r][1] = 'Create/modify/remove membership fees';
263 $this->rights[$r][2] = 'w';
264 $this->rights[$r][3] = 0;
265 $this->rights[$r][4] = 'cotisation';
266 $this->rights[$r][5] = 'creer';
267
268
269 // Menus
270 //-------
271 $this->menu = 1; // This module add menu entries. They are coded into menu manager.
272
273
274 // Exports
275 //--------
276 $r = 0;
277
278 // $this->export_code[$r] Unique code identifying the export (all modules combined)
279 // $this->export_label[$r] Libelle by default if translation of key "ExportXXX" not found (XXX = Code)
280 // $this->export_permission[$r] List of permission codes required to export
281 // $this->export_fields_sql[$r] List of exportable fields in SQL codiffication
282 // $this->export_fields_name[$r] List of exportable fields in translation codiffication
283 // $this->export_sql[$r] SQL query that offers data for export
284
285 $r++;
286 $this->export_code[$r] = $this->rights_class.'_'.$r;
287 $this->export_label[$r] = 'MembersAndSubscriptions';
288 $this->export_permission[$r] = array(array("adherent", "export"));
289 $this->export_fields_array[$r] = array(
290 'a.rowid' => 'MemberId', 'a.ref' => 'MemberRef', 'a.civility' => "UserTitle", 'a.lastname' => "Lastname", 'a.firstname' => "Firstname", 'a.login' => "Login", 'a.gender' => "Gender", 'a.morphy' => 'MemberNature',
291 'a.societe' => 'Company', 'a.address' => "Address", 'a.zip' => "Zip", 'a.town' => "Town", 'd.code_departement' => 'StateCode', 'd.nom' => "State", 'co.code' => "CountryCode", 'co.label' => "Country",
292 'a.phone' => "PhonePro", 'a.phone_perso' => "PhonePerso", 'a.phone_mobile' => "PhoneMobile", 'a.email' => "Email", 'a.birth' => "Birthday", 'a.statut' => "Status",
293 'a.photo' => "Photo", 'a.note_public' => "NotePublic", 'a.note_private' => "NotePrivate", 'a.datec' => 'DateCreation', 'a.datevalid' => 'DateValidation',
294 'a.tms' => 'DateLastModification', 'a.datefin' => 'DateEndSubscription', 'ta.rowid' => 'MemberTypeId', 'ta.libelle' => 'MemberTypeLabel',
295 'c.rowid' => 'SubscriptionId', 'c.dateadh' => 'DateSubscription', 'c.datef' => 'DateEndSubscription', 'c.subscription' => 'Amount'
296 );
297 $this->export_TypeFields_array[$r] = array(
298 'a.civility' => "Text", 'a.lastname' => "Text", 'a.firstname' => "Text", 'a.login' => "Text", 'a.gender' => 'Text', 'a.morphy' => 'Text', 'a.societe' => 'Text', 'a.address' => "Text",
299 'a.zip' => "Text", 'a.town' => "Text", 'd.nom' => "Text", 'co.code' => 'Text', 'co.label' => "Text", 'a.phone' => "Text", 'a.phone_perso' => "Text", 'a.phone_mobile' => "Text",
300 'a.email' => "Text", 'a.birth' => "Date", 'a.statut' => "Status", 'a.note_public' => "Text", 'a.note_private' => "Text", 'a.datec' => 'Date', 'a.datevalid' => 'Date',
301 'a.tms' => 'Date', 'a.datefin' => 'Date', 'ta.rowid' => 'List:adherent_type:libelle::member_type', 'ta.libelle' => 'Text',
302 'c.rowid' => 'Numeric', 'c.dateadh' => 'Date', 'c.datef' => 'Date', 'c.subscription' => 'Numeric'
303 );
304 $this->export_entities_array[$r] = array(
305 'a.rowid' => 'member', 'a.ref' => 'member', 'a.civility' => "member", 'a.lastname' => "member", 'a.firstname' => "member", 'a.login' => "member", 'a.gender' => 'member', 'a.morphy' => 'member',
306 'a.societe' => 'member', 'a.address' => "member", 'a.zip' => "member", 'a.town' => "member", 'd.nom' => "member", 'co.code' => "member", 'co.label' => "member",
307 'a.phone' => "member", 'a.phone_perso' => "member", 'a.phone_mobile' => "member", 'a.email' => "member", 'a.birth' => "member", 'a.statut' => "member",
308 'a.photo' => "member", 'a.note_public' => "member", 'a.note_private' => "member", 'a.datec' => 'member', 'a.datevalid' => 'member', 'a.tms' => 'member',
309 'a.datefin' => 'member', 'ta.rowid' => 'member_type', 'ta.libelle' => 'member_type',
310 'c.rowid' => 'subscription', 'c.dateadh' => 'subscription', 'c.datef' => 'subscription', 'c.subscription' => 'subscription'
311 );
312 // Add extra fields
313 $keyforselect = 'adherent';
314 $keyforelement = 'member';
315 $keyforaliasextra = 'extra';
316 include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
317 // End add axtra fields
318 $this->export_sql_start[$r] = 'SELECT DISTINCT ';
319 $this->export_sql_end[$r] = ' FROM ('.MAIN_DB_PREFIX.'adherent_type as ta, '.MAIN_DB_PREFIX.'adherent as a)';
320 $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'adherent_extrafields as extra ON a.rowid = extra.fk_object';
321 $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'subscription as c ON c.fk_adherent = a.rowid';
322 $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON a.state_id = d.rowid';
323 $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON a.country = co.rowid';
324 $this->export_sql_end[$r] .= ' WHERE a.fk_adherent_type = ta.rowid AND ta.entity IN ('.getEntity('member_type').') ';
325 $this->export_dependencies_array[$r] = array('subscription' => 'c.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
326
327 // Imports
328 //--------
329 $r = 0;
330
331 $now = dol_now();
332 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
333
334 $r++;
335 $this->import_code[$r] = $this->rights_class.'_'.$r;
336 $this->import_label[$r] = "Members"; // Translation key
337 $this->import_icon[$r] = $this->picto;
338 $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon
339 $this->import_tables_array[$r] = array('a' => MAIN_DB_PREFIX.'adherent', 'extra' => MAIN_DB_PREFIX.'adherent_extrafields');
340 $this->import_tables_creator_array[$r] = array('a' => 'fk_user_author'); // Fields to store import user id
341 $this->import_fields_array[$r] = array(
342 'a.ref' => 'MemberRef*',
343 'a.civility' => "UserTitle", 'a.lastname' => "Lastname*", 'a.firstname' => "Firstname", 'a.gender' => "Gender", 'a.login' => "Login*", "a.pass" => "Password",
344 "a.fk_adherent_type" => "MemberTypeId*", 'a.morphy' => 'MemberNature*', 'a.societe' => 'Company', 'a.address' => "Address", 'a.zip' => "Zip", 'a.town' => "Town",
345 'a.state_id' => 'StateId|StateCode', 'a.country' => "CountryId|CountryCode", 'a.phone' => "PhonePro", 'a.phone_perso' => "PhonePerso", 'a.phone_mobile' => "PhoneMobile",
346 'a.email' => "Email", 'a.birth' => "Birthday", 'a.statut' => "Status*", 'a.photo' => "Photo", 'a.note_public' => "NotePublic", 'a.note_private' => "NotePrivate",
347 'a.datec' => 'DateCreation', 'a.datefin' => 'DateEndSubscription'
348 );
349 if (isModEnabled("societe")) {
350 $this->import_fields_array[$r]['a.fk_soc'] = "ThirdParty";
351 }
352 // Add extra fields
353 $sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type <> 'separate' AND elementtype = 'adherent' AND entity IN (0,".((int) $conf->entity).")";
354 $resql = $this->db->query($sql);
355 if ($resql) { // This can fail when class is used on old database (during migration for example)
356 while ($obj = $this->db->fetch_object($resql)) {
357 $fieldname = 'extra.'.$obj->name;
358 $fieldlabel = ucfirst($obj->label);
359 $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ? '*' : '');
360 }
361 }
362 // End add extra fields
363 $this->import_convertvalue_array[$r] = array(
364 'a.ref' => array(
365 'rule' => 'getrefifauto',
366 'class' => getDolGlobalString('MEMBER_ADDON', 'mod_member_simple'),
367 'path' => "/core/modules/member/".getDolGlobalString('MEMBER_ADDON', 'mod_member_simple').'.php'
368 ),
369 'a.state_id' => array(
370 'rule' => 'fetchidfromcodeid',
371 'classfile' => '/core/class/cstate.class.php',
372 'class' => 'Cstate',
373 'method' => 'fetch',
374 'dict' => 'DictionaryStateCode'
375 ),
376 'a.country' => array(
377 'rule' => 'fetchidfromcodeid',
378 'classfile' => '/core/class/ccountry.class.php',
379 'class' => 'Ccountry',
380 'method' => 'fetch',
381 'dict' => 'DictionaryCountry'
382 )
383 );
384 if (isModEnabled("societe")) {
385 $this->import_convertvalue_array[$r]['a.fk_soc'] = array('rule' => 'fetchidfromref', 'classfile' => '/societe/class/societe.class.php', 'class' => 'Societe', 'method' => 'fetch', 'element' => 'ThirdParty');
386 }
387 $this->import_fieldshidden_array[$r] = array('extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'adherent'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
388 $this->import_regex_array[$r] = array(
389 'a.civility' => 'code@'.MAIN_DB_PREFIX.'c_civility', 'a.fk_adherent_type' => 'rowid@'.MAIN_DB_PREFIX.'adherent_type', 'a.morphy' => '(phy|mor)',
390 'a.statut' => '^[0|1]', 'a.datec' => '^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 'a.datefin' => '^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
391 $this->import_examplevalues_array[$r] = array(
392 'a.ref' => "auto or MEM2010-1234",
393 'a.civility' => "MR", 'a.lastname' => 'Smith', 'a.firstname' => 'John', 'a.gender' => 'man or woman', 'a.login' => 'jsmith', 'a.pass' => 'passofjsmith', 'a.fk_adherent_type' => '1',
394 'a.morphy' => '"mor" or "phy"', 'a.societe' => 'JS company', 'a.address' => '21 jump street', 'a.zip' => '55000', 'a.town' => 'New York', 'a.country' => '1',
395 'a.email' => 'jsmith@example.com', 'a.birth' => '1972-10-10', 'a.statut' => "0 or 1", 'a.note_public' => "This is a public comment on member",
396 'a.note_private' => "This is private comment on member", 'a.datec' => dol_print_date($now, '%Y-%m__%d'), 'a.datefin' => dol_print_date(dol_time_plus_duree($now, 1, 'y'), '%Y-%m-%d')
397 );
398 if (isModEnabled("societe")) {
399 $this->import_examplevalues_array[$r]['a.fk_soc'] = "rowid or name";
400 }
401 $this->import_updatekeys_array[$r] = array('a.ref' => 'MemberRef', 'a.login' => 'Login');
402
403 // Import subscriptions
404 $r++;
405 $this->import_code[$r] = $this->rights_class.'_'.$r;
406 $this->import_label[$r] = "Subscriptions"; // Translation key
407 $this->import_icon[$r] = $this->picto;
408 $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon
409 $this->import_tables_array[$r] = array('c' => MAIN_DB_PREFIX.'subscription');
410 $this->import_fields_array[$r] = array(
411 'c.fk_adherent' => 'MemberRef*',
412 'c.note' => 'Note', 'c.dateadh' => 'DateSubscription', 'c.datef' => 'DateEndSubscription', 'c.subscription' => 'Amount', 'c.fk_type' => 'MemberType', 'c.fk_bank' => 'Bank'
413 );
414 $this->import_convertvalue_array[$r] = array(
415 'c.fk_adherent' => array(
416 'rule' => 'fetchidfromref',
417 'classfile' => '/adherents/class/adherent.class.php',
418 'class' => 'Adherent',
419 'method' => 'fetch',
420 'element' => 'member'
421 )
422 );
423 $this->import_examplevalues_array[$r] = array(
424 'c.fk_adherent' => 'member ref',
425 'c.note' => 'Subscription #33', 'c.dateadh' => '2025-09-01', 'c.datef' => '2026-08-31', 'c.subscription' => '50'
426 );
427
428 // Cronjobs
429 $arraydate = dol_getdate(dol_now());
430 $datestart = dol_mktime(22, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
431 $this->cronjobs = array(
432 0 => array(
433 'label' => 'SendReminderForExpiredSubscriptionTitle',
434 'jobtype' => 'method', 'class' => 'adherents/class/adherent.class.php',
435 'objectname' => 'Adherent',
436 'method' => 'sendReminderForExpiredSubscription',
437 'parameters' => '10;0',
438 'comment' => 'SendReminderForExpiredSubscription',
439 'frequency' => 1,
440 'unitfrequency' => 3600 * 24,
441 'priority' => 50,
442 'status' => 1,
443 'test' => 'isModEnabled("member")',
444 'datestart' => $datestart
445 ),
446 );
447 }
448
449
458 public function init($options = '')
459 {
460 global $conf;
461
462 // Permissions
463 $this->remove($options);
464
465 // ODT template
466 /*
467 $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/members/template_member.odt';
468 $dirodt=DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/members';
469 $dest=$dirodt.'/template_order.odt';
470
471 if (file_exists($src) && ! file_exists($dest)) {
472 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
473 dol_mkdir($dirodt);
474 $result=dol_copy($src,$dest,0,0);
475 if ($result < 0) {
476 $langs->load("errors");
477 $this->error=$langs->trans('ErrorFailToCopyFile',$src,$dest);
478 return 0;
479 }
480 }*/
481
482 $sql = array(
483 "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type='member' AND entity = ".((int) $conf->entity),
484 "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','member',".((int) $conf->entity).")"
485 );
486
487 return $this->_init($sql, $options);
488 }
489}
Class DolibarrModules.
_init($array_sql, $options='')
Enables a module.
Class to describe and enable module Adherent.
__construct($db)
Constructor.
init($options='')
Function called when module is enabled.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition date.lib.php:126
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:133