29require
'../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/partnership/lib/partnership.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/partnership/class/partnership.class.php';
46$langs->loadLangs(array(
"admin",
"partnership"));
48$action =
GETPOST(
'action',
'aZ09');
61if ($action ==
'setPARTNERSHIP_ENABLE_PUBLIC') {
69if ($action ==
'update') {
70 $public =
GETPOST(
'PARTNERSHIP_ENABLE_PUBLIC');
79 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
81 setEventMessages($langs->trans(
"Error"),
null,
'errors');
92$title = $langs->trans(
'PartnershipSetup');
95llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-partnership page-admin-website');
98$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>';
104print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
105print
'<input type="hidden" name="action" value="update">';
106print
'<input type="hidden" name="token" value="'.newToken().
'">';
108print
dol_get_fiche_head($head,
'website', $langs->trans(
"Partnerships"), -1,
'partnership');
110if (
$conf->use_javascript_ajax) {
111 print
"\n".
'<script type="text/javascript">';
112 print
'jQuery(document).ready(function () {
115 if (jQuery("#PARTNERSHIP_NEWFORM_PAYONLINE").val()==\'-1\')
117 jQuery("#tremail").hide();
121 jQuery("#tremail").show();
124 function initfields()
126 if (jQuery("#PARTNERSHIP_ENABLE_PUBLIC").val()==\'0\')
128 jQuery("#trforcetype, #tramount, #tredit, #trpayment, #tremail").hide();
130 if (jQuery("#PARTNERSHIP_ENABLE_PUBLIC").val()==\'1\')
132 jQuery("#trforcetype, #tramount, #tredit, #trpayment").show();
133 if (jQuery("#PARTNERSHIP_NEWFORM_PAYONLINE").val()==\'-1\') jQuery("#tremail").hide();
134 else jQuery("#tremail").show();
138 jQuery("#PARTNERSHIP_ENABLE_PUBLIC").change(function() { initfields(); });
139 jQuery("#PARTNERSHIP_NEWFORM_PAYONLINE").change(function() { initemail(); });
141 print
'</script>'.
"\n";
145print
'<div class="info">'.$langs->trans(
"PublicFormRegistrationPartnerDesc").
'</div>';
149$enabledisablehtml = $langs->trans(
"EnablePublicSubscriptionForm").
' ';
152 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setPARTNERSHIP_ENABLE_PUBLIC&token='.
newToken().
'&value=1'.$param.
'">';
153 $enabledisablehtml .= img_picto($langs->trans(
"Disabled"),
'switch_off');
154 $enabledisablehtml .=
'</a>';
157 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setPARTNERSHIP_ENABLE_PUBLIC&token='.
newToken().
'&value=0'.$param.
'">';
158 $enabledisablehtml .= img_picto($langs->trans(
"Activated"),
'switch_on');
159 $enabledisablehtml .=
'</a>';
162print
'<div class="neutral">';
163print $enabledisablehtml;
164print
'<input type="hidden" id="PARTNERSHIP_ENABLE_PUBLIC" name="PARTNERSHIP_ENABLE_PUBLIC" value="'.(!
getDolGlobalString(
'PARTNERSHIP_ENABLE_PUBLIC') ? 0 : 1).
'">';
221 print img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
'BlankSubscriptionForm').
'</span><br>';
223 $entity_qr =
'?entity='.$conf->entity;
230 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
233 print
'<div class="urllink">';
234 print
'<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.
'/public/partnership/new.php'.$entity_qr.
'">';
235 print
'<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.
'/public/partnership/new.php'.$entity_qr.
'">'.img_picto(
'',
'globe',
'class="paddingleft"').
'</a>';
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).
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.
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.
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.
partnershipAdminPrepareHead()
Prepare admin pages header.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.