add more parameters to restrictedArea hook (#35013)

* add more parameters to hook

* add more parameters to hook

* add more parameters to hook

* add more parameters to hook

* add more parameters to hook

* add more parameters to hook

* add more parameters to hook

* add more parameters to hook
This commit is contained in:
Frédéric FRANCE
2025-08-20 18:57:52 +02:00
committed by GitHub
parent b9d02e16cc
commit 926defb22c
5 changed files with 27 additions and 14 deletions

View File

@@ -2871,7 +2871,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di
* @param string $title Title
* @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no sepaaration under tab (to start a tab just after), -3=Add tab header but no footer separation
* @param string $picto Add a picto on tab title
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodule/img/myimg.png',1) for $picto.
* @param string $morehtmlright Add more html content on right of tabs title
* @param string $morecss More Css
* @param int $limittoshow Limit number of tabs to show. Use 0 to use automatic default value.
@@ -2892,7 +2892,7 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0
* @param string $title Title
* @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no separation under tab (to start a tab just after), -3=-2+'noborderbottom'
* @param string $picto Add a picto on tab title
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodule/img/myimg.png',1) for $picto.
* @param string $morehtmlright Add more html content on right of tabs title
* @param string $morecss More CSS on the link <a>
* @param int $limittoshow Limit number of tabs to show. Use 0 to use automatic default value.

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2008-2021 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2020 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -531,7 +532,19 @@ function restrictedArea(User $user, $features, $object = 0, $tableandshare = '',
// print $features.' - '.$tableandshare.' - '.$feature2.' - '.$dbt_select."\n";
// Get more permissions checks from hooks
$parameters = array('features' => $features, 'originalfeatures' => $originalfeatures, 'objectid' => $objectid, 'dbt_select' => $dbt_select, 'idtype' => $dbt_select, 'isdraft' => $isdraft);
$parameters = array(
'features' => $features,
'feature2' => $feature2,
'originalfeatures' => $originalfeatures,
'tableandshare' => $tableandshare,
'object' => $object,
'objectid' => $objectid,
'dbt_keyfield' => $dbt_keyfield,
'dbt_select' => $dbt_select,
'idtype' => $dbt_select,
'isdraft' => $isdraft,
'mode' => $mode,
);
if (!empty($hookmanager)) {
$reshook = $hookmanager->executeHooks('restrictedArea', $parameters);

View File

@@ -4,7 +4,7 @@
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -1176,7 +1176,7 @@ if ($step == 4 && $datatoimport) {
$entity = (!empty($objimport->array_import_entities[0][$code]) ? $objimport->array_import_entities[0][$code] : $objimport->array_import_icon[0]);
$entityicon = !empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity; // $entityicon must string name of picto of the field like 'project', 'company', 'contact', 'modulename', ...
$entitylang = !empty($entitytolang[$entity]) ? $entitytolang[$entity] : $objimport->array_import_label[0]; // $entitylang must be a translation key to describe object the field is related to, like 'Company', 'Contact', 'MyModyle', ...
$entitylang = !empty($entitytolang[$entity]) ? $entitytolang[$entity] : $objimport->array_import_label[0]; // $entitylang must be a translation key to describe object the field is related to, like 'Company', 'Contact', 'MyModule', ...
print '<td class="nowraponall hideonsmartphone" style="font-weight: normal">=> </td>';
print '<td class="nowraponall" style="font-weight: normal">';

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) ---Replace with your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
@@ -49,7 +49,7 @@ class MyObject extends CommonObject
public $table_element = 'mymodule_myobject';
/**
* @var string If permission must be checkec with hasRight('mymodule', 'read') and not hasright('mymodyle', 'myobject', 'read'), you can uncomment this line
* @var string If permission must be checked with hasRight('mymodule', 'read') and not hasright('mymodule', 'myobject', 'read'), you can uncomment this line
*/
//public $element_for_permission = 'mymodule';

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 Alice Adminson <myemail@mycompany.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -49,7 +49,7 @@ class TriggerHistory extends CommonObject
public $table_element = 'webhook_history';
/**
* @var string If permission must be checkec with hasRight('webhook', 'read') and not hasright('mymodyle', 'triggerhistory', 'read'), you can uncomment this line
* @var string If permission must be checked with hasRight('webhook', 'read') and not hasright('mymodule', 'triggerhistory', 'read'), you can uncomment this line
*/
//public $element_for_permission = 'webhook';