21 require
'../../main.inc.php';
22 require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
23 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
24 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
25 require_once
'../lib/datapolicy.lib.php';
28 $langs->loadLangs(array(
'admin',
'companies',
'members',
'datapolicy'));
32 $action =
GETPOST(
'action',
'aZ09');
33 $backtopage =
GETPOST(
'backtopage',
'alpha');
39 $l = $langs->defaultlang;
49 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
51 if ($action ==
'setvalue' && $user->admin) {
53 $sub =
"DATAPOLICIESSUBJECT_".$l;
55 $cont =
"DATAPOLICIESCONTENT_".$l;
57 $cont =
"TXTLINKDATAPOLICIESACCEPT_".$l;
59 $cont =
"TXTLINKDATAPOLICIESREFUSE_".$l;
61 $sub =
"DATAPOLICIESACCEPT_".$l;
63 $sub =
"DATAPOLICIESREFUSE_".$l;
81 $page_name =
"datapolicySetup";
85 $linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
94 print "<script type='text/javascript'>
95 $(document).ready(function(){
96 $('#default_lang').change(function(){
97 lang=$('#default_lang').val();
98 window.location.replace('" .
$_SERVER[
'PHP_SELF'].
"?l='+lang);
103 print '<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'?l='.$l.
'">';
104 print '<input type="hidden" name="token" value="'.newToken().
'">';
105 print '<input type="hidden" name="action" value="setvalue">';
107 if ($conf->global->MAIN_MULTILANGS) {
108 print '<tr><td>'.$form->editfieldkey(
'DefaultLang',
'default_lang',
'', null, 0).
'</td><td colspan="3" class="maxwidthonsmartphone">'.
"\n";
109 print $formadmin->select_language((
GETPOST(
'l') ?
GETPOST(
'l') : $langs->defaultlang),
'default_lang', 0, 0, 1, 0, 0,
'maxwidth200onsmartphone');
112 $subject =
'DATAPOLICIESSUBJECT_'.$l;
113 $linka =
'TXTLINKDATAPOLICIESACCEPT_'.$l;
114 $linkr =
'TXTLINKDATAPOLICIESREFUSE_'.$l;
115 $content =
'DATAPOLICIESCONTENT_'.$l;
116 $acc =
'DATAPOLICIESACCEPT_'.$l;
117 $ref =
'DATAPOLICIESREFUSE_'.$l;
118 print '<tr class"oddeven"><td class="fieldrequired">';
119 print $langs->trans(
'DATAPOLICIESSUBJECTMAIL').
'</td><td>';
120 print '<input type="text" size="100" name="'.$subject.
'" value="'.$conf->global->$subject.
'" />';
122 print '<tr class"oddeven"><td class="fieldrequired">';
123 print $langs->trans(
'DATAPOLICIESCONTENTMAIL').
'</td><td>';
124 print $langs->trans(
'DATAPOLICIESSUBSITUTION'); echo
'__LINKACCEPT__,__LINKREFUSED__,__FIRSTNAME__,__NAME__,__CIVILITY__';
125 $doleditor =
new DolEditor($content, $conf->global->$content,
'', 250,
'Full',
'',
false,
true, 1, 200, 70);
126 $doleditor->Create();
128 print '<tr class"oddeven"><td class="fieldrequired">';
129 print $langs->trans(
'TXTLINKDATAPOLICIESACCEPT').
'</td><td>';
130 print '<input type="text" size="200" name="'.$linka.
'" value="'.$conf->global->$linka.
'" />';
132 print '<tr class"oddeven"><td class="fieldrequired">';
133 print $langs->trans(
'TXTLINKDATAPOLICIESREFUSE').
'</td><td>';
134 print '<input type="text" size="200" name="'.$linkr.
'" value="'.$conf->global->$linkr.
'" />';
136 print '<tr class"oddeven"><td class="fieldrequired">';
138 print $langs->trans(
'DATAPOLICIESACCEPT').
'</td><td>';
140 $doleditor =
new DolEditor($acc, $conf->global->$acc,
'', 250,
'Full',
'',
false,
true, 1, 200, 70);
141 $doleditor->Create();
143 print '<tr class"oddeven"><td class="fieldrequired">';
144 print $langs->trans(
'DATAPOLICIESREFUSE').
'</td><td>';
146 print $langs->trans(
'');
147 $doleditor =
new DolEditor($ref, $conf->global->$ref,
'', 250,
'Full',
'',
false,
true, 1, 200, 70);
148 $doleditor->Create();
152 print '<br><center><input type="submit" class="button" value="'.$langs->trans(
"Modify").
'"></center>';
160 print $langs->trans(
'SendAgreementText');
161 print '<a class="button" href="'.dol_buildpath(
'/datapolicy/mailing.php').
'">'.$langs->trans(
'SendAgreement').
'</a>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
setEventMessage($mesgs, $style= 'mesgs')
Set event message in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
datapolicyAdminPrepareHead()
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 Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage a WYSIWYG editor.