From 538d59872710bc0764f45e9a1a9e22a740e688d9 Mon Sep 17 00:00:00 2001 From: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Date: Mon, 27 Mar 2023 04:22:17 -0500 Subject: [PATCH 1/3] Fix share link expedition and delivery --- htdocs/core/lib/files.lib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index cebcbfe373f..b018a919ad1 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2019 Frédéric France + * Copyright (C) 2023 Lenin Rivas * * 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)) { From 78bd96dd58c866929c91def091540351cd91fa72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 28 Mar 2023 20:03:42 +0200 Subject: [PATCH 2/3] fix tooltip ajax --- htdocs/categories/class/categorie.class.php | 3 ++- htdocs/core/lib/functions.lib.php | 8 ++++++++ .../supplier_proposal/class/supplier_proposal.class.php | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 6762770d564..f69040b5f16 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -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)); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d83d7eee3c3..ce01867bc8f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11249,6 +11249,10 @@ function getElementProperties($element_type) $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 +11276,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'; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index aa82aaecb9c..2cd5e28bb24 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -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")]; } From ab281663982d869c8437f9b45550486aba34c4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 28 Mar 2023 21:01:59 +0200 Subject: [PATCH 3/3] fix tooltip --- htdocs/core/lib/functions.lib.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a757d10fd74..f8074ffcd46 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11244,6 +11244,12 @@ 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'; @@ -11329,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)) {