diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php
index 2dbaaa07373..c08336841e2 100644
--- a/htdocs/compta/bank/releve.php
+++ b/htdocs/compta/bank/releve.php
@@ -387,6 +387,10 @@ if (empty($numref)) {
* Show list of record into a bank statement
*/
+ $title = $langs->trans("FinancialAccount").' - '.$langs->trans("AccountStatements");
+ $helpurl = "";
+ llxHeader('', $title, $helpurl);
+
// Onglets
$head = account_statement_prepare_head($object, $numref);
print dol_get_fiche_head($head, 'statement', $langs->trans("AccountStatement"), -1, 'account');
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index bdc6a102147..7b7d8c61c1d 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -2083,7 +2083,7 @@ if ($resql) {
// Amount HT
if (!empty($arrayfields['f.total_ht']['checked'])) {
- print '
'.price($obj->total_ht)." | \n";
+ print ''.price($obj->total_ht)." | \n";
if (!$i) {
$totalarray['nbfield']++;
}
diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php
index 9462c810393..6aec6f4064a 100644
--- a/htdocs/core/boxes/box_birthdays.php
+++ b/htdocs/core/boxes/box_birthdays.php
@@ -85,13 +85,19 @@ class box_birthdays extends ModeleBoxes
if ($user->rights->user->user->lire) {
$tmparray = dol_getdate(dol_now(), true);
- $sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth, u.email, u.statut as status";
+ $sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth as datea, 'birth' as typea, u.email, u.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.entity IN (".getEntity('user').")";
$sql .= " AND u.statut = 1";
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
- $sql .= " ORDER BY DAY(u.birth) ASC";
- $sql .= $this->db->plimit($max, 0);
+ $sql .= ' UNION ';
+ $sql .= "SELECT u.rowid, u.firstname, u.lastname, u.dateemployment as datea, 'employment' as typea, u.email, u.statut as status";
+ $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
+ $sql .= " WHERE u.entity IN (".getEntity('user').")";
+ $sql .= " AND u.statut = 1";
+ $sql .= dolSqlDateFilter('u.dateemployment', 0, $tmparray['mon'], 0);
+
+ $sql .= " ORDER BY DAY(datea) ASC";
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
$result = $this->db->query($sql);
@@ -108,9 +114,13 @@ class box_birthdays extends ModeleBoxes
$userstatic->email = $objp->email;
$userstatic->statut = $objp->status;
- $dateb = $this->db->jdate($objp->birth);
+ $dateb = $this->db->jdate($objp->datea);
$age = date('Y', dol_now()) - date('Y', $dateb);
+ $picb = '';
+ $pice = '';
+ $typea = ($objp->typea == 'birth') ? $picb : $pice;
+
$this->info_box_contents[$line][] = array(
'td' => '',
'text' => $userstatic->getNomUrl(1),
@@ -119,7 +129,18 @@ class box_birthdays extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="center nowraponall"',
- 'text' => dol_print_date($dateb, "day", 'tzserver').' - '.$age.' '.$langs->trans('DurationYears')
+ 'text' => dol_print_date($dateb, "day", 'tzserver')
+ );
+
+ $this->info_box_contents[$line][] = array(
+ 'td' => 'class="right nowraponall"',
+ 'text' => $age.' '.$langs->trans('DurationYears')
+ );
+
+ $this->info_box_contents[$line][] = array(
+ 'td' => 'class="center nowraponall"',
+ 'text' => $typea,
+ 'asis' => 1
);
/*$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 94fb05d5346..7acd7ac3db0 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -6,7 +6,7 @@
* Copyright (C) 2003 Jean-Louis Bergamo
* Copyright (C) 2004-2015 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2019-2020 Frédéric France
+ * Copyright (C) 2019-2022 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
@@ -547,10 +547,18 @@ class CMailFile
}
if (!empty($this->addr_cc)) {
- $this->message->setCc($this->getArrayAddress($this->addr_cc));
+ try {
+ $this->message->setCc($this->getArrayAddress($this->addr_cc));
+ } catch (Exception $e) {
+ $this->errors[] = $e->getMessage();
+ }
}
if (!empty($this->addr_bcc)) {
- $this->message->setBcc($this->getArrayAddress($this->addr_bcc));
+ try {
+ $this->message->setBcc($this->getArrayAddress($this->addr_bcc));
+ } catch (Exception $e) {
+ $this->errors[] = $e->getMessage();
+ }
}
//if (! empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to));
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) {
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 2d393ab9dc3..aa85c0aa5c2 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -744,6 +744,7 @@ abstract class CommonObject
public function setUpperOrLowerCase()
{
global $conf;
+
if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) {
$this->lastname = dol_ucwords(dol_strtolower($this->lastname));
$this->firstname = dol_ucwords(dol_strtolower($this->firstname));
@@ -759,8 +760,12 @@ abstract class CommonObject
$this->address = dol_strtoupper($this->address);
$this->town = dol_strtoupper($this->town);
}
- $this->email = dol_strtolower($this->email);
- $this->personal_email = dol_strtolower($this->personal_email);
+ if (isset($this->email)) {
+ $this->email = dol_strtolower($this->email);
+ }
+ if (isset($this->personal_email)) {
+ $this->personal_email = dol_strtolower($this->personal_email);
+ }
}
/**
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index e13aaba4685..62965413a5d 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -119,7 +119,7 @@ class FormTicket
$this->action = 'add';
- $this->withcompany = $conf->societe->enabled ? 1 : 0;
+ $this->withcompany = isModEnabled("societe");
$this->withfromsocid = 0;
$this->withfromcontactid = 0;
//$this->withreadid=0;
@@ -169,7 +169,7 @@ class FormTicket
print dol_get_fiche_head(null, 'card', '', 0, '');
}
- print '