From 76d5ce18caa83f375561ead51f1300ac178c04f6 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Fri, 28 Aug 2020 14:07:35 +0200 Subject: [PATCH] Titres + lien cliquable client + traductions --- htdocs/core/boxes/box_validated_projects.php | 54 ++++++++++++++++---- htdocs/langs/fr_FR/boxes.lang | 1 + 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index 02121612aea..e06da942b8a 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -100,7 +100,7 @@ class box_validated_projects extends ModeleBoxes $sql = "SELECT p.rowid, p.ref as Ref, p.fk_soc as Client, p.dateo as startDate,"; $sql.= " (SELECT COUNT(t.rowid) FROM ".MAIN_DB_PREFIX."projet_task AS t"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact AS c ON t.rowid = c.element_id"; - $sql.= " WHERE t.fk_projet = p.rowid AND c.fk_socpeople = ".$user->id." AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time)) AS 'taskNumber'"; + $sql.= " WHERE t.fk_projet = p.rowid AND c.fk_c_type_contact != 160 AND c.fk_socpeople = ".$user->id." AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time)) AS 'taskNumber'"; $sql.= " FROM ".MAIN_DB_PREFIX."projet AS p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task AS t ON p.rowid = t.fk_projet"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact AS c ON t.rowid = c.element_id"; @@ -109,12 +109,30 @@ class box_validated_projects extends ModeleBoxes $sql.= " AND c.fk_socpeople = ".$user->id; $sql.= " GROUP BY p.ref"; $sql.= " ORDER BY p.dateo ASC"; -var_dump($user->id); + $result = $this->db->query($sql); if ($result) { $num = $this->db->num_rows($result); $i = 0; - while ($i < min($num, $max)) { + $this->info_box_contents[$i][] = array( + 'td' => 'class="nowraponall"', + 'text' => "Reference projet", + ); + $this->info_box_contents[$i][] = array( + 'td' => 'class="center"', + 'text' => 'Client', + ); + $this->info_box_contents[$i][] = array( + 'td' => 'class="center"', + 'text' => 'Date debut de projet', + ); + $this->info_box_contents[$i][] = array( + 'td' => 'class="center"', + 'text' => 'Nombre de mes tâches sans temps saisi', + ); + $i++; + + while ($i < min($num+1, $max+1)) { $objp = $this->db->fetch_object($result); $projectstatic->id = $objp->rowid; @@ -122,30 +140,44 @@ var_dump($user->id); $projectstatic->customer = $objp->Client; $projectstatic->startDate = $objp->startDate; $projectstatic->taskNumber = $objp->taskNumber; - +//var_dump($projectstatic->getNomUrl(1)); $this->info_box_contents[$i][] = array( 'td' => 'class="nowraponall"', 'text' => $projectstatic->getNomUrl(1), 'asis' => 1 ); - $this->info_box_contents[$i][] = array( - 'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"', - 'text' => $objp->Client, - ); + $sql = 'SELECT nom FROM '.MAIN_DB_PREFIX.'societe WHERE rowid ='.$objp->Client; + $resql = $this->db->query($sql); + if ($resql){ + $socstatic = new Societe($this->db); + $obj = $this->db->fetch_object($resql); + $socstatic->nom = $obj->nom; + $this->info_box_contents[$i][] = array( + 'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"', + 'text' => $socstatic->getNomUrl(1), + 'asis' => 1 + ); + } + else { + dol_print_error($this->db); + } $this->info_box_contents[$i][] = array( - 'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"', + 'td' => 'class="center"', 'text' => $objp->startDate, ); $this->info_box_contents[$i][] = array( - 'td' => 'class="nowraponall"', + 'td' => 'class="center"', 'text' => $objp->taskNumber." ".$langs->trans("Tasks"), + 'asis' => 1 ); $i++; } - } + }else { + dol_print_error($this->db); + } } diff --git a/htdocs/langs/fr_FR/boxes.lang b/htdocs/langs/fr_FR/boxes.lang index e2964afd6a3..7b633336c34 100644 --- a/htdocs/langs/fr_FR/boxes.lang +++ b/htdocs/langs/fr_FR/boxes.lang @@ -104,3 +104,4 @@ BoxTitleLastCustomerShipments=Les %s dernières expéditions clients NoRecordedShipments=Aucune expédition client # Pages AccountancyHome=Comptabilité +ValidatedProjects = Projets ouverts dont les tâches me sont affectées et n'ont pas de temps saisi