From 112922206469e35129ec5198bac125f40ce736fa Mon Sep 17 00:00:00 2001
From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com>
Date: Fri, 19 Nov 2021 15:59:34 +0100
Subject: [PATCH 1/6] FIX: user employee tab: offset in open days messes up
holiday length calculation
---
htdocs/user/bank.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php
index 3bdc6b5390c..e97d6504369 100644
--- a/htdocs/user/bank.php
+++ b/htdocs/user/bank.php
@@ -327,7 +327,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
$holiday->id = $objp->rowid;
$holiday->ref = $objp->rowid;
$holiday->fk_type = $objp->fk_type;
- $nbopenedday = num_open_day($db->jdate($objp->date_debut), $db->jdate($objp->date_fin), 0, 1, $objp->halfday);
+ $nbopenedday = num_open_day($db->jdate($objp->date_debut, 'gmt'), $db->jdate($objp->date_fin, 'gmt'), 0, 1, $objp->halfday);
print $holiday->getNomUrl(1);
print '
Date: Mon, 11 Apr 2022 17:25:45 +0200
Subject: [PATCH 2/6] Module builder: Translate permissions label
---
htdocs/modulebuilder/index.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index f3922aa6342..f8abd703bf0 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -3008,7 +3008,7 @@ if ($module == 'initmodule')
print '';
print '';
- print $perm[1];
+ print $langs->trans($perm[1]);
print ' | ';
print '';
From 62b74962535ed38c424e569d9dbd79b25653ab16 Mon Sep 17 00:00:00 2001
From: Ferran Marcet
Date: Mon, 11 Apr 2022 18:26:49 +0200
Subject: [PATCH 3/6] Fix: Direct download don't work with multicompany
---
htdocs/document.php | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/htdocs/document.php b/htdocs/document.php
index 060722e8d5b..fc894091615 100644
--- a/htdocs/document.php
+++ b/htdocs/document.php
@@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2010 Pierre Morin
* Copyright (C) 2010 Juanjo Menent
+ * Copyright (C) 2022 Ferran Marcet
*
* 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
@@ -140,6 +141,11 @@ if (!empty($hashp))
$modulepart = $moduleparttocheck;
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
}
+ $entity = $ecmfile->entity;
+ if ($entity != $conf->entity) {
+ $conf->entity = $entity;
+ $conf->setValues($db);
+ }
} else {
$langs->load("errors");
accessforbidden($langs->trans("ErrorFileNotFoundWithSharedLink"), 0, 0, 1);
From f4023b4e44160e0861eb09a0d0d407e5420575e3 Mon Sep 17 00:00:00 2001
From: kevin
Date: Tue, 12 Apr 2022 11:08:50 +0200
Subject: [PATCH 4/6] Add missing entity on salary's payment
---
htdocs/salaries/class/paymentsalary.class.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php
index 76236bb88aa..506e9b73ea5 100644
--- a/htdocs/salaries/class/paymentsalary.class.php
+++ b/htdocs/salaries/class/paymentsalary.class.php
@@ -164,9 +164,9 @@ class PaymentSalary extends CommonObject
$this->db->begin();
if ($totalamount != 0) {
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_salary (fk_salary, datec, datep, amount,";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_salary (entity, fk_salary, datec, datep, amount,";
$sql .= " fk_typepayment, num_payment, note, fk_user_author, fk_bank)";
- $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',";
+ $sql .= " VALUES (".$conf->entity.", ".$this->chid.", '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->datepaye)."',";
$sql .= " ".price2num($totalamount).",";
$sql .= " ".((int) $this->paiementtype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".((int) $user->id).",";
From 0fcfb7c5fd3988fb362ee550dd7edc6beb185c97 Mon Sep 17 00:00:00 2001
From: atm-arnaud
Date: Thu, 14 Apr 2022 12:08:06 +0200
Subject: [PATCH 5/6] FIX intervention entity missing
---
htdocs/fichinter/class/fichinter.class.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 371853dc70c..92b628b9aab 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -426,7 +426,7 @@ class Fichinter extends CommonObject
$sql .= " f.datec, f.dateo, f.datee, f.datet, f.fk_user_author,";
$sql .= " f.date_valid as datev,";
$sql .= " f.tms as datem,";
- $sql .= " f.duree, f.fk_projet as fk_project, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat";
+ $sql .= " f.duree, f.fk_projet as fk_project, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat, f.entity as entity";
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f";
if ($ref) {
$sql .= " WHERE f.entity IN (".getEntity('intervention').")";
@@ -459,6 +459,7 @@ class Fichinter extends CommonObject
$this->model_pdf = $obj->model_pdf;
$this->modelpdf = $obj->model_pdf; // deprecated
$this->fk_contrat = $obj->fk_contrat;
+ $this->entity = $obj->entity;
$this->user_creation = $obj->fk_user_author;
From 02a3cfbb5f16672f2fff6c65f0fe6a0a3386d56b Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Thu, 14 Apr 2022 21:43:55 +0200
Subject: [PATCH 6/6] Update paymentsalary.class.php
---
htdocs/salaries/class/paymentsalary.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php
index 506e9b73ea5..08e850c259a 100644
--- a/htdocs/salaries/class/paymentsalary.class.php
+++ b/htdocs/salaries/class/paymentsalary.class.php
@@ -166,7 +166,7 @@ class PaymentSalary extends CommonObject
if ($totalamount != 0) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_salary (entity, fk_salary, datec, datep, amount,";
$sql .= " fk_typepayment, num_payment, note, fk_user_author, fk_bank)";
- $sql .= " VALUES (".$conf->entity.", ".$this->chid.", '".$this->db->idate($now)."',";
+ $sql .= " VALUES (".((int) $conf->entity).", ".((int) $this->chid).", '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->datepaye)."',";
$sql .= " ".price2num($totalamount).",";
$sql .= " ".((int) $this->paiementtype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".((int) $user->id).",";
|