From 1ef27913d7225dc4c8e107841f763a28ead49b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 26 Jul 2016 17:07:56 +0200 Subject: [PATCH 1/6] FIX #5549 getNomUrl tooltips show Order info even if user has no rights to read them --- htdocs/commande/class/commande.class.php | 34 ++++++++++++++++-------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 9eb67cecc56..003f3fab255 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3081,17 +3081,29 @@ class Commande extends CommonOrder if ($short) return $url; $picto = 'order'; - $label = '' . $langs->trans("ShowOrder") . ''; - if (! empty($this->ref)) - $label .= '
' . $langs->trans('Ref') . ': ' . $this->ref; - if (! empty($this->ref_client)) - $label.= '
' . $langs->trans('RefCustomer') . ': ' . $this->ref_client; - if (! empty($this->total_ht)) - $label.= '
' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); - if (! empty($this->total_tva)) - $label.= '
' . $langs->trans('VAT') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); - if (! empty($this->total_ttc)) - $label.= '
' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); + $label = ''; + + if ($user->rights->commande->lire) { + $label = ''.$langs->trans("ShowOrder").''; + if (!empty($this->ref)) { + $label .= '
'.$langs->trans('Ref').': '.$this->ref; + } + if (!empty($this->ref_client)) { + $label .= '
'.$langs->trans('RefCustomer').': '.$this->ref_client; + } + if (!empty($this->total_ht)) { + $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, + $conf->currency); + } + if (!empty($this->total_tva)) { + $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, + $conf->currency); + } + if (!empty($this->total_ttc)) { + $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, + $conf->currency); + } + } $linkstart = ''; $linkend=''; From 86c2ced714d59dcd83beb29f055e4d8216481c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 29 Jul 2016 11:53:24 +0200 Subject: [PATCH 2/6] Missing $user variable --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 003f3fab255..7c4176edac8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3071,7 +3071,7 @@ class Commande extends CommonOrder */ function getNomUrl($withpicto=0,$option=0,$max=0,$short=0) { - global $conf, $langs; + global $conf, $langs, $user; $result=''; From 69247afd06361d287fb2cedf51db44bf2b49b2a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Jul 2016 17:26:24 +0200 Subject: [PATCH 3/6] FIX #4447 --- htdocs/compta/prelevement/fiche-stat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 0e9174ef034..9d70bc76a4e 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -141,7 +141,7 @@ if ($prev_id) print price($row[0]); print ''; - print round($row[0]/$bon->amount*100,2)." %"; + if ($bon->amount) print round($row[0]/$bon->amount*100,2)." %"; print ''; print "\n"; From fb2444c7a35e4c495b4354a5c1e02a3357a3c0b0 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Mon, 1 Aug 2016 10:20:10 +0200 Subject: [PATCH 4/6] Fix: Can't set PRODUIT_LIMIT_SIZE to value 0 --- htdocs/product/admin/product.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index b8c07df87a5..c2069bea15f 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -7,6 +7,7 @@ * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -108,7 +109,7 @@ if ($action == 'setModuleOptions') } } -if ($action == 'other' && GETPOST('value_PRODUIT_LIMIT_SIZE') > 0) +if ($action == 'other' && GETPOST('value_PRODUIT_LIMIT_SIZE') >= 0) { $res = dolibarr_set_const($db, "PRODUIT_LIMIT_SIZE", GETPOST('value_PRODUIT_LIMIT_SIZE'),'chaine',0,'',$conf->entity); } From 5144f21c6ce0a6c49c5b4769cd1cca36c22f651d Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 2 Aug 2016 15:36:00 +0200 Subject: [PATCH 5/6] FIX php Strict --- htdocs/core/modules/barcode/mod_barcode_product_standard.php | 4 ++-- htdocs/core/modules/barcode/modules_barcode.class.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index aeb7ea4cd8f..12f4fb96545 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -278,7 +278,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode } dol_syslog(get_class($this).'::verif_syntax codefortest='.$codefortest." typefortest=".$typefortest); - + $newcodefortest=$codefortest; // Special case, if mask is on 12 digits instead of 13, we remove last char into code to test @@ -290,7 +290,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode dol_syslog(get_class($this).'::verif_syntax newcodefortest='.$newcodefortest); } } - + $result=check_value($mask,$newcodefortest); return $result; diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php index d03302f36b7..43924165901 100644 --- a/htdocs/core/modules/barcode/modules_barcode.class.php +++ b/htdocs/core/modules/barcode/modules_barcode.class.php @@ -87,11 +87,11 @@ abstract class ModeleNumRefBarCode /** * Return next value available * - * @param Societe $objsoc Object thirdparty + * @param Societe $objproduct Object Product * @param int $type Type * @return string Value */ - function getNextValue($objsoc=0,$type=-1) + function getNextValue($objproduct,$type='') { global $langs; return $langs->trans("Function_getNextValue_InModuleNotWorking"); From 5f415478aca360a6e28f215e0313af10ddf3cde3 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 3 Aug 2016 17:29:04 +0200 Subject: [PATCH 6/6] FIX : update limit stock on product stock --- htdocs/product/stock/product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 9d84ccd6bfe..3170f329ea7 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -50,7 +50,7 @@ $cancel=GETPOST('cancel'); $id=GETPOST('id', 'int'); $ref=GETPOST('ref', 'alpha'); -$stocklimit = GETPOST('stocklimit'); +$stocklimit = GETPOST('seuil_stock_alerte'); $desiredstock = GETPOST('desiredstock'); $cancel = GETPOST('cancel'); $fieldid = isset($_GET["ref"])?'ref':'rowid'; @@ -70,7 +70,7 @@ $result=restrictedArea($user,'produit&stock',$id,'product&product','','',$fieldi if ($cancel) $action=''; // Set stock limit -if ($action == 'setstocklimit') +if ($action == 'setseuil_stock_alerte') { $object = new Product($db); $result=$object->fetch($id);