Bulks masive visual action buttons

This commit is contained in:
Jonathan 2023-03-27 11:10:51 +02:00
parent 0ae7630714
commit 665976e011
17 changed files with 55 additions and 33 deletions

View File

@ -270,7 +270,7 @@ $agents_with_templates_json = json_encode($agents_with_templates_json);
echo "<input type='hidden' id='hidden-agents_with_templates' value='$agents_with_templates_json'>"; echo "<input type='hidden' id='hidden-agents_with_templates' value='$agents_with_templates_json'>";
attachActionButton('add', 'create', $table->width); attachActionButton('add', 'create', $table->width, false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -293,7 +293,7 @@ $table->data[2][3] = '';
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts">'; echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts">';
html_print_table($table); html_print_table($table);
attachActionButton('add', 'add', $table->width); attachActionButton('add', 'add', $table->width, false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -295,7 +295,7 @@ array_push($table->data, $data);
html_print_table($table); html_print_table($table);
attachActionButton('create_profiles', 'update', $table->width); attachActionButton('create_profiles', 'update', $table->width, false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -310,7 +310,7 @@ echo '<legend><span>'.__('To agent(s)').'</span></legend>';
html_print_table($table); html_print_table($table);
echo '</fieldset>'; echo '</fieldset>';
attachActionButton('do_operation', 'copy', $table->width); attachActionButton('do_operation', 'copy', $table->width, false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -298,7 +298,7 @@ $agents_with_templates_json = json_encode($agents_with_templates_json);
echo "<input type='hidden' id='hidden-agents_with_templates' value='".$agents_with_templates_json."'>"; echo "<input type='hidden' id='hidden-agents_with_templates' value='".$agents_with_templates_json."'>";
attachActionButton('delete', 'delete', $table->width); attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -188,7 +188,7 @@ $params = [
echo get_table_inputs_masive_agents($params); echo get_table_inputs_masive_agents($params);
if (is_metaconsole() === true || is_management_allowed() === true) { if (is_metaconsole() === true || is_management_allowed() === true) {
attachActionButton('delete', 'delete', '100%'); attachActionButton('delete', 'delete', '100%', false, $SelectAction);
} }
echo '</form>'; echo '</form>';

View File

@ -358,7 +358,7 @@ $table->data[2][3] = html_print_select([], 'module[]', '', false, '', '', true,
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_alerts" >'; echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_alerts" >';
html_print_table($table); html_print_table($table);
attachActionButton('delete', 'delete', $table->width); attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -583,7 +583,7 @@ $table->data['form_agents_3'][3] = html_print_select(
echo '<form method="post" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >'; echo '<form method="post" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
html_print_table($table); html_print_table($table);
attachActionButton('delete', 'delete', $table->width); attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -246,7 +246,7 @@ array_push($table->data, $data);
html_print_table($table); html_print_table($table);
attachActionButton('delete_profiles', 'delete', $table->width); attachActionButton('delete_profiles', 'delete', $table->width, false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -1257,7 +1257,7 @@ echo '<h3 class="error invisible" id="message"> </h3>';
html_print_input_hidden('id_agente', $id_agente); html_print_input_hidden('id_agente', $id_agente);
attachActionButton('update_agents', 'update', $table->width); attachActionButton('update_agents', 'update', $table->width, false, $SelectAction);
// Shown and hide div. // Shown and hide div.
echo '</div></form>'; echo '</div></form>';

View File

@ -1265,7 +1265,7 @@ $table->data['edit1'][1] = '<table width="100%">';
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit">'; echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit">';
html_print_table($table); html_print_table($table);
attachActionButton('update', 'update', $table->width); attachActionButton('update', 'update', $table->width, false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -391,7 +391,7 @@ echo '<form method="POST" id="form-massive_plugin_edition"
html_print_table($table); html_print_table($table);
attachActionButton('update', 'update', $table->width); attachActionButton('update', 'update', $table->width, false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -556,7 +556,7 @@ echo sprintf(
); );
echo '</div>'; echo '</div>';
attachActionButton('edit_users', 'update', '100%'); attachActionButton('edit_users', 'update', '100%', false, $SelectAction);
echo '</form>'; echo '</form>';

View File

@ -443,29 +443,26 @@ if (is_management_allowed() === false) {
); );
} }
echo '<br />'; $tip = '';
echo '<form method="post" id="form_options" action="'.$url.'">'; if ($option === 'edit_agents' || $option === 'edit_modules') {
echo '<table border="0"><tr><td>'; $tip = ui_print_help_tip(__('The blank fields will not be updated'), true);
echo __('Action'); }
echo '</td><td>';
html_print_select( $SelectAction = '<form method="post" id="form_options" action="'.$url.'">';
$SelectAction .= '<span class="mrgn_lft_10px mrgn_right_10px">'._('Action').'</span>';
$SelectAction .= html_print_select(
$options, $options,
'option', 'option',
$option, $option,
'this.form.submit()', 'this.form.submit()',
'', '',
0, 0,
false, true,
false, false,
false false
); ).$tip;
if ($option === 'edit_agents' || $option === 'edit_modules') {
ui_print_help_tip(__('The blank fields will not be updated'));
}
echo '</td></tr></table>'; $SelectAction .= '</form>';
echo '</form>';
echo '<br />';
switch ($option) { switch ($option) {
case 'delete_alerts': case 'delete_alerts':

View File

@ -50,13 +50,23 @@ echo '<form action="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2" method="
switch ($action) { switch ($action) {
case 'create_connection_map': case 'create_connection_map':
// Header. // Header.
ui_print_page_header( ui_print_standard_header(
__('Create new map connection'), __('Create new map connection'),
'', '',
false, false,
'map_connection_tab', 'map_connection_tab',
true, true,
$buttons $buttons,
[
[
'link' => '',
'label' => __('Setup'),
],
[
'link' => '',
'label' => __('Setup').' - '.__('Gis'),
],
]
); );
$mapConnection_name = ''; $mapConnection_name = '';
@ -77,13 +87,23 @@ switch ($action) {
case 'edit_connection_map': case 'edit_connection_map':
// Header. // Header.
ui_print_page_header( ui_print_standard_header(
__('Edit map connection'), __('Edit map connection'),
'', '',
false, false,
'map_connection_tab', 'map_connection_tab',
true, true,
$buttons $buttons,
[
[
'link' => '',
'label' => __('Setup'),
],
[
'link' => '',
'label' => __('Setup').' - '.__('Gis'),
],
]
); );
$idConnectionMap = get_parameter('id_connection_map'); $idConnectionMap = get_parameter('id_connection_map');

View File

@ -43,7 +43,8 @@ function attachActionButton(
string $action, string $action,
string $buttonAction, string $buttonAction,
string $tableWidth, string $tableWidth,
bool $return=false bool $return=false,
string $SelectAction=''
) { ) {
switch ($buttonAction) { switch ($buttonAction) {
case 'add': case 'add':
@ -88,7 +89,7 @@ function attachActionButton(
['icon' => $class], ['icon' => $class],
true true
), ),
[], ['right_content' => $SelectAction],
$return $return
); );
} }

View File

@ -75,6 +75,10 @@ function menu_print_menu(&$menu)
} else { } else {
$sec2 = 'operation/gis_maps/gis_map'; $sec2 = 'operation/gis_maps/gis_map';
} }
} else if ($sec2 === 'enterprise/godmode/servers/manage_export_form') {
$sec2 = 'enterprise/godmode/servers/manage_export';
} else if ($sec2 === 'godmode/setup/gis_step_2') {
$sec2 = 'godmode/setup/setup&section=gis';
} else if ($sec2 === 'operation/gis_maps/render_view') { } else if ($sec2 === 'operation/gis_maps/render_view') {
$map_id = (int) get_parameter('map_id'); $map_id = (int) get_parameter('map_id');
if (empty($map_id) === false) { if (empty($map_id) === false) {