From 912999a6b6b82c6d18db32416aae4ccc0eda9921 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 27 Aug 2020 11:11:53 +0200 Subject: [PATCH 01/10] Creation box --- htdocs/core/boxes/box_validated_projects.php | 205 +++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 htdocs/core/boxes/box_validated_projects.php diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php new file mode 100644 index 00000000000..9fffc92963f --- /dev/null +++ b/htdocs/core/boxes/box_validated_projects.php @@ -0,0 +1,205 @@ + + * Copyright (C) 2014 Marcos García + * Copyright (C) 2015 Frederic France + * Copyright (C) 2016 Juan José Menent + * Copyright (C) 2020 Pierre Ardoin + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/boxes/box_project.php + * \ingroup projet + * \brief Module to show Projet activity of the current Year + */ +include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; + +/** + * Class to manage the box to show last projet + */ +class box_project extends ModeleBoxes +{ + public $boxcode="project"; + public $boximg="object_projectpub"; + public $boxlabel; + //var $depends = array("projet"); + + /** + * @var DoliDB Database handler. + */ + public $db; + + public $param; + + public $info_box_head = array(); + public $info_box_contents = array(); + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + global $user, $langs; + + // Load translation files required by the page + $langs->loadLangs(array('boxes', 'projects')); + + $this->db = $db; + $this->boxlabel = "OpenedProjects"; + + $this->hidden = ! ($user->rights->projet->lire); + } + + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + global $conf, $user, $langs; + + $this->max=$max; + + $totalMnt = 0; + $totalnb = 0; + $totalnbTask=0; + + $textHead = $langs->trans("OpenedProjects"); + $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); + + // list the summary of the orders + if ($user->rights->projet->lire) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + $projectstatic = new Project($this->db); + + $socid=0; + //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. + + // Get list of project id allowed to user (in a string list separated by coma) + $projectsListId=''; + if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid); + + $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut as status, p.public"; + $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; + $sql.= " WHERE p.entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok + $sql.= " AND p.fk_statut = 1"; // Only open projects + if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users + + $sql.= " ORDER BY p.datec DESC"; + //$sql.= $this->db->plimit($max, 0); + + $result = $this->db->query($sql); + + if ($result) { + $num = $this->db->num_rows($result); + $i = 0; + while ($i < min($num, $max)) { + $objp = $this->db->fetch_object($result); + + $projectstatic->id = $objp->rowid; + $projectstatic->ref = $objp->ref; + $projectstatic->title = $objp->title; + $projectstatic->public = $objp->public; + $projectstatic->statut = $objp->status; + + $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->title, + ); + + $sql ="SELECT count(*) as nb, sum(progress) as totprogress"; + $sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid"; + $sql.= " WHERE p.entity IN (".getEntity('project').')'; + $sql.=" AND p.rowid = ".$objp->rowid; + $resultTask = $this->db->query($sql); + if ($resultTask) { + $objTask = $this->db->fetch_object($resultTask); + $this->info_box_contents[$i][] = array( + 'td' => 'class="right"', + 'text' => $objTask->nb." ".$langs->trans("Tasks"), + ); + if ($objTask->nb > 0) + $this->info_box_contents[$i][] = array( + 'td' => 'class="right"', + 'text' => round($objTask->totprogress/$objTask->nb, 0)."%", + ); + else + $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A "); + $totalnbTask += $objTask->nb; + } else { + $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => round(0)); + $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A "); + } + $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => $projectstatic->getLibStatut(3)); + + $i++; + } + if ($max < $num) + { + $this->info_box_contents[$i][] = array('td' => 'colspan="5"', 'text' => '...'); + $i++; + } + } + } + + + // Add the sum à the bottom of the boxes + $this->info_box_contents[$i][] = array( + 'td' => 'class="liste_total"', + 'text' => $langs->trans("Total")." ".$textHead, + 'text' => " ", + ); + $this->info_box_contents[$i][] = array( + 'td' => 'class="right liste_total" ', + 'text' => round($num, 0)." ".$langs->trans("Projects"), + ); + $this->info_box_contents[$i][] = array( + 'td' => 'class="right liste_total" ', + 'text' => (($max < $num) ? '' : (round($totalnbTask, 0)." ".$langs->trans("Tasks"))), + ); + $this->info_box_contents[$i][] = array( + 'td' => 'class="liste_total"', + 'text' => " ", + ); + $this->info_box_contents[$i][] = array( + 'td' => 'class="liste_total"', + 'text' => " ", + ); + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @param int $nooutput No print, only return string + * @return string + */ + public function showBox($head = null, $contents = null, $nooutput = 0) + { + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + } +} From c9833c501d38dab811c61320de0de6f8621765db Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 27 Aug 2020 17:23:53 +0200 Subject: [PATCH 02/10] SQL + insertion champs dans box --- htdocs/core/boxes/box_validated_projects.php | 105 ++++++------------- htdocs/core/modules/modProjet.class.php | 2 + 2 files changed, 35 insertions(+), 72 deletions(-) diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index 9fffc92963f..02121612aea 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -20,18 +20,18 @@ */ /** - * \file htdocs/core/boxes/box_project.php + * \file htdocs/core/boxes/box_validated_projects.php * \ingroup projet - * \brief Module to show Projet activity of the current Year + * \brief Module to show validated projects whose tasks are assigned to the connected person, without any time entered by the connected person */ include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; /** * Class to manage the box to show last projet */ -class box_project extends ModeleBoxes +class box_validated_projects extends ModeleBoxes { - public $boxcode="project"; + public $boxcode="validated_project"; public $boximg="object_projectpub"; public $boxlabel; //var $depends = array("projet"); @@ -60,7 +60,7 @@ class box_project extends ModeleBoxes $langs->loadLangs(array('boxes', 'projects')); $this->db = $db; - $this->boxlabel = "OpenedProjects"; + $this->boxlabel = "ValidatedProjects"; $this->hidden = ! ($user->rights->projet->lire); } @@ -81,11 +81,12 @@ class box_project extends ModeleBoxes $totalnb = 0; $totalnbTask=0; - $textHead = $langs->trans("OpenedProjects"); + $textHead = $langs->trans("ValidatedProjects"); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); // list the summary of the orders if ($user->rights->projet->lire) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $projectstatic = new Project($this->db); @@ -96,17 +97,20 @@ class box_project extends ModeleBoxes $projectsListId=''; if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid); - $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut as status, p.public"; - $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; - $sql.= " WHERE p.entity IN (".getEntity('project').")"; // Only current entity or severals if permission ok - $sql.= " AND p.fk_statut = 1"; // Only open projects - if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users - - $sql.= " ORDER BY p.datec DESC"; - //$sql.= $this->db->plimit($max, 0); - + $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.= " 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"; + $sql.= " WHERE p.fk_statut = 1"; // Only open projects + $sql.= " AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time)"; + $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; @@ -114,10 +118,10 @@ class box_project extends ModeleBoxes $objp = $this->db->fetch_object($result); $projectstatic->id = $objp->rowid; - $projectstatic->ref = $objp->ref; - $projectstatic->title = $objp->title; - $projectstatic->public = $objp->public; - $projectstatic->statut = $objp->status; + $projectstatic->ref = $objp->Ref; + $projectstatic->customer = $objp->Client; + $projectstatic->startDate = $objp->startDate; + $projectstatic->taskNumber = $objp->taskNumber; $this->info_box_contents[$i][] = array( 'td' => 'class="nowraponall"', @@ -127,67 +131,24 @@ class box_project extends ModeleBoxes $this->info_box_contents[$i][] = array( 'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"', - 'text' => $objp->title, + 'text' => $objp->Client, ); - $sql ="SELECT count(*) as nb, sum(progress) as totprogress"; - $sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid"; - $sql.= " WHERE p.entity IN (".getEntity('project').')'; - $sql.=" AND p.rowid = ".$objp->rowid; - $resultTask = $this->db->query($sql); - if ($resultTask) { - $objTask = $this->db->fetch_object($resultTask); - $this->info_box_contents[$i][] = array( - 'td' => 'class="right"', - 'text' => $objTask->nb." ".$langs->trans("Tasks"), - ); - if ($objTask->nb > 0) - $this->info_box_contents[$i][] = array( - 'td' => 'class="right"', - 'text' => round($objTask->totprogress/$objTask->nb, 0)."%", - ); - else - $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A "); - $totalnbTask += $objTask->nb; - } else { - $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => round(0)); - $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A "); - } - $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => $projectstatic->getLibStatut(3)); + $this->info_box_contents[$i][] = array( + 'td' => 'class="tdoverflowmax150 maxwidth200onsmartphone"', + 'text' => $objp->startDate, + ); - $i++; - } - if ($max < $num) - { - $this->info_box_contents[$i][] = array('td' => 'colspan="5"', 'text' => '...'); + $this->info_box_contents[$i][] = array( + 'td' => 'class="nowraponall"', + 'text' => $objp->taskNumber." ".$langs->trans("Tasks"), + ); $i++; } } } - // Add the sum à the bottom of the boxes - $this->info_box_contents[$i][] = array( - 'td' => 'class="liste_total"', - 'text' => $langs->trans("Total")." ".$textHead, - 'text' => " ", - ); - $this->info_box_contents[$i][] = array( - 'td' => 'class="right liste_total" ', - 'text' => round($num, 0)." ".$langs->trans("Projects"), - ); - $this->info_box_contents[$i][] = array( - 'td' => 'class="right liste_total" ', - 'text' => (($max < $num) ? '' : (round($totalnbTask, 0)." ".$langs->trans("Tasks"))), - ); - $this->info_box_contents[$i][] = array( - 'td' => 'class="liste_total"', - 'text' => " ", - ); - $this->info_box_contents[$i][] = array( - 'td' => 'class="liste_total"', - 'text' => " ", - ); } /** diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 77d339da035..ad77f85dfb5 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -144,6 +144,8 @@ class modProjet extends DolibarrModules $r++; $this->boxes[$r][1] = "box_task.php"; $r++; + $this->boxes[$r][1] = "box_validated_projects.php"; + $r++; // Permissions $this->rights = array(); From 76d5ce18caa83f375561ead51f1300ac178c04f6 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Fri, 28 Aug 2020 14:07:35 +0200 Subject: [PATCH 03/10] 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 From 281b52db752fc9664cc68043192754b66d3fbbd3 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Fri, 28 Aug 2020 15:45:10 +0200 Subject: [PATCH 04/10] =?UTF-8?q?lien=20cliquable=20nbTache=20vers=20liste?= =?UTF-8?q?=20tache=20filtr=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/boxes/box_validated_projects.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index e06da942b8a..bd76fc9c4c9 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -140,7 +140,7 @@ class box_validated_projects extends ModeleBoxes $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), @@ -171,7 +171,8 @@ class box_validated_projects extends ModeleBoxes $this->info_box_contents[$i][] = array( 'td' => 'class="center"', 'text' => $objp->taskNumber." ".$langs->trans("Tasks"), - 'asis' => 1 + 'asis' => 1, + 'url' => DOL_URL_ROOT.'/custom/cligp/tasks/projettasks.php?id='.$objp->rowid.'&search_progresscalc=0%&search_user_id='.$user->id, ); $i++; } From 343b39e31ff8868a5b6e1a906858242240b16850 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Fri, 28 Aug 2020 16:59:50 +0200 Subject: [PATCH 05/10] FIX : lien cliquable tiers --- htdocs/core/boxes/box_validated_projects.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index bd76fc9c4c9..0683b771a9b 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -147,16 +147,16 @@ class box_validated_projects extends ModeleBoxes 'asis' => 1 ); - $sql = 'SELECT nom FROM '.MAIN_DB_PREFIX.'societe WHERE rowid ='.$objp->Client; + $sql = 'SELECT rowid, 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 + 'text' => $obj->nom, + 'asis' => 1, + 'url' => DOL_URL_ROOT.'/societe/card.php?socid='.$obj->rowid ); } else { From 5a3016594752b80422597a24b2b8d81f9b13a5ff Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 31 Aug 2020 10:21:10 +0200 Subject: [PATCH 06/10] FIX : correction redirection pour nbTache --- htdocs/core/boxes/box_validated_projects.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index 0683b771a9b..f1e7fda8a2e 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -172,7 +172,7 @@ class box_validated_projects extends ModeleBoxes 'td' => 'class="center"', 'text' => $objp->taskNumber." ".$langs->trans("Tasks"), 'asis' => 1, - 'url' => DOL_URL_ROOT.'/custom/cligp/tasks/projettasks.php?id='.$objp->rowid.'&search_progresscalc=0%&search_user_id='.$user->id, + 'url' => DOL_URL_ROOT.'/custom/cligp/tasks/projettasks.php?id='.$objp->rowid.'&search_timespend==0&search_user_id='.$user->id, ); $i++; } From acfae190c381170499ce2fa9dbdf0b46e4860e93 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 2 Sep 2020 09:15:15 +0200 Subject: [PATCH 07/10] =?UTF-8?q?FIX=20:=20suppression=20lien=20nbT=C3=A2c?= =?UTF-8?q?he?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/boxes/box_validated_projects.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index f1e7fda8a2e..fc190b9d5d3 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -172,7 +172,6 @@ class box_validated_projects extends ModeleBoxes 'td' => 'class="center"', 'text' => $objp->taskNumber." ".$langs->trans("Tasks"), 'asis' => 1, - 'url' => DOL_URL_ROOT.'/custom/cligp/tasks/projettasks.php?id='.$objp->rowid.'&search_timespend==0&search_user_id='.$user->id, ); $i++; } From 419b2b71a924142de3053b3950cae35468617ee2 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 2 Sep 2020 10:52:30 +0200 Subject: [PATCH 08/10] =?UTF-8?q?FIX=20:=20modif=20requete=20SQL,=20prise?= =?UTF-8?q?=20en=20compte=20user=20connect=C3=A9=20pour=20saisie=20des=20t?= =?UTF-8?q?emps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/boxes/box_validated_projects.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index fc190b9d5d3..2bf303d9254 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -100,12 +100,12 @@ 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_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.= " 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 WHERE fk_user =".$user->id.")) 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"; $sql.= " WHERE p.fk_statut = 1"; // Only open projects - $sql.= " AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time)"; + $sql.= " AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user =".$user->id.")"; $sql.= " AND c.fk_socpeople = ".$user->id; $sql.= " GROUP BY p.ref"; $sql.= " ORDER BY p.dateo ASC"; From b4942707bbb4cc719df7f22ac29a0523d0a67059 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 10 Sep 2020 11:23:45 +0200 Subject: [PATCH 09/10] EN_US Traductions --- htdocs/langs/en_US/boxes.lang | 1 + htdocs/langs/fr_FR/boxes.lang | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index ab89bc10c4b..14db79809bc 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -104,3 +104,4 @@ BoxTitleLastCustomerShipments=Latest %s customer shipments NoRecordedShipments=No recorded customer shipment # Pages AccountancyHome=Accountancy +ValidatedProjects=Validated projects diff --git a/htdocs/langs/fr_FR/boxes.lang b/htdocs/langs/fr_FR/boxes.lang index 7b633336c34..e2964afd6a3 100644 --- a/htdocs/langs/fr_FR/boxes.lang +++ b/htdocs/langs/fr_FR/boxes.lang @@ -104,4 +104,3 @@ 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 From 0fc24366e12bcd97354f52bf582ddca60d3d8579 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 10 Sep 2020 09:28:05 +0000 Subject: [PATCH 10/10] Fixing style errors. --- htdocs/core/boxes/box_validated_projects.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index 2bf303d9254..378aea61df5 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -86,7 +86,6 @@ class box_validated_projects extends ModeleBoxes // list the summary of the orders if ($user->rights->projet->lire) { - include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $projectstatic = new Project($this->db); @@ -179,8 +178,6 @@ class box_validated_projects extends ModeleBoxes dol_print_error($this->db); } } - - } /**