Merge branch 'ent-11713-bugs-de-visualizacion-de-los-botones-de-accion-en-metaconsola-y-consola' into 'develop'

Ent 11713 bugs de visualizacion de los botones de accion en metaconsola y consola

See merge request artica/pandorafms!6249
This commit is contained in:
Rafael Ameijeiras 2023-08-04 06:34:35 +00:00
commit b2821c0db3
9 changed files with 90 additions and 43 deletions

View File

@ -807,12 +807,12 @@ foreach ($commands as $command) {
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
if ($is_management_allowed === true && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
if (is_user_admin($config['id_user']) === true) {
$data['action'] = '<span class="inline_flex">';
$data['action'] = '<span class="inline_flex">';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter ', 'title' => 'Duplicate']).'</a>';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset_delete.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter', 'title' => 'Delete']).'</a>';
$data['action'] .= '</span>';
}
}

View File

@ -912,7 +912,10 @@ foreach ($simple_alerts as $alert) {
1,
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'invert_filter main_menu_icon']
[
'class' => 'invert_filter main_menu_icon',
'title' => __('Enable'),
]
);
$data[4] .= html_print_input_hidden('enable_alert', 1, true);
} else {
@ -922,7 +925,10 @@ foreach ($simple_alerts as $alert) {
1,
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'main_menu_icon']
[
'class' => 'invert filter main_menu_icon',
'title' => __('Disable'),
]
);
$data[4] .= html_print_input_hidden('disable_alert', 1, true);
}
@ -940,7 +946,10 @@ foreach ($simple_alerts as $alert) {
1,
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'invert_filter main_menu_icon']
[
'class' => 'invert_filter main_menu_icon',
'title' => __('Standby off'),
]
);
$data[4] .= html_print_input_hidden('standbyon_alert', 1, true);
} else {
@ -950,7 +959,10 @@ foreach ($simple_alerts as $alert) {
1,
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'invert_filter main_menu_icon']
[
'class' => 'invert_filter main_menu_icon',
'title' => __('Standby on'),
]
);
$data[4] .= html_print_input_hidden('standbyoff_alert', 1, true);
}
@ -1139,8 +1151,7 @@ if (! $id_agente) {
return false;
});
$("input[name=disable]").attr ("title", "<?php echo __('Disable'); ?>")
.hover (function () {
$("input[name=disable]").hover (function () {
$(this).attr ("src",
<?php
echo '"'.html_print_image(
@ -1166,8 +1177,7 @@ if (! $id_agente) {
}
);
$("input[name=enable]").attr ("title", "<?php echo __('Enable'); ?>")
.hover (function () {
$("input[name=enable]").hover (function () {
$(this).attr ("src",
<?php
echo '"'.html_print_image(
@ -1193,8 +1203,7 @@ if (! $id_agente) {
}
);
$("input[name=standby_on]").attr ("title", "<?php echo __('Set off standby'); ?>")
.hover (function () {
$("input[name=standby_on]").hover (function () {
$(this).attr ("src",
<?php
echo '"'.html_print_image(
@ -1220,8 +1229,7 @@ if (! $id_agente) {
}
);
$("input[name=standby_off]").attr ("title", "<?php echo __('Set standby'); ?>")
.hover (function () {
$("input[name=standby_off]").hover (function () {
$(this).attr ("src",
<?php
echo '"'.html_print_image(

View File

@ -210,7 +210,10 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
echo '<td class="'.$tdcolor.' table_action_buttons"><a href="index.php?sec=gsetup&sec2=godmode/setup/links&id_link='.$row['id_link'].'&borrar='.$row['id_link'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image(
'images/delete.svg',
true,
['class' => 'invert_filter']
[
'class' => 'invert_filter main_menu_icon',
'title' => __('Delete'),
]
).'</a></td></tr>';
}

View File

@ -132,7 +132,15 @@ foreach ($osList as $os) {
$data[] = html_print_anchor(
[
'href' => $hrefDelete,
'content' => html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']),
'content' => html_print_image(
'images/delete.svg',
true,
[
'alt' => __('Delete'),
'title' => __('Delete'),
'class' => 'main_menu_icon invert_filter',
]
),
],
true
);

View File

@ -2006,6 +2006,7 @@ if ($create_alert || $update_alert) {
'alt' => __('Update'),
'border' => 0,
'class' => 'main_menu_icon',
'title' => __('Edit'),
]
),
],
@ -2174,24 +2175,11 @@ if ($create_alert || $update_alert) {
echo '</form>';
}
echo '<div class="right">';
echo '<form name="agente" method="post" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_alert">';
html_print_input_hidden('create_alert', 1);
$submitButton = html_print_submit_button(
__('Create'),
'alert',
false,
['icon' => 'wand'],
true
);
html_print_action_buttons($submitButton.$deleteButton, ['right_content' => $pagination]);
echo '</form></div>';
$legend = '<table id="legend_snmp_alerts"class="w100p"><td><div class="snmp_view_div w100p legend_white">';
$legend .= '<div class="display-flex"><div class="flex-50">';
$priorities = get_priorities();
$half = (count($priorities) / 2);
$count = 0;
$legend = '<table id="legend_snmp_alerts"class="w100p"><td><div class="snmp_view_div w100p legend_white">';
$legend .= '<div class="display-flex"><div class="flex-50">';
$priorities = get_priorities();
$half = (count($priorities) / 2);
$count = 0;
foreach ($priorities as $num => $name) {
if ($count == $half) {
$legend .= '</div><div class="mrgn_lft_5px flex-50">';
@ -2202,11 +2190,24 @@ if ($create_alert || $update_alert) {
$count++;
}
$legend .= '</div></div></div></td>';
$legend .= '</div></div></div></td></tr></table>';
ui_toggle($legend, __('Legend'));
ui_toggle($legend, __('Legend'));
unset($table);
unset($table);
echo '<div class="right">';
echo '<form name="agente" method="post" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_alert">';
html_print_input_hidden('create_alert', 1);
$submitButton = html_print_submit_button(
__('Create'),
'alert',
false,
['icon' => 'wand'],
true
);
html_print_action_buttons($submitButton.$deleteButton, ['right_content' => $pagination]);
echo '</form></div>';
}
ui_require_javascript_file('pandora', 'include/javascript/', true);

View File

@ -682,6 +682,7 @@ class ManageExtensions extends HTML
[
'onclick' => 'if (!confirm(\''.__('Deleting this application will also delete all the discovery tasks using it. Do you want to delete it?').'\')) return false;',
'class' => 'main_menu_icon invert_filter action_button_hidden',
'title' => 'Delete',
]
);
$data[$key]['actions'] .= html_print_input_hidden('short_name', $row['short_name'], true);
@ -697,6 +698,7 @@ class ManageExtensions extends HTML
[
'onclick' => 'if (!confirm(\''.__('Are you sure you want to reapply?').'\')) return false;',
'class' => 'main_menu_icon invert_filter action_button_hidden',
'title' => 'Refresh',
]
);
$data[$key]['actions'] .= html_print_input_hidden('sync_action', 'refresh', true);

View File

@ -766,7 +766,18 @@ function filemanager_file_explorer(
&& ($readOnly === false)
) {
$data[4] .= '<form method="post" action="'.$url.'" style="">';
$data[4] .= '<input type="image" style="margin-top: 2px;height:21px" class="invert_filter main_menu_icon" src="images/delete.svg" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[4] .= html_print_input_image(
'delete',
'images/delete.svg',
1,
'margin-top: 2px;height:21px',
true,
[
'title' => __('Delete'),
'class' => 'invert_filter main_menu_icon',
'onclick' => 'if (!confirm(\' '.__('Are you sure?').'\')) return false;',
]
);
$data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true);
$data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['server_unique_identifier']), true);
$data[4] .= html_print_input_hidden('delete_file', 1, true);

View File

@ -3336,9 +3336,23 @@ function html_print_input_image($name, $src, $value, $style='', $return=false, $
'disabled',
];
if (isset($options['title']) && $options['title'] != '') {
if (isset($options['class'])) {
$options['class'] .= ' forced_title';
} else {
$options['class'] = 'forced_title';
}
// New way to show the force_title (cleaner and better performance).
$output .= 'data-title="'.io_safe_input_html($options['title']).'" ';
$output .= 'data-use_title_for_force_title="1" ';
}
foreach ($attrs as $attribute) {
if (isset($options[$attribute])) {
$output .= ' '.$attribute.'="'.io_safe_input_html($options[$attribute]).'"';
if ($attribute !== 'title') {
if (isset($options[$attribute])) {
$output .= ' '.$attribute.'="'.io_safe_input_html($options[$attribute]).'"';
}
}
}

View File

@ -323,7 +323,7 @@ input[type="radio"] {
input[type="image"] {
border: 0px;
background-color: transparent;
background-color: transparent !important;
height: auto;
padding: 0px;
}
@ -4750,7 +4750,7 @@ form ul.form_flex li ul li {
.flex_center > form > input[type="image"] {
margin: 0;
padding: 0;
width: 14px;
width: 20px;
padding-left: 5px;
}