diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 64389354605..f2d96ad1e51 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -1,6 +1,6 @@ + * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -38,20 +38,25 @@ class box_comptes extends ModeleBoxes var $db; var $param; - + var $enabled = 1; + var $info_box_head = array(); var $info_box_contents = array(); - + /** * Constructor */ function __construct() { - global $langs; + global $conf, $langs, $user; $langs->load("boxes"); $this->boxlabel=$langs->transnoentitiesnoconv('BoxCurrentAccounts'); + + // disable module for such cases + $listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL); + if (! in_array('banque',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users } /** diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 89bce42088e..5c9e3a6f3ab 100755 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -19,8 +19,8 @@ /** * \file htdocs/core/boxes/box_members.php - * \ingroup societes - * \brief Module de generation de l'affichage de la box clients + * \ingroup adherent + * \brief Module to show box of members */ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; @@ -38,19 +38,25 @@ class box_members extends ModeleBoxes var $db; var $param; - + var $enabled = 1; + var $info_box_head = array(); var $info_box_contents = array(); + /** * Constructor */ function __construct() { - global $langs; + global $conf, $langs, $user; $langs->load("boxes"); $this->boxlabel=$langs->transnoentitiesnoconv("BoxLastMembers"); + + // disable module for such cases + $listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL); + if (! in_array('banque',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users } /** diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 913e3d1627a..e0b2efd7489 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -32,7 +32,8 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" var $db; var $error=''; var $max=5; - + var $enabled=1; + var $rowid; var $id; var $position; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index d131db5e89b..9cf96f14aeb 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -409,7 +409,7 @@ class Conf $this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024); // Define list of limited modules - if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='facture,commande,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later. + if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='facture,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later. // Timeouts if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10; diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 2d3ca1d6ae9..ce961a5868c 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -119,15 +119,16 @@ class InfoBox $box->box_id = (! empty($obj->box_id) ? $obj->box_id : ''); $box->note = (! empty($obj->note) ? $obj->note : ''); - $enabled=true; + $enabled=$box->enabled; if (isset($box->depends) && count($box->depends) > 0) { foreach($box->depends as $module) { //print $boxname.'-'.$module.'
'; - if (empty($conf->$module->enabled)) $enabled=false; + if (empty($conf->$module->enabled)) $enabled=0; } } + //print 'xx module='.$module.' enabled='.$enabled; if ($enabled) $boxes[]=$box; } }