mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -813,7 +813,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
|
||||
if (empty($check)) {
|
||||
dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and a 2nd param that is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING);
|
||||
// Enable this line to know who call the GETPOST with '' $check parameter.
|
||||
//var_dump(debug_backtrace()[0]);
|
||||
//var_dump(getCallerInfoString());
|
||||
}
|
||||
|
||||
if (empty($method)) {
|
||||
@@ -2409,8 +2409,12 @@ function getCallerInfoString()
|
||||
{
|
||||
$backtrace = debug_backtrace();
|
||||
$msg = "";
|
||||
if (count($backtrace) >= 2) {
|
||||
$trace = $backtrace[1];
|
||||
if (count($backtrace) >= 1) {
|
||||
$pos = 1;
|
||||
if (count($backtrace) == 1) {
|
||||
$pos = 0;
|
||||
}
|
||||
$trace = $backtrace[$pos];
|
||||
if (isset($trace['file'], $trace['line'])) {
|
||||
$msg = " From {$trace['file']}:{$trace['line']}.";
|
||||
}
|
||||
@@ -13004,7 +13008,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
||||
* 30 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleOtherAction', 'urlraw' => '# || external Url || javascript: || tel: || mailto:' ),
|
||||
* ); );
|
||||
* @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method.
|
||||
* @param int|boolean $userRight User action right
|
||||
* @param int|boolean $userRight User action right. Use 0 if user has no permission. It will add the message "No permission" on tooltip. Use -1 to have button not allowed without adding the message (because an explicit label is already set).
|
||||
* // phpcs:disable
|
||||
* @param array{confirm?:array{url?:string,title?:string,content?:string,use_unsecured_unescapedattr?:bool|string[],action-btn-label?:string,cancel-btn-label?:string,modal?:bool},attr?:array<string,mixed>,areDropdownButtons?:bool,backtopage?:string,lang?:string,enabled?:bool,perm?:int<0,1>,label?:string,url?:string,isDropdown?:int<0,1>,isDropDown?:int<0,1>} $params = [ // Various params for future : recommended rather than adding more function arguments
|
||||
* 'attr' => [ // to add or override button attributes
|
||||
@@ -13132,11 +13136,11 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url =
|
||||
$attr['aria-label'] = $label;
|
||||
}
|
||||
|
||||
if (empty($userRight)) {
|
||||
if (empty($userRight) || $userRight < 0) {
|
||||
$attr['class'] = 'butActionRefused';
|
||||
$attr['href'] = '';
|
||||
$attr['title'] = (($label && $text && $label != $text) ? $label : '');
|
||||
$attr['title'] = ($attr['title'] ? $attr['title'].'<br>' : '').$langs->trans('NotEnoughPermissions');
|
||||
$attr['title'] = ($attr['title'] ? $attr['title'] . (empty($userRight) ? '<br>' : '') : '').(empty($userRight) ? $langs->trans('NotEnoughPermissions') : '');
|
||||
}
|
||||
|
||||
if (!empty($id)) {
|
||||
|
||||
Reference in New Issue
Block a user