From 25196fa7092b561ab14cd3f0c670aed31a2de2cc Mon Sep 17 00:00:00 2001
From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com>
Date: Thu, 19 May 2022 10:20:31 +0200
Subject: [PATCH 01/18] FIX: new member subscription: bank account and payment
mode might be hidden
---
htdocs/adherents/subscription.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index 799f043c4df..c069f0d12e2 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -960,12 +960,12 @@ if ($rowid > 0) {
// Bank account
print '
| '.$langs->trans("FinancialAccount").' | ';
- $form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 2);
+ $form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 2, '', 0, 'minwidth200');
print " |
\n";
// Payment mode
print '| '.$langs->trans("PaymentMode").' | ';
- $form->select_types_paiements(GETPOST('operation'), 'operation', '', 2);
+ $form->select_types_paiements(GETPOST('operation'), 'operation', '', 2, 1, 0, 0, 1, 'minwidth200');
print " |
\n";
// Date of payment
From a2fe72225f61054db1f58342d5f1f00177f70595 Mon Sep 17 00:00:00 2001
From: Quentin VIAL-GOUTEYRON
Date: Fri, 20 May 2022 10:06:28 +0200
Subject: [PATCH 02/18] NEW : hook for dol_format_address
---
htdocs/core/lib/functions.lib.php | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index e891904e39e..19fa4cd5c63 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2154,7 +2154,7 @@ function dol_bc($var, $moreclass = '')
*/
function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs = '', $mode = 0, $extralangcode = '')
{
- global $conf, $langs;
+ global $conf, $langs, $hookmanager;
$ret = '';
$countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
@@ -2220,6 +2220,14 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
$langs->load("dict");
$ret .= (empty($object->country_code) ? '' : ($ret ? $sep : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->country_code)));
}
+ if ($hookmanager) {
+ $parameters = array('withcountry' => $withcountry, 'sep' => $sep, 'outputlangs' => $outputlangs,'mode' => $mode, 'extralangcode' => $extralangcode);
+ $reshook = $hookmanager->executeHooks('formatAddress', $parameters, $object);
+ if ($reshook > 0) {
+ $ret = '';
+ }
+ $ret .= $hookmanager->resPrint;
+ }
return $ret;
}
From 8231a9ea0fab852d3c9268c29a97833d7f3f49f2 Mon Sep 17 00:00:00 2001
From: Maxime Kohlhaas
Date: Fri, 20 May 2022 23:29:35 +0200
Subject: [PATCH 03/18] Fix wrong right test to show button
---
htdocs/expensereport/card.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 07d3e018390..acd6a60f0f9 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -2648,7 +2648,7 @@ if ($action != 'create' && $action != 'edit')
}
// If bank module is not used
- if (($user->rights->expensereport->to_paid || empty($conf->banque->enabled)) && $object->status == ExpenseReport::STATUS_APPROVED)
+ if (($user->rights->expensereport->to_paid && empty($conf->banque->enabled)) && $object->status == ExpenseReport::STATUS_APPROVED)
{
//if ((round($remaintopay) == 0 || empty($conf->banque->enabled)) && $object->paid == 0)
if ($object->paid == 0)
From 4c10ef8f4c913cca2c16b3be2cfda25c5687ea22 Mon Sep 17 00:00:00 2001
From: Maxime Kohlhaas
Date: Sat, 21 May 2022 15:36:04 +0200
Subject: [PATCH 04/18] Fix labels in tickets widgets
---
htdocs/core/boxes/box_graph_nb_tickets_type.php | 2 +-
htdocs/core/boxes/box_graph_ticket_by_severity.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php
index 2da54d84e7a..f4efce23797 100644
--- a/htdocs/core/boxes/box_graph_nb_tickets_type.php
+++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php
@@ -131,7 +131,7 @@ class box_graph_nb_tickets_type extends ModeleBoxes
}
foreach ($listofoppcode as $rowid => $code) {
$dataseries[] = array(
- 'label' => $langs->getLabelFromKey($this->db, 'TicketTypeShort' . $code, 'c_ticket_category', 'code', 'label', $code),
+ 'label' => $langs->getLabelFromKey($this->db, 'TicketTypeShort' . $code, 'c_ticket_type', 'code', 'label', $code),
'data' => (empty($data[$code]) ? 0 : $data[$code])
);
}
diff --git a/htdocs/core/boxes/box_graph_ticket_by_severity.php b/htdocs/core/boxes/box_graph_ticket_by_severity.php
index 13cd0c40c86..a7fa571b6c7 100644
--- a/htdocs/core/boxes/box_graph_ticket_by_severity.php
+++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php
@@ -152,7 +152,7 @@ class box_graph_ticket_by_severity extends ModeleBoxes
}
foreach ($listofoppcode as $rowid => $code) {
$dataseries[] = array(
- 'label' => $langs->getLabelFromKey($this->db, 'TicketSeverityShort' . $code, 'c_ticket_category', 'code', 'label', $code),
+ 'label' => $langs->getLabelFromKey($this->db, 'TicketSeverityShort' . $code, 'c_ticket_severity', 'code', 'label', $code),
'data' => (empty($data[$code]) ? 0 : $data[$code])
);
}
From 4932f86a2d2f5cc04d065417cc5eccdff7eb4899 Mon Sep 17 00:00:00 2001
From: Maxime Kohlhaas
Date: Sat, 21 May 2022 15:41:34 +0200
Subject: [PATCH 05/18] Fix default value for boolean extrafield
---
htdocs/core/class/commonobject.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 02421ea9157..14c91ccd19a 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7518,7 +7518,7 @@ abstract class CommonObject
}
// HTML, text, select, integer and varchar: take into account default value in database if in create mode
- if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'varchar', 'select', 'int'))) {
+ if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'varchar', 'select', 'int', 'boolean'))) {
if ($action == 'create') {
$value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) || $value) ? $value : $extrafields->attributes[$this->table_element]['default'][$key];
}
From 9b2a54317090025c0dc5151b0f12c25a1abd46ef Mon Sep 17 00:00:00 2001
From: Maxime Kohlhaas
Date: Sat, 21 May 2022 15:49:27 +0200
Subject: [PATCH 06/18] Fix phpcs too long line
---
htdocs/core/class/commonobject.class.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 14c91ccd19a..a706583c7cc 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7503,14 +7503,16 @@ abstract class CommonObject
if (!is_numeric($this->array_options['options_'.$key])) { // For backward compatibility
$datenotinstring = $this->db->jdate($datenotinstring);
}
- $value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)) ? dol_mktime(12, 0, 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year", 'int', 3)) : $datenotinstring;
+ $datekey = $keyprefix.'options_'.$key.$keysuffix;
+ $value = (GETPOSTISSET($datekey)) ? dol_mktime(12, 0, 0, GETPOST($datekey.'month', 'int', 3), GETPOST($datekey.'day', 'int', 3), GETPOST($datekey.'year', 'int', 3)) : $datenotinstring;
}
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('datetime'))) {
$datenotinstring = $this->array_options['options_'.$key];
if (!is_numeric($this->array_options['options_'.$key])) { // For backward compatibility
$datenotinstring = $this->db->jdate($datenotinstring);
}
- $value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)) ? dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."sec", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."month", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year", 'int', 3), 'tzuserrel') : $datenotinstring;
+ $timekey = $keyprefix.'options_'.$key.$keysuffix;
+ $value = (GETPOSTISSET($timekey)) ? dol_mktime(GETPOST($timekey.'hour', 'int', 3), GETPOST($timekey.'min', 'int', 3), GETPOST($timekey.'sec', 'int', 3), GETPOST($timekey.'month', 'int', 3), GETPOST($timekey.'day', 'int', 3), GETPOST($timekey.'year', 'int', 3), 'tzuserrel') : $datenotinstring;
}
// Convert float submited string into real php numeric (value in memory must be a php numeric)
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('price', 'double'))) {
From d8a68d280ee197729dfc700acf05d9d1f301e0a5 Mon Sep 17 00:00:00 2001
From: Nicolas
Date: Sat, 21 May 2022 17:06:36 +0200
Subject: [PATCH 07/18] FIX missing morecss for multiselectarray
---
htdocs/core/class/commonobject.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 02421ea9157..bbca87fe125 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -6760,7 +6760,7 @@ abstract class CommonObject
$out .= '';
} elseif ($type == 'checkbox') {
$value_arr = explode(',', $value);
- $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%');
+ $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, $morecss, 0, '100%');
} elseif ($type == 'radio') {
$out = '';
foreach ($param['options'] as $keyopt => $val) {
From e5c38572d196bb38ae0f3bedbba784f55ed2ce94 Mon Sep 17 00:00:00 2001
From: Maxime Kohlhaas
Date: Sun, 22 May 2022 00:23:16 +0200
Subject: [PATCH 08/18] Fix no document available on job candidature
---
htdocs/core/modules/modRecruitment.class.php | 12 +++++-------
.../recruitment/modules_recruitmentcandidature.php | 2 +-
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php
index 3d4e88872ef..41679c19a1c 100644
--- a/htdocs/core/modules/modRecruitment.class.php
+++ b/htdocs/core/modules/modRecruitment.class.php
@@ -423,7 +423,7 @@ class modRecruitment extends DolibarrModules
$sql = array();
// Document template
- $moduledir = 'mymodule';
+ $moduledir = 'recruitment';
$myTmpObjects = array();
$myTmpObjects['RecruitmentJobPosition'] = array('includerefgeneration'=>1, 'includedocgeneration'=>1);
@@ -431,10 +431,10 @@ class modRecruitment extends DolibarrModules
if ($myTmpObjectKey == 'MyObject') {
continue;
}
- if ($myTmpObjectArray['includerefgeneration']) {
- $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mymodule/template_myobjects.odt';
- $dirodt = DOL_DATA_ROOT.'/doctemplates/mymodule';
- $dest = $dirodt.'/template_myobjects.odt';
+ if ($myTmpObjectArray['includedocgeneration']) {
+ $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_recruitmentjobposition.odt';
+ $dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;
+ $dest = $dirodt.'/template_recruitmentjobposition.odt';
if (file_exists($src) && !file_exists($dest)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -450,8 +450,6 @@ class modRecruitment extends DolibarrModules
$sql = array_merge($sql, array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey)."' AND type = '".strtolower($myTmpObjectKey)."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey)."','".strtolower($myTmpObjectKey)."',".$conf->entity.")",
- "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'generic_".strtolower($myTmpObjectKey)."_odt' AND type = '".strtolower($myTmpObjectKey)."' AND entity = ".$conf->entity,
- "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('generic_".strtolower($myTmpObjectKey)."_odt', '".strtolower($myTmpObjectKey)."', ".$conf->entity.")"
));
}
}
diff --git a/htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php b/htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php
index 84bfd30401c..089aa720fa7 100644
--- a/htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php
+++ b/htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php
@@ -51,7 +51,7 @@ abstract class ModelePDFRecruitmentCandidature extends CommonDocGenerator
// phpcs:enable
global $conf;
- $type = 'recruitmentjobposition';
+ $type = 'recruitmentjobcandidature';
$list = array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
From c1473b55149d6ae578a75712dded5ee7668662dc Mon Sep 17 00:00:00 2001
From: Eric Seigne
Date: Sun, 22 May 2022 01:21:52 +0200
Subject: [PATCH 09/18] fix #18338: Undefined property $ficheinter
---
htdocs/comm/propal/card.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index a77e242379f..bf0c63e5b11 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -121,7 +121,9 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->
$usercancreateorder = $user->rights->commande->creer;
$usercancreateinvoice = $user->rights->facture->creer;
$usercancreatecontract = $user->rights->contrat->creer;
-$usercancreateintervention = $user->rights->ficheinter->creer;
+if ($conf->ficheinter->enabled) {
+ $usercancreateintervention = $user->rights->ficheinter->creer;
+}
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
From 4a222fe5d5e91c946abb92ffe6bf2acb76c31e01 Mon Sep 17 00:00:00 2001
From: Eric Seigne
Date: Sun, 22 May 2022 01:38:32 +0200
Subject: [PATCH 10/18] fix potential warning ($conf->ficheinter->enabled)
---
htdocs/comm/propal/card.php | 2 +-
htdocs/commande/card.php | 2 +-
htdocs/ticket/card.php | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index bf0c63e5b11..3e9c2cb4eeb 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -121,7 +121,7 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->
$usercancreateorder = $user->rights->commande->creer;
$usercancreateinvoice = $user->rights->facture->creer;
$usercancreatecontract = $user->rights->contrat->creer;
-if ($conf->ficheinter->enabled) {
+if (!empty($conf->ficheinter->enabled)) {
$usercancreateintervention = $user->rights->ficheinter->creer;
}
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 3ed5ede556c..3e5ec08a0f3 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2525,7 +2525,7 @@ if ($action == 'create' && $usercancreate) {
}
// Create intervention
- if ($conf->ficheinter->enabled) {
+ if (!empty($conf->ficheinter->enabled)) {
$langs->load("interventions");
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index ab2c2794e38..9c1a7c709b7 100644
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -1047,7 +1047,7 @@ if ($action == 'create' || $action == 'presend') {
print '';
// Timing (Duration sum of linked fichinter)
- if ($conf->ficheinter->enabled) {
+ if (!empty($conf->ficheinter->enabled)) {
$object->fetchObjectLinked();
$num = count($object->linkedObjects);
$timing = 0;
From 45bc1ff28748b8f4193bd0cba6acf32538f824c5 Mon Sep 17 00:00:00 2001
From: Eric Seigne
Date: Sun, 22 May 2022 01:50:01 +0200
Subject: [PATCH 11/18] fix #18339 : Attempt to read property creer
---
htdocs/comm/propal/card.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index a77e242379f..501be1bbca1 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -121,7 +121,9 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->
$usercancreateorder = $user->rights->commande->creer;
$usercancreateinvoice = $user->rights->facture->creer;
$usercancreatecontract = $user->rights->contrat->creer;
-$usercancreateintervention = $user->rights->ficheinter->creer;
+if (!empty($conf->ficheinter->enabled)) {
+ $usercancreateintervention = $user->rights->ficheinter->creer;
+}
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
From 1ca1afd73402b5e57167583c8c1b1f39c2d790f3 Mon Sep 17 00:00:00 2001
From: Eric Seigne
Date: Sun, 22 May 2022 01:50:10 +0200
Subject: [PATCH 12/18] fix #18339 : Attempt to read property creer
---
htdocs/comm/propal/card.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 501be1bbca1..3e9c2cb4eeb 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -122,7 +122,7 @@ $usercancreateorder = $user->rights->commande->creer;
$usercancreateinvoice = $user->rights->facture->creer;
$usercancreatecontract = $user->rights->contrat->creer;
if (!empty($conf->ficheinter->enabled)) {
- $usercancreateintervention = $user->rights->ficheinter->creer;
+ $usercancreateintervention = $user->rights->ficheinter->creer;
}
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
From c3fb7647c5f8cf4d4cd8d744af1fecc2f5e2cbed Mon Sep 17 00:00:00 2001
From: Maxime Kohlhaas
Date: Sun, 22 May 2022 02:30:35 +0200
Subject: [PATCH 13/18] Fix delete customer payment
---
htdocs/compta/paiement/card.php | 2 +-
htdocs/core/lib/security.lib.php | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index b53debd79ba..47897902a9c 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -48,7 +48,7 @@ $object = new Paiement($db);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
-$result = restrictedArea($user, $object->element, $object->id, 'paiement', '');
+$result = restrictedArea($user, $object->element, $object->id, 'paiement');
// Security check
if ($user->socid) $socid = $user->socid;
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index f8bde1ce489..c1eda701604 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -185,7 +185,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
//print "user_id=".$user->id.", features=".$features.", feature2=".$feature2.", objectid=".$objectid;
- //print ", dbtablename=".$dbtablename.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
+ //print ", dbtablename=".$tableandshare.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
//print ", perm: ".$features."->".$feature2."=".($user->rights->$features->$feature2->lire)."
";
$parentfortableentity = '';
@@ -374,6 +374,8 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
} elseif ($feature == 'salaries')
{
if (!$user->rights->salaries->delete) $deleteok = 0;
+ } elseif ($feature == 'payment') {
+ if (!$user->rights->facture->paiement) $deleteok = 0;
} elseif ($feature == 'payment_supplier')
{
if (!$user->rights->fournisseur->facture->creer) { $deleteok = 0; }
From a193474fa38046605fdca8cfabcad92a315242f8 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 22 May 2022 17:15:43 +0200
Subject: [PATCH 14/18] Update card.php
---
htdocs/comm/propal/card.php | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 3e9c2cb4eeb..cb7e512bc36 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -121,9 +121,7 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->
$usercancreateorder = $user->rights->commande->creer;
$usercancreateinvoice = $user->rights->facture->creer;
$usercancreatecontract = $user->rights->contrat->creer;
-if (!empty($conf->ficheinter->enabled)) {
- $usercancreateintervention = $user->rights->ficheinter->creer;
-}
+$usercancreateintervention = empty($conf->ficheinter->enabled) ? 0 : $user->rights->ficheinter->creer;
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
From 460687504cb1b1973a04e6c0aa490883afd35bc2 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 22 May 2022 17:16:48 +0200
Subject: [PATCH 15/18] Update card.php
---
htdocs/comm/propal/card.php | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 3e9c2cb4eeb..cb7e512bc36 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -121,9 +121,7 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->
$usercancreateorder = $user->rights->commande->creer;
$usercancreateinvoice = $user->rights->facture->creer;
$usercancreatecontract = $user->rights->contrat->creer;
-if (!empty($conf->ficheinter->enabled)) {
- $usercancreateintervention = $user->rights->ficheinter->creer;
-}
+$usercancreateintervention = empty($conf->ficheinter->enabled) ? 0 : $user->rights->ficheinter->creer;
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
From e437a53657d378ac765d117359f190442cc959a7 Mon Sep 17 00:00:00 2001
From: Alexandre SPANGARO
Date: Mon, 23 May 2022 21:40:47 +0200
Subject: [PATCH 16/18] Typo
---
htdocs/accountancy/class/accountingaccount.class.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php
index a4dcac8c1ad..b50139a2d76 100644
--- a/htdocs/accountancy/class/accountingaccount.class.php
+++ b/htdocs/accountancy/class/accountingaccount.class.php
@@ -732,11 +732,11 @@ class AccountingAccount extends CommonObject
global $hookmanager;
// Instantiate hooks for external modules
- $hookmanager->initHooks(array('accoutancyBindingCalculation'));
+ $hookmanager->initHooks(array('accountancyBindingCalculation'));
- // Execute hook accoutancyBindingCalculation
+ // Execute hook accountancyBindingCalculation
$parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount'=>$accountingAccount, $type);
- $reshook = $hookmanager->executeHooks('accoutancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks
+ $reshook = $hookmanager->executeHooks('accountancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
if ($type == 'customer') {
From 9d31d6448c3c19acaea2e8a109ff52f6a1c78775 Mon Sep 17 00:00:00 2001
From: John BOTELLA
Date: Wed, 25 May 2022 09:59:45 +0200
Subject: [PATCH 17/18] Fix btn confirm url
---
htdocs/core/lib/functions.lib.php | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 43a549655b9..93fbf98e81b 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -10043,9 +10043,11 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
// Js Confirm button
if ($userRight && !empty($params['confirm'])) {
if (!is_array($params['confirm'])) {
- $params['confirm'] = array(
- 'url' => $url . (strpos($url, '?') > 0 ? '&' : '?') . 'confirm=yes'
- );
+ $params['confirm'] = array();
+ }
+
+ if (empty($params['confirm'])) {
+ $params['confirm']['url'] = $url . (strpos($url, '?') > 0 ? '&' : '?') . 'confirm=yes';
}
// for js desabled compatibility set $url as call to confirm action and $params['confirm']['url'] to confirmed action
From e07827a0befca2d2a0c28a1edf7262a57889cf8a Mon Sep 17 00:00:00 2001
From: John BOTELLA
Date: Wed, 25 May 2022 10:03:08 +0200
Subject: [PATCH 18/18] Fix btn confirm url
---
htdocs/core/lib/functions.lib.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 93fbf98e81b..99320a47072 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -10046,7 +10046,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
$params['confirm'] = array();
}
- if (empty($params['confirm'])) {
+ if (empty($params['confirm']['url'])) {
$params['confirm']['url'] = $url . (strpos($url, '?') > 0 ? '&' : '?') . 'confirm=yes';
}