From 949ae2f160caf39293fd55918f31ca76c5a11c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 14 Sep 2014 13:09:31 +0200 Subject: [PATCH] [ bug #1591 ] Linked object block shows Total HT/TTC even if not having permission to read them --- ChangeLog | 1 + .../comm/propal/tpl/linkedobjectblock.tpl.php | 17 +++++++++++++---- htdocs/commande/tpl/linkedobjectblock.tpl.php | 15 ++++++++++++--- .../facture/tpl/linkedobjectblock.tpl.php | 15 ++++++++++++--- htdocs/expedition/tpl/linkedobjectblock.tpl.php | 15 ++++++++++++--- .../commande/tpl/linkedobjectblock.tpl.php | 15 ++++++++++++--- .../fourn/facture/tpl/linkedobjectblock.tpl.php | 15 ++++++++++++--- 7 files changed, 74 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04e63ec1c8e..575aa1aa0e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,7 @@ Fix: [ bug #1544 ] Can remove date from invoice. Fix: list event view lost type event filter. Fix: Add code save on create event. Fix: SQL injection. +Fix: [ bug #1591 ] Linked object block shows Total HT/TTC even if not having permission to read them ***** ChangeLog for 3.5.4 compared to 3.5.3 ***** Fix: Hide title of event when agenda module disabled. diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 632dee63965..cb920afd5fc 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -1,6 +1,7 @@ - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2014 Marcos García * * 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 @@ -27,6 +28,8 @@ id ?>">trans("ShowPropal"),"propal").' '.$object->ref; ?> ref_client; ?> date,'day'); ?> - total_ht); ?> + rights->propale->lire) { + $total = $total + $object->total_ht; + echo price($object->total_ht); + } ?> getLibStatut(3); ?> total_ht; } ?> trans('TotalHT'); ?> - + rights->propale->lire) { + echo price($total); + } ?>   diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index c7d073501a3..d2fe19c5b6f 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2014 Marcos García * * 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 @@ -22,6 +23,8 @@ > trans("ShowOrder"),"order").' '.$object->ref; ?> date,'day'); ?> - total_ht); ?> + rights->commande->lire) { + $total = $total + $object->total_ht; + echo price($object->total_ht); + } ?> getLibStatut(3); ?> total_ht; } ?> trans('TotalHT'); ?> - + rights->commande->lire) { + echo price($total); + } ?>   diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index f0fca0b90ff..ae3038a6021 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2014 Marcos García * * 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 @@ -22,6 +23,8 @@ > trans("ShowBill"),"bill").' '.$object->ref; ?> date,'day'); ?> - total_ht); ?> + rights->facture->lire) { + $total = $total + $object->total_ht; + echo price($object->total_ht); + } ?> getLibStatut(3); ?> total_ht; } ?> trans("TotalHT"); ?> - + rights->facture->lire) { + echo price($total); + } ?>   diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php index fd723650561..364afb92177 100644 --- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php @@ -1,5 +1,6 @@ + * Copyright (C) 2014 Marcos García * * 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 @@ -21,6 +22,8 @@ id ?>">trans("ShowShipping"),"sending").' '.$object->ref; ?> date_creation,'day'); ?> date_delivery,'day'); ?> - total_ht); ?> + rights->expedition->lire) { + $total = $total + $object->total_ht; + echo price($object->total_ht); + } ?> getLibStatut(3); ?> total_ht; } ?> trans('TotalHT'); ?> - + rights->expedition->lire) { + echo price($total); + } ?>   diff --git a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php index d1e209eb54b..fc1942e0f61 100644 --- a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php @@ -1,5 +1,6 @@ + * Copyright (C) 2014 Marcos García * * 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 @@ -21,6 +22,8 @@ > trans("ShowOrder"),"order").' '.$object->ref; ?> date,'day'); ?> - total_ht); ?> + rights->fournisseur->commande->lire) { + $total = $total + $object->total_ht; + echo price($object->total_ht); + } ?> getLibStatut(3); ?> total_ht; } ?> trans('TotalHT'); ?> - + rights->fournisseur->commande->lire) { + echo price($total); + } ?>   diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index ab585cc4b1f..c10fea8bb8a 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -1,5 +1,6 @@ + * Copyright (C) 2014 Marcos García * * 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 @@ -21,6 +22,8 @@ > trans("ShowBill"),"bill").' '.$object->ref; ?> date,'day'); ?> - total_ht); ?> + rights->fournisseur->facture->lire) { + $total = $total + $object->total_ht; + echo price($object->total_ht); + } ?> getLibStatut(3); ?> total_ht; } ?> trans("TotalHT"); ?> - + rights->fournisseur->facture->lire) { + echo price($total); + } ?>