31require
'../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
49$langs->loadLangs(array(
"admin",
"members"));
51$action =
GETPOST(
'action',
'aZ09');
54$hookmanager->initHooks(array(
'newpayment'));
67if ($action ==
'setMEMBER_ENABLE_PUBLIC') {
75if ($action ==
'update') {
76 $public =
GETPOST(
'MEMBER_ENABLE_PUBLIC');
78 $minamount =
GETPOST(
'MEMBER_MIN_AMOUNT');
79 $publiccounters =
GETPOST(
'MEMBER_COUNTERS_ARE_PUBLIC');
80 $showtable =
GETPOST(
'MEMBER_SHOW_TABLE');
81 $showvoteallowed =
GETPOST(
'MEMBER_SHOW_VOTE_ALLOWED');
82 $payonline =
GETPOST(
'MEMBER_NEWFORM_PAYONLINE');
83 $forcetype =
GETPOSTINT(
'MEMBER_NEWFORM_FORCETYPE');
84 $forcemorphy =
GETPOST(
'MEMBER_NEWFORM_FORCEMORPHY',
'aZ09');
91 $res =
dolibarr_set_const($db,
"MEMBER_HIDE_VOTE_ALLOWED", $showvoteallowed ? 0 : 1,
'chaine', 0,
'',
$conf->entity);
99 if (empty($forcemorphy) || $forcemorphy ==
'-1') {
104 if (
GETPOSTISSET(
'MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE')) {
105 $res =
dolibarr_set_const($db,
"MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE",
GETPOST(
'MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE') ==
'yes' ? 1 : 0,
'chaine', 0,
'',
$conf->entity);
113 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
115 setEventMessages($langs->trans(
"Error"),
null,
'errors');
124$form =
new Form($db);
126$title = $langs->trans(
"MembersSetup");
127$help_url =
'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder';
129llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-admin_website');
131$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
139print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
140print
'<input type="hidden" name="action" value="update">';
141print
'<input type="hidden" name="token" value="'.newToken().
'">';
145if (
$conf->use_javascript_ajax) {
146 print
"\n".
'<script type="text/javascript">';
147 print
'jQuery(document).ready(function () {
150 if (jQuery("#MEMBER_NEWFORM_PAYONLINE").val()==\'-1\') {
151 jQuery("#tremail").hide();
153 jQuery("#tremail").show();
156 function initfields()
158 if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'0\') {
159 jQuery("#trforcetype, #tramount, #tredit, #trpayment, #tremail").hide();
161 if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'1\') {
162 jQuery("#trforcetype, #tramount, #tredit, #trpayment").show();
163 if (jQuery("#MEMBER_NEWFORM_PAYONLINE").val()==\'-1\') jQuery("#tremail").hide();
164 else jQuery("#tremail").show();
168 jQuery("#MEMBER_ENABLE_PUBLIC").change(function() { initfields(); });
169 jQuery("#MEMBER_NEWFORM_PAYONLINE").change(function() { initemail(); });
171 print
'</script>'.
"\n";
175print
'<div class="info">'.$langs->trans(
"BlankSubscriptionFormDesc").
'</div>';
179$enabledisablehtml = $langs->trans(
"EnablePublicSubscriptionForm").
' ';
182 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setMEMBER_ENABLE_PUBLIC&token='.
newToken().
'&value=1'.$param.
'">';
183 $enabledisablehtml .= img_picto($langs->trans(
"Disabled"),
'switch_off');
184 $enabledisablehtml .=
'</a>';
187 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setMEMBER_ENABLE_PUBLIC&token='.
newToken().
'&value=0'.$param.
'">';
188 $enabledisablehtml .= img_picto($langs->trans(
"Activated"),
'switch_on');
189 $enabledisablehtml .=
'</a>';
192print
'<div class="neutral">';
193print $enabledisablehtml;
194print
'<input type="hidden" id="MEMBER_ENABLE_PUBLIC" name="MEMBER_ENABLE_PUBLIC" value="'.(!
getDolGlobalString(
'MEMBER_ENABLE_PUBLIC') ? 0 : 1).
'">';
202 print img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
'BlankSubscriptionForm').
'</span><br>';
204 $entity_qr =
'?entity='.((int)
$conf->entity);
211 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
214 print
'<div class="urllink">';
215 print
'<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.
'/public/members/new.php'.$entity_qr.
'">';
216 print
'<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.
'/public/members/new.php'.$entity_qr.
'">'.img_picto(
'',
'globe',
'class="paddingleft"').
'</a>';
222 print
'<div class="div-table-responsive-no-min">';
223 print
'<table class="noborder centpercent">';
225 print
'<tr class="liste_titre">';
226 print
'<td>'.$langs->trans(
"Parameter").
'</td>';
232 print
'<tr class="oddeven" id="tredit"><td>';
233 print $langs->trans(
"MembersShowMembershipTypesTable");
235 print $form->selectyesno(
"MEMBER_SHOW_TABLE", (
int) !$skiptable, 1,
false, 0, 1);
236 print
"</td></tr>\n";
241 print
'<tr class="oddeven" id="tredit"><td>';
242 print $langs->trans(
"MembersShowVotesAllowed");
244 print $form->selectyesno(
"MEMBER_SHOW_VOTE_ALLOWED", (
int) !$hidevoteallowed, 1,
false, 0, 1);
245 print
"</td></tr>\n";
250 print
'<tr class="oddeven drag" id="trforcetype"><td>';
251 print $langs->trans(
"ForceMemberType");
253 $listofval = array();
254 $listofval += $adht->liste_array(1);
256 print $form->selectarray(
"MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, $langs->trans(
"No"), 0, 0,
'', 0, 0, 0,
'',
'width200');
257 print
"</td></tr>\n";
261 "phy" => $langs->trans(
"Physical"),
262 "mor" => $langs->trans(
"Moral"),
264 print
'<tr class="oddeven drag" id="trforcenature"><td>';
265 print $langs->trans(
"ForceMemberNature");
269 print $form->selectarray(
"MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, $langs->trans(
"No"), 0, 0,
'', 0, 0, 0,
'',
'width200');
270 print
"</td></tr>\n";
273 print
'<tr class="oddeven" id="tredit"><td>';
274 print $langs->trans(
"MinimumAmount");
276 print
'<input type="text" class="right width50" id="MEMBER_MIN_AMOUNT" name="MEMBER_MIN_AMOUNT" value="'.getDolGlobalString(
'MEMBER_MIN_AMOUNT').
'">';
277 print
' <span class="opacitymedium">'.$langs->getCurrencySymbol(
$mysoc->currency_code).
'</span>';
278 print
"</td></tr>\n";
281 print
'<tr class="oddeven" id="tredit"><td>';
282 print $langs->trans(
"MemberCountersArePublic");
284 print $form->selectyesno(
"MEMBER_COUNTERS_ARE_PUBLIC",
getDolGlobalInt(
'MEMBER_COUNTERS_ARE_PUBLIC'), 1,
false, 0, 1);
285 print
"</td></tr>\n";
288 print
'<tr class="oddeven" id="trpayment"><td>';
289 print $langs->trans(
"MEMBER_NEWFORM_PAYONLINE");
294 $validpaymentmethod = getValidOnlinePaymentMethods(
'', 1);
297 $listofval = array();
298 $listofval[
'-1'] = array(
'label' => $langs->trans(
'No'));
299 $listofval[
'all'] = array(
'label' => $langs->trans(
'Yes').
' ('.$langs->trans(
"VisitorCanChooseItsPaymentMode").
')',
'data-html' => $langs->trans(
'Yes').
' <span class="opacitymedium">('.$langs->trans(
"VisitorCanChooseItsPaymentMode").
')</span>');
300 foreach ($validpaymentmethod as $key => $val) {
301 if (is_array($val)) {
302 $listofval[$key] = $val;
304 $listofval[$key] = array(
'label' => $key,
'status' =>
'valid');
308 print $form->selectarray(
"MEMBER_NEWFORM_PAYONLINE", $listofval,
getDolGlobalString(
'MEMBER_NEWFORM_PAYONLINE'), 0);
309 print
"</td></tr>\n";
312 print
'<tr class="oddeven" id="trpayment"><td>';
313 print $form->textwithpicto($langs->trans(
"MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE"), $langs->trans(
"MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATEDesc"));
315 print $form->selectyesno(
"MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE",
getDolGlobalInt(
"MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE"));
316 print
"</td></tr>\n";
321 print
'<div class="center">';
322 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'">';
global $dolibarr_main_url_root
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.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.