Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-05-20 23:30:02 +02:00
commit 482da404f0

View File

@ -1049,17 +1049,20 @@ class Project extends CommonObject
if (isset($this->public)) { if (isset($this->public)) {
$label .= '<br><b>'.$langs->trans("Visibility").":</b> ".($this->public ? $langs->trans("SharedProject") : $langs->trans("PrivateProject")); $label .= '<br><b>'.$langs->trans("Visibility").":</b> ".($this->public ? $langs->trans("SharedProject") : $langs->trans("PrivateProject"));
} }
if (!empty($this->thirdparty_name)) 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 $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)) }
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 $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->datee)) }
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 $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 ($moreinpopup) $label .= '<br>'.$moreinpopup; if ($moreinpopup) $label .= '<br>'.$moreinpopup;
if (isset($this->status)) { if (isset($this->status)) {
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5); $label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5);
} }
$url = ''; $url = '';
if ($option != 'nolink') if ($option != 'nolink')
{ {
@ -1837,12 +1840,12 @@ public function loadTimeSpent($datestart, $taskid = 0, $userid = 0)
public function loadTimeSpentMonth($datestart, $taskid = 0, $userid = 0) public function loadTimeSpentMonth($datestart, $taskid = 0, $userid = 0)
{ {
$error = 0; $error = 0;
$this->monthWorkLoad = array(); $this->monthWorkLoad = array();
$this->monthWorkLoadPerTask = array(); $this->monthWorkLoadPerTask = array();
if (empty($datestart)) dol_print_error('', 'Error datestart parameter is empty'); if (empty($datestart)) dol_print_error('', 'Error datestart parameter is empty');
$sql = "SELECT ptt.rowid as taskid, ptt.task_duration, ptt.task_date, ptt.task_datehour, ptt.fk_task"; $sql = "SELECT ptt.rowid as taskid, ptt.task_duration, ptt.task_date, ptt.task_datehour, ptt.fk_task";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time AS ptt, ".MAIN_DB_PREFIX."projet_task as pt"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time AS ptt, ".MAIN_DB_PREFIX."projet_task as pt";
$sql .= " WHERE ptt.fk_task = pt.rowid"; $sql .= " WHERE ptt.fk_task = pt.rowid";
@ -1851,13 +1854,13 @@ public function loadTimeSpentMonth($datestart, $taskid = 0, $userid = 0)
$sql .= " AND ptt.task_date <= '".$this->db->idate(dol_time_plus_duree($datestart, 1, 'm') - 1)."')"; $sql .= " AND ptt.task_date <= '".$this->db->idate(dol_time_plus_duree($datestart, 1, 'm') - 1)."')";
if ($task_id) $sql .= " AND ptt.fk_task=".$taskid; if ($task_id) $sql .= " AND ptt.fk_task=".$taskid;
if (is_numeric($userid)) $sql .= " AND ptt.fk_user=".$userid; if (is_numeric($userid)) $sql .= " AND ptt.fk_user=".$userid;
//print $sql; //print $sql;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$weekalreadyfound = array(); $weekalreadyfound = array();
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
$i = 0; $i = 0;
// Loop on each record found, so each couple (project id, task id) // Loop on each record found, so each couple (project id, task id)