More complete dependencies

This commit is contained in:
Laurent Destailleur 2016-03-26 12:26:27 +01:00
parent 1d02f6446f
commit 40e0347bb5
2 changed files with 3 additions and 5 deletions

View File

@ -31,11 +31,10 @@ class box_graph_product_distribution extends ModeleBoxes
var $boxcode="productdistribution";
var $boximg="object_product";
var $boxlabel="BoxProductDistribution";
var $depends = array("product|service");
var $depends = array("product|service","facture|propal|commande");
var $db;
var $param;
var $enabled=1;
var $info_box_head = array();
var $info_box_contents = array();
@ -52,7 +51,6 @@ class box_graph_product_distribution extends ModeleBoxes
global $conf;
$this->db=$db;
$this->enabled=($conf->facture->enabled || $conf->propal->enabled || $conf->commande->enabled);
}
/**

View File

@ -72,7 +72,7 @@ class InfoBox
$sql.= " FROM ".MAIN_DB_PREFIX."boxes_def as d";
$sql.= " WHERE d.entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
}
dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user)?$user->id:'')."", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
@ -145,7 +145,7 @@ class InfoBox
if (! empty($conf->$tmpmodule->enabled)) $tmpenabled=1;
//print $boxname.'-'.$module.'-module enabled='.(empty($conf->$tmpmodule->enabled)?0:1).'<br>';
}
if (empty($tmpenabled)) // We found at least one module required that disabled
if (empty($tmpenabled)) // We found at least one module required that is disabled
{
$enabled=0;
break;