#10563 Move menu item Links from Management to Operation. Add button in setup to global disable the Feedback functionality

This commit is contained in:
miguel angel rasteu 2023-06-30 08:35:37 +02:00
parent 3569cc53a4
commit ac92b5979c
6 changed files with 124 additions and 13 deletions

View File

@ -352,7 +352,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
}
// Button for feedback pandora.
if (enterprise_installed()) {
if (enterprise_installed() && $config['activate_feedback'] !== false) {
$header_feedback = '<div id="feedback-icon-header">';
$header_feedback .= '<div id="modal-feedback-form" class="invisible"></div>';
$header_feedback .= '<div id="msg-header" class="invisible"></div>';

View File

@ -47,8 +47,74 @@ if (isset($policy_page) === false) {
$policy_page = false;
}
$checked = (bool) get_parameter('checked');
$checked = (bool) get_parameter('status_hierachy_mode');
$status_hierachy_mode = (bool) get_parameter('status_hierachy_mode');
$sec2 = (string) get_parameter('sec2');
// Table for filter bar.
$filterTable = new stdClass();
$filterTable->class = 'filter-table-adv w100p';
$filterTable->size[0] = '20%';
$filterTable->size[1] = '20%';
$filterTable->size[2] = '20%';
$filterTable->size[3] = '20%';
$filterTable->size[4] = '20%';
$filterTable->data = [];
$filterTable->cellstyle[0][0] = 'width:0';
$filterTable->data[0][0] = __('Search');
$filterTable->data[1][0] .= html_print_input_text(
'search_string',
$search_string,
'',
30,
255,
true,
false,
false,
'',
''
);
$filterTable->data[0][0] .= html_print_input_hidden('search', 1, true);
if ((bool) $policy_page === false) {
$filterTable->data[0][1] = __('Show in hierachy mode');
$filterTable->data[1][1] = html_print_checkbox_switch(
'status_hierachy_mode',
((string) $checked),
((string) $checked),
true,
false,
'onChange=change_mod_filter();'
);
}
$filterTable->data[1][2] = html_print_submit_button(
__('Filter'),
'filter',
false,
[
'icon' => 'search',
'class' => 'float-right',
'mode' => 'secondary mini',
],
true
);
// Print filter table.
echo '<form id="create_module_type" method="post" action="'.$url.'">';
ui_toggle(
html_print_table($filterTable, true).'</form>',
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'filter',
true,
false,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
);
echo '</form>';
if (isset($id_agente) === false) {
return;
@ -1215,14 +1281,17 @@ html_print_div(
if (/checked/.test(window.location)) {
var url = window.location.toString();
if (checked) {
window.location = url.replace("checked=false", "checked=true");
//window.location = url.replace("checked=0", "checked=1");
$("#checkbox-status_hierachy_mode").val('1');
}
else {
window.location = url.replace("checked=true", "checked=false");
//window.location = url.replace("checked=1", "checked=0");
$("#checkbox-status_hierachy_mode").val('0');
}
}
else {
window.location = window.location + "&checked=true";
//window.location = window.location + "&checked=1";
$("#checkbox-status_hierachy_mode").val('1');
}
}

View File

@ -551,21 +551,23 @@ if ($access_console_node === true) {
}
}
$menu_godmode['links']['text'] = __('Links');
$menu_godmode['links']['sec2'] = '';
$menu_godmode['links']['id'] = 'god-links';
/*
$menu_godmode['links']['text'] = __('Links');
$menu_godmode['links']['sec2'] = '';
$menu_godmode['links']['id'] = 'god-links';
$sub = [];
$rows = db_get_all_rows_in_table('tlink', 'name');
foreach ($rows as $row) {
$sub = [];
$rows = db_get_all_rows_in_table('tlink', 'name');
foreach ($rows as $row) {
// Audit //meter en extensiones.
$sub[$row['link']]['text'] = $row['name'];
$sub[$row['link']]['id'] = $row['name'];
$sub[$row['link']]['type'] = 'direct';
$sub[$row['link']]['subtype'] = 'new_blank';
}
}
$menu_godmode['links']['sub'] = $sub;
$menu_godmode['links']['sub'] = $sub;
*/
}
// Warp Manager.

View File

@ -429,6 +429,19 @@ $table->data[$i++][] = html_print_label_input_block(
)
);
$table->data[$i++][] = html_print_label_input_block(
__('Enable Feedback'),
html_print_checkbox_switch_extended(
'activate_feedback',
1,
$config['activate_feedback'],
false,
'',
'',
true
)
);
$table->colspan[$i][] = 2;
$table->data[$i++][] = html_print_label_input_block(
__('Server timezone setup'),

View File

@ -264,6 +264,10 @@ function config_update_config()
$error_update[] = __('Enable Sflow');
}
if (config_update_value('activate_feedback', (bool) get_parameter('activate_feedback'), true) === false) {
$error_update[] = __('Enable Feedback');
}
if (config_update_value('general_network_path', get_parameter('general_network_path'), true) === false) {
$error_update[] = __('General network path');
} else {
@ -3358,6 +3362,10 @@ function config_process_config()
config_update_value('autoupdate', 1);
}
if (!isset($config['activate_feedback'])) {
config_update_value('activate_feedback', true);
}
if (!isset($config['api_password'])) {
config_update_value('api_password', '');
}

View File

@ -629,6 +629,25 @@ if ($favorite_menu !== false) {
// Links.
$rows = db_get_all_rows_in_table('tlink', 'name');
// $rows = [];
if (!empty($rows)) {
$menu_operation['links']['text'] = __('Links');
$menu_operation['links']['sec2'] = '';
$menu_operation['links']['id'] = 'god-links';
$sub = [];
foreach ($rows as $row) {
// Audit //meter en extensiones.
$sub[$row['link']]['text'] = $row['name'];
$sub[$row['link']]['id'] = $row['name'];
$sub[$row['link']]['type'] = 'direct';
$sub[$row['link']]['subtype'] = 'new_blank';
}
$menu_operation['links']['sub'] = $sub;
}
// Workspace.
$menu_operation['workspace']['text'] = __('Workspace');