From 6f62a1e71755ff2ae4ade291eb7927d1fe2ef0d6 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Tue, 1 Mar 2022 13:16:28 +0100 Subject: [PATCH 1/2] Fix Project data Fix issue that block loading of project's data in pdf. Now, any project's data can be load, like, third party, name, etc. --- .../core/modules/pdf/pdf_rat.modules.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/timesheet/core/modules/pdf/pdf_rat.modules.php b/htdocs/timesheet/core/modules/pdf/pdf_rat.modules.php index da76115..ebac0ee 100644 --- a/htdocs/timesheet/core/modules/pdf/pdf_rat.modules.php +++ b/htdocs/timesheet/core/modules/pdf/pdf_rat.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2018 Laurent Destailleur + * Copyright (C) 2022 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 @@ -27,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; /** * Class to manage generation of project document Baleine */ @@ -477,7 +480,12 @@ public function tableau(&$pdf, $tab_top, $tab_height, $heightoftitleline, $outpu */ public function pageHead(&$pdf, $object, $showaddress, $outputlangs, $projectid, $userName = "") { - global $langs, $conf, $mysoc; + global $langs, $conf, $mysoc, $db; + + $project = new Project($db); + $project->fetch($projectid); + $project->fetch_thirdparty(); + $default_font_size = pdf_getPDFFontSize($outputlangs); pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); $pdf->SetTextColor(0, 0, 60); @@ -513,7 +521,7 @@ public function pageHead(&$pdf, $object, $showaddress, $outputlangs, $projectid, $pdf->SetFont('', 'B', $default_font_size +1); $pdf->SetXY($this->marge_gauche+$logoWidth, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite - $logoWidth, 4, $outputlangs->convToOutputCharset($object->ref[$projectid]), '', 'R'); + $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite - $logoWidth, 4, $outputlangs->convToOutputCharset($project->ref." - ".$project->title), '', 'R'); //worker name if (!empty($userName) && !$conf->global->TIMESHEET_PDF_HIDE_NAME) { $pdf->SetXY($this->marge_gauche, $height+$default_font_size + 3); @@ -530,10 +538,10 @@ public function pageHead(&$pdf, $object, $showaddress, $outputlangs, $projectid, $pdf->SetXY($posx, $posy); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : " . dol_print_date($object->stopDate, 'day', false, $outputlangs, true), '', 'R'); // third party name - if (is_object($object->thirdparty[$projectid])) { + if ($project->thirdparty->id > 0) { $posy += 5; $pdf->SetXY($posx, $posy); - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("ThirdParty")." : " . $object->thirdparty[$projectid]->getFullName($outputlangs), '', 'R'); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("ThirdParty")." : " . $project->thirdparty->getFullName($outputlangs), '', 'R'); } $pdf->SetTextColor(0, 0, 60); } From 5f8aae4355d6684a105040026b17376f0312d09a Mon Sep 17 00:00:00 2001 From: Patrick Delcroix Date: Wed, 2 Mar 2022 19:12:25 +0100 Subject: [PATCH 2/2] 4.5.1 --- htdocs/timesheet/ChangeLog.md | 19 +++++++++++++++++++ .../core/modules/modtimesheet.class.php | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/timesheet/ChangeLog.md b/htdocs/timesheet/ChangeLog.md index f5f5100..8747d74 100644 --- a/htdocs/timesheet/ChangeLog.md +++ b/htdocs/timesheet/ChangeLog.md @@ -1,4 +1,23 @@ # dolibarr_project_timesheet changelog +4.5.1 +- Fix Project data on reports + +4.5.0 +- new; first verison of the TS missing reminder +- new: add submit/save next button on ts pages +- new: add propal lines in the invoice service assignation screen (behave as lumpsum) +- new: add lump sum option the invoice service assignation screen +- new: show "all users" report +- new: enable masking "import from agenda" +- new add customer code in exports +- new: total lines are dynamic +- new: box for average/Max timesheet delta with hours per week for the user +- fix: role authorisation issue on project/task +- fix issue when selecting "curent user" in ts for other option +- fix: unblock holiday if not approved +- fix: project name on user report + + 4.4.10 (2021-12-01) - fix the watch clock issue (going way to fast) diff --git a/htdocs/timesheet/core/modules/modtimesheet.class.php b/htdocs/timesheet/core/modules/modtimesheet.class.php index 798cbbd..cfdca49 100644 --- a/htdocs/timesheet/core/modules/modtimesheet.class.php +++ b/htdocs/timesheet/core/modules/modtimesheet.class.php @@ -54,7 +54,7 @@ public function __construct($db) $this->editor_name = 'Patrick Delcroix'; $this->editor_url = 'https://github.com/delcroip'; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = '4.5.0'; + $this->version = '4.5.1'; // Key used in llx_cons table to save module status enabled/disabled(where timesheet is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page(0=common, 1=interface, 2=others, 3=very specific)