#10324 added fav menu in reporting viewer
This commit is contained in:
parent
d6645ee283
commit
032fcdeae4
|
@ -7132,5 +7132,9 @@ function ui_print_fav_menu($id_element, $url, $label, $section)
|
|||
['onclick' => 'favMenuAction(this)']
|
||||
);
|
||||
$output .= '</span>';
|
||||
$output .= '<div id="dialog-fav-menu">';
|
||||
$output .= '<p><b>'.__('Title').'</b></p>';
|
||||
$output .= html_print_input_text('label_fav_menu', '', '', 25, 255, true, false, true);
|
||||
$output .= '</div>';
|
||||
return $output;
|
||||
}
|
|
@ -837,6 +837,31 @@ function unblockSubmit(button) {
|
|||
|
||||
function favMenuAction(e) {
|
||||
var data = JSON.parse(atob(e.value));
|
||||
if (
|
||||
data.label === "" &&
|
||||
$(e)
|
||||
.attr("src")
|
||||
.endsWith("star.png") === false
|
||||
) {
|
||||
$("#dialog-fav-menu").dialog({
|
||||
title: "Please choose a title",
|
||||
width: 330,
|
||||
buttons: [
|
||||
{
|
||||
class:
|
||||
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-next",
|
||||
text: "Confirm",
|
||||
click: function() {
|
||||
data.label = $("#text-label_fav_menu").val();
|
||||
$(e).val(btoa(JSON.stringify(data)));
|
||||
favMenuAction(e);
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "ajax.php",
|
||||
|
|
|
@ -317,3 +317,10 @@ div.ui-tooltip.ui-corner-all.ui-widget-shadow.ui-widget.ui-widget-content.uitool
|
|||
bottom: -20px;
|
||||
top: auto;
|
||||
}
|
||||
#dialog-fav-menu {
|
||||
display: none;
|
||||
}
|
||||
#dialog-fav-menu p {
|
||||
margin: 0px;
|
||||
padding-top: 40px;
|
||||
}
|
||||
|
|
|
@ -232,6 +232,12 @@ if (is_metaconsole()) {
|
|||
'link' => '',
|
||||
'label' => __('Custom reports'),
|
||||
],
|
||||
],
|
||||
[
|
||||
'id_element' => $id_report,
|
||||
'url' => 'operation/reporting/reporting_viewer&id='.$id_report,
|
||||
'label' => reporting_get_name($id_report),
|
||||
'section' => 'Reporting',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue