From 149bb14202a798fcd654f2b589cd9d83c6b462a4 Mon Sep 17 00:00:00 2001 From: ThomasNgr-OpenDSI Date: Sat, 26 Apr 2025 21:23:08 +0200 Subject: [PATCH] NEW Move right from advance to normal for thirdparty information payment page (#33885)d Co-authored-by: Alexandre SPANGARO Co-authored-by: Laurent Destailleur --- htdocs/core/modules/modSociete.class.php | 8 ++------ htdocs/install/mysql/migration/21.0.0-22.0.0.sql | 3 +++ htdocs/societe/paymentmodes.php | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 9ed888f646a..577c69a370d 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -203,7 +203,7 @@ class modSociete extends DolibarrModules $this->rights[$r][0] = 130; $this->rights[$r][1] = 'Modify thirdparty information payment'; $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'thirdparty_paymentinformation_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on + $this->rights[$r][4] = 'thirdparty_paymentinformation'; $this->rights[$r][5] = 'write'; // 262 : Restrict access to sales representative @@ -456,11 +456,7 @@ class modSociete extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'ExportDataset_company_3'; $this->export_icon[$r] = 'account'; - if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) { - $this->export_permission[$r] = array(array("societe", "export"), array("societe", "thirdparty_paymentinformation_advance", "write")); - } else { - $this->export_permission[$r] = array(array("societe", "export")); - } + $this->export_permission[$r] = array(array("societe", "export")); $this->export_fields_array[$r] = array( 'b.rowid' => "IdPaymentMode", 'b.fk_soc' => "ThirdPartyName", diff --git a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql index d78a09c7310..4f8077e32b4 100644 --- a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql +++ b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql @@ -276,6 +276,9 @@ CREATE TABLE llx_webhook_history( ALTER TABLE llx_societe_rib ADD COLUMN cci varchar(100) after iban_prefix; -- Interbank code for some countries like Chile +-- Move permission thirdparty_paymentinformation out of advanced rights +UPDATE llx_rights_def SET perms = 'thirdparty_paymentinformation' WHERE perms = 'thirdparty_paymentinformation_advance'; + ALTER TABLE llx_eventorganization_conferenceorboothattendee DROP INDEX idx_eventorganization_conferenceorboothattendee_ref; ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_confboothattendee(ref); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index c8d00a1559f..aadad0f52ef 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -91,8 +91,7 @@ $hookmanager->initHooks(array('thirdpartybancard', 'globalcard')); $permissiontoread = $user->hasRight('societe', 'lire'); $permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_builddoc.inc.php -$permissiontoaddupdatepaymentinformation = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $permissiontoadd) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('societe', 'thirdparty_paymentinformation_advance', 'write'))); - +$permissiontoaddupdatepaymentinformation = $user->hasRight('societe', 'thirdparty_paymentinformation_advance', 'write'); // Check permission on company $result = restrictedArea($user, 'societe', '', '');