Merge pull request #6897 from hregis/develop_bug4

Fix: for view special values
This commit is contained in:
Laurent Destailleur 2017-05-29 10:46:03 +02:00 committed by GitHub
commit 3f5cf0ee18

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -165,6 +166,7 @@ foreach ($modulesdir as $dir)
// Gives the possibility to the module, to provide his own family info and position of this family // Gives the possibility to the module, to provide his own family info and position of this family
if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) { if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) {
if (!is_array($familyinfo)) $familyinfo=array();
$familyinfo = array_merge($familyinfo, $objMod->familyinfo); $familyinfo = array_merge($familyinfo, $objMod->familyinfo);
$familykey = key($objMod->familyinfo); $familykey = key($objMod->familyinfo);
} else { } else {
@ -450,11 +452,28 @@ if ($mode == 'feature')
$text.='<br><strong>'.$langs->trans("AddHooks").':</strong> '; $text.='<br><strong>'.$langs->trans("AddHooks").':</strong> ';
if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks'])) if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks']))
{ {
$i=0; $i=0;
foreach($objMod->module_parts['hooks'] as $val) foreach($objMod->module_parts['hooks'] as $key => $val)
{ {
$text.=($i?', ':'').($val); if ($key == 'entity') continue;
$i++;
// For special values
if ($key == 'data')
{
if (is_array($val))
{
foreach($val as $value)
{
$text.=($i?', ':'').($value);
$i++;
}
continue;
}
}
$text.=($i?', ':'').($val);
$i++;
} }
} }
else $text.=$langs->trans("No"); else $text.=$langs->trans("No");
@ -467,8 +486,8 @@ if ($mode == 'feature')
$i=0; $i=0;
foreach($objMod->rights as $val) foreach($objMod->rights as $val)
{ {
$text.=($i?', ':'').($val[1]); $text.=($i?', ':'').($val[1]);
$i++; $i++;
} }
} }
else $text.=$langs->trans("No"); else $text.=$langs->trans("No");