Clean module datapolicy
This commit is contained in:
parent
ee05abaa27
commit
90d58bde27
@ -98,6 +98,12 @@ source_file = htdocs/langs/en_US/cron.lang
|
|||||||
source_lang = en_US
|
source_lang = en_US
|
||||||
type = MOZILLAPROPERTIES
|
type = MOZILLAPROPERTIES
|
||||||
|
|
||||||
|
[dolibarr.datapolicy]
|
||||||
|
file_filter = htdocs/langs/<lang>/datapolicy.lang
|
||||||
|
source_file = htdocs/langs/en_US/datapolicy.lang
|
||||||
|
source_lang = en_US
|
||||||
|
type = MOZILLAPROPERTIES
|
||||||
|
|
||||||
[dolibarr.deliveries]
|
[dolibarr.deliveries]
|
||||||
file_filter = htdocs/langs/<lang>/deliveries.lang
|
file_filter = htdocs/langs/<lang>/deliveries.lang
|
||||||
source_file = htdocs/langs/en_US/deliveries.lang
|
source_file = htdocs/langs/en_US/deliveries.lang
|
||||||
|
|||||||
@ -106,7 +106,7 @@ class modDataPolicy extends DolibarrModules {
|
|||||||
$this->depends = array('always'=>'modCron'); // List of module class names as string that must be enabled if this module is enabled
|
$this->depends = array('always'=>'modCron'); // List of module class names as string that must be enabled if this module is enabled
|
||||||
$this->requiredby = array(); // List of module ids to disable if this one is disabled
|
$this->requiredby = array(); // List of module ids to disable if this one is disabled
|
||||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
|
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
|
||||||
$this->langfiles = array("datapolicy@datapolicy");
|
$this->langfiles = array("datapolicy");
|
||||||
$this->phpmin = array(5, 3); // Minimum version of PHP required by module
|
$this->phpmin = array(5, 3); // Minimum version of PHP required by module
|
||||||
$this->need_dolibarr_version = array(4, 0); // Minimum version of Dolibarr required by module
|
$this->need_dolibarr_version = array(4, 0); // Minimum version of Dolibarr required by module
|
||||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||||
@ -217,23 +217,23 @@ class modDataPolicy extends DolibarrModules {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
// Extrafield contact
|
// Extrafield contact
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
$result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy', '$conf->datapolicy->enabled');
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
$result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy', '$conf->datapolicy->enabled');
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
$result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy', '$conf->datapolicy->enabled');
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_date', $langs->trans("DATAPOLICY_date"), 'date', 104, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0);
|
$result1 = $extrafields->addExtraField('datapolicy_date', $langs->trans("DATAPOLICY_date"), 'date', 104, 3, 'thirdparty', 0, 0, '', '', 1, '', '3', 0);
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'thirdparty', 0, 0, '', '', 0, '', '0', 0);
|
$result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'thirdparty', 0, 0, '', '', 0, '', '0', 0);
|
||||||
|
|
||||||
// Extrafield Tiers
|
// Extrafield Tiers
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
$result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy', '$conf->datapolicy->enabled');
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
$result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy', '$conf->datapolicy->enabled');
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
$result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'contact', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy', '$conf->datapolicy->enabled');
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_date', $langs->trans("DATAPOLICY_date"), 'date', 104, 3, 'contact', 0, 0, '', '', 1, '', '3', 0);
|
$result1 = $extrafields->addExtraField('datapolicy_date', $langs->trans("DATAPOLICY_date"), 'date', 104, 3, 'contact', 0, 0, '', '', 1, '', '3', 0);
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'contact', 0, 0, '', '', 0, '', '0', 0);
|
$result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'contact', 0, 0, '', '', 0, '', '0', 0);
|
||||||
|
|
||||||
// Extrafield Adherent
|
// Extrafield Adherent
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
$result1 = $extrafields->addExtraField('datapolicy_consentement', $langs->trans("DATAPOLICY_consentement"), 'boolean', 101, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy', '$conf->datapolicy->enabled');
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
$result1 = $extrafields->addExtraField('datapolicy_opposition_traitement', $langs->trans("DATAPOLICY_opposition_traitement"), 'boolean', 102, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy', '$conf->datapolicy->enabled');
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy@datapolicy', '$conf->datapolicy->enabled');
|
$result1 = $extrafields->addExtraField('datapolicy_opposition_prospection', $langs->trans("DATAPOLICY_opposition_prospection"), 'boolean', 103, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0, '', '', 'datapolicy', '$conf->datapolicy->enabled');
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_date', $langs->trans("DATAPOLICY_date"), 'date', 104, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0);
|
$result1 = $extrafields->addExtraField('datapolicy_date', $langs->trans("DATAPOLICY_date"), 'date', 104, 3, 'adherent', 0, 0, '', '', 1, '', '3', 0);
|
||||||
$result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'adherent', 0, 0, '', '', 0, '', '0', 0);
|
$result1 = $extrafields->addExtraField('datapolicy_send', $langs->trans("DATAPOLICY_send"), 'date', 105, 3, 'adherent', 0, 0, '', '', 0, '', '0', 0);
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -17,25 +17,56 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/datapolicy/mailing.php
|
* \file htdocs/datapolicy/admin/mailing.php
|
||||||
* \ingroup datapolicy
|
* \ingroup datapolicy
|
||||||
* \brief datapolicy mailing page.
|
* \brief Page called by the setupmail.php page to send agreements by email.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php';
|
||||||
|
|
||||||
$idcontact = GETPOST('idc');
|
$idcontact = GETPOST('idc', 'int');
|
||||||
|
$idcompany = GETPOST('ids', 'int');
|
||||||
|
$idmember = GETPOST('ida', 'int');
|
||||||
|
|
||||||
|
// Security
|
||||||
|
if (!isModEnabled("datapolicy")) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (!$user->admin) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
if (!empty($idcontact)) {
|
if (!empty($idcontact)) {
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
$contact->fetch($idcontact);
|
$contact->fetch($idcontact);
|
||||||
DataPolicy::sendMailDataPolicyContact($contact);
|
DataPolicy::sendMailDataPolicyContact($contact);
|
||||||
|
} elseif (!empty($idcompany)) {
|
||||||
|
$company = new Societe($db);
|
||||||
|
$company->fetch($idcompany);
|
||||||
|
DataPolicy::sendMailDataPolicyCompany($company);
|
||||||
|
} elseif (!empty($idmember)) {
|
||||||
|
$member = new Adherent($db);
|
||||||
|
$member->fetch($idmember);
|
||||||
|
DataPolicy::sendMailDataPolicyAdherent($member);
|
||||||
} else {
|
} else {
|
||||||
$contacts = new DataPolicy($db);
|
$contacts = new DataPolicy($db);
|
||||||
|
|
||||||
|
// Send email to all contacts where email was not already sent
|
||||||
$contacts->getAllContactNotInformed();
|
$contacts->getAllContactNotInformed();
|
||||||
$contacts->getAllCompaniesNotInformed();
|
$contacts->getAllCompaniesNotInformed();
|
||||||
$contacts->getAllAdherentsNotInformed();
|
$contacts->getAllAdherentsNotInformed();
|
||||||
echo $langs->trans('AllAgreementSend');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
echo $langs->trans('AllAgreementSend');
|
||||||
@ -19,15 +19,15 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/datapolicy/admin/setup.php
|
* \file htdocs/datapolicy/admin/setup.php
|
||||||
* \ingroup datapolicy
|
* \ingroup datapolicy
|
||||||
* \brief datapolicy setup page.
|
* \brief Datapolicy setup page to define duration of data keeping.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||||
require_once '../lib/datapolicy.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/datapolicy/lib/datapolicy.lib.php';
|
||||||
|
|
||||||
// Translations
|
// Translations
|
||||||
$langs->loadLangs(array('admin', 'companies', 'members', 'datapolicy@datapolicy'));
|
$langs->loadLangs(array('admin', 'companies', 'members', 'datapolicy'));
|
||||||
|
|
||||||
// Parameters
|
// Parameters
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
@ -69,7 +69,10 @@ $valTab = array(
|
|||||||
'240' => $langs->trans('NB_YEARS', 20),
|
'240' => $langs->trans('NB_YEARS', 20),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Access control
|
// Security
|
||||||
|
if (!isModEnabled("datapolicy")) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if (!$user->admin) {
|
if (!$user->admin) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
@ -137,7 +140,7 @@ if ($action == 'edit') {
|
|||||||
foreach ($tab as $key => $val) {
|
foreach ($tab as $key => $val) {
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $val['picto'];
|
print $val['picto'];
|
||||||
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
|
print $form->textwithpicto($langs->trans($key), $langs->trans('DATAPOLICY_Tooltip_SETUP'));
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<select name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'">';
|
print '<select name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'">';
|
||||||
foreach ($valTab as $key1 => $val1) {
|
foreach ($valTab as $key1 => $val1) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
@ -18,11 +18,17 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/datapolicy/admin/setupmail.php
|
||||||
|
* \ingroup datapolicy
|
||||||
|
* \brief Datapolicy setup page to define email content end send email for end user agreement.
|
||||||
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||||
require_once '../lib/datapolicy.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/datapolicy/lib/datapolicy.lib.php';
|
||||||
|
|
||||||
// Translations
|
// Translations
|
||||||
$langs->loadLangs(array('admin', 'companies', 'members', 'datapolicy'));
|
$langs->loadLangs(array('admin', 'companies', 'members', 'datapolicy'));
|
||||||
@ -31,18 +37,22 @@ $langs->loadLangs(array('admin', 'companies', 'members', 'datapolicy'));
|
|||||||
// Parameters
|
// Parameters
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
$formadmin = new FormAdmin($db);
|
|
||||||
|
|
||||||
if (GETPOST('l')) {
|
if (GETPOST('l')) {
|
||||||
$l = GETPOST('l');
|
$l = GETPOST('l');
|
||||||
} else {
|
} else {
|
||||||
$l = $langs->defaultlang;
|
$l = $langs->defaultlang;
|
||||||
}
|
}
|
||||||
// Access control
|
|
||||||
|
// Security
|
||||||
|
if (!isModEnabled("datapolicy")) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if (!$user->admin) {
|
if (!$user->admin) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -51,17 +61,17 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
|||||||
|
|
||||||
if ($action == 'setvalue' && $user->admin) {
|
if ($action == 'setvalue' && $user->admin) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$sub = "DATAPOLICIESSUBJECT_".$l;
|
$sub = "DATAPOLICYSUBJECT_".$l;
|
||||||
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
||||||
$cont = "DATAPOLICIESCONTENT_".$l;
|
$cont = "DATAPOLICYCONTENT_".$l;
|
||||||
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
||||||
$cont = "TXTLINKDATAPOLICIESACCEPT_".$l;
|
$cont = "TXTLINKDATAPOLICYACCEPT_".$l;
|
||||||
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
||||||
$cont = "TXTLINKDATAPOLICIESREFUSE_".$l;
|
$cont = "TXTLINKDATAPOLICYREFUSE_".$l;
|
||||||
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
||||||
$sub = "DATAPOLICIESACCEPT_".$l;
|
$sub = "DATAPOLICYACCEPT_".$l;
|
||||||
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
||||||
$sub = "DATAPOLICIESREFUSE_".$l;
|
$sub = "DATAPOLICYREFUSE_".$l;
|
||||||
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
||||||
if (!($result > 0)) {
|
if (!($result > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
@ -80,17 +90,19 @@ if ($action == 'setvalue' && $user->admin) {
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$formadmin = new FormAdmin($db);
|
||||||
|
|
||||||
$page_name = "datapolicySetup";
|
$page_name = "datapolicySetup";
|
||||||
llxHeader('', $langs->trans($page_name));
|
llxHeader('', $langs->trans($page_name));
|
||||||
|
|
||||||
// Subheader
|
// Subheader
|
||||||
$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_datapolicy@datapolicy');
|
print load_fiche_titre($langs->trans($page_name), $linkback, 'generic');
|
||||||
|
|
||||||
// Configuration header
|
// Configuration header
|
||||||
$head = datapolicyAdminPrepareHead();
|
$head = datapolicyAdminPrepareHead();
|
||||||
print dol_get_fiche_head($head, 'settings', '', -1, "datapolicy@datapolicy");
|
print dol_get_fiche_head($head, 'emailing', '', -1, '');
|
||||||
|
|
||||||
|
|
||||||
print "<script type='text/javascript'>
|
print "<script type='text/javascript'>
|
||||||
@ -108,42 +120,46 @@ print '<input type="hidden" name="action" value="setvalue">';
|
|||||||
print '<table>';
|
print '<table>';
|
||||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||||
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', null, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
|
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', null, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
|
||||||
|
print img_picto('', 'language', 'class="pictofixedwidth"');
|
||||||
print $formadmin->select_language((GETPOST('l') ? GETPOST('l') : $langs->defaultlang), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
|
print $formadmin->select_language((GETPOST('l') ? GETPOST('l') : $langs->defaultlang), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
$subject = 'DATAPOLICIESSUBJECT_'.$l;
|
$subject = 'DATAPOLICYSUBJECT_'.$l;
|
||||||
$linka = 'TXTLINKDATAPOLICIESACCEPT_'.$l;
|
$linka = 'TXTLINKDATAPOLICYACCEPT_'.$l;
|
||||||
$linkr = 'TXTLINKDATAPOLICIESREFUSE_'.$l;
|
$linkr = 'TXTLINKDATAPOLICYREFUSE_'.$l;
|
||||||
$content = 'DATAPOLICIESCONTENT_'.$l;
|
$content = 'DATAPOLICYCONTENT_'.$l;
|
||||||
$acc = 'DATAPOLICIESACCEPT_'.$l;
|
$acc = 'DATAPOLICYACCEPT_'.$l;
|
||||||
$ref = 'DATAPOLICIESREFUSE_'.$l;
|
$ref = 'DATAPOLICYREFUSE_'.$l;
|
||||||
print '<tr class"oddeven"><td class="fieldrequired">';
|
print '<tr class"oddeven"><td class="fieldrequired">';
|
||||||
print $langs->trans('DATAPOLICIESSUBJECTMAIL').'</td><td>';
|
print $langs->trans('DATAPOLICYSUBJECTMAIL').'</td><td>';
|
||||||
print '<input type="text" size="100" name="'.$subject.'" value="'.$conf->global->$subject.'" />';
|
print '<input type="text" name="'.$subject.'" value="'.$conf->global->$subject.'" />';
|
||||||
print '</td><tr>';
|
print '</td><tr>';
|
||||||
print '<tr class"oddeven"><td class="fieldrequired">';
|
print '<tr class"oddeven"><td class="fieldrequired">';
|
||||||
print $langs->trans('DATAPOLICIESCONTENTMAIL').'</td><td>';
|
print $langs->trans('DATAPOLICYCONTENTMAIL').'</td><td>';
|
||||||
print $langs->trans('DATAPOLICIESSUBSITUTION'); echo'__LINKACCEPT__,__LINKREFUSED__,__FIRSTNAME__,__NAME__,__CIVILITY__';
|
print '<span class="opacitymedium">';
|
||||||
|
print $langs->trans('DATAPOLICYSUBSITUTION');
|
||||||
|
print '__LINKACCEPT__,__LINKREFUSED__,__FIRSTNAME__,__NAME__,__CIVILITY__';
|
||||||
|
print '</span>';
|
||||||
$doleditor = new DolEditor($content, $conf->global->$content, '', 250, 'Full', '', false, true, 1, 200, 70);
|
$doleditor = new DolEditor($content, $conf->global->$content, '', 250, 'Full', '', false, true, 1, 200, 70);
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
print '</td><tr>';
|
print '</td><tr>';
|
||||||
print '<tr class"oddeven"><td class="fieldrequired">';
|
print '<tr class"oddeven"><td class="fieldrequired">';
|
||||||
print $langs->trans('TXTLINKDATAPOLICIESACCEPT').'</td><td>';
|
print $langs->trans('TXTLINKDATAPOLICYACCEPT').'</td><td>';
|
||||||
print '<input type="text" size="200" name="'.$linka.'" value="'.$conf->global->$linka.'" />';
|
print '<input type="text" name="'.$linka.'" value="'.$conf->global->$linka.'" />';
|
||||||
print '</td><tr>';
|
print '</td><tr>';
|
||||||
print '<tr class"oddeven"><td class="fieldrequired">';
|
print '<tr class"oddeven"><td class="fieldrequired">';
|
||||||
print $langs->trans('TXTLINKDATAPOLICIESREFUSE').'</td><td>';
|
print $langs->trans('TXTLINKDATAPOLICYREFUSE').'</td><td>';
|
||||||
print '<input type="text" size="200" name="'.$linkr.'" value="'.$conf->global->$linkr.'" />';
|
print '<input type="text" name="'.$linkr.'" value="'.$conf->global->$linkr.'" />';
|
||||||
print '</td><tr>';
|
print '</td><tr>';
|
||||||
print '<tr class"oddeven"><td class="fieldrequired">';
|
print '<tr class"oddeven"><td class="fieldrequired">';
|
||||||
|
|
||||||
print $langs->trans('DATAPOLICIESACCEPT').'</td><td>';
|
print $langs->trans('DATAPOLICYACCEPT').'</td><td>';
|
||||||
|
|
||||||
$doleditor = new DolEditor($acc, $conf->global->$acc, '', 250, 'Full', '', false, true, 1, 200, 70);
|
$doleditor = new DolEditor($acc, $conf->global->$acc, '', 250, 'Full', '', false, true, 1, 200, 70);
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
print '</td><tr>';
|
print '</td><tr>';
|
||||||
print '<tr class"oddeven"><td class="fieldrequired">';
|
print '<tr class"oddeven"><td class="fieldrequired">';
|
||||||
print $langs->trans('DATAPOLICIESREFUSE').'</td><td>';
|
print $langs->trans('DATAPOLICYREFUSE').'</td><td>';
|
||||||
|
|
||||||
print $langs->trans('');
|
print $langs->trans('');
|
||||||
$doleditor = new DolEditor($ref, $conf->global->$ref, '', 250, 'Full', '', false, true, 1, 200, 70);
|
$doleditor = new DolEditor($ref, $conf->global->$ref, '', 250, 'Full', '', false, true, 1, 200, 70);
|
||||||
@ -160,7 +176,7 @@ print dol_get_fiche_end();
|
|||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
print $langs->trans('SendAgreementText');
|
print $langs->trans('SendAgreementText');
|
||||||
print '<a class="button" href="'.DOL_URL_ROOT.'/datapolicy/mailing.php">'.$langs->trans('SendAgreement').'</a>';
|
print '<a class="button" href="'.DOL_URL_ROOT.'/datapolicy/admin/mailing.php">'.$langs->trans('SendAgreementRequestByEmail').'</a>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -331,9 +331,9 @@ class ActionsDatapolicy
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
$langs->load('datapolicy@datapolicy');
|
$langs->load('datapolicy@datapolicy');
|
||||||
|
|
||||||
if (!empty($conf->global->DATAPOLICIES_ENABLE_EMAILS)) {
|
if (!empty($conf->global->DATAPOLICY_ENABLE_EMAILS)) {
|
||||||
$dialog = '<div id="dialogdatapolicy" style="display:none;" title="'.$langs->trans('DATAPOLICIES_PORTABILITE_TITLE').'">';
|
$dialog = '<div id="dialogdatapolicy" style="display:none;" title="'.$langs->trans('DATAPOLICY_PORTABILITE_TITLE').'">';
|
||||||
$dialog .= '<div class="confirmmessage">'.img_help('', '').' '.$langs->trans('DATAPOLICIES_PORTABILITE_CONFIRMATION').'</div>';
|
$dialog .= '<div class="confirmmessage">'.img_help('', '').' '.$langs->trans('DATAPOLICY_PORTABILITE_CONFIRMATION').'</div>';
|
||||||
$dialog .= "</div>";
|
$dialog .= "</div>";
|
||||||
$dialog .= '<script>
|
$dialog .= '<script>
|
||||||
$( function() {
|
$( function() {
|
||||||
@ -359,18 +359,18 @@ class ActionsDatapolicy
|
|||||||
</script>';
|
</script>';
|
||||||
echo $dialog;
|
echo $dialog;
|
||||||
if ($parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
|
if ($parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
|
||||||
echo '<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?socid=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICIES_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICIES_PORTABILITE").'</a></div>';
|
echo '<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?socid=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICY_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICY_PORTABILITE").'</a></div>';
|
||||||
} elseif ($parameters['currentcontext'] == 'membercard') {
|
} elseif ($parameters['currentcontext'] == 'membercard') {
|
||||||
echo '<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICIES_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICIES_PORTABILITE").'</a></div>';
|
echo '<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICY_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICY_PORTABILITE").'</a></div>';
|
||||||
} elseif ($parameters['currentcontext'] == 'contactcard') {
|
} elseif ($parameters['currentcontext'] == 'contactcard') {
|
||||||
echo '<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?id=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICIES_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICIES_PORTABILITE").'</a></div>';
|
echo '<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?id=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICY_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICY_PORTABILITE").'</a></div>';
|
||||||
}
|
}
|
||||||
if (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
|
if (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
|
||||||
echo '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?socid=".$object->id.'&action=send_datapolicy" title="'.$langs->trans('DATAPOLICIES_SEND').'">'.$langs->trans("DATAPOLICIES_SEND").'</a></div>';
|
echo '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?socid=".$object->id.'&action=send_datapolicy" title="'.$langs->trans('DATAPOLICY_SEND').'">'.$langs->trans("DATAPOLICY_SEND").'</a></div>';
|
||||||
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'membercard') {
|
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'membercard') {
|
||||||
echo '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id.'&action=send_datapolicy" title="'.$langs->trans('DATAPOLICIES_SEND').'">'.$langs->trans("DATAPOLICIES_SEND").'</a></div>';
|
echo '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id.'&action=send_datapolicy" title="'.$langs->trans('DATAPOLICY_SEND').'">'.$langs->trans("DATAPOLICY_SEND").'</a></div>';
|
||||||
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'contactcard') {
|
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'contactcard') {
|
||||||
echo '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?id=".$object->id.'&action=send_datapolicy" title="'.$langs->trans('DATAPOLICIES_SEND').'">'.$langs->trans("DATAPOLICIES_SEND").'</a></div>';
|
echo '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?id=".$object->id.'&action=send_datapolicy" title="'.$langs->trans('DATAPOLICY_SEND').'">'.$langs->trans("DATAPOLICY_SEND").'</a></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -412,7 +412,7 @@ class ActionsDatapolicy
|
|||||||
if ((in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $societe->typent_id == 8) && $societe->isObjectUsed(GETPOST('socid'))) {
|
if ((in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $societe->typent_id == 8) && $societe->isObjectUsed(GETPOST('socid'))) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||||
$form = new Form($this->db);
|
$form = new Form($this->db);
|
||||||
echo $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".GETPOST('socid'), substr($langs->trans("DATAPOLICIES_POPUP_ANONYME_TITLE"), 0, strlen($langs->trans("DATAPOLICIES_POPUP_ANONYME_TITLE")) - 2), $langs->trans("DATAPOLICIES_POPUP_ANONYME_TEXTE"), 'anonymiser', '', '', 1);
|
echo $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".GETPOST('socid'), substr($langs->trans("DATAPOLICY_POPUP_ANONYME_TITLE"), 0, strlen($langs->trans("DATAPOLICY_POPUP_ANONYME_TITLE")) - 2), $langs->trans("DATAPOLICY_POPUP_ANONYME_TEXTE"), 'anonymiser', '', '', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -161,17 +162,17 @@ class DataPolicy
|
|||||||
$from = $user->getFullName($langs).' <'.$user->email.'>';
|
$from = $user->getFullName($langs).' <'.$user->email.'>';
|
||||||
|
|
||||||
$sendto = $contact->email;
|
$sendto = $contact->email;
|
||||||
$code = md5($contact->email);
|
$code = dol_hash($contact->email, 'md5');
|
||||||
if (!empty($contact->default_lang)) {
|
if (!empty($contact->default_lang)) {
|
||||||
$l = $contact->default_lang;
|
$l = $contact->default_lang;
|
||||||
} else {
|
} else {
|
||||||
$l = $langs->defaultlang;
|
$l = $langs->defaultlang;
|
||||||
}
|
}
|
||||||
// TODO Use a dolibarr email template
|
// TODO Use a dolibarr email template
|
||||||
$s = "DATAPOLICIESSUBJECT_".$l;
|
$s = "DATAPOLICYSUBJECT_".$l;
|
||||||
$ma = "DATAPOLICIESCONTENT_".$l;
|
$ma = "DATAPOLICYCONTENT_".$l;
|
||||||
$la = 'TXTLINKDATAPOLICIESACCEPT_'.$l;
|
$la = 'TXTLINKDATAPOLICYACCEPT_'.$l;
|
||||||
$lr = 'TXTLINKDATAPOLICIESREFUSE_'.$l;
|
$lr = 'TXTLINKDATAPOLICYREFUSE_'.$l;
|
||||||
|
|
||||||
$subject = $conf->global->$s;
|
$subject = $conf->global->$s;
|
||||||
$message = $conf->global->$ma;
|
$message = $conf->global->$ma;
|
||||||
@ -182,8 +183,8 @@ class DataPolicy
|
|||||||
$deliveryreceipt = 0;
|
$deliveryreceipt = 0;
|
||||||
|
|
||||||
$substitutionarray = array(
|
$substitutionarray = array(
|
||||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linka.'</a>',
|
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/public/datapolicy/index.php?action=1&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linka.'</a>',
|
||||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linkr.'</a>',
|
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/public/datapolicy/index.php?action=2&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linkr.'</a>',
|
||||||
'__FIRSTNAME__' => $contact->firstname,
|
'__FIRSTNAME__' => $contact->firstname,
|
||||||
'__NAME__' => $contact->lastname,
|
'__NAME__' => $contact->lastname,
|
||||||
'__CIVILITY__' => $contact->civility,
|
'__CIVILITY__' => $contact->civility,
|
||||||
@ -238,17 +239,17 @@ class DataPolicy
|
|||||||
|
|
||||||
$sendto = $societe->email;
|
$sendto = $societe->email;
|
||||||
|
|
||||||
$code = md5($societe->email);
|
$code = dol_hash($societe->email, 'md5');
|
||||||
if (!empty($societe->default_lang)) {
|
if (!empty($societe->default_lang)) {
|
||||||
$l = $societe->default_lang;
|
$l = $societe->default_lang;
|
||||||
} else {
|
} else {
|
||||||
$l = $langs->defaultlang;
|
$l = $langs->defaultlang;
|
||||||
}
|
}
|
||||||
// TODO Use a dolibarr email template
|
// TODO Use a dolibarr email template
|
||||||
$s = "DATAPOLICIESSUBJECT_".$l;
|
$s = "DATAPOLICYSUBJECT_".$l;
|
||||||
$ma = "DATAPOLICIESCONTENT_".$l;
|
$ma = "DATAPOLICYCONTENT_".$l;
|
||||||
$la = 'TXTLINKDATAPOLICIESACCEPT_'.$l;
|
$la = 'TXTLINKDATAPOLICYACCEPT_'.$l;
|
||||||
$lr = 'TXTLINKDATAPOLICIESREFUSE_'.$l;
|
$lr = 'TXTLINKDATAPOLICYREFUSE_'.$l;
|
||||||
|
|
||||||
$subject = $conf->global->$s;
|
$subject = $conf->global->$s;
|
||||||
$message = $conf->global->$ma;
|
$message = $conf->global->$ma;
|
||||||
@ -259,8 +260,8 @@ class DataPolicy
|
|||||||
$deliveryreceipt = 0;
|
$deliveryreceipt = 0;
|
||||||
|
|
||||||
$substitutionarray = array(
|
$substitutionarray = array(
|
||||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linka.'</a>',
|
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/public/datapolicy/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linka.'</a>',
|
||||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linkr.'</a>',
|
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/public/datapolicy/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linkr.'</a>',
|
||||||
);
|
);
|
||||||
$subject = make_substitutions($subject, $substitutionarray);
|
$subject = make_substitutions($subject, $substitutionarray);
|
||||||
$message = make_substitutions($message, $substitutionarray);
|
$message = make_substitutions($message, $substitutionarray);
|
||||||
@ -311,17 +312,17 @@ class DataPolicy
|
|||||||
|
|
||||||
$sendto = $adherent->email;
|
$sendto = $adherent->email;
|
||||||
|
|
||||||
$code = md5($adherent->email);
|
$code = dol_hash($adherent->email, 'md5');
|
||||||
if (!empty($adherent->default_lang)) {
|
if (!empty($adherent->default_lang)) {
|
||||||
$l = $adherent->default_lang;
|
$l = $adherent->default_lang;
|
||||||
} else {
|
} else {
|
||||||
$l = $langs->defaultlang;
|
$l = $langs->defaultlang;
|
||||||
}
|
}
|
||||||
// TODO Use a dolibarr email template
|
// TODO Use a dolibarr email template
|
||||||
$s = 'TXTLINKDATAPOLICIESSUBJECT_'.$l;
|
$s = 'TXTLINKDATAPOLICYSUBJECT_'.$l;
|
||||||
$ma = 'TXTLINKDATAPOLICIESMESSAGE_'.$l;
|
$ma = 'TXTLINKDATAPOLICYMESSAGE_'.$l;
|
||||||
$la = 'TXTLINKDATAPOLICIESACCEPT_'.$l;
|
$la = 'TXTLINKDATAPOLICYACCEPT_'.$l;
|
||||||
$lr = 'TXTLINKDATAPOLICIESREFUSE_'.$l;
|
$lr = 'TXTLINKDATAPOLICYREFUSE_'.$l;
|
||||||
|
|
||||||
$subject = $conf->global->$s;
|
$subject = $conf->global->$s;
|
||||||
$message = $conf->global->$ma;
|
$message = $conf->global->$ma;
|
||||||
@ -332,8 +333,8 @@ class DataPolicy
|
|||||||
$deliveryreceipt = 0;
|
$deliveryreceipt = 0;
|
||||||
|
|
||||||
$substitutionarray = array(
|
$substitutionarray = array(
|
||||||
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&a='.$adherent->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linka.'</a>',
|
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/public/datapolicy/index.php?action=1&a='.$adherent->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linka.'</a>',
|
||||||
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&a='.$adherent->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linkr.'</a>',
|
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/public/datapolicy/index.php?action=2&a='.$adherent->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linkr.'</a>',
|
||||||
);
|
);
|
||||||
$subject = make_substitutions($subject, $substitutionarray);
|
$subject = make_substitutions($subject, $substitutionarray);
|
||||||
$message = make_substitutions($message, $substitutionarray);
|
$message = make_substitutions($message, $substitutionarray);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class DataPolicyCron
|
|||||||
|
|
||||||
// FIXME Exclude data from the selection if there is at least 1 invoice.
|
// FIXME Exclude data from the selection if there is at least 1 invoice.
|
||||||
$arrayofparameters = array(
|
$arrayofparameters = array(
|
||||||
'DATAPOLICIES_TIERS_CLIENT' => array(
|
'DATAPOLICY_TIERS_CLIENT' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
||||||
WHERE s.entity = %d
|
WHERE s.entity = %d
|
||||||
@ -90,7 +90,7 @@ class DataPolicyCron
|
|||||||
'country_id' => '',
|
'country_id' => '',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'DATAPOLICIES_TIERS_PROSPECT' => array(
|
'DATAPOLICY_TIERS_PROSPECT' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
||||||
WHERE s.entity = %d
|
WHERE s.entity = %d
|
||||||
@ -124,7 +124,7 @@ class DataPolicyCron
|
|||||||
'country_id' => '',
|
'country_id' => '',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'DATAPOLICIES_TIERS_PROSPECT_CLIENT' => array(
|
'DATAPOLICY_TIERS_PROSPECT_CLIENT' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
||||||
WHERE s.entity = %d
|
WHERE s.entity = %d
|
||||||
@ -158,7 +158,7 @@ class DataPolicyCron
|
|||||||
'country_id' => '',
|
'country_id' => '',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'DATAPOLICIES_TIERS_NIPROSPECT_NICLIENT' => array(
|
'DATAPOLICY_TIERS_NIPROSPECT_NICLIENT' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
||||||
WHERE s.entity = %d
|
WHERE s.entity = %d
|
||||||
@ -192,7 +192,7 @@ class DataPolicyCron
|
|||||||
'country_id' => '',
|
'country_id' => '',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'DATAPOLICIES_TIERS_FOURNISSEUR' => array(
|
'DATAPOLICY_TIERS_FOURNISSEUR' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
||||||
WHERE s.entity = %d
|
WHERE s.entity = %d
|
||||||
@ -225,7 +225,7 @@ class DataPolicyCron
|
|||||||
'country_id' => '',
|
'country_id' => '',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'DATAPOLICIES_CONTACT_CLIENT' => array(
|
'DATAPOLICY_CONTACT_CLIENT' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT c.rowid FROM ".MAIN_DB_PREFIX."socpeople as c
|
SELECT c.rowid FROM ".MAIN_DB_PREFIX."socpeople as c
|
||||||
INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc
|
INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc
|
||||||
@ -263,7 +263,7 @@ class DataPolicyCron
|
|||||||
'country_id' => '',
|
'country_id' => '',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'DATAPOLICIES_CONTACT_PROSPECT' => array(
|
'DATAPOLICY_CONTACT_PROSPECT' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT c.rowid FROM ".MAIN_DB_PREFIX."socpeople as c
|
SELECT c.rowid FROM ".MAIN_DB_PREFIX."socpeople as c
|
||||||
INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc
|
INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc
|
||||||
@ -301,7 +301,7 @@ class DataPolicyCron
|
|||||||
'country_id' => '',
|
'country_id' => '',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'DATAPOLICIES_CONTACT_PROSPECT_CLIENT' => array(
|
'DATAPOLICY_CONTACT_PROSPECT_CLIENT' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT c.rowid FROM ".MAIN_DB_PREFIX."socpeople as c
|
SELECT c.rowid FROM ".MAIN_DB_PREFIX."socpeople as c
|
||||||
INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc
|
INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc
|
||||||
@ -339,7 +339,7 @@ class DataPolicyCron
|
|||||||
'country_id' => '',
|
'country_id' => '',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'DATAPOLICIES_CONTACT_NIPROSPECT_NICLIENT' => array(
|
'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT c.rowid FROM ".MAIN_DB_PREFIX."socpeople as c
|
SELECT c.rowid FROM ".MAIN_DB_PREFIX."socpeople as c
|
||||||
INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc
|
INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc
|
||||||
@ -377,7 +377,7 @@ class DataPolicyCron
|
|||||||
'country_id' => '',
|
'country_id' => '',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'DATAPOLICIES_CONTACT_FOURNISSEUR' => array(
|
'DATAPOLICY_CONTACT_FOURNISSEUR' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT c.rowid FROM ".MAIN_DB_PREFIX."socpeople as c
|
SELECT c.rowid FROM ".MAIN_DB_PREFIX."socpeople as c
|
||||||
INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc
|
INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc
|
||||||
@ -414,7 +414,7 @@ class DataPolicyCron
|
|||||||
'country_id' => '',
|
'country_id' => '',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'DATAPOLICIES_ADHERENT' => array(
|
'DATAPOLICY_ADHERENT' => array(
|
||||||
'sql' => "
|
'sql' => "
|
||||||
SELECT a.rowid FROM ".MAIN_DB_PREFIX."adherent as a
|
SELECT a.rowid FROM ".MAIN_DB_PREFIX."adherent as a
|
||||||
WHERE a.entity = %d
|
WHERE a.entity = %d
|
||||||
|
|||||||
@ -1,97 +0,0 @@
|
|||||||
# Copyright (C) 2018 INOVEA CONSEil info@inovea-conseil.com
|
|
||||||
#
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
#
|
|
||||||
# Générique
|
|
||||||
#
|
|
||||||
|
|
||||||
# Module label 'ModuledatapolicyName'
|
|
||||||
Module4100Name = Protection des Données
|
|
||||||
# Module description 'ModuledatapolicyDesc'
|
|
||||||
Module4100Desc = Module de gestion de la protection des données (RGPD)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Page d'administration
|
|
||||||
#
|
|
||||||
datapolicySetup = Configuration du module Protection des données
|
|
||||||
Settings_DATAPOLICY = Paramétrage du module Protection des données
|
|
||||||
datapolicySetupPage = Selon la loi de votre pays (Exemple <a href="http://www.privacy-regulation.eu/fr/5.htm" target="_blank" rel="noopener noreferrer">l’article 5</a> du RGPD), les données à caractère personnel doivent être conservées pendant une durée n’excédant pas celle nécessaire au regard des finalités pour lesquelles elles ont été traitées, à l’exception de fins archivistiques. La suppression se fera automatiquement après une certaine durée sans évènement (la durée que vous aurez indiquée ci-dessous).
|
|
||||||
NB_MONTHS = %s mois
|
|
||||||
ONE_YEAR = 1 an
|
|
||||||
NB_YEARS = %s ans
|
|
||||||
DATAPOLICY_TIERS_CLIENT = Client
|
|
||||||
DATAPOLICY_TIERS_PROSPECT = Prospect
|
|
||||||
DATAPOLICY_TIERS_PROSPECT_CLIENT = Prospect/Client
|
|
||||||
DATAPOLICY_TIERS_NIPROSPECT_NICLIENT = Ni prospect / Ni client
|
|
||||||
DATAPOLICY_TIERS_FOURNISSEUR = Fournisseur
|
|
||||||
DATAPOLICY_CONTACT_CLIENT = Client
|
|
||||||
DATAPOLICY_CONTACT_PROSPECT = Prospect
|
|
||||||
DATAPOLICY_CONTACT_PROSPECT_CLIENT = Prospect/Client
|
|
||||||
DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT = Ni prospect / Ni client
|
|
||||||
DATAPOLICY_CONTACT_FOURNISSEUR = Fournisseur
|
|
||||||
DATAPOLICY_ADHERENT = Adhérent
|
|
||||||
DATAPOLICY_Tooltip_SETUP = Type du contact - Indiquez vos choix pour chaque type.
|
|
||||||
DATAPOLICYMail=Paramétrage des emails
|
|
||||||
DATAPOLICYSUBJECTMAIL=Objet du mail
|
|
||||||
DATAPOLICYCONTENTMAIL=Contenu du mail
|
|
||||||
DATAPOLICYSUBSITUTION=Vous pouvez utiliser les variables suivantes dans votre email (LINKACCEPT permet de créer un lien enregistrant l'acceptation de la personne, LINKREFUSED permet d'enregistrer le refus de la personne) :
|
|
||||||
DATAPOLICYACCEPT=Message suite acceptation
|
|
||||||
DATAPOLICYREFUSE=Message suite opposition
|
|
||||||
SendAgreementText=Vous pouvez envoyer un email DATAPOLICY à tous vos contacts concernés (qui n'ont pas encore reçus de mail et pour lesquels vous n'avez rien enregistré concernant leur accord/désaccord DATAPOLICY). Pour cela, utilisez le bouton suivant.
|
|
||||||
SendAgreement=Envoyer les emails
|
|
||||||
AllAgreementSend = Tous les e-mails de consentement ont été envoyés
|
|
||||||
TXTLINKDATAPOLICYACCEPT= Texte du lien d'acceptation
|
|
||||||
TXTLINKDATAPOLICYREFUSE= Texte du lien d'opposition
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Extrafield
|
|
||||||
#
|
|
||||||
DATAPOLICY_BLOCKCHECKBOX = DATAPOLICY : Traitement des données à caractère personnel
|
|
||||||
DATAPOLICY_consentement = Consentement recueilli pour le traitement des données à caractère personnel le concernant
|
|
||||||
DATAPOLICY_opposition_traitement = S’oppose au traitement de ses données à caractère personnel
|
|
||||||
DATAPOLICY_opposition_prospection = S’oppose au traitement de ses données à caractère personnel à des fins de prospection
|
|
||||||
|
|
||||||
#
|
|
||||||
# Popup
|
|
||||||
#
|
|
||||||
DATAPOLICY_POPUP_ANONYME_TITLE = Anonymiser un tiers
|
|
||||||
DATAPOLICY_POPUP_ANONYME_TEXTE = Vous ne pouvez pas supprimer ce contact de Dolibarr car des éléments y sont liés. Conformément au DATAPOLICY, vous allez rendre toutes ces données anonymes afin de respecter vos obligations. Souhaitez-vous continuer ?
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bouton portabilité
|
|
||||||
#
|
|
||||||
DATAPOLICY_PORTABILITE = Portabilité DATAPOLICY
|
|
||||||
DATAPOLICY_PORTABILITE_TITLE = Export des données à caractère personnel
|
|
||||||
DATAPOLICY_PORTABILITE_CONFIRMATION = Vous souhaitez exporter les données à caractère personnel de ce contact. Etes-vous sûr ?
|
|
||||||
|
|
||||||
#
|
|
||||||
# Note ajoutés lors d'une anonymisation
|
|
||||||
#
|
|
||||||
ANONYMISER_AT = Anonymisé le %s
|
|
||||||
|
|
||||||
#V2
|
|
||||||
DATAPOLICYReturn=Validation DATAPOLICY
|
|
||||||
DATAPOLICY_date=Date d'accord/opposition au traitement
|
|
||||||
DATAPOLICY_send=Date envoi consentement
|
|
||||||
DATAPOLICYReturn=Retour DATAPOLICY
|
|
||||||
DATAPOLICY_SEND=Envoyer l'email de consentement
|
|
||||||
MailSent=L'email a bien été envoyé
|
|
||||||
|
|
||||||
#ERROR
|
|
||||||
ErrorSubjectIsRequired=Erreur : vous n'avez pas indiqué l'objet de l'email dans la configuration
|
|
||||||
=Suite à un problème technique, nous n'avons pas pu enregistrer votre choix. Nous nous en excusons. Contactez-nous pour nous transmettre votre choix.
|
|
||||||
NUMBER_MONTH_BEFORE_DELETION = Nombre de mois avant suppression des données
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
# Copyright (C) 2018 INOVEA CONSEIl info@inovea-conseil.com - Thanks to Claudio Aschieri
|
|
||||||
#
|
|
||||||
# # Module label 'ModuledatapolicyName'
|
|
||||||
Module4100Name = Data Policy
|
|
||||||
# Module description 'ModuledatapolicyDesc'
|
|
||||||
Module4100Desc = Conformità con GDPR
|
|
||||||
|
|
||||||
#
|
|
||||||
# Page d'administration
|
|
||||||
#
|
|
||||||
datapolicySetup = Module Setup
|
|
||||||
Settings_DATAPOLICY = Configurazione modulo GDPR
|
|
||||||
datapolicySetupPage = In accordo con <a href="http://www.privacy-regulation.eu/it/5.htm" target="_blank" rel="noopener noreferrer">l'art 5 del GDPR </a> i dati personali devono essere conservati per un periodo di tempo che .... ed eliminati se non sono più utili agli scopi per cui sono stati processati.
|
|
||||||
NB_MONTHS = %s mesi
|
|
||||||
ONE_YEAR = 1 anno
|
|
||||||
NB_YEARS = %s anni
|
|
||||||
DATAPOLICY_TIERS_CLIENT = Cliente
|
|
||||||
DATAPOLICY_TIERS_PROSPECT = Fornitore
|
|
||||||
DATAPOLICY_TIERS_PROSPECT_CLIENT = Potenziale Cliente / Cliente
|
|
||||||
DATAPOLICY_TIERS_NIPROSPECT_NICLIENT = Nè potenziale cliente / Nè cliente
|
|
||||||
DATAPOLICY_TIERS_FOURNISSEUR = Fornitore
|
|
||||||
DATAPOLICY_CONTACT_CLIENT = Cliente
|
|
||||||
DATAPOLICY_CONTACT_PROSPECT = Potenziale cliente
|
|
||||||
DATAPOLICY_CONTACT_PROSPECT_CLIENT = Potenziale Cliente / Cliente
|
|
||||||
DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT = Nè potenziale cliente / Nè cliente
|
|
||||||
DATAPOLICY_CONTACT_FOURNISSEUR = Fornitore
|
|
||||||
DATAPOLICY_ADHERENT = Membri
|
|
||||||
DATAPOLICY_Tooltip_SETUP = Tipo di contatto - Indica la scelta per ogni tipologia
|
|
||||||
DATAPOLICYMail=Configurazione Email
|
|
||||||
DATAPOLICYSUBJECTMAIL=Subject dell'e-mail
|
|
||||||
DATAPOLICYCONTENTMAIL=Contenuto dell'e-mail
|
|
||||||
DATAPOLICYSUBSITUTION=Puoi utilizzare le seguenti variabili nella tua email (LINKACCEPT consente di creare un link per registrare l'accettazione della persona, LINKREFUSED consente di registrare il rifiuto della persona):
|
|
||||||
DATAPOLICYACCEPT= Messaggio dopo il consenso
|
|
||||||
DATAPOLICYREFUSE=Messaggio dopo il rifiuto
|
|
||||||
SendAgreementText=Puoi inviare un'email GDPR a tutti i tuoi contatti rilevanti (che non hanno ancora ricevuto un'e-mail e per i quali non hai registrato nulla sul loro accordo GDPR). Per fare ciò, utilizzare il seguente pulsante.
|
|
||||||
SendAgreement=Invia emails
|
|
||||||
AllAgreementSend = Tutte le email sono state inviate
|
|
||||||
TXTLINKDATAPOLICYACCEPT= Testo per il link "Consenso"
|
|
||||||
TXTLINKDATAPOLICYREFUSE= Testo per il link "Consenso negato"
|
|
||||||
|
|
||||||
#
|
|
||||||
# Extrafield
|
|
||||||
#
|
|
||||||
DATAPOLICY_BLOCKCHECKBOX = GDPR : Trattamento dei dati personali
|
|
||||||
DATAPOLICY_consentement = Consenso ottenuto al Trattamento dei dati personali
|
|
||||||
DATAPOLICY_opposition_traitement = Consenso negato al trattamento dei dati personali
|
|
||||||
DATAPOLICY_opposition_prospection = Consenso negato al trattamento dei dati personali a fini commerciali
|
|
||||||
|
|
||||||
#
|
|
||||||
# Popup
|
|
||||||
#
|
|
||||||
DATAPOLICY_POPUP_ANONYME_TITLE = Anonimizza un soggetto terzo
|
|
||||||
DATAPOLICY_POPUP_ANONYME_TEXTE = Impossibile eliminare questo contatto da Dolibarr perchè vi sono elementi collegati. In conformità con il GDPR, renderai tutti questi dati anonimi per rispettare i tuoi obblighi. Vuoi continuare?
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bouton portabilité
|
|
||||||
#
|
|
||||||
DATAPOLICY_PORTABILITE = Portabilità GDPR
|
|
||||||
DATAPOLICY_PORTABILITE_TITLE = Esporta i dati personali
|
|
||||||
DATAPOLICY_PORTABILITE_CONFIRMATION = Vuoi davvero esportare i dati personali di questo contatto?
|
|
||||||
|
|
||||||
#
|
|
||||||
# Note ajoutée lors d'une anonymisation
|
|
||||||
#
|
|
||||||
ANONYMISER_AT = Anonimizzato il %s
|
|
||||||
|
|
||||||
#V2
|
|
||||||
DATAPOLICYReturn=GDPR Validazione
|
|
||||||
DATAPOLICY_date = Data di accordo / disaccordo GDPR
|
|
||||||
DATAPOLICY_send = Data di invio del consenso (e-mail)
|
|
||||||
DATAPOLICYReturn = GDPR ritorno
|
|
||||||
DATAPOLICY_SEND = Inviare GDPR e-mail
|
|
||||||
MailSent=L'email è stata inviata
|
|
||||||
|
|
||||||
#ERROR
|
|
||||||
ErrorSubjectIsRequired= Errore: L'oggetto della mail è obbligatorio. Inserisci l'oggetto nella configurazione del modulo.
|
|
||||||
=A causa di un problema tecnico, non siamo stati in grado di registrare la tua scelta. Ci scusiamo per questo. Contattaci per inviarci la tua scelta.
|
|
||||||
@ -31,7 +31,7 @@ function datapolicyAdminPrepareHead()
|
|||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
$langs->load("datapolicy@datapolicy");
|
$langs->load("datapolicy");
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
@ -41,10 +41,10 @@ function datapolicyAdminPrepareHead()
|
|||||||
$head[$h][2] = 'settings';
|
$head[$h][2] = 'settings';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if (!empty($conf->global->DATAPOLICIES_ENABLE_EMAILS)) {
|
if (!empty($conf->global->DATAPOLICY_ENABLE_EMAILS) || getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
|
||||||
$head[$h][0] = DOL_URL_ROOT."/datapolicy/admin/setupmail.php";
|
$head[$h][0] = DOL_URL_ROOT."/datapolicy/admin/setupmail.php";
|
||||||
$head[$h][1] = $langs->trans("DATAPOLICIESMail");
|
$head[$h][1] = $langs->trans("DATAPOLICYMail");
|
||||||
$head[$h][2] = 'settings';
|
$head[$h][2] = 'emailing';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -75,7 +75,7 @@ if (isset($user->socid) && $user->socid > 0) {
|
|||||||
// Security check (enable the most restrictive one)
|
// Security check (enable the most restrictive one)
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//if (!isModEnabled('barcode')) {
|
//if (!isModEnabled('mymodule')) {
|
||||||
// accessforbidden('Module not enabled');
|
// accessforbidden('Module not enabled');
|
||||||
//}
|
//}
|
||||||
//if (! $user->hasRight('mymodule', 'myobject', 'read')) {
|
//if (! $user->hasRight('mymodule', 'myobject', 'read')) {
|
||||||
|
|||||||
@ -148,7 +148,9 @@ if ($enablepermissioncheck) {
|
|||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (!isModEnabled("mymodule")) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -148,8 +148,12 @@ $upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object-
|
|||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (!isModEnabled("mymodule")) {
|
||||||
if (!$permissiontoread) accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (!$permissiontoread) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -94,7 +94,9 @@ if ($enablepermissioncheck) {
|
|||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (!isModEnabled("mymodule")) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -140,7 +140,9 @@ if ($enablepermissioncheck) {
|
|||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (!isModEnabled("mymodule")) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -199,7 +199,9 @@ if ($user->socid > 0) accessforbidden();
|
|||||||
//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
|
//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, 0, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, 0, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
if (empty($conf->mymodule->enabled)) accessforbidden('Module not enabled');
|
if (!isModEnabled("mymodule")) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -120,7 +120,9 @@ if ($enablepermissioncheck) {
|
|||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (!isModEnabled("mymodule")) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
/* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -19,15 +18,12 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/datapolicy/admin/setup.php
|
* \file htdocs/datapolicy/admin/setup.php
|
||||||
* \ingroup datapolicy
|
* \ingroup datapolicy
|
||||||
* \brief datapolicy setup page.
|
* \brief Page to show the result of updating it Data policiy preferences after an email campaign using sendMailDataPolicyContact()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('NOLOGIN')) {
|
if (!defined('NOLOGIN')) {
|
||||||
define("NOLOGIN", 1); // This means this output page does not require to be logged.
|
define("NOLOGIN", 1); // This means this output page does not require to be logged.
|
||||||
}
|
}
|
||||||
if (!defined('NOCSRFCHECK')) {
|
|
||||||
define('NOCSRFCHECK', '1'); // Do not check anti CSRF attack test
|
|
||||||
}
|
|
||||||
if (!defined('NOREQUIREMENU')) {
|
if (!defined('NOREQUIREMENU')) {
|
||||||
define('NOREQUIREMENU', '1');
|
define('NOREQUIREMENU', '1');
|
||||||
}
|
}
|
||||||
@ -38,89 +34,103 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
|
||||||
|
|
||||||
$idc = GETPOST('c', 'int');
|
$idc = GETPOST('c', 'int');
|
||||||
$ids = GETPOST('s', 'int');
|
$ids = GETPOST('s', 'int');
|
||||||
$ida = GETPOST('a', 'int');
|
$ida = GETPOST('a', 'int');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09'); // 1 or 2
|
||||||
$lang = GETPOST('l', 'alpha');
|
$l = GETPOST('l', 'alpha');
|
||||||
$code = GETPOST('key', 'alpha');
|
$securitykey = GETPOST('key', 'alpha');
|
||||||
|
|
||||||
$acc = "DATAPOLICIESACCEPT_".$lang;
|
$acc = "DATAPOLICIESACCEPT_".$l;
|
||||||
$ref = "DATAPOLICIESREFUSE_".$lang;
|
$ref = "DATAPOLICIESREFUSE_".$l;
|
||||||
$langs->load('datapolicy@datapolicy', 0, 0, $lang);
|
$langs->load('datapolicy', 0, 0, $l);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
if (empty($action) || (empty($idc) && empty($ids) && empty($ida))) {
|
if (empty($action) || (empty($idc) && empty($ids) && empty($ida))) {
|
||||||
|
print 'Missing paramater s, c or a';
|
||||||
return 0;
|
return 0;
|
||||||
} elseif (!empty($idc)) {
|
} elseif (!empty($idc)) {
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
$contact->fetch($idc);
|
$contact->fetch($idc);
|
||||||
$check = md5($contact->email);
|
$check = dol_hash($contact->email, 'md5');
|
||||||
if ($check != $code) {
|
if ($check != $securitykey) {
|
||||||
$return = $langs->trans('ErrorEmailDATAPOLICIES');
|
$return = $langs->trans('Bad value for key.');
|
||||||
} elseif ($action == 1) {
|
} elseif ($action == 1) {
|
||||||
$contact->array_options['options_datapolicy_consentement'] = 1;
|
$contact->array_options['options_datapolicy_consentement'] = 1;
|
||||||
$contact->array_options['options_datapolicy_opposition_traitement'] = 0;
|
$contact->array_options['options_datapolicy_opposition_traitement'] = 0;
|
||||||
$contact->array_options['options_datapolicy_opposition_prospection'] = 0;
|
$contact->array_options['options_datapolicy_opposition_prospection'] = 0;
|
||||||
$contact->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
$contact->array_options['options_datapolicy_date'] = dol_now();
|
||||||
|
|
||||||
$return = $conf->global->$acc;
|
$return = getDolGlobalString($acc);
|
||||||
} elseif ($action == 2) {
|
} elseif ($action == 2) {
|
||||||
$contact->no_email = 1;
|
$contact->no_email = 1;
|
||||||
$contact->array_options['options_datapolicy_consentement'] = 0;
|
$contact->array_options['options_datapolicy_consentement'] = 0;
|
||||||
$contact->array_options['options_datapolicy_opposition_traitement'] = 1;
|
$contact->array_options['options_datapolicy_opposition_traitement'] = 1;
|
||||||
$contact->array_options['options_datapolicy_opposition_prospection'] = 1;
|
$contact->array_options['options_datapolicy_opposition_prospection'] = 1;
|
||||||
$contact->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
$contact->array_options['options_datapolicy_date'] = dol_now();
|
||||||
|
|
||||||
$return = $conf->global->$ref;
|
$return = getDolGlobalString($ref);
|
||||||
}
|
}
|
||||||
$contact->update($idc);
|
$contact->update($idc);
|
||||||
} elseif (!empty($ids)) {
|
} elseif (!empty($ids)) {
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
$societe->fetch($ids);
|
$societe->fetch($ids);
|
||||||
$check = md5($societe->email);
|
$check = dol_hash($societe->email, 'md5');
|
||||||
if ($check != $code) {
|
if ($check != $securitykey) {
|
||||||
$return = $langs->trans('ErrorEmailDATAPOLICIES');
|
$return = $langs->trans('Bad value for key.');
|
||||||
} elseif ($action == 1) {
|
} elseif ($action == 1) {
|
||||||
$societe->array_options['options_datapolicy_consentement'] = 1;
|
$societe->array_options['options_datapolicy_consentement'] = 1;
|
||||||
$societe->array_options['options_datapolicy_opposition_traitement'] = 0;
|
$societe->array_options['options_datapolicy_opposition_traitement'] = 0;
|
||||||
$societe->array_options['options_datapolicy_opposition_prospection'] = 0;
|
$societe->array_options['options_datapolicy_opposition_prospection'] = 0;
|
||||||
$societe->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
$societe->array_options['options_datapolicy_date'] = dol_now();
|
||||||
$return = $conf->global->$acc;
|
|
||||||
|
$return = getDolGlobalString($acc);
|
||||||
} elseif ($action == 2) {
|
} elseif ($action == 2) {
|
||||||
$societe->array_options['options_datapolicy_consentement'] = 0;
|
$societe->array_options['options_datapolicy_consentement'] = 0;
|
||||||
$societe->array_options['options_datapolicy_opposition_traitement'] = 1;
|
$societe->array_options['options_datapolicy_opposition_traitement'] = 1;
|
||||||
$societe->array_options['options_datapolicy_opposition_prospection'] = 1;
|
$societe->array_options['options_datapolicy_opposition_prospection'] = 1;
|
||||||
$societe->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
$societe->array_options['options_datapolicy_date'] = dol_now();
|
||||||
|
|
||||||
$return = $conf->global->$ref;
|
$return = getDolGlobalString($ref);
|
||||||
}
|
}
|
||||||
$societe->update($ids);
|
$societe->update($ids);
|
||||||
} elseif (!empty($ida)) {
|
} elseif (!empty($ida)) {
|
||||||
$adherent = new Adherent($db);
|
$adherent = new Adherent($db);
|
||||||
$adherent->fetch($ida);
|
$adherent->fetch($ida);
|
||||||
$check = md5($adherent->email);
|
$check = dol_hash($adherent->email, 'md5');
|
||||||
if ($check != $code) {
|
if ($check != $securitykey) {
|
||||||
$return = $langs->trans('ErrorEmailDATAPOLICIES');
|
$return = $langs->trans('Bad value for key.');
|
||||||
} elseif ($action == 1) {
|
} elseif ($action == 1) {
|
||||||
$adherent->array_options['options_datapolicy_consentement'] = 1;
|
$adherent->array_options['options_datapolicy_consentement'] = 1;
|
||||||
$adherent->array_options['options_datapolicy_opposition_traitement'] = 0;
|
$adherent->array_options['options_datapolicy_opposition_traitement'] = 0;
|
||||||
$adherent->array_options['options_datapolicy_opposition_prospection'] = 0;
|
$adherent->array_options['options_datapolicy_opposition_prospection'] = 0;
|
||||||
//$adherent->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
//$adherent->array_options['options_datapolicy_date'] = dol_now();
|
||||||
$return = $conf->global->$acc;
|
|
||||||
|
$return = getDolGlobalString($acc);
|
||||||
} elseif ($action == 2) {
|
} elseif ($action == 2) {
|
||||||
$adherent->array_options['options_datapolicy_consentement'] = 0;
|
$adherent->array_options['options_datapolicy_consentement'] = 0;
|
||||||
$adherent->array_options['options_datapolicy_opposition_traitement'] = 1;
|
$adherent->array_options['options_datapolicy_opposition_traitement'] = 1;
|
||||||
$adherent->array_options['options_datapolicy_opposition_prospection'] = 1;
|
$adherent->array_options['options_datapolicy_opposition_prospection'] = 1;
|
||||||
//$adherent->array_options['options_datapolicy_date'] = date('Y-m-d', time());
|
//$adherent->array_options['options_datapolicy_date'] = dol_now();
|
||||||
|
|
||||||
$return = $conf->global->$ref;
|
$return = getDolGlobalString($ref);
|
||||||
}
|
}
|
||||||
$newuser = new User($db);
|
$newuser = new User($db);
|
||||||
$adherent->update($newuser);
|
$adherent->update($newuser);
|
||||||
}
|
}
|
||||||
|
|
||||||
header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
top_httphead();
|
||||||
|
|
||||||
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
||||||
print "\n";
|
print "\n";
|
||||||
Loading…
Reference in New Issue
Block a user