Fix scrutinizer bugs

This commit is contained in:
Laurent Destailleur 2018-10-10 02:01:13 +02:00
parent 8f4b74733c
commit e2e935e713
2 changed files with 28 additions and 12 deletions

View File

@ -16,11 +16,9 @@
*/ */
/** /**
* \file datapolicies/class/actions_datapolicies.class.php * \file datapolicies/class/datapolicies.class.php
* \ingroup datapolicies * \ingroup datapolicies
* \brief Example hook overload. * \brief Class to manage feature of Data Policies module.
*
* Put detailed description here.
*/ */
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';
@ -147,6 +145,9 @@ Class DataPolicies extends Contact
function sendMailDataPoliciesContact($contact) function sendMailDataPoliciesContact($contact)
{ {
global $langs, $conf, $db, $user; global $langs, $conf, $db, $user;
$error = 0;
$from = $user->getFullName($langs) . ' <' . $user->email . '>'; $from = $user->getFullName($langs) . ' <' . $user->email . '>';
$replyto = $from; $replyto = $from;
$sendto = $contact->email; $sendto = $contact->email;
@ -165,6 +166,9 @@ Class DataPolicies extends Contact
$message = $conf->global->$ma; $message = $conf->global->$ma;
$linka = $conf->global->$la; $linka = $conf->global->$la;
$linkr = $conf->global->$lr; $linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$substitutionarray = array( $substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=1&c='.$contact->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>', '__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=1&c='.$contact->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>',
@ -217,6 +221,9 @@ Class DataPolicies extends Contact
function sendMailDataPoliciesCompany($societe) function sendMailDataPoliciesCompany($societe)
{ {
global $langs, $conf, $db, $user; global $langs, $conf, $db, $user;
$error = 0;
$from = $user->getFullName($langs) . ' <' . $user->email . '>'; $from = $user->getFullName($langs) . ' <' . $user->email . '>';
$replyto = $from; $replyto = $from;
$sendto = $societe->email; $sendto = $societe->email;
@ -236,7 +243,9 @@ Class DataPolicies extends Contact
$message = $conf->global->$ma; $message = $conf->global->$ma;
$linka = $conf->global->$la; $linka = $conf->global->$la;
$linkr = $conf->global->$lr; $linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$substitutionarray = array( $substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>', '__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>',
@ -284,6 +293,9 @@ Class DataPolicies extends Contact
function sendMailDataPoliciesAdherent($adherent) function sendMailDataPoliciesAdherent($adherent)
{ {
global $langs, $conf, $db, $user; global $langs, $conf, $db, $user;
$error = 0;
$from = $user->getFullName($langs) . ' <' . $user->email . '>'; $from = $user->getFullName($langs) . ' <' . $user->email . '>';
$replyto = $from; $replyto = $from;
$sendto = $adherent->email; $sendto = $adherent->email;
@ -301,7 +313,9 @@ Class DataPolicies extends Contact
$message = $conf->global->$ma; $message = $conf->global->$ma;
$linka = $conf->global->$la; $linka = $conf->global->$la;
$linkr = $conf->global->$lr; $linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$substitutionarray = array( $substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=1&a='.$adherent->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>', '__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicies/public/index.php?action=1&a='.$adherent->id.'&l='.$l.'&key='.$code,3).'" target="_blank">'.$linka.'</a>',

View File

@ -21,6 +21,7 @@
* \ingroup datapolicies * \ingroup datapolicies
* \brief datapolicies setup page. * \brief datapolicies setup page.
*/ */
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')) if (!defined('NOCSRFCHECK'))
@ -35,12 +36,13 @@ dol_include_once('/adherents/class/adherent.class.php');
dol_include_once('/user/class/user.class.php'); dol_include_once('/user/class/user.class.php');
dol_include_once('/datapolicies/class/datapolicies.class.php'); dol_include_once('/datapolicies/class/datapolicies.class.php');
$idc = GETPOST('c'); $idc = GETPOST('c', 'int');
$ids = GETPOST('s'); $ids = GETPOST('s', 'int');
$ida = GETPOST('a'); $ida = GETPOST('a', 'int');
$action = GETPOST('action'); $action = GETPOST('action', 'alpha');
$lang = GETPOST('l'); $lang = GETPOST('l', 'alpha');
$code = GETPOST('key'); $code = GETPOST('key', 'alpha');
$acc = "DATAPOLICIESACCEPT_" . $lang; $acc = "DATAPOLICIESACCEPT_" . $lang;
$ref = "DATAPOLICIESREFUSE_" . $lang; $ref = "DATAPOLICIESREFUSE_" . $lang;
$langs->load('datapolicies@datapolicies',0,0,$lang); $langs->load('datapolicies@datapolicies',0,0,$lang);