Merge pull request #21168 from defrance/patch-203

datee and dateo not filled
This commit is contained in:
Laurent Destailleur 2022-06-12 18:37:59 +02:00 committed by GitHub
commit 9202612cc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@
* Copyright (C) 2014-2017 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.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
@ -1212,11 +1213,11 @@ class Project extends CommonObject
if (!empty($this->thirdparty_name)) {
$label .= ($label ? '<br>' : '').'<b>'.$langs->trans('ThirdParty').': </b>'.$this->thirdparty_name; // The space must be after the : to not being explode when showing the title in img_picto
}
if (!empty($this->dateo)) {
$label .= ($label ? '<br>' : '').'<b>'.$langs->trans('DateStart').': </b>'.dol_print_date($this->dateo, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
if (!empty($this->date_start)) {
$label .= ($label ? '<br>' : '').'<b>'.$langs->trans('DateStart').': </b>'.dol_print_date($this->date_start, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
}
if (!empty($this->datee)) {
$label .= ($label ? '<br>' : '').'<b>'.$langs->trans('DateEnd').': </b>'.dol_print_date($this->datee, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
if (!empty($this->date_end)) {
$label .= ($label ? '<br>' : '').'<b>'.$langs->trans('DateEnd').': </b>'.dol_print_date($this->date_end, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
}
if ($moreinpopup) {
$label .= '<br>'.$moreinpopup;
@ -2073,7 +2074,7 @@ class Project extends CommonObject
$project_static->statut = $obj->status;
$project_static->opp_status = $obj->fk_opp_status;
$project_static->datee = $this->db->jdate($obj->datee);
$project_static->date_end = $this->db->jdate($obj->datee);
if ($project_static->hasDelay()) {
$response->nbtodolate++;
@ -2155,13 +2156,13 @@ class Project extends CommonObject
if (!($this->statut == self::STATUS_VALIDATED)) {
return false;
}
if (!$this->datee && !$this->date_end) {
if (!$this->date_end) {
return false;
}
$now = dol_now();
return ($this->datee ? $this->datee : $this->date_end) < ($now - $conf->projet->warning_delay);
return ($this->date_end) < ($now - $conf->projet->warning_delay);
}