Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2023-03-28 22:28:10 +02:00
commit 764ce03d10
4 changed files with 29 additions and 3 deletions

View File

@ -1624,6 +1624,8 @@ class Categorie extends CommonObject
{
global $langs;
$langs->load('categories');
$datas = [];
$datas['label'] = $langs->trans("ShowCategory").': '.($this->ref ? $this->ref : $this->label);
@ -1656,7 +1658,6 @@ class Categorie extends CommonObject
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
$classfortooltip = 'classforajaxtooltip';
$dataparams = ' data-params='.json_encode($params);
// $label = $langs->trans('Loading');
}
$label = implode($this->getTooltipContentArray($params));

View File

@ -5,6 +5,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2023 Lenin Rivas <lenin.rivas777@gmail.com>
*
* 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
@ -2558,6 +2559,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($modulepart == 'tva') {
$modulepart = 'tax-vat';
}
// Fix modulepart delivery
if ($modulepart == 'expedition' && strpos($original_file, 'receipt/') === 0) {
$modulepart = 'delivery';
}
//print 'dol_check_secure_access_document modulepart='.$modulepart.' original_file='.$original_file.' entity='.$entity;
dol_syslog('dol_check_secure_access_document modulepart='.$modulepart.' original_file='.$original_file.' entity='.$entity);
@ -3040,14 +3045,14 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($fuser->hasRight('expedition', $lire) || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
}
$original_file = $conf->expedition->dir_output."/".(strpos('sending/', $original_file) === 0 ? '' : 'sending/').$original_file;
$original_file = $conf->expedition->dir_output."/".(strpos($original_file, 'sending/') === 0 ? '' : 'sending/').$original_file;
//$original_file = $conf->expedition->dir_output."/".$original_file;
} elseif (($modulepart == 'livraison' || $modulepart == 'delivery') && !empty($conf->expedition->dir_output)) {
// Delivery Note Wrapping
if ($fuser->hasRight('expedition', 'delivery', $lire) || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
}
$original_file = $conf->expedition->dir_output."/".(strpos('receipt/', $original_file) === 0 ? '' : 'receipt/').$original_file;
$original_file = $conf->expedition->dir_output."/".(strpos($original_file, 'receipt/') === 0 ? '' : 'receipt/').$original_file;
} elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) {
// Wrapping pour les actions
if ($fuser->hasRight('agenda', 'myactions', $read) || preg_match('/^specimen/i', $original_file)) {

View File

@ -11244,11 +11244,21 @@ function getElementProperties($element_type)
$classpath = 'comm/action/class';
$subelement = 'Actioncomm';
$module = 'agenda';
} elseif ($element_type == 'adherent_type') {
$classpath = 'adherents/class';
$classfile = 'adherent_type';
$module = 'adherent';
$subelement = 'adherent_type';
$classname = 'AdherentType';
} elseif ($element_type == 'bank_account') {
$classpath = 'compta/bank/class';
$module = 'banque';
$classfile = 'Account';
$classname = 'Account';
} elseif ($element_type == 'category') {
$classpath = 'categories/class';
$module = 'categorie';
$subelement = 'categorie';
} elseif ($element_type == 'stock') {
$classpath = 'product/stock/class';
$classfile = 'entrepot';
@ -11272,6 +11282,10 @@ function getElementProperties($element_type)
$classpath = 'comm/propal/class';
} elseif ($element_type == 'supplier_proposal') {
$classpath = 'supplier_proposal/class';
$module = 'supplier_proposal';
$element = 'supplierproposal';
$classfile = 'supplier_proposal';
$subelement = 'supplierproposal';
} elseif ($element_type == 'shipping') {
$classpath = 'expedition/class';
$subelement = 'expedition';
@ -11321,6 +11335,9 @@ function getElementProperties($element_type)
} elseif ($element_type == "service") {
$classpath = 'product/class';
$subelement = 'product';
} elseif ($objecttype == 'salary') {
$classpath = 'salaries/class';
$module = 'salaries';
}
if (empty($classfile)) {

View File

@ -2477,6 +2477,9 @@ class SupplierProposal extends CommonObject
public function getTooltipContentArray($params)
{
global $conf, $langs, $menumanager;
$langs->load('supplier_proposal');
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
return ['optimize' => $langs->trans("ShowSupplierProposal")];
}