Go to the documentation of this file.
25 require
'../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
27 require_once
'../lib/datapolicy.lib.php';
30 $langs->loadLangs(array(
'admin',
'companies',
'members',
'datapolicy@datapolicy'));
33 $action =
GETPOST(
'action',
'aZ09');
34 $backtopage =
GETPOST(
'backtopage',
'alpha');
36 $arrayofparameters = array();
37 $arrayofparameters[
'ThirdParty'] = array(
38 'DATAPOLICY_TIERS_CLIENT'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'company',
'class="pictofixedwidth"')),
39 'DATAPOLICY_TIERS_PROSPECT'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'company',
'class="pictofixedwidth"')),
40 'DATAPOLICY_TIERS_PROSPECT_CLIENT'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'company',
'class="pictofixedwidth"')),
41 'DATAPOLICY_TIERS_NIPROSPECT_NICLIENT'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'company',
'class="pictofixedwidth"')),
42 'DATAPOLICY_TIERS_FOURNISSEUR'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'supplier',
'class="pictofixedwidth"')),
44 if (!empty($conf->global->DATAPOLICY_USE_SPECIFIC_DELAY_FOR_CONTACT)) {
45 $arrayofparameters[
'Contact'] = array(
46 'DATAPOLICY_CONTACT_CLIENT'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'contact',
'class="pictofixedwidth"')),
47 'DATAPOLICY_CONTACT_PROSPECT'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'contact',
'class="pictofixedwidth"')),
48 'DATAPOLICY_CONTACT_PROSPECT_CLIENT'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'contact',
'class="pictofixedwidth"')),
49 'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'contact',
'class="pictofixedwidth"')),
50 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'contact',
'class="pictofixedwidth"')),
53 if (!empty($conf->adherent->enabled)) {
54 $arrayofparameters[
'Member'] = array(
55 'DATAPOLICY_ADHERENT'=>array(
'css'=>
'minwidth200',
'picto'=>
img_picto(
'',
'member',
'class="pictofixedwidth"')),
60 '' => $langs->trans(
'Never'),
61 '6' => $langs->trans(
'NB_MONTHS', 6),
62 '12' => $langs->trans(
'ONE_YEAR'),
63 '24' => $langs->trans(
'NB_YEARS', 2),
64 '36' => $langs->trans(
'NB_YEARS', 3),
65 '48' => $langs->trans(
'NB_YEARS', 4),
66 '60' => $langs->trans(
'NB_YEARS', 5),
67 '120' => $langs->trans(
'NB_YEARS', 10),
68 '180' => $langs->trans(
'NB_YEARS', 15),
69 '240' => $langs->trans(
'NB_YEARS', 20),
82 foreach ($arrayofparameters as $title => $tab) {
83 foreach ($tab as $key => $val) {
86 if (preg_match(
'/category:/', $val[
'type'])) {
87 if (
GETPOST($key,
'int') ==
'-1') {
90 $val_const =
GETPOST($key,
'int');
93 $val_const =
GETPOST($key,
'alpha');
111 $page_name =
"datapolicySetup";
112 llxHeader(
'', $langs->trans($page_name));
115 $linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
124 echo
'<span class="opacitymedium">'.$langs->trans(
"datapolicySetupPage").
'</span><br><br>';
127 if ($action ==
'edit') {
128 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
129 print
'<input type="hidden" name="token" value="'.newToken().
'">';
130 print
'<input type="hidden" name="action" value="update">';
132 print
'<table class="noborder centpercent">';
133 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
135 foreach ($arrayofparameters as $title => $tab) {
136 print
'<tr class="trforbreak"><td class="titlefield trforbreak" colspan="2">'.$langs->trans($title).
'</td></tr>';
137 foreach ($tab as $key => $val) {
138 print
'<tr class="oddeven"><td>';
140 print
$form->textwithpicto($langs->trans($key), $langs->trans($key.
'Tooltip'));
142 print
'<select name="'.$key.
'" class="flat '.(empty($val[
'css']) ?
'minwidth200' : $val[
'css']).
'">';
143 foreach ($valTab as $key1 => $val1) {
144 print
'<option value="'.$key1.
'" '.($conf->global->$key == $key1 ?
'selected="selected"' :
'').
'>';
155 print
'<br><div class="center">';
156 print
'<input class="button button-save" type="submit" value="'.$langs->trans(
"Save").
'">';
162 print
'<table class="noborder centpercent">';
163 print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
165 foreach ($arrayofparameters as $title => $tab) {
166 print
'<tr class="trforbreak"><td class="titlefield trforbreak" colspan="2">'.$langs->trans($title).
'</td></tr>';
167 foreach ($tab as $key => $val) {
168 print
'<tr class="oddeven"><td>';
170 print
$form->textwithpicto($langs->trans($key), $langs->trans(
'DATAPOLICY_Tooltip_SETUP'));
171 print
'</td><td>'.($conf->global->$key ==
'' ? $langs->trans(
'None') : $valTab[$conf->global->$key]).
'</td></tr>';
177 print
'<div class="tabsAction">';
178 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
datapolicyAdminPrepareHead()
Prepare admin pages header.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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 ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.