diff --git a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php
index 76ae63d7b7d..c74641876f1 100644
--- a/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php
+++ b/htdocs/contact/canvas/default/tpl/contactcard_create.tpl.php
@@ -126,11 +126,11 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
';
print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, '', $sortfield, $sortorder, 'left ');
- print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder);
- print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, 'align="center"', $sortfield, $sortorder);
+ print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'width="150"', $sortfield, $sortorder, 'center ');
+ print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('ContactType', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right ');
@@ -427,10 +427,10 @@ if ($sql_select)
print '';
print $documentstatic->getNomUrl(1);
print ' ';
- print ''.dol_print_date($db->jdate($objp->dateprint), 'day').' ';
+ print ''.dol_print_date($db->jdate($objp->dateprint), 'day').' ';
// Status
- print '';
+ print ' ';
if ($type_element == 'contract')
{
print $documentstaticline->getLibStatut(2);
@@ -616,17 +616,15 @@ if ($sql_select)
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
}
$db->free($resql);
-}
-elseif (empty($type_element) || $type_element == -1)
-{
+} elseif (empty($type_element) || $type_element == -1) {
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', '');
print ''."\n";
// Titles with sort buttons
print '';
print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, '', $sortfield, $sortorder, 'left ');
- print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder);
- print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_status', '', $param, 'align="center"', $sortfield, $sortorder);
+ print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'width="150"', $sortfield, $sortorder, 'center ');
+ print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_status', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right ');
print " \n";
@@ -634,8 +632,7 @@ elseif (empty($type_element) || $type_element == -1)
print ''.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).' ';
print "
";
-}
-else {
+} else {
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', '');
print ''."\n";
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 71d86016fe6..aa27e43ee71 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -688,7 +688,9 @@ if (! empty($arrayfields['p.zip']['checked'])) print_liste_field
if (! empty($arrayfields['p.town']['checked'])) print_liste_field_titre($arrayfields['p.town']['label'], $_SERVER["PHP_SELF"], "p.town", $begin, $param, '', $sortfield, $sortorder);
//if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
//if (! empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder);
-if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "co.code_iso", "", $param, 'align="center"', $sortfield, $sortorder);
+if (! empty($arrayfields['country.code_iso']['checked'])) {
+ print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "co.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
+}
if (! empty($arrayfields['p.phone']['checked'])) print_liste_field_titre($arrayfields['p.phone']['label'], $_SERVER["PHP_SELF"], "p.phone", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.phone_perso']['checked'])) print_liste_field_titre($arrayfields['p.phone_perso']['label'], $_SERVER["PHP_SELF"], "p.phone_perso", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['p.phone_mobile']['label'], $_SERVER["PHP_SELF"], "p.phone_mobile", $begin, $param, '', $sortfield, $sortorder);
@@ -702,14 +704,27 @@ if (! empty($arrayfields['p.priv']['checked'])) print_liste_field
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
-$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
+$parameters = array(
+ 'arrayfields'=>$arrayfields,
+ 'param'=>$param,
+ 'sortfield'=>$sortfield,
+ 'sortorder'=>$sortorder,
+);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
-if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
-if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
-if (! empty($arrayfields['p.statut']['checked'])) print_liste_field_titre($arrayfields['p.statut']['label'], $_SERVER["PHP_SELF"], "p.statut", "", $param, '', $sortfield, $sortorder, 'center ');
-if (! empty($arrayfields['p.import_key']['checked'])) print_liste_field_titre($arrayfields['p.import_key']['label'], $_SERVER["PHP_SELF"], "p.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
-print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
+if (! empty($arrayfields['p.datec']['checked'])) {
+ print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
+}
+if (! empty($arrayfields['p.tms']['checked'])) {
+ print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
+}
+if (! empty($arrayfields['p.statut']['checked'])) {
+ print_liste_field_titre($arrayfields['p.statut']['label'], $_SERVER["PHP_SELF"], "p.statut", "", $param, '', $sortfield, $sortorder, 'center ');
+}
+if (! empty($arrayfields['p.import_key']['checked'])) {
+ print_liste_field_titre($arrayfields['p.import_key']['label'], $_SERVER["PHP_SELF"], "p.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
+}
+print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "\n";
diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php
index 6114f49930c..118ad0f5c67 100644
--- a/htdocs/contact/perso.php
+++ b/htdocs/contact/perso.php
@@ -157,13 +157,13 @@ if ($action == 'edit')
print '';
// Photo
- print '';
+ print ' ';
print $form->showphoto('contact', $object)."\n";
if ($object->photo) print " \n";
print '';
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index 7ffc09625a3..f7d154c6b71 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -2017,30 +2017,30 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent)
/**
* Get an array with properties of an element
*
- * @param string $element_type Element type: 'action', 'facture', 'project_task' or 'object@modulext'...
- * @return array (module, classpath, element, subelement, classfile, classname)
+ * @param string $element_type Element type: 'action', 'facture', 'project_task' or 'object@modulext'...
+ * @return array (module, classpath, element, subelement, classfile, classname)
*/
function getElementProperties($element_type)
{
// Parse element/subelement (ex: project_task)
- $module = $element = $subelement = $element_type;
+ $module = $element_type;
+ $element = $element_type;
+ $subelement = $element_type;
// If we ask an resource form external module (instead of default path)
- if (preg_match('/^([^@]+)@([^@]+)$/i', $element_type, $regs))
- {
+ if (preg_match('/^([^@]+)@([^@]+)$/i', $element_type, $regs)) {
$element = $subelement = $regs[1];
- $module = $regs[2];
+ $module = $regs[2];
}
//print ' 1. element : '.$element.' - module : '.$module .' ';
- if ( preg_match('/^([^_]+)_([^_]+)/i', $element, $regs))
- {
+ if ( preg_match('/^([^_]+)_([^_]+)/i', $element, $regs)) {
$module = $element = $regs[1];
$subelement = $regs[2];
}
// For compat
- if($element_type == "action") {
+ if ($element_type == "action") {
$classpath = 'comm/action/class';
$subelement = 'Actioncomm';
$module = 'agenda';
@@ -2049,13 +2049,13 @@ function getElementProperties($element_type)
// To work with non standard path
if ($element_type == 'facture' || $element_type == 'invoice') {
$classpath = 'compta/facture/class';
- $module='facture';
- $subelement='facture';
+ $module ='facture';
+ $subelement = 'facture';
}
if ($element_type == 'commande' || $element_type == 'order') {
$classpath = 'commande/class';
- $module='commande';
- $subelement='commande';
+ $module = 'commande';
+ $subelement = 'commande';
}
if ($element_type == 'propal') {
$classpath = 'comm/propal/class';
@@ -2142,8 +2142,7 @@ function getElementProperties($element_type)
*/
function fetchObjectByElement($element_id, $element_type, $element_ref = '')
{
- global $conf;
- global $db,$conf;
+ global $conf, $db;
$element_prop = getElementProperties($element_type);
if (is_array($element_prop) && $conf->{$element_prop['module']}->enabled)
@@ -2270,7 +2269,7 @@ function getModuleDirForApiClass($module)
$moduledirforclass = 'commande';
}
elseif ($module == 'shipments') {
- $moduledirforclass = 'expedition';
+ $moduledirforclass = 'expedition';
}
elseif ($module == 'facture' || $module == 'invoice' || $module == 'invoices') {
$moduledirforclass = 'compta/facture';
diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php
index 14f4b272799..ba41de80a72 100644
--- a/htdocs/datapolicy/admin/setup.php
+++ b/htdocs/datapolicy/admin/setup.php
@@ -17,7 +17,7 @@
*/
/**
- * \file datapolicy/admin/setup.php
+ * \file htdocs/datapolicy/admin/setup.php
* \ingroup datapolicy
* \brief datapolicy setup page.
*/
@@ -25,7 +25,6 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
require_once '../lib/datapolicy.lib.php';
-//require_once "../class/myclass.class.php";
// Translations
$langs->load('admin');
@@ -61,22 +60,22 @@ $arrayofparameters=array(
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-if (DOL_VERSION < '7' && $action == 'update') {
- foreach ($arrayofparameters as $k => $v) {
- $res = dolibarr_set_const($db, $k, GETPOST($k), 'chaine', 0, '', $conf->entity);
- if (! $res > 0) $error++;
- }
- if (! $error)
- {
- $db->commit();
- if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
- }
- else
- {
- $db->rollback();
- if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors');
- }
-}
+// if (DOL_VERSION < '7' && $action == 'update') {
+// foreach ($arrayofparameters as $k => $v) {
+// $res = dolibarr_set_const($db, $k, GETPOST($k), 'chaine', 0, '', $conf->entity);
+// if (! $res > 0) $error++;
+// }
+// if (! $error)
+// {
+// $db->commit();
+// if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+// }
+// else
+// {
+// $db->rollback();
+// if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors');
+// }
+// }
$arrayofparameters=array(
@@ -108,8 +107,8 @@ $valTab = array(
'48' => $langs->trans('NB_YEARS', 4),
'60' => $langs->trans('NB_YEARS', 5),
'120' => $langs->trans('NB_YEARS', 10),
- '180' => $langs->trans('NB_YEARS', 15),
- '240' => $langs->trans('NB_YEARS', 20),
+ '180' => $langs->trans('NB_YEARS', 15),
+ '240' => $langs->trans('NB_YEARS', 20),
);
@@ -135,15 +134,15 @@ echo ''.$langs->trans("datapolicySetupPage").' ';
- print ' ';
- print ' ';
+ print '';
- print ' ';
-}
-else
-{
- print '';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
+ print '';
+ print ' ';
+} else {
+ print '';
+ print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
foreach($arrayofparameters as $title => $tab)
{
@@ -186,11 +183,11 @@ else
}
}
- print '
';
+ print '
';
- print '';
+ print '';
}
diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php
index bb6b18e6ac7..7362542e8d6 100644
--- a/htdocs/datapolicy/class/actions_datapolicy.class.php
+++ b/htdocs/datapolicy/class/actions_datapolicy.class.php
@@ -293,12 +293,12 @@ class ActionsDatapolicy
/**
* Execute action
*
- * @param array $parameters Array of parameters
- * @param Object $object Object output on PDF
- * @param string $action 'add', 'update', 'view'
- * @return int <0 if KO,
- * =0 if OK but we want to process standard actions too,
- * >0 if OK and we want to replace standard actions.
+ * @param array $parameters Array of parameters
+ * @param Object $object Object output on PDF
+ * @param string $action 'add', 'update', 'view'
+ * @return int <0 if KO,
+ * =0 if OK but we want to process standard actions too,
+ * >0 if OK and we want to replace standard actions.
*/
function beforePDFCreation($parameters, &$object, &$action)
{
@@ -336,46 +336,46 @@ class ActionsDatapolicy
if (! empty($conf->global->DATAPOLICIES_ENABLE_EMAILS))
{
- $dialog = '';
- $dialog .= '
' . img_help('', '') . ' ' . $langs->trans('DATAPOLICIES_PORTABILITE_CONFIRMATION') . '
';
- $dialog .= "
";
- $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) {
- echo '';
- } elseif ($parameters['currentcontext'] == 'membercard') {
- echo '';
- } elseif ($parameters['currentcontext'] == 'contactcard') {
- echo '';
- }
- 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 '';
- } elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'membercard') {
- echo '';
- } elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'contactcard') {
- echo '';
- }
+ return false;
+ });
+ } );
+ ';
+ 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) {
+ echo '';
+ } elseif ($parameters['currentcontext'] == 'membercard') {
+ echo '';
+ } elseif ($parameters['currentcontext'] == 'contactcard') {
+ echo '';
+ }
+ 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 '';
+ } elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'membercard') {
+ echo '';
+ } elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'contactcard') {
+ echo '';
+ }
}
}
diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php
index 4b89b79e273..b3cb0ce3cd9 100644
--- a/htdocs/datapolicy/class/datapolicy.class.php
+++ b/htdocs/datapolicy/class/datapolicy.class.php
@@ -30,11 +30,11 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
*/
Class DataPolicy
{
- /**
- * getAllContactNotInformed
- *
- * @return number
- */
+ /**
+ * getAllContactNotInformed
+ *
+ * @return number
+ */
function getAllContactNotInformed()
{
global $langs, $conf, $db, $user;
@@ -144,71 +144,71 @@ Class DataPolicy
*/
function sendMailDataPolicyContact($contact)
{
- global $langs, $conf, $db, $user;
+ global $langs, $conf, $db, $user;
- $error = 0;
+ $error = 0;
- $from = $user->getFullName($langs) . ' <' . $user->email . '>';
+ $from = $user->getFullName($langs) . ' <' . $user->email . '>';
- $sendto = $contact->email;
- $code= md5($contact->email);
- if (!empty($contact->default_lang)) {
- $l = $contact->default_lang;
- } else {
- $l = $langs->defaultlang;
- }
- $s = "DATAPOLICIESSUBJECT_" . $l;
- $ma = "DATAPOLICIESCONTENT_" . $l;
- $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
- $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
+ $sendto = $contact->email;
+ $code= md5($contact->email);
+ if (!empty($contact->default_lang)) {
+ $l = $contact->default_lang;
+ } else {
+ $l = $langs->defaultlang;
+ }
+ $s = "DATAPOLICIESSUBJECT_" . $l;
+ $ma = "DATAPOLICIESCONTENT_" . $l;
+ $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
+ $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
- $subject = $conf->global->$s;
- $message = $conf->global->$ma;
- $linka = $conf->global->$la;
- $linkr = $conf->global->$lr;
- $sendtocc = $sendtobcc = '';
- $filepath = $mimetype = $filename = array();
- $deliveryreceipt = 0;
+ $subject = $conf->global->$s;
+ $message = $conf->global->$ma;
+ $linka = $conf->global->$la;
+ $linkr = $conf->global->$lr;
+ $sendtocc = $sendtobcc = '';
+ $filepath = $mimetype = $filename = array();
+ $deliveryreceipt = 0;
- $substitutionarray = array(
- '__LINKACCEPT__' => ''.$linka.' ',
- '__LINKREFUSED__' => ''.$linkr.' ',
- '__FIRSTNAME__' => $contact->firstname,
- '__NAME__' => $contact->lastname,
- '__CIVILITY__' => $contact->civility,
- );
- $subject = make_substitutions($subject, $substitutionarray);
- $message = make_substitutions($message, $substitutionarray);
+ $substitutionarray = array(
+ '__LINKACCEPT__' => ''.$linka.' ',
+ '__LINKREFUSED__' => ''.$linkr.' ',
+ '__FIRSTNAME__' => $contact->firstname,
+ '__NAME__' => $contact->lastname,
+ '__CIVILITY__' => $contact->civility,
+ );
+ $subject = make_substitutions($subject, $substitutionarray);
+ $message = make_substitutions($message, $substitutionarray);
- $actiontypecode = 'AC_EMAIL';
- $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
- if ($message) {
- if ($sendtocc)
- $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
- $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
- $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
- $actionmsg = dol_concatdesc($actionmsg, $message);
- }
+ $actiontypecode = 'AC_EMAIL';
+ $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
+ if ($message) {
+ if ($sendtocc)
+ $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
+ $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
+ $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
+ $actionmsg = dol_concatdesc($actionmsg, $message);
+ }
- // Send mail
- require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
- $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
+ // Send mail
+ require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
+ $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
- if ($mailfile->error) {
- $resultmasssend .= '' . $mailfile->error . '
';
- } else {
- $result4 = $mailfile->sendfile();
- if (!$error) {
+ if ($mailfile->error) {
+ $resultmasssend .= '' . $mailfile->error . '
';
+ } else {
+ $result4 = $mailfile->sendfile();
+ if (!$error) {
- $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . " ";
- $contact->array_options['options_datapolicy_send'] = date('Y-m-d', time());
- $contact->update($contact->id);
- } else {
- dol_print_error($db);
- }
- }
- setEventMessage($resultmasssend);
+ $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . " ";
+ $contact->array_options['options_datapolicy_send'] = date('Y-m-d', time());
+ $contact->update($contact->id);
+ } else {
+ dol_print_error($db);
+ }
+ }
+ setEventMessage($resultmasssend);
}
/**
@@ -219,44 +219,44 @@ Class DataPolicy
*/
function sendMailDataPolicyCompany($societe)
{
- global $langs, $conf, $db, $user;
+ global $langs, $conf, $db, $user;
- $error = 0;
+ $error = 0;
- $from = $user->getFullName($langs) . ' <' . $user->email . '>';
+ $from = $user->getFullName($langs) . ' <' . $user->email . '>';
- $sendto = $societe->email;
+ $sendto = $societe->email;
- $code= md5($societe->email);
- if (!empty($societe->default_lang)) {
- $l = $societe->default_lang;
- } else {
- $l = $langs->defaultlang;
- }
- $s = "DATAPOLICIESSUBJECT_" . $l;
- $ma = "DATAPOLICIESCONTENT_" . $l;
- $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
- $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
+ $code= md5($societe->email);
+ if (!empty($societe->default_lang)) {
+ $l = $societe->default_lang;
+ } else {
+ $l = $langs->defaultlang;
+ }
+ $s = "DATAPOLICIESSUBJECT_" . $l;
+ $ma = "DATAPOLICIESCONTENT_" . $l;
+ $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
+ $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
- $subject = $conf->global->$s;
- $message = $conf->global->$ma;
- $linka = $conf->global->$la;
- $linkr = $conf->global->$lr;
- $sendtocc = $sendtobcc = '';
- $filepath = $mimetype = $filename = array();
- $deliveryreceipt = 0;
+ $subject = $conf->global->$s;
+ $message = $conf->global->$ma;
+ $linka = $conf->global->$la;
+ $linkr = $conf->global->$lr;
+ $sendtocc = $sendtobcc = '';
+ $filepath = $mimetype = $filename = array();
+ $deliveryreceipt = 0;
- $substitutionarray = array(
+ $substitutionarray = array(
'__LINKACCEPT__' => ''.$linka.' ',
'__LINKREFUSED__' => ''.$linkr.' ',
- );
- $subject = make_substitutions($subject, $substitutionarray);
- $message = make_substitutions($message, $substitutionarray);
+ );
+ $subject = make_substitutions($subject, $substitutionarray);
+ $message = make_substitutions($message, $substitutionarray);
- $actiontypecode = 'AC_EMAIL';
- $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
- if ($message) {
- if ($sendtocc) {
+ $actiontypecode = 'AC_EMAIL';
+ $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
+ if ($message) {
+ if ($sendtocc) {
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
}
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
@@ -264,23 +264,23 @@ Class DataPolicy
$actionmsg .= dol_concatdesc($actionmsg, $message);
}
- // Send mail
- require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
- $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
- if ($mailfile->error) {
- $resultmasssend .= '' . $mailfile->error . '
';
- } else {
- $result4 = $mailfile->sendfile();
+ // Send mail
+ require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
+ $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
+ if ($mailfile->error) {
+ $resultmasssend .= '' . $mailfile->error . '
';
+ } else {
+ $result4 = $mailfile->sendfile();
- if (!$error) {
- $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . " ";
- $societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
- $societe->update($societe->id);
- } else {
- dol_print_error($db);
- }
- }
- setEventMessage($resultmasssend);
+ if (!$error) {
+ $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . " ";
+ $societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
+ $societe->update($societe->id);
+ } else {
+ dol_print_error($db);
+ }
+ }
+ setEventMessage($resultmasssend);
}
/**
@@ -291,66 +291,66 @@ Class DataPolicy
*/
function sendMailDataPolicyAdherent($adherent)
{
- global $langs, $conf, $db, $user;
+ global $langs, $conf, $db, $user;
- $error = 0;
+ $error = 0;
- $from = $user->getFullName($langs) . ' <' . $user->email . '>';
+ $from = $user->getFullName($langs) . ' <' . $user->email . '>';
- $sendto = $adherent->email;
+ $sendto = $adherent->email;
- $code= md5($adherent->email);
- if (!empty($adherent->default_lang)) {
- $l = $adherent->default_lang;
- } else {
- $l = $langs->defaultlang;
- }
- $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
- $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
+ $code= md5($adherent->email);
+ if (!empty($adherent->default_lang)) {
+ $l = $adherent->default_lang;
+ } else {
+ $l = $langs->defaultlang;
+ }
+ $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
+ $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
- $subject = $conf->global->$s;
- $message = $conf->global->$ma;
- $linka = $conf->global->$la;
- $linkr = $conf->global->$lr;
- $sendtocc = $sendtobcc = '';
- $filepath = $mimetype = $filename = array();
- $deliveryreceipt = 0;
+ $subject = $conf->global->$s;
+ $message = $conf->global->$ma;
+ $linka = $conf->global->$la;
+ $linkr = $conf->global->$lr;
+ $sendtocc = $sendtobcc = '';
+ $filepath = $mimetype = $filename = array();
+ $deliveryreceipt = 0;
- $substitutionarray = array(
+ $substitutionarray = array(
'__LINKACCEPT__' => ''.$linka.' ',
'__LINKREFUSED__' => ''.$linkr.' ',
- );
- $subject = make_substitutions($subject, $substitutionarray);
- $message = make_substitutions($message, $substitutionarray);
+ );
+ $subject = make_substitutions($subject, $substitutionarray);
+ $message = make_substitutions($message, $substitutionarray);
- $actiontypecode = 'AC_EMAIL';
- $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
- if ($message) {
- if ($sendtocc) {
+ $actiontypecode = 'AC_EMAIL';
+ $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
+ if ($message) {
+ if ($sendtocc) {
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
}
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg .= dol_concatdesc($actionmsg, $message);
- }
+ }
- // Send mail
- require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
- $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
- if ($mailfile->error) {
- $resultmasssend .= '' . $mailfile->error . '
';
- } else {
- $result4 = $mailfile->sendfile();
+ // Send mail
+ require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
+ $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
+ if ($mailfile->error) {
+ $resultmasssend .= '' . $mailfile->error . '
';
+ } else {
+ $result4 = $mailfile->sendfile();
- if (!$error) {
- $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . " ";
- $adherent->array_options['options_datapolicy_send'] = date('Y-m-d', time());
- $adherent->update($user);
- } else {
- dol_print_error($db);
- }
- }
- setEventMessage($resultmasssend);
+ if (!$error) {
+ $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . " ";
+ $adherent->array_options['options_datapolicy_send'] = date('Y-m-d', time());
+ $adherent->update($user);
+ } else {
+ dol_print_error($db);
+ }
+ }
+ setEventMessage($resultmasssend);
}
}
diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php
index 01478580a3a..656831eed2f 100644
--- a/htdocs/datapolicy/class/datapolicycron.class.php
+++ b/htdocs/datapolicy/class/datapolicycron.class.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2018 Nicolas ZABOURI
* Copyright (C) 2018 Frédéric France
*
* This program is free software: you can redistribute it and/or modify
@@ -17,7 +17,7 @@
*/
/**
- * \file datapolicy/class/datapolicycron.class.php
+ * \file htdocs/datapolicy/class/datapolicycron.class.php
* \ingroup datapolicy
* \brief Example hook overload.
*/
@@ -27,11 +27,11 @@
*/
class DataPolicyCron
{
- /**
- * Function exec
- *
- * @return boolean
- */
+ /**
+ * Function exec
+ *
+ * @return boolean
+ */
public function exec()
{
global $conf, $db, $langs, $user;
diff --git a/htdocs/datapolicy/lib/datapolicy.lib.php b/htdocs/datapolicy/lib/datapolicy.lib.php
index 41c92299989..b72417d7ff9 100644
--- a/htdocs/datapolicy/lib/datapolicy.lib.php
+++ b/htdocs/datapolicy/lib/datapolicy.lib.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2019 Frédéric France
*
* 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
@@ -16,7 +17,7 @@
*/
/**
- * \file datapolicy/lib/datapolicy.lib.php
+ * \file htdocs/datapolicy/lib/datapolicy.lib.php
* \ingroup datapolicy
* \brief Library files with common functions for datapolicy
*/
@@ -28,27 +29,26 @@
*/
function datapolicyAdminPrepareHead()
{
- global $langs, $conf;
+ global $langs, $conf;
- $langs->load("datapolicy@datapolicy");
+ $langs->load("datapolicy@datapolicy");
- $h = 0;
- $head = array();
+ $h = 0;
+ $head = array();
- $head[$h][0] = dol_buildpath("/datapolicy/admin/setup.php", 1);
- $head[$h][1] = $langs->trans("Deletion");
- $head[$h][2] = 'settings';
- $h++;
+ $head[$h][0] = DOL_URL_ROOT."/datapolicy/admin/setup.php";
+ $head[$h][1] = $langs->trans("Deletion");
+ $head[$h][2] = 'settings';
+ $h++;
- if (! empty($conf->global->DATAPOLICIES_ENABLE_EMAILS))
- {
- $head[$h][0] = dol_buildpath("/datapolicy/admin/setupmail.php", 1);
- $head[$h][1] = $langs->trans("DATAPOLICIESMail");
- $head[$h][2] = 'settings';
- $h++;
- }
+ if (! empty($conf->global->DATAPOLICIES_ENABLE_EMAILS)) {
+ $head[$h][0] = DOL_URL_ROOT."/datapolicy/admin/setupmail.php";
+ $head[$h][1] = $langs->trans("DATAPOLICIESMail");
+ $head[$h][2] = 'settings';
+ $h++;
+ }
- complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicy');
+ complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicy');
- return $head;
+ return $head;
}
diff --git a/htdocs/datapolicy/mailing.php b/htdocs/datapolicy/mailing.php
index e3f38b269be..69da78e00ac 100644
--- a/htdocs/datapolicy/mailing.php
+++ b/htdocs/datapolicy/mailing.php
@@ -1,5 +1,6 @@
+/* Copyright (C) 2018 Nicolas ZABOURI
+ * Copyright (C) 2019 Frédéric France
*
* 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
@@ -16,22 +17,22 @@
*/
/**
- * \file datapolicy/mailing.php
+ * \file htdocs/datapolicy/mailing.php
* \ingroup datapolicy
* \brief datapolicy mailing page.
*/
require '../../main.inc.php';
-dol_include_once('/contact/class/contact.class.php');
-dol_include_once('/datapolicy/class/datapolicy.class.php');
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php';
$idcontact = GETPOST('idc');
-if(!empty($idcontact)){
+if (!empty($idcontact)) {
$contact = new Contact($db);
$contact->fetch($idcontact);
DataPolicy::sendMailDataPolicyContact($contact);
-}else{
+} else {
$contacts = new DataPolicy($db);
$contacts->getAllContactNotInformed();
diff --git a/htdocs/datapolicy/public/index.php b/htdocs/datapolicy/public/index.php
index f819fb079f5..6c78f380b93 100644
--- a/htdocs/datapolicy/public/index.php
+++ b/htdocs/datapolicy/public/index.php
@@ -17,7 +17,7 @@
*/
/**
- * \file datapolicy/admin/setup.php
+ * \file htdocs/datapolicy/admin/setup.php
* \ingroup datapolicy
* \brief datapolicy setup page.
*/
@@ -30,11 +30,11 @@ if (!defined('NOREQUIREMENU'))
define('NOREQUIREMENU', '1');
require '../../main.inc.php';
-dol_include_once('/contact/class/contact.class.php');
-dol_include_once('/societe/class/societe.class.php');
-dol_include_once('/adherents/class/adherent.class.php');
-dol_include_once('/user/class/user.class.php');
-dol_include_once('/datapolicy/class/datapolicy.class.php');
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+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.'/user/class/user.class.php';
+require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php';
$idc = GETPOST('c', 'int');
$ids = GETPOST('s', 'int');
diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php
index b326c6f4959..6fae048c3db 100644
--- a/htdocs/don/class/api_donations.class.php
+++ b/htdocs/don/class/api_donations.class.php
@@ -48,7 +48,7 @@ class Donations extends DolibarrApi
{
global $db, $conf;
$this->db = $db;
- $this->don = new Don($this->db);
+ $this->don = new Don($this->db);
}
/**
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index 4daa8b6498f..d37271f6480 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -933,7 +933,7 @@ if ($resql)
if (! empty($arrayfields['e.ref']['checked'])) {
// We are on a specific warehouse card, no filter on other should be possible
print_liste_field_titre($arrayfields['e.ref']['label'], $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder);
-
+ }
if (! empty($arrayfields['m.fk_user_author']['checked'])) {
print_liste_field_titre($arrayfields['m.fk_user_author']['label'], $_SERVER["PHP_SELF"], "m.fk_user_author", "", $param, "", $sortfield, $sortorder);
}
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index 5d8f0fe11ce..43abb1f9e75 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -763,7 +763,7 @@ if (! empty($id) || ! empty($ref))
trans('OnBuy') ?>
';
+ print '';
$searchpicto=$form->showCheckAddButtons('checkforselect', 1);
print $searchpicto;
print ' ';
@@ -802,7 +802,7 @@ if (! empty($id) || ! empty($ref))
';
+ print '';
if ($productCombinations || $massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected=0;