| '.$langs->trans("CreatedBy").' | ';
print img_picto('', 'user', 'class="pictofixedwidth"');
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index d51a45e465b..ffcfb7d0559 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -2107,6 +2107,9 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
$classpath = 'commande/class';
$module = 'commande';
$myobject = 'commande';
+ } elseif ($objecttype == 'mailing') {
+ $langs->load('mailing');
+ $classpath = 'comm/mailing/class';
} elseif ($objecttype == 'propal') {
$langs->load('propal');
$classpath = 'comm/propal/class';
@@ -2656,6 +2659,8 @@ function getModuleDirForApiClass($moduleobject)
$moduledirforclass = 'comm/propal';
} elseif ($moduleobject == 'agenda' || $moduleobject == 'agendaevents') {
$moduledirforclass = 'comm/action';
+ } elseif ($moduleobject == 'mailing') {
+ $moduledirforclass = 'comm/mailing';
} elseif ($moduleobject == 'adherent' || $moduleobject == 'members' || $moduleobject == 'memberstypes' || $moduleobject == 'subscriptions') {
$moduledirforclass = 'adherents';
} elseif ($moduleobject == 'don' || $moduleobject == 'donations') {
diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php
index d82d9b4f048..6eb7860e07b 100644
--- a/htdocs/core/modules/modSalaries.class.php
+++ b/htdocs/core/modules/modSalaries.class.php
@@ -98,14 +98,22 @@ class modSalaries extends DolibarrModules
$r++;
$this->rights[$r][0] = 511;
- $this->rights[$r][1] = 'Read employee salaries and payments (yours and your subordinates)';
+ $this->rights[$r][1] = 'Read employee salaries and payments (yours only)';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'read';
$this->rights[$r][5] = '';
$r++;
- $this->rights[$r][0] = 512;
+ $this->rights[$r][0] = 511;
+ $this->rights[$r][1] = 'Read employee salaries and payments (yours and your subordinates)';
+ $this->rights[$r][2] = 'r';
+ $this->rights[$r][3] = 0;
+ $this->rights[$r][4] = 'readchild';
+ $this->rights[$r][5] = '';
+
+ $r++;
+ $this->rights[$r][0] = 513;
$this->rights[$r][1] = 'Create/modify payments of empoyee salaries';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
diff --git a/htdocs/install/mysql/tables/llx_categorie_propal.sql b/htdocs/install/mysql/tables/llx_categorie_propal.sql
new file mode 100644
index 00000000000..9316d0c9ca5
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_categorie_propal.sql
@@ -0,0 +1,21 @@
+-- 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 .
+--
+-- ============================================================================
+
+create table llx_categorie_propal
+(
+ fk_categorie integer NOT NULL,
+ fk_propal integer NOT NULL,
+ import_key varchar(14)
+)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_categorie_supplier_proposal.sql b/htdocs/install/mysql/tables/llx_categorie_supplier_proposal.sql
new file mode 100644
index 00000000000..f4023ff5f19
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_categorie_supplier_proposal.sql
@@ -0,0 +1,26 @@
+-- ============================================================================
+-- Copyright (C) 2007 Patrick Raguin
+-- Copyright (C) 2012 Juanjo Menent
+-- Copyright (C) 2022 Solution Libre SAS
+--
+-- 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 .
+--
+-- ============================================================================
+
+create table llx_categorie_supplier_proposal
+(
+ fk_categorie integer NOT NULL,
+ fk_supplier_proposal integer NOT NULL,
+ import_key varchar(14)
+)ENGINE=innodb;
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 3ce725f46c2..1d254809ebb 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -920,8 +920,9 @@ Permission402=Créer/modifier les avoirs
Permission403=Valider les avoirs
Permission404=Supprimer les avoirs
Permission431=Utilisez la barre de débogage
-Permission511=Lire les salaires et leur paiement (les vôtres et ceux de vos subordonnées)
-Permission512=Créer/modifier les salaires et leur paiement
+Permission511=Lire les salaires et leur paiement (les vôtres seulement)
+Permission512=Lire les salaires et leur paiement (les vôtres et ceux de vos subordonnées)
+Permission513=Créer/modifier les salaires et leur paiement
Permission514=Supprimer les salaires et leur paiement
Permission517=Lire les salaires et leur paiement de tout le monde
Permission519=Exporter les salaires
diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php
index d46a59b26fc..68348ae2fb3 100644
--- a/htdocs/salaries/list.php
+++ b/htdocs/salaries/list.php
@@ -361,9 +361,13 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account ba ON (ba.rowid = s.fk_accoun
$sql .= " ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = s.fk_user";
$sql .= " AND s.entity IN (".getEntity('salaries').")";
+if (!$user->hasRight('salaries', 'readchild')) {
+ $sql .= " AND s.fk_user = ".(int) $user->id;
+}
if (!$user->hasRight('salaries', 'readall')) {
$sql .= " AND s.fk_user IN (".$db->sanitize(implode(',', $childids)).")";
}
+
//print $sql;
// Search criteria
diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php
index 59f31d1e747..7990f3b6491 100644
--- a/htdocs/salaries/payments.php
+++ b/htdocs/salaries/payments.php
@@ -255,8 +255,11 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.ro
$sql .= " ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = sal.fk_user";
$sql .= " AND s.entity IN (".getEntity('payment_salaries').")";
+if (!$user->hasRight('salaries', 'readchild')) {
+ $sql .= " AND s.fk_user = ".(int) $user->id;
+}
if (!$user->hasRight('salaries', 'readall')) {
- $sql .= " AND sal.fk_user IN (".$db->sanitize(implode(',', $childids)).")";
+ $sql .= " AND s.fk_user IN (".$db->sanitize(implode(',', $childids)).")";
}
// Search criteria
diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php
index 39b8558e9de..87fbe395c7f 100644
--- a/htdocs/salaries/stats/index.php
+++ b/htdocs/salaries/stats/index.php
@@ -85,6 +85,9 @@ dol_mkdir($dir);
$useridtofilter = $userid; // Filter from parameters
+if (!$user->hasRight('salaries', 'readchild') && empty($useridtofilter)) {
+ $useridtofilter = $user->id;
+}
if (!$user->hasRight('salaries', 'readall') && empty($useridtofilter)) {
$useridtofilter = $user->getAllChildIds(1);
}
@@ -216,14 +219,19 @@ print '';
// Show filter box
print ' |