This commit is contained in:
phf 2016-06-04 17:17:22 +02:00
parent 1552e7f41f
commit a62f5bd5b4
2 changed files with 8 additions and 0 deletions

View File

@ -732,17 +732,24 @@ function activateModule($value,$withdeps=1)
if (isset($objMod->depends) && is_array($objMod->depends) && ! empty($objMod->depends))
{
// Activation des modules dont le module depend
$TError=array();
$num = count($objMod->depends);
for ($i = 0; $i < $num; $i++)
{
$activate = false;
foreach ($modulesdir as $dir)
{
if (file_exists($dir.$objMod->depends[$i].".class.php"))
{
activateModule($objMod->depends[$i]);
$activate = true;
}
}
if (!$activate) $TError[] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $objMod->depends[$i]);
}
setEventMessages('', $TError, 'errors');
}
if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && ! empty($objMod->conflictwith))

View File

@ -1563,3 +1563,4 @@ TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both custome
IncludePath=Include path (defined into variable %s)
NoModueToManageStockDecrease=No module able to manage automatic stock decrease has been activated. Stock decrease will be done on manual input only.
NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only.
activateModuleDependNotSatisfied=Module "%s" depends on module "%s" that is missing, so module "%1$s" may not work correclty. Please install module "%2$s" or disable module "%1$s" if you want to be safe from any surprise