Go to the documentation of this file.
33 require
'../../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
38 $langs->loadLangs(array(
"admin",
"members"));
45 $choices = array(
'yesno',
'texte',
'chaine');
47 $value =
GETPOST(
'value',
'alpha');
48 $label =
GETPOST(
'label',
'alpha');
49 $scandir =
GETPOST(
'scandir',
'alpha');
52 $action =
GETPOST(
'action',
'aZ09');
59 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
61 if ($action ==
'set_default') {
64 } elseif ($action ==
'del_default') {
72 } elseif ($action ==
'setdoc') {
74 if (
dolibarr_set_const($db,
"MEMBER_ADDON_PDF_ODT", $value,
'chaine', 0,
'', $conf->entity)) {
77 $conf->global->MEMBER_ADDON_PDF_ODT = $value;
86 } elseif (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
89 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
94 } elseif (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
97 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
102 } elseif ($action ==
'updateall') {
104 $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = $res7 = 0;
105 $res1 =
dolibarr_set_const($db,
'ADHERENT_LOGIN_NOT_REQUIRED',
GETPOST(
'ADHERENT_LOGIN_NOT_REQUIRED',
'alpha') ? 0 : 1,
'chaine', 0,
'', $conf->entity);
106 $res2 =
dolibarr_set_const($db,
'ADHERENT_MAIL_REQUIRED',
GETPOST(
'ADHERENT_MAIL_REQUIRED',
'alpha'),
'chaine', 0,
'', $conf->entity);
107 $res3 =
dolibarr_set_const($db,
'ADHERENT_DEFAULT_SENDINFOBYMAIL',
GETPOST(
'ADHERENT_DEFAULT_SENDINFOBYMAIL',
'alpha'),
'chaine', 0,
'', $conf->entity);
108 $res3 =
dolibarr_set_const($db,
'ADHERENT_CREATE_EXTERNAL_USER_LOGIN',
GETPOST(
'ADHERENT_CREATE_EXTERNAL_USER_LOGIN',
'alpha'),
'chaine', 0,
'', $conf->entity);
109 $res4 =
dolibarr_set_const($db,
'ADHERENT_BANK_USE',
GETPOST(
'ADHERENT_BANK_USE',
'alpha'),
'chaine', 0,
'', $conf->entity);
112 $res4 =
dolibarr_set_const($db,
'ADHERENT_VAT_FOR_SUBSCRIPTIONS',
GETPOST(
'ADHERENT_VAT_FOR_SUBSCRIPTIONS',
'alpha'),
'chaine', 0,
'', $conf->entity);
113 $res5 =
dolibarr_set_const($db,
'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS',
GETPOST(
'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS',
'alpha'),
'chaine', 0,
'', $conf->entity);
114 if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
115 $res6 =
dolibarr_set_const($db,
'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS',
GETPOST(
'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS',
'alpha'),
'chaine', 0,
'', $conf->entity);
118 if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) {
128 if ($action ==
'update' || $action ==
'add') {
129 $constname =
GETPOST(
'constname',
'alpha');
130 $constvalue = (
GETPOST(
'constvalue_'.$constname) ?
GETPOST(
'constvalue_'.$constname) :
GETPOST(
'constvalue'));
132 if (($constname ==
'ADHERENT_CARD_TYPE' || $constname ==
'ADHERENT_ETIQUETTE_TYPE' || $constname ==
'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && $constvalue == -1) {
135 if ($constname ==
'ADHERENT_LOGIN_NOT_REQUIRED') {
143 $consttype =
GETPOST(
'consttype',
'alpha');
144 $constnote =
GETPOST(
'constnote');
145 $res =
dolibarr_set_const($db, $constname, $constvalue, $choices[$consttype], 0, $constnote, $conf->entity);
159 if ($action ==
'set') {
167 if ($action ==
'unset') {
182 $help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
187 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
188 print
load_fiche_titre($langs->trans(
"MembersSetup"), $linkback,
'title_setup');
195 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
196 print
'<input type="hidden" name="token" value="'.newToken().
'">';
197 print
'<input type="hidden" name="action" value="updateall">';
204 print
'<div class="div-table-responsive-no-min">';
205 print
'<table class="noborder centpercent">';
206 print
'<tr class="liste_titre">';
207 print
'<td>'.$langs->trans(
"Description").
'</td>';
208 print
'<td>'.$langs->trans(
"Value").
'</td>';
212 print
'<tr class="oddeven"><td>'.$langs->trans(
"AdherentMailRequired").
'</td><td>';
213 print
$form->selectyesno(
'ADHERENT_MAIL_REQUIRED', (!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? $conf->global->ADHERENT_MAIL_REQUIRED : 0), 1);
214 print
"</td></tr>\n";
217 print
'<tr class="oddeven"><td>'.$langs->trans(
"AdherentLoginRequired").
'</td><td>';
218 print
$form->selectyesno(
'ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
219 print
"</td></tr>\n";
222 print
'<tr class="oddeven"><td>'.$langs->trans(
"MemberSendInformationByMailByDefault").
'</td><td>';
223 print
$form->selectyesno(
'ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1);
224 print
"</td></tr>\n";
227 print
'<tr class="oddeven"><td>'.$langs->trans(
"MemberCreateAnExternalUserForSubscriptionValidated").
'</td><td>';
228 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);
229 print
"</td></tr>\n";
239 print
'<tr class="oddeven"><td>'.$langs->trans(
"MoreActionsOnSubscription").
'</td>';
240 $arraychoices = array(
'0'=>$langs->trans(
"None"));
241 if (!empty($conf->banque->enabled)) {
242 $arraychoices[
'bankdirect'] = $langs->trans(
"MoreActionBankDirect");
244 if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) &&
isModEnabled(
'facture')) {
245 $arraychoices[
'invoiceonly'] = $langs->trans(
"MoreActionInvoiceOnly");
247 if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) &&
isModEnabled(
'facture')) {
248 $arraychoices[
'bankviainvoice'] = $langs->trans(
"MoreActionBankViaInvoice");
253 print
'<br><div style="padding-top: 5px;"><span class="opacitymedium">'.$langs->trans(
"ABankAccountMustBeDefinedOnPaymentModeSetup").
'</span></div>';
260 print
'<tr class="oddeven"><td>'.$langs->trans(
"VATToUseForSubscriptions").
'</td>';
261 if (!empty($conf->banque->enabled)) {
263 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);
266 print
'<td class="right">';
267 print $langs->trans(
"WarningModuleNotActive", $langs->transnoentities(
"Module85Name"));
272 if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
273 print
'<tr class="oddeven"><td>'.$langs->trans(
"ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").
'</td>';
275 $selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ?
'' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
276 print
img_picto(
'',
'product',
'class="pictofixedwidth"');
277 $form->select_produits($selected,
'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS',
'', 0);
286 print
'<div class="center">';
287 print
'<input type="submit" class="button" value="'.$langs->trans(
"Update").
'" name="Button">';
296 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
300 $sql =
"SELECT nom as name";
301 $sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
302 $sql .=
" WHERE type = '".$db->escape($type).
"'";
303 $sql .=
" AND entity = ".$conf->entity;
304 $resql = $db->query($sql);
307 $num_rows = $db->num_rows(
$resql);
308 while ($i < $num_rows) {
309 $obj = $db->fetch_object(
$resql);
310 array_push($def, $obj->name);
320 print
'<div class="div-table-responsive-no-min">';
321 print
'<table class="noborder centpercent">';
322 print
'<tr class="liste_titre">';
323 print
'<td>'.$langs->trans(
"Name").
'</td>';
324 print
'<td>'.$langs->trans(
"Description").
'</td>';
325 print
'<td align="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
326 print
'<td align="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
327 print
'<td align="center" width="80">'.$langs->trans(
"ShortInfo").
'</td>';
328 print
'<td align="center" width="80">'.$langs->trans(
"Preview").
'</td>';
333 foreach ($dirmodels as $reldir) {
334 foreach (array(
'',
'/doc') as $valdir) {
337 $handle = opendir($dir);
338 if (is_resource($handle)) {
339 while (($file = readdir($handle)) !==
false) {
344 foreach ($filelist as $file) {
345 if (preg_match(
'/\.class\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
346 if (file_exists($dir.
'/'.$file)) {
347 $name = substr($file, 4,
dol_strlen($file) - 14);
348 $classname = substr($file, 0,
dol_strlen($file) - 10);
350 require_once $dir.
'/'.$file;
351 $module =
new $classname($db);
353 $modulequalified = 1;
354 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
355 $modulequalified = 0;
357 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
358 $modulequalified = 0;
361 if ($modulequalified) {
362 print
'<tr class="oddeven"><td width="100">';
363 print (empty($module->name) ? $name : $module->name);
365 if (method_exists($module,
'info')) {
366 print $module->info($langs);
368 print $module->description;
373 if (in_array($name, $def)) {
374 print
'<td class="center">'.
"\n";
375 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=del_default&token='.
newToken().
'&value='.$name.
'">';
376 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
380 print
'<td class="center">'.
"\n";
381 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>';
386 print
'<td class="center">';
388 print
img_picto($langs->trans(
"Default"),
'on');
390 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>';
395 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
396 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
397 if ($module->type ==
'pdf') {
398 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
400 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
401 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn(!empty($module->option_logo) ? $module->option_logo : 0, 1, 1);
402 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn(!empty($module->option_multilang) ? $module->option_multilang : 0, 1, 1);
405 print
'<td class="center">';
406 print
$form->textwithpicto(
'', $htmltooltip, 1, 0);
410 print
'<td class="center">';
411 if ($module->type ==
'pdf') {
412 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'contract').
'</a>';
414 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
444 'ADHERENT_CARD_TYPE',
446 'ADHERENT_CARD_HEADER_TEXT',
447 'ADHERENT_CARD_TEXT',
448 'ADHERENT_CARD_TEXT_RIGHT',
449 'ADHERENT_CARD_FOOTER_TEXT'
454 $helptext =
'*'.$langs->trans(
"FollowingConstantsWillBeSubstituted").
'<br>';
455 $helptext .=
'__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ';
456 $helptext .=
'__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, ';
457 $helptext .=
'__YEAR__, __MONTH__, __DAY__';
467 $constantes = array(
'ADHERENT_ETIQUETTE_TYPE',
'ADHERENT_ETIQUETTE_TEXT');
471 $helptext =
'*'.$langs->trans(
"FollowingConstantsWillBeSubstituted").
'<br>';
472 $helptext .=
'__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, ';
473 $helptext .=
'__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, ';
474 $helptext .=
'__YEAR__, __MONTH__, __DAY__';
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
member_admin_prepare_head()
Return array head with list of tabs to view object informations.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
delDocumentModel($name, $type)
Delete document model used by doc generator.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
isModEnabled($module)
Is Dolibarr module enabled.
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).
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
form_constantes($tableau, $strictw3c=0, $helptext='', $text='Value')
Show array with constants to edit.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->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->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.