Merge pull request #21957 from dolibit-ut/patch-468

Update paymentmodes.php
This commit is contained in:
Laurent Destailleur 2022-08-30 00:55:02 +02:00 committed by GitHub
commit 32753ae541
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,8 @@
* \brief Tab of payment modes for the customer
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
@ -40,8 +42,11 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "commercial", "banks", "bills", 'paypal', 'stripe', 'withdrawals'));
// Security check
$socid = GETPOST("socid", "int");
if ($user->socid) {
@ -49,12 +54,15 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'societe', '', '');
// Get parameters
$id = GETPOST("id", "int");
$source = GETPOST("source", "alpha"); // source can be a source or a paymentmode
$ribid = GETPOST("ribid", "int");
$action = GETPOST("action", 'alpha', 3);
$cancel = GETPOST('cancel', 'alpha');
// Initialize objects
$object = new Societe($db);
$object->fetch($socid);
@ -70,6 +78,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('thirdpartybancard', 'globalcard'));
// Permissions
$permissiontoread = $user->rights->societe->lire;
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_builddoc.inc.php