dolibarr  17.0.4
member.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003 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) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
8  * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
9  * Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
10  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
11  * Copyright (C) 2020-2021 Frédéric France <frederic.france@netlogic.fr>
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 
33 // Load Dolibarr environment
34 require '../../main.inc.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
37 
38 // Load translation files required by the page
39 $langs->loadLangs(array("admin", "members"));
40 
41 if (!$user->admin) {
43 }
44 
45 
46 $choices = array('yesno', 'texte', 'chaine');
47 
48 $value = GETPOST('value', 'alpha');
49 $label = GETPOST('label', 'alpha');
50 $scandir = GETPOST('scandir', 'alpha');
51 $type = 'member';
52 
53 $action = GETPOST('action', 'aZ09');
54 
55 
56 /*
57  * Actions
58  */
59 
60 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
61 
62 if ($action == 'set_default') {
63  $ret = addDocumentModel($value, $type, $label, $scandir);
64  $res = true;
65 } elseif ($action == 'del_default') {
66  $ret = delDocumentModel($value, $type);
67  if ($ret > 0) {
68  if (getDolGlobalString('MEMBER_ADDON_PDF_ODT') == "$value") {
69  dolibarr_del_const($db, 'MEMBER_ADDON_PDF_ODT', $conf->entity);
70  }
71  }
72  $res = true;
73 } elseif ($action == 'setdoc') {
74  // Set default model
75  if (dolibarr_set_const($db, "MEMBER_ADDON_PDF_ODT", $value, 'chaine', 0, '', $conf->entity)) {
76  // The constant that was read ahead of the new set
77  // we therefore go through a variable to have a consistent display
78  $conf->global->MEMBER_ADDON_PDF_ODT = $value;
79  }
80 
81  // We activate the model
82  $ret = delDocumentModel($value, $type);
83  if ($ret > 0) {
84  $ret = addDocumentModel($value, $type, $label, $scandir);
85  }
86  $res = true;
87 } elseif (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
88  $code = $reg[1];
89  if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) {
90  header("Location: ".$_SERVER["PHP_SELF"]);
91  exit;
92  } else {
93  dol_print_error($db);
94  }
95 } elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
96  $code = $reg[1];
97  if (dolibarr_del_const($db, $code, $conf->entity) > 0) {
98  header("Location: ".$_SERVER["PHP_SELF"]);
99  exit;
100  } else {
101  dol_print_error($db);
102  }
103 } elseif ($action == 'updatemainoptions') {
104  $db->begin();
105  $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = $res7 = 0;
106  $res1 = dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha') ? 0 : 1, 'chaine', 0, '', $conf->entity);
107  $res2 = dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
108  $res3 = dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity);
109  $res3 = dolibarr_set_const($db, 'ADHERENT_CREATE_EXTERNAL_USER_LOGIN', GETPOST('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', 'alpha'), 'chaine', 0, '', $conf->entity);
110  $res4 = dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
111  // Use vat for invoice creation
112  if (isModEnabled('facture')) {
113  $res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
114  $res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
115  if (isModEnabled("product") || isModEnabled("service")) {
116  $res6 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
117  }
118  }
119  if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) {
120  setEventMessages('ErrorFailedToSaveDate', null, 'errors');
121  $db->rollback();
122  } else {
123  setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
124  $db->commit();
125  }
126 } elseif ($action == 'updatememberscards') {
127  $db->begin();
128  $res1 = $res2 = $res3 = $res4 = 0;
129  $res1 = dolibarr_set_const($db, 'ADHERENT_CARD_TYPE', GETPOST('ADHERENT_CARD_TYPE'), 'chaine', 0, '', $conf->entity);
130  $res2 = dolibarr_set_const($db, 'ADHERENT_CARD_HEADER_TEXT', GETPOST('ADHERENT_CARD_HEADER_TEXT', 'alpha'), 'chaine', 0, '', $conf->entity);
131  $res3 = dolibarr_set_const($db, 'ADHERENT_CARD_TEXT', GETPOST('ADHERENT_CARD_TEXT', 'alpha'), 'chaine', 0, '', $conf->entity);
132  $res3 = dolibarr_set_const($db, 'ADHERENT_CARD_TEXT_RIGHT', GETPOST('ADHERENT_CARD_TEXT_RIGHT', 'alpha'), 'chaine', 0, '', $conf->entity);
133  $res4 = dolibarr_set_const($db, 'ADHERENT_CARD_FOOTER_TEXT', GETPOST('ADHERENT_CARD_FOOTER_TEXT', 'alpha'), 'chaine', 0, '', $conf->entity);
134 
135  if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0) {
136  setEventMessages('ErrorFailedToSaveDate', null, 'errors');
137  $db->rollback();
138  } else {
139  setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
140  $db->commit();
141  }
142 } elseif ($action == 'updatememberstickets') {
143  $db->begin();
144  $res1 = $res2 = 0;
145  $res1 = dolibarr_set_const($db, 'ADHERENT_ETIQUETTE_TYPE', GETPOST('ADHERENT_ETIQUETTE_TYPE'), 'chaine', 0, '', $conf->entity);
146  $res2 = dolibarr_set_const($db, 'ADHERENT_ETIQUETTE_TEXT', GETPOST('ADHERENT_ETIQUETTE_TEXT', 'alpha'), 'chaine', 0, '', $conf->entity);
147 
148  if ($res1 < 0 || $res2 < 0) {
149  setEventMessages('ErrorFailedToSaveDate', null, 'errors');
150  $db->rollback();
151  } else {
152  setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
153  $db->commit();
154  }
155 }
156 
157 // Action to update or add a constant
158 if ($action == 'update' || $action == 'add') {
159  $constname = GETPOST('constname', 'alpha');
160  $constvalue = (GETPOST('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname) : GETPOST('constvalue'));
161 
162 
163  if (($constname == 'ADHERENT_CARD_TYPE' || $constname == 'ADHERENT_ETIQUETTE_TYPE' || $constname == 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && $constvalue == -1) {
164  $constvalue = '';
165  }
166  if ($constname == 'ADHERENT_LOGIN_NOT_REQUIRED') { // Invert choice
167  if ($constvalue) {
168  $constvalue = 0;
169  } else {
170  $constvalue = 1;
171  }
172  }
173 
174  $consttype = GETPOST('consttype', 'alpha');
175  $constnote = GETPOST('constnote');
176  $res = dolibarr_set_const($db, $constname, $constvalue, $choices[$consttype], 0, $constnote, $conf->entity);
177 
178  if (!($res > 0)) {
179  $error++;
180  }
181 
182  if (!$error) {
183  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
184  } else {
185  setEventMessages($langs->trans("Error"), null, 'errors');
186  }
187 }
188 
189 // Action to enable of a submodule of the adherent module
190 if ($action == 'set') {
191  $result = dolibarr_set_const($db, GETPOST('name', 'alpha'), GETPOST('value'), '', 0, '', $conf->entity);
192  if ($result < 0) {
193  print $db->error();
194  }
195 }
196 
197 // Action to disable a submodule of the adherent module
198 if ($action == 'unset') {
199  $result = dolibarr_del_const($db, GETPOST('name', 'alpha'), $conf->entity);
200  if ($result < 0) {
201  print $db->error();
202  }
203 }
204 
205 
206 
207 /*
208  * View
209  */
210 
211 $form = new Form($db);
212 
213 $help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros|DE:Modul_Mitglieder';
214 
215 llxHeader('', $langs->trans("MembersSetup"), $help_url);
216 
217 
218 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
219 print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');
220 
221 
222 $head = member_admin_prepare_head();
223 
224 print dol_get_fiche_head($head, 'general', $langs->trans("Members"), -1, 'user');
225 
226 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
227 print '<input type="hidden" name="token" value="'.newToken().'">';
228 print '<input type="hidden" name="action" value="updatemainoptions">';
229 
230 
231 // Main options
232 
233 print load_fiche_titre($langs->trans("MemberMainOptions"), '', '');
234 
235 print '<div class="div-table-responsive-no-min">';
236 print '<table class="noborder centpercent">';
237 print '<tr class="liste_titre">';
238 print '<td>'.$langs->trans("Description").'</td>';
239 print '<td>'.$langs->trans("Value").'</td>';
240 print "</tr>\n";
241 
242 // Mail required for members
243 print '<tr class="oddeven"><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
244 print $form->selectyesno('ADHERENT_MAIL_REQUIRED', (!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? $conf->global->ADHERENT_MAIL_REQUIRED : 0), 1);
245 print "</td></tr>\n";
246 
247 // Login/Pass required for members
248 print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
249 print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
250 print "</td></tr>\n";
251 
252 // Send mail information is on by default
253 print '<tr class="oddeven"><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
254 print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1);
255 print "</td></tr>\n";
256 
257 // Create an external user login for each new member subscription validated
258 print '<tr class="oddeven"><td>'.$langs->trans("MemberCreateAnExternalUserForSubscriptionValidated").'</td><td>';
259 print $form->selectyesno('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', (!empty($conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN) ? $conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN : 0), 1);
260 print "</td></tr>\n";
261 
262 // Allow members to change type on renewal forms
263 /* To test during next beta
264 print '<tr class="oddeven"><td>'.$langs->trans("MemberAllowchangeOfType").'</td><td>';
265 print $form->selectyesno('MEMBER_ALLOW_CHANGE_OF_TYPE', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1);
266 print "</td></tr>\n";
267 */
268 
269 // Insert subscription into bank account
270 print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
271 $arraychoices = array('0'=>$langs->trans("None"));
272 if (isModEnabled("banque")) {
273  $arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect");
274 }
275 if (isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) {
276  $arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly");
277 }
278 if (isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) {
279  $arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice");
280 }
281 print '<td>';
282 print $form->selectarray('ADHERENT_BANK_USE', $arraychoices, getDolGlobalString('ADHERENT_BANK_USE'), 0);
283 if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' || getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice') {
284  print '<br><div style="padding-top: 5px;"><span class="opacitymedium">'.$langs->trans("ABankAccountMustBeDefinedOnPaymentModeSetup").'</span></div>';
285 }
286 print '</td>';
287 print "</tr>\n";
288 
289 // Use vat for invoice creation
290 if (isModEnabled('facture')) {
291  print '<tr class="oddeven"><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
292  if (isModEnabled("banque")) {
293  print '<td>';
294  print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) ? '0' : $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
295  print '</td>';
296  } else {
297  print '<td class="right">';
298  print $langs->trans("WarningModuleNotActive", $langs->transnoentities("Module85Name"));
299  print '</td>';
300  }
301  print "</tr>\n";
302 
303  if (isModEnabled("product") || isModEnabled("service")) {
304  print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
305  print '<td>';
306  $selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
307  print img_picto('', 'product', 'class="pictofixedwidth"');
308  $form->select_produits($selected, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0);
309  print '</td>';
310  }
311  print "</tr>\n";
312 }
313 
314 print '</table>';
315 print '</div>';
316 
317 print '<div class="center">';
318 print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
319 print '</div>';
320 
321 print '</form>';
322 
323 
324 print '<br>';
325 
326 
327 // Document templates for documents generated from member record
328 
329 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
330 
331 // Defined model definition table
332 $def = array();
333 $sql = "SELECT nom as name";
334 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
335 $sql .= " WHERE type = '".$db->escape($type)."'";
336 $sql .= " AND entity = ".$conf->entity;
337 $resql = $db->query($sql);
338 if ($resql) {
339  $i = 0;
340  $num_rows = $db->num_rows($resql);
341  while ($i < $num_rows) {
342  $obj = $db->fetch_object($resql);
343  array_push($def, $obj->name);
344  $i++;
345  }
346 } else {
347  dol_print_error($db);
348 }
349 
350 
351 print load_fiche_titre($langs->trans("MembersDocModules"), '', '');
352 
353 print '<div class="div-table-responsive-no-min">';
354 print '<table class="noborder centpercent">';
355 print '<tr class="liste_titre">';
356 print '<td>'.$langs->trans("Name").'</td>';
357 print '<td>'.$langs->trans("Description").'</td>';
358 print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
359 print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
360 print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
361 print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
362 print "</tr>\n";
363 
364 clearstatcache();
365 
366 foreach ($dirmodels as $reldir) {
367  foreach (array('', '/doc') as $valdir) {
368  $dir = dol_buildpath($reldir."core/modules/member".$valdir);
369  if (is_dir($dir)) {
370  $handle = opendir($dir);
371  if (is_resource($handle)) {
372  while (($file = readdir($handle)) !== false) {
373  $filelist[] = $file;
374  }
375  closedir($handle);
376  arsort($filelist);
377  foreach ($filelist as $file) {
378  if (preg_match('/\.class\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
379  if (file_exists($dir.'/'.$file)) {
380  $name = substr($file, 4, dol_strlen($file) - 14);
381  $classname = substr($file, 0, dol_strlen($file) - 10);
382 
383  require_once $dir.'/'.$file;
384  $module = new $classname($db);
385 
386  $modulequalified = 1;
387  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
388  $modulequalified = 0;
389  }
390  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
391  $modulequalified = 0;
392  }
393 
394  if ($modulequalified) {
395  print '<tr class="oddeven"><td width="100">';
396  print (empty($module->name) ? $name : $module->name);
397  print "</td><td>\n";
398  if (method_exists($module, 'info')) {
399  print $module->info($langs);
400  } else {
401  print $module->description;
402  }
403  print '</td>';
404 
405  // Active
406  if (in_array($name, $def)) {
407  print '<td class="center">'."\n";
408  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del_default&token='.newToken().'&value='.$name.'">';
409  print img_picto($langs->trans("Enabled"), 'switch_on');
410  print '</a>';
411  print '</td>';
412  } else {
413  print '<td class="center">'."\n";
414  print '<a href="'.$_SERVER["PHP_SELF"].'?action=set_default&token='.newToken().'&value='.$name.'&scandir='.(!empty($module->scandir) ? $module->scandir : '').'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
415  print "</td>";
416  }
417 
418  // Defaut
419  print '<td class="center">';
420  if (getDolGlobalString('MEMBER_ADDON_PDF') == $name) {
421  print img_picto($langs->trans("Default"), 'on');
422  } else {
423  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.$name.'&scandir='.(!empty($module->scandir) ? $module->scandir : '').'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
424  }
425  print '</td>';
426 
427  // Info
428  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
429  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
430  if ($module->type == 'pdf') {
431  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
432  }
433  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
434  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn(!empty($module->option_logo) ? $module->option_logo : 0, 1, 1);
435  $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn(!empty($module->option_multilang) ? $module->option_multilang : 0, 1, 1);
436 
437 
438  print '<td class="center">';
439  print $form->textwithpicto('', $htmltooltip, 1, 0);
440  print '</td>';
441 
442  // Preview
443  print '<td class="center">';
444  if ($module->type == 'pdf') {
445  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
446  } else {
447  print img_object($langs->trans("PreviewNotAvailable"), 'generic');
448  }
449  print '</td>';
450 
451  print "</tr>\n";
452  }
453  }
454  }
455  }
456  }
457  }
458  }
459 }
460 
461 print '</table>';
462 print '</div>';
463 
464 
465 
466 
467 // Generation of cards for members
468 
469 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
470 print '<input type="hidden" name="token" value="'.newToken().'">';
471 print '<input type="hidden" name="action" value="updatememberscards">';
472 
473 print load_fiche_titre($langs->trans("MembersCards"), '', '');
474 
475 $helptext = '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
476 $helptext .= '__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ';
477 $helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, ';
478 $helptext .= '__YEAR__, __MONTH__, __DAY__';
479 
480 print '<div class="div-table-responsive-no-min">';
481 print '<table class="noborder centpercent">';
482 print '<tr class="liste_titre">';
483 print '<td>'.$langs->trans("Description").'</td>';
484 print '<td>'.$form->textwithpicto($langs->trans("Value"), $helptext, 1, 'help', '', 0, 2, 'idhelptext').'</td>';
485 print "</tr>\n";
486 
487 // Format of cards page
488 print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_CARD_TYPE").'</td><td>';
489 
490 require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php'; // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
491 $arrayoflabels = array();
492 foreach (array_keys($_Avery_Labels) as $codecards) {
493  $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
494 }
495 print $form->selectarray('ADHERENT_CARD_TYPE', $arrayoflabels, getDolGlobalString('ADHERENT_CARD_TYPE') ? getDolGlobalString('ADHERENT_CARD_TYPE') : 'CARD', 1, 0, 0);
496 
497 print "</td></tr>\n";
498 
499 // Text printed on top of member cards
500 print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_CARD_HEADER_TEXT").'</td><td>';
501 print '<input type="text" class="flat minwidth300" name="ADHERENT_CARD_HEADER_TEXT" value="'.dol_escape_htmltag(getDolGlobalString('ADHERENT_CARD_HEADER_TEXT')).'">';
502 print "</td></tr>\n";
503 
504 // Text printed on member cards (align on left)
505 print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_CARD_TEXT").'</td><td>';
506 print '<textarea class="flat" name="ADHERENT_CARD_TEXT" cols="50" rows="5" wrap="soft">'."\n";
507 print getDolGlobalString('ADHERENT_CARD_TEXT');
508 print '</textarea>';
509 print "</td></tr>\n";
510 
511 // Text printed on member cards (align on right)
512 print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_CARD_TEXT_RIGHT").'</td><td>';
513 print '<textarea class="flat" name="ADHERENT_CARD_TEXT_RIGHT" cols="50" rows="5" wrap="soft">'."\n";
514 print getDolGlobalString('ADHERENT_CARD_TEXT_RIGHT');
515 print '</textarea>';
516 print "</td></tr>\n";
517 
518 // Text printed on bottom of member cards
519 print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_CARD_FOOTER_TEXT").'</td><td>';
520 print '<input type="text" class="flat minwidth300" name="ADHERENT_CARD_FOOTER_TEXT" value="'.dol_escape_htmltag(getDolGlobalString('ADHERENT_CARD_FOOTER_TEXT')).'">';
521 print "</td></tr>\n";
522 
523 print '</table>';
524 print '</div>';
525 
526 print '<div class="center">';
527 print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
528 print '</div>';
529 
530 print '</form>';
531 
532 print '<br>';
533 
534 // Membership address sheet
535 
536 print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
537 print '<input type="hidden" name="token" value="'.newToken().'">';
538 print '<input type="hidden" name="action" value="updatememberstickets">';
539 
540 print load_fiche_titre($langs->trans("MembersTickets"), '', '');
541 
542 $helptext = '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
543 $helptext .= '__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ';
544 $helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, ';
545 $helptext .= '__YEAR__, __MONTH__, __DAY__';
546 
547 print '<div class="div-table-responsive-no-min">';
548 print '<table class="noborder centpercent">';
549 print '<tr class="liste_titre">';
550 print '<td>'.$langs->trans("Description").'</td>';
551 print '<td>'.$form->textwithpicto($langs->trans("Value"), $helptext, 1, 'help', '', 0, 2, 'idhelptext').'</td>';
552 print "</tr>\n";
553 
554 // Format of labels page
555 print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_ETIQUETTE_TYPE").'</td><td>';
556 
557 require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php'; // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php)
558 $arrayoflabels = array();
559 foreach (array_keys($_Avery_Labels) as $codecards) {
560  $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
561 }
562 print $form->selectarray('ADHERENT_ETIQUETTE_TYPE', $arrayoflabels, getDolGlobalString('ADHERENT_ETIQUETTE_TYPE') ? getDolGlobalString('ADHERENT_ETIQUETTE_TYPE') : 'CARD', 1, 0, 0);
563 
564 print "</td></tr>\n";
565 
566 // Text printed on member address sheets
567 print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_ETIQUETTE_TEXT").'</td><td>';
568 print '<textarea class="flat" name="ADHERENT_ETIQUETTE_TEXT" cols="50" rows="5" wrap="soft">'."\n";
569 print getDolGlobalString('ADHERENT_ETIQUETTE_TEXT');
570 print '</textarea>';
571 print "</td></tr>\n";
572 
573 print '</table>';
574 print '</div>';
575 
576 print '<div class="center">';
577 print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
578 print '</div>';
579 
580 print '</form>';
581 
582 print '<br>';
583 
584 print "<br>";
585 
586 print dol_get_fiche_end();
587 
588 // End of page
589 llxFooter();
590 $db->close();
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:118
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1888
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:632
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:556
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1919
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
llxFooter()
Empty footer.
Definition: wrapper.php:70
Class to manage generation of HTML components Only common components must be here.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:745
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
member_admin_prepare_head()
Return array head with list of tabs to view object informations.
Definition: member.lib.php:199
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.