mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-25 19:09:08 +02:00
Wip command center, error merge
This commit is contained in:
parent
81254cf3fb
commit
452d5d0b73
@ -108,6 +108,8 @@ function add_component_selection($id_network_component_type)
|
||||
$data[0] = __('Using module component').' ';
|
||||
|
||||
$component_groups = network_components_get_groups($id_network_component_type);
|
||||
|
||||
hd($component_groups);
|
||||
$data[1] = '<span id="component_group" class="left">';
|
||||
$data[1] .= html_print_select(
|
||||
$component_groups,
|
||||
|
@ -265,6 +265,7 @@ function network_components_get_group($id_network_component_group, $filter=false
|
||||
*/
|
||||
function network_components_get_groups($id_module_components=0, $localComponent=false)
|
||||
{
|
||||
hd($id_module_components);
|
||||
// Special vars to keep track of indentation level
|
||||
static $level = 0;
|
||||
static $id_parent = 0;
|
||||
@ -283,7 +284,7 @@ function network_components_get_groups($id_module_components=0, $localComponent=
|
||||
}
|
||||
|
||||
$retval = [];
|
||||
// Magic indentation is here
|
||||
// Magic indentation is here.
|
||||
$prefix = str_repeat(' ', ($level * 3));
|
||||
foreach ($groups as $group) {
|
||||
$level++;
|
||||
@ -296,29 +297,18 @@ function network_components_get_groups($id_module_components=0, $localComponent=
|
||||
$id_parent = $tmp;
|
||||
$level--;
|
||||
|
||||
hd($localComponent);
|
||||
|
||||
if ($localComponent) {
|
||||
if (! empty($childs)) {
|
||||
$retval[$group['id_sg']] = $prefix.$group['name'];
|
||||
$retval = ($retval + $childs);
|
||||
} else {
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
case 'postgresql':
|
||||
$count = db_get_value_filter(
|
||||
'COUNT(*)',
|
||||
'tlocal_component',
|
||||
['id_network_component_group' => (int) $group['id_sg']]
|
||||
);
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$count = db_get_value_filter(
|
||||
'count(*)',
|
||||
'tlocal_component',
|
||||
['id_network_component_group' => (int) $group['id_sg']]
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($count > 0) {
|
||||
$retval[$group['id_sg']] = $prefix.$group['name'];
|
||||
@ -333,9 +323,6 @@ function network_components_get_groups($id_module_components=0, $localComponent=
|
||||
If components id module is provided, only groups with components
|
||||
that belongs to this id module are returned */
|
||||
if ($id_module_components) {
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
case 'postgresql':
|
||||
$count = db_get_value_filter(
|
||||
'COUNT(*)',
|
||||
'tnetwork_component',
|
||||
@ -344,19 +331,6 @@ function network_components_get_groups($id_module_components=0, $localComponent=
|
||||
'id_modulo' => $id_module_components,
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$count = db_get_value_filter(
|
||||
'count(*)',
|
||||
'tnetwork_component',
|
||||
[
|
||||
'id_group' => (int) $group['id_sg'],
|
||||
'id_modulo' => $id_module_components,
|
||||
]
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($count > 0) {
|
||||
$retval[$group['id_sg']] = $prefix.$group['name'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user