diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index de064d6bccf..297cadac0be 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -79,7 +79,7 @@ if ($company->id) if (!$contact->phone_pro) $v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE"); if (!$contact->fax) $v->setPhoneNumber($company->fax, "TYPE=WORK;FAX"); if (!$contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country, "TYPE=WORK;POSTAL"); - if ($company->email != $contact->email) $v->setEmail($company->email, 'TYPE=PREF,INTERNET'); + if (empty($contact->email)) $v->setEmail($company->email, 'TYPE=PREF,INTERNET'); // Si contact lie a un tiers non de type "particulier" if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name); } diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php index 7c8c110db88..17dd29057b3 100644 --- a/htdocs/core/boxes/box_birthdays.php +++ b/htdocs/core/boxes/box_birthdays.php @@ -89,7 +89,7 @@ class box_birthdays extends ModeleBoxes $sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.entity IN (".getEntity('user').")"; - $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], $tmparray['year']); + $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0); $sql .= " ORDER BY u.birth ASC"; $sql .= $this->db->plimit($max, 0); diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php index 96fc97f2e37..010bf8e7f21 100644 --- a/htdocs/core/boxes/box_birthdays_members.php +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -90,7 +90,7 @@ class box_birthdays_members extends ModeleBoxes $sql .= " FROM ".MAIN_DB_PREFIX."adherent as u"; $sql .= " WHERE u.entity IN (".getEntity('adherent').")"; $sql .= " AND u.statut = 1"; - $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], $tmparray['year']); + $sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0); $sql .= " ORDER BY u.birth ASC"; $sql .= $this->db->plimit($max, 0); diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 4baf2aa0232..cff2670061e 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -301,7 +301,7 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $exclu $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date)); $sqldate .= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date))."'"; } else - $sqldate .= ($excludefirstand ? "" : " AND ")." date_format( ".$datefield.", '%m') = '".$db->escape($month_date)."'"; + $sqldate .= ($excludefirstand ? "" : " AND ")." date_format( ".$datefield.", '%c') = '".$db->escape($month_date)."'"; } elseif ($year_date > 0) { $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, false)); $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, 12, false))."'";