30require
'../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
37$langs->loadLangs(array(
"admin",
"members"));
39$action =
GETPOST(
'action',
'aZ09');
52if ($action ==
'setMEMBER_ENABLE_PUBLIC') {
60if ($action ==
'update') {
61 $public =
GETPOST(
'MEMBER_ENABLE_PUBLIC');
62 if (
GETPOST(
'MEMBER_NEWFORM_AMOUNT') !==
'') {
67 $minamount =
GETPOST(
'MEMBER_MIN_AMOUNT');
68 $publiccounters =
GETPOST(
'MEMBER_COUNTERS_ARE_PUBLIC');
69 $showtable =
GETPOST(
'MEMBER_SHOW_TABLE');
70 $showvoteallowed =
GETPOST(
'MEMBER_SHOW_VOTE_ALLOWED');
71 $payonline =
GETPOST(
'MEMBER_NEWFORM_PAYONLINE');
72 $forcetype =
GETPOSTINT(
'MEMBER_NEWFORM_FORCETYPE');
73 $forcemorphy =
GETPOST(
'MEMBER_NEWFORM_FORCEMORPHY',
'aZ09');
75 $res =
dolibarr_set_const($db,
"MEMBER_ENABLE_PUBLIC", $public,
'chaine', 0,
'', $conf->entity);
76 $res =
dolibarr_set_const($db,
"MEMBER_NEWFORM_AMOUNT", $amount,
'chaine', 0,
'', $conf->entity);
77 $res =
dolibarr_set_const($db,
"MEMBER_MIN_AMOUNT", $minamount,
'chaine', 0,
'', $conf->entity);
78 $res =
dolibarr_set_const($db,
"MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters,
'chaine', 0,
'', $conf->entity);
79 $res =
dolibarr_set_const($db,
"MEMBER_SKIP_TABLE", $showtable ? 0 : 1,
'chaine', 0,
'', $conf->entity);
80 $res =
dolibarr_set_const($db,
"MEMBER_HIDE_VOTE_ALLOWED", $showvoteallowed ? 0 : 1,
'chaine', 0,
'', $conf->entity);
81 $res =
dolibarr_set_const($db,
"MEMBER_NEWFORM_PAYONLINE", $payonline,
'chaine', 0,
'', $conf->entity);
85 $res =
dolibarr_set_const($db,
"MEMBER_NEWFORM_FORCETYPE", $forcetype,
'chaine', 0,
'', $conf->entity);
87 if ($forcemorphy ==
'-1') {
90 $res =
dolibarr_set_const($db,
"MEMBER_NEWFORM_FORCEMORPHY", $forcemorphy,
'chaine', 0,
'', $conf->entity);
109$form =
new Form($db);
111$title = $langs->trans(
"MembersSetup");
112$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
114llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-admin_website');
117$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
124print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
125print
'<input type="hidden" name="action" value="update">';
126print
'<input type="hidden" name="token" value="'.newToken().
'">';
130if ($conf->use_javascript_ajax) {
131 print
"\n".
'<script type="text/javascript">';
132 print
'jQuery(document).ready(function () {
135 if (jQuery("#MEMBER_NEWFORM_PAYONLINE").val()==\'-1\')
137 jQuery("#tremail").hide();
141 jQuery("#tremail").show();
144 function initfields()
146 if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'0\')
148 jQuery("#trforcetype, #tramount, #tredit, #trpayment, #tremail").hide();
150 if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'1\')
152 jQuery("#trforcetype, #tramount, #tredit, #trpayment").show();
153 if (jQuery("#MEMBER_NEWFORM_PAYONLINE").val()==\'-1\') jQuery("#tremail").hide();
154 else jQuery("#tremail").show();
158 jQuery("#MEMBER_ENABLE_PUBLIC").change(function() { initfields(); });
159 jQuery("#MEMBER_NEWFORM_PAYONLINE").change(function() { initemail(); });
161 print
'</script>'.
"\n";
165print
'<span class="opacitymedium">'.$langs->trans(
"BlankSubscriptionFormDesc").
'</span><br><br>';
169$enabledisablehtml = $langs->trans(
"EnablePublicSubscriptionForm").
' ';
172 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setMEMBER_ENABLE_PUBLIC&token='.
newToken().
'&value=1'.$param.
'">';
173 $enabledisablehtml .=
img_picto($langs->trans(
"Disabled"),
'switch_off');
174 $enabledisablehtml .=
'</a>';
177 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setMEMBER_ENABLE_PUBLIC&token='.
newToken().
'&value=0'.$param.
'">';
178 $enabledisablehtml .=
img_picto($langs->trans(
"Activated"),
'switch_on');
179 $enabledisablehtml .=
'</a>';
181print $enabledisablehtml;
182print
'<input type="hidden" id="MEMBER_ENABLE_PUBLIC" name="MEMBER_ENABLE_PUBLIC" value="'.(!
getDolGlobalString(
'MEMBER_ENABLE_PUBLIC') ? 0 : 1).
'">';
190 print
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
'BlankSubscriptionForm').
'</span><br>';
191 if (isModEnabled(
'multicompany')) {
192 $entity_qr =
'?entity='.((int) $conf->entity);
198 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
199 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
202 print
'<div class="urllink">';
203 print
'<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.
'/public/members/new.php'.$entity_qr.
'">';
204 print
'<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.
'/public/members/new.php'.$entity_qr.
'">'.
img_picto(
'',
'globe',
'class="paddingleft"').
'</a>';
210 print
'<div class="div-table-responsive-no-min">';
211 print
'<table class="noborder centpercent">';
213 print
'<tr class="liste_titre">';
214 print
'<td>'.$langs->trans(
"Parameter").
'</td>';
215 print
'<td>'.$langs->trans(
"Value").
'</td>';
220 print
'<tr class="oddeven drag" id="trforcetype"><td>';
221 print $langs->trans(
"ForceMemberType");
223 $listofval = array();
224 $listofval += $adht->liste_array(1);
226 print $form->selectarray(
"MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval) > 1 ? 1 : 0);
227 print
"</td></tr>\n";
231 $morphys[
"phy"] = $langs->trans(
"Physical");
232 $morphys[
"mor"] = $langs->trans(
"Moral");
233 print
'<tr class="oddeven drag" id="trforcenature"><td>';
234 print $langs->trans(
"ForceMemberNature");
237 print $form->selectarray(
"MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1);
238 print
"</td></tr>\n";
241 print
'<tr class="oddeven" id="tramount"><td>';
242 print $langs->trans(
"DefaultAmount");
244 print
'<input type="text" class="right width50" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.getDolGlobalString(
'MEMBER_NEWFORM_AMOUNT').
'">';
245 print
"</td></tr>\n";
248 print
'<tr class="oddeven" id="tredit"><td>';
249 print $langs->trans(
"MinimumAmount");
251 print
'<input type="text" class="right width50" id="MEMBER_MIN_AMOUNT" name="MEMBER_MIN_AMOUNT" value="'.getDolGlobalString(
'MEMBER_MIN_AMOUNT').
'">';
252 print
"</td></tr>\n";
255 print
'<tr class="oddeven" id="tredit"><td>';
256 print $langs->trans(
"MemberCountersArePublic");
258 print $form->selectyesno(
"MEMBER_COUNTERS_ARE_PUBLIC",
getDolGlobalInt(
'MEMBER_COUNTERS_ARE_PUBLIC'), 1,
false, 0, 1);
259 print
"</td></tr>\n";
263 print
'<tr class="oddeven" id="tredit"><td>';
264 print $langs->trans(
"MembersShowMembershipTypesTable");
266 print $form->selectyesno(
"MEMBER_SHOW_TABLE", !$skiptable, 1,
false, 0, 1);
267 print
"</td></tr>\n";
271 print
'<tr class="oddeven" id="tredit"><td>';
272 print $langs->trans(
"MembersShowVotesAllowed");
274 print $form->selectyesno(
"MEMBER_SHOW_VOTE_ALLOWED", !$hidevoteallowed, 1,
false, 0, 1);
275 print
"</td></tr>\n";
278 print
'<tr class="oddeven" id="trpayment"><td>';
279 print $langs->trans(
"MEMBER_NEWFORM_PAYONLINE");
281 $listofval = array();
282 $listofval[
'-1'] = $langs->trans(
'No');
283 $listofval[
'all'] = $langs->trans(
'Yes').
' ('.$langs->trans(
"VisitorCanChooseItsPaymentMode").
')';
284 if (isModEnabled(
'paybox')) {
285 $listofval[
'paybox'] =
'Paybox';
287 if (isModEnabled(
'paypal')) {
288 $listofval[
'paypal'] =
'PayPal';
290 if (isModEnabled(
'stripe')) {
291 $listofval[
'stripe'] =
'Stripe';
293 print $form->selectarray(
"MEMBER_NEWFORM_PAYONLINE", $listofval,
getDolGlobalString(
'MEMBER_NEWFORM_PAYONLINE'), 0);
294 print
"</td></tr>\n";
299 print
'<div class="center">';
300 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'">';
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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage members type.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
member_admin_prepare_head()
Return array head with list of tabs to view object information.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.