New style for modal window Show More - #3613

Former-commit-id: 61cb4c99ef4f586cfdf07df5262c789cdee75915
This commit is contained in:
Tatiana Llorente 2019-04-15 13:11:58 +02:00
parent 9da83faade
commit 0b352860cf
3 changed files with 128 additions and 34 deletions

View File

@ -418,15 +418,15 @@ if ($get_extended_event) {
} }
// Tabs. // Tabs.
$tabs = "<ul style='background:#ffffff !important; border-top: 0px; border-left: 0px; border-right: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-color: #D3D3D3;'>"; $tabs = "<ul class='events_tabs'>";
$tabs .= "<li><a href='#extended_event_general_page' id='link_general'>".html_print_image('images/lightning_go.png', true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('General').'</span></a></li>'; $tabs .= "<li><a href='#extended_event_general_page' id='link_general'>".html_print_image('images/lightning_go.png', true).'<span>'.__('General').'</span></a></li>';
if (events_has_extended_info($event['id_evento']) === true) { if (events_has_extended_info($event['id_evento']) === true) {
$tabs .= "<li><a href='#extended_event_related_page' id='link_related'>".html_print_image('images/zoom.png', true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('Related').'</span></a></li>'; $tabs .= "<li><a href='#extended_event_related_page' id='link_related'>".html_print_image('images/zoom.png', true).'<span>'.__('Related').'</span></a></li>';
} }
$tabs .= "<li><a href='#extended_event_details_page' id='link_details'>".html_print_image('images/zoom.png', true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('Details').'</span></a></li>'; $tabs .= "<li><a href='#extended_event_details_page' id='link_details'>".html_print_image('images/zoom.png', true).'<span>'.__('Details').'</span></a></li>';
$tabs .= "<li><a href='#extended_event_custom_fields_page' id='link_custom_fields'>".html_print_image('images/custom_field_col.png', true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('Agent fields').'</span></a></li>'; $tabs .= "<li><a href='#extended_event_custom_fields_page' id='link_custom_fields'>".html_print_image('images/custom_field_col.png', true).'<span>'.__('Agent fields').'</span></a></li>';
$tabs .= "<li><a href='#extended_event_comments_page' id='link_comments'>".html_print_image('images/pencil.png', true)."<span style='position:relative;top:-6px;left:5px;margin-right:10px;'>".__('Comments').'</span></a></li>'; $tabs .= "<li><a href='#extended_event_comments_page' id='link_comments'>".html_print_image('images/pencil.png', true).'<span>'.__('Comments').'</span></a></li>';
if (!$readonly if (!$readonly
&& ((tags_checks_event_acl( && ((tags_checks_event_acl(
@ -546,7 +546,7 @@ if ($get_extended_event) {
$loading = '<div id="response_loading" style="display:none">'.html_print_image('images/spinner.gif', true).'</div>'; $loading = '<div id="response_loading" style="display:none">'.html_print_image('images/spinner.gif', true).'</div>';
$out = '<div id="tabs" style="height:95%; overflow: auto">'.$tabs.$notifications.$loading.$general.$details.$related.$custom_fields.$comments.$responses.$custom_data.html_print_input_hidden('id_event', $event['id_evento']).'</div>'; $out = '<div id="tabs">'.$tabs.$notifications.$loading.$general.$details.$related.$custom_fields.$comments.$responses.$custom_data.html_print_input_hidden('id_event', $event['id_evento']).'</div>';
$js = '<script> $js = '<script>
$(function() { $(function() {

View File

@ -2521,9 +2521,7 @@ function events_page_custom_fields($event)
$table->width = '100%'; $table->width = '100%';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
$table->style[0] = 'width:35%; font-weight: bold; text-align: left; height: 23px;'; $table->class = 'events_show_more_table';
$table->style[1] = 'text-align: left; height: 23px;';
$table->class = 'alternate rounded_cells';
$all_customs_fields = (bool) check_acl( $all_customs_fields = (bool) check_acl(
$config['id_user'], $config['id_user'],
@ -2671,11 +2669,9 @@ function events_page_details($event, $server='')
$table_details->width = '100%'; $table_details->width = '100%';
$table_details->data = []; $table_details->data = [];
$table_details->head = []; $table_details->head = [];
$table_details->cellspacing = 2; $table_details->cellspacing = 0;
$table_details->cellpadding = 2; $table_details->cellpadding = 0;
$table_details->style[0] = 'width:35%; font-weight: bold; text-align: left; height: 23px;'; $table_details->class = 'events_show_more_table';
$table_details->style[1] = 'text-align: left; height: 23px;';
$table_details->class = 'alternate rounded_cells';
/* /*
* Useless switch. * Useless switch.
@ -3137,14 +3133,12 @@ function events_page_general($event)
// General. // General.
$table_general = new stdClass; $table_general = new stdClass;
$table_general->cellspacing = 2; $table_general->cellspacing = 0;
$table_general->cellpadding = 2; $table_general->cellpadding = 0;
$table_general->width = '100%'; $table_general->width = '100%';
$table_general->data = []; $table_general->data = [];
$table_general->head = []; $table_general->head = [];
$table_general->style[0] = 'width:35%; font-weight: bold; text-align: left; height: 23px;'; $table_general->class = 'events_show_more_table';
$table_general->style[1] = 'text-align: left; height: 23px;';
$table_general->class = 'alternate rounded_cells';
$data = []; $data = [];
$data[0] = __('Event ID'); $data[0] = __('Event ID');
@ -3185,10 +3179,17 @@ function events_page_general($event)
$data = []; $data = [];
$data[0] = __('Type'); $data[0] = __('Type');
$data[1] = events_print_type_img( /*
$data[1] = events_print_type_img(
$event['event_type'], $event['event_type'],
true true
).' '.events_print_type_description($event['event_type'], true); ).' '.events_print_type_description($event['event_type'], true);*/
$data[1] = events_print_type_description($event['event_type'], true);
$data[2] = events_print_type_img(
$event['event_type'],
true
);
$table_general->data[] = $data; $table_general->data[] = $data;
$data = []; $data = [];
@ -3208,8 +3209,21 @@ function events_page_general($event)
$data = []; $data = [];
$data[0] = __('Severity'); $data[0] = __('Severity');
$event_criticity = get_priority_name($event['criticity']); $event_criticity = get_priority_name($event['criticity']);
/*
$data[1] = html_print_image( $data[1] = html_print_image(
$img_sev,
true,
[
'class' => 'image_status',
'width' => 12,
'height' => 12,
'title' => $event_criticity,
]
);
$data[1] .= ' '.$event_criticity;
*/
$data[1] = $event_criticity;
$data[2] = html_print_image(
$img_sev, $img_sev,
true, true,
[ [
@ -3219,7 +3233,6 @@ function events_page_general($event)
'title' => $event_criticity, 'title' => $event_criticity,
] ]
); );
$data[1] .= ' '.$event_criticity;
$table_general->data[] = $data; $table_general->data[] = $data;
// Get Status. // Get Status.
@ -3227,7 +3240,9 @@ function events_page_general($event)
$data = []; $data = [];
$data[0] = __('Status'); $data[0] = __('Status');
$data[1] = html_print_image($event_st['img'], true).' '.$event_st['title']; // $data[1] = html_print_image($event_st['img'], true).' '.$event_st['title'];
$data[1] = $event_st['title'];
$data[2] = html_print_image($event_st['img'], true);
$table_general->data[] = $data; $table_general->data[] = $data;
// If event is validated, show who and when acknowleded it. // If event is validated, show who and when acknowleded it.
@ -3250,12 +3265,11 @@ function events_page_general($event)
$data = []; $data = [];
$data[0] = __('Group'); $data[0] = __('Group');
$data[1] = ''; $data[1] = groups_get_name($event['id_grupo']);
if (!$config['show_group_name']) { if (!$config['show_group_name']) {
$data[1] = ui_print_group_icon($event['id_grupo'], true); $data[2] = ui_print_group_icon($event['id_grupo'], true);
} }
$data[1] .= groups_get_name($event['id_grupo']);
$table_general->data[] = $data; $table_general->data[] = $data;
$data = []; $data = [];
@ -3281,6 +3295,16 @@ function events_page_general($event)
$table_general->data[] = $data; $table_general->data[] = $data;
$table_data = $table_general->data;
$table_data_total = count($table_data);
for ($i = 0; $i <= $table_data_total; $i++) {
if (count($table_data[$i]) == 2) {
$table_general->colspan[$i][1] = 2;
$table_general->style[2] = 'text-align:center; width:10%;';
}
}
$general = '<div id="extended_event_general_page" class="extended_event_pages">'.html_print_table($table_general, true).'</div>'; $general = '<div id="extended_event_general_page" class="extended_event_pages">'.html_print_table($table_general, true).'</div>';
return $general; return $general;
@ -3304,9 +3328,7 @@ function events_page_comments($event, $childrens_ids=[])
$table_comments->width = '100%'; $table_comments->width = '100%';
$table_comments->data = []; $table_comments->data = [];
$table_comments->head = []; $table_comments->head = [];
$table_comments->style[0] = 'width:35%; vertical-align: top; text-align: left;'; $table_comments->class = 'events_show_more_table';
$table_comments->style[1] = 'text-align: left;';
$table_comments->class = 'alternate rounded_cells';
$event_comments = $event['user_comment']; $event_comments = $event['user_comment'];
$event_comments = str_replace(["\n", '&#x0a;'], '<br>', $event_comments); $event_comments = str_replace(["\n", '&#x0a;'], '<br>', $event_comments);
@ -3411,9 +3433,9 @@ function events_page_comments($event, $childrens_ids=[])
$childrens_ids $childrens_ids
))) && $config['show_events_in_local'] == false || $config['event_replication'] == false ))) && $config['show_events_in_local'] == false || $config['event_replication'] == false
) { ) {
$comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea('comment', 3, 10, '', 'style="min-height: 15px; width: 100%; disabled"', true); $comments_form = '<br><div id="comments_form" style="width:98%;">'.html_print_textarea('comment', 3, 10, '', 'style="min-height: 15px; padding:0; width: 100%; disabled"', true);
$comments_form .= '<br><div style="text-align:right;">'.html_print_button(__('Add comment'), 'comment_button', false, 'event_comment();', 'class="sub next"', true).'</div><br></div>'; $comments_form .= '<br><div style="text-align:right; margin-top:10px;">'.html_print_button(__('Add comment'), 'comment_button', false, 'event_comment();', 'class="sub next"', true).'</div><br></div>';
} else { } else {
$comments_form = ui_print_message( $comments_form = ui_print_message(
__('If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.') __('If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.')

View File

@ -3618,6 +3618,78 @@ div.simple_value > a > span.text p {
cursor: pointer; cursor: pointer;
} }
.events_show_more_table {
border-spacing: 0px;
text-align: left;
}
/* Modal window - Show More */
table.events_show_more_table tr:nth-child(odd) td {
background-color: #ffffff;
}
table.events_show_more_table tr:nth-child(even) td {
background-color: #f5f5f5;
border-top: 1px solid #cacaca;
border-bottom: 1px solid #cacaca;
}
table.events_show_more_table tr td {
height: 22px;
padding: 4px;
}
table.events_show_more_table tr td:first-child {
width: 35%;
font-weight: bold;
padding-left: 20px;
}
ul.events_tabs {
background: #ffffff !important;
border: 0px;
display: flex;
justify-content: space-between;
padding: 0px !important;
}
ul.events_tabs:before,
ul.events_tabs:after {
content: none !important;
}
ul.events_tabs > li {
margin: 0 !important;
width: 20%;
text-align: center;
float: none !important;
outline-width: 0;
}
ul.events_tabs > li.ui-state-default {
background: #fff !important;
border: none !important;
border-bottom: 2px solid black !important;
}
ul.events_tabs > li a {
text-align: center;
float: none !important;
padding: 8px !important;
display: block;
}
ul.events_tabs > li span {
position: relative;
top: -6px;
left: 5px;
margin-right: 10px;
}
ul.events_tabs > li.ui-tabs-active {
border-bottom: 2px solid #82b92e !important;
border-top: 2px solid #82b92e !important;
}
/* /*
* --------------------------------------------------------------------- * ---------------------------------------------------------------------
* - modal window and edit user - * - modal window and edit user -