28require
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/partnership/lib/partnership.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/partnership/class/partnership.class.php';
36$langs->loadLangs(array(
"admin",
"partnership"));
38$action =
GETPOST(
'action',
'aZ09');
51if ($action ==
'setPARTNERSHIP_ENABLE_PUBLIC') {
53 dolibarr_set_const($db,
'PARTNERSHIP_ENABLE_PUBLIC', 1,
'chaine', 0,
'', $conf->entity);
55 dolibarr_set_const($db,
'PARTNERSHIP_ENABLE_PUBLIC', 0,
'chaine', 0,
'', $conf->entity);
59if ($action ==
'update') {
60 $public =
GETPOST(
'PARTNERSHIP_ENABLE_PUBLIC');
62 $res =
dolibarr_set_const($db,
"PARTNERSHIP_ENABLE_PUBLIC", $public,
'chaine', 0,
'', $conf->entity);
82$title = $langs->trans(
'PartnershipSetup');
88$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
95print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
96print
'<input type="hidden" name="action" value="update">';
97print
'<input type="hidden" name="token" value="'.newToken().
'">';
99print
dol_get_fiche_head($head,
'website', $langs->trans(
"Partnerships"), -1,
'partnership');
101if ($conf->use_javascript_ajax) {
102 print
"\n".
'<script type="text/javascript" language="javascript">';
103 print
'jQuery(document).ready(function () {
106 if (jQuery("#PARTNERSHIP_NEWFORM_PAYONLINE").val()==\'-1\')
108 jQuery("#tremail").hide();
112 jQuery("#tremail").show();
115 function initfields()
117 if (jQuery("#PARTNERSHIP_ENABLE_PUBLIC").val()==\'0\')
119 jQuery("#trforcetype, #tramount, #tredit, #trpayment, #tremail").hide();
121 if (jQuery("#PARTNERSHIP_ENABLE_PUBLIC").val()==\'1\')
123 jQuery("#trforcetype, #tramount, #tredit, #trpayment").show();
124 if (jQuery("#PARTNERSHIP_NEWFORM_PAYONLINE").val()==\'-1\') jQuery("#tremail").hide();
125 else jQuery("#tremail").show();
129 jQuery("#PARTNERSHIP_ENABLE_PUBLIC").change(function() { initfields(); });
130 jQuery("#PARTNERSHIP_NEWFORM_PAYONLINE").change(function() { initemail(); });
132 print
'</script>'.
"\n";
136print
'<span class="opacitymedium">'.$langs->trans(
"PublicFormRegistrationPartnerDesc").
'</span><br><br>';
140$enabledisablehtml = $langs->trans(
"EnablePublicSubscriptionForm").
' ';
141if (empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) {
143 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setPARTNERSHIP_ENABLE_PUBLIC&token='.newToken().
'&value=1'.$param.
'">';
144 $enabledisablehtml .=
img_picto($langs->trans(
"Disabled"),
'switch_off');
145 $enabledisablehtml .=
'</a>';
148 $enabledisablehtml .=
'<a class="reposition valignmiddle" href="'.$_SERVER[
"PHP_SELF"].
'?action=setPARTNERSHIP_ENABLE_PUBLIC&token='.newToken().
'&value=0'.$param.
'">';
149 $enabledisablehtml .=
img_picto($langs->trans(
"Activated"),
'switch_on');
150 $enabledisablehtml .=
'</a>';
152print $enabledisablehtml;
153print
'<input type="hidden" id="PARTNERSHIP_ENABLE_PUBLIC" name="PARTNERSHIP_ENABLE_PUBLIC" value="'.(empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC) ? 0 : 1).
'">';
213if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) {
216 print
img_picto(
'',
'globe').
' <span class="opacitymedium">'.$langs->trans(
'BlankSubscriptionForm').
'</span><br>';
217 if (isModEnabled(
'multicompany')) {
218 $entity_qr =
'?entity='.$conf->entity;
224 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
225 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
228 print
'<div class="urllink">';
229 print
'<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.
'/public/partnership/new.php'.$entity_qr.
'">';
230 print
'<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.
'/public/partnership/new.php'.$entity_qr.
'">'.
img_picto(
'',
'globe',
'class="paddingleft"').
'</a>';
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).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
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='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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.