From 30e27014b887b21dfb33458512b8819bdcac3e6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Oct 2014 15:49:14 +0200 Subject: [PATCH] Fix: box of customer and propsects were not correctly disabled. --- htdocs/core/boxes/box_clients.php | 18 +++++++++++++++++- htdocs/core/boxes/box_prospect.php | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index b2ad0a6b718..b65702b643f 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -37,12 +37,28 @@ class box_clients extends ModeleBoxes var $depends = array("societe"); var $db; - var $param; + var $enabled = 1; var $info_box_head = array(); var $info_box_contents = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param='') + { + global $conf, $user; + + $this->db = $db; + + // disable box for such cases + if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled=0; // disabled by this option + } + /** * Load data for box to show them later * diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 9c7a666bc4a..6d62989727b 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -39,11 +39,28 @@ class box_prospect extends ModeleBoxes var $depends = array("societe"); var $db; + var $enabled = 1; var $info_box_head = array(); var $info_box_contents = array(); + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + function __construct($db,$param='') + { + global $conf, $user; + + $this->db = $db; + + // disable box for such cases + if (! empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $this->enabled=0; // disabled by this option + } + /** * Load data into info_box_contents array to show array later. *