visually enhance dialog box events, assignment alerts, alert list #58#52#57
This commit is contained in:
parent
1ae453d8bc
commit
95d73ceb88
|
@ -37,9 +37,9 @@ $table->head = array ();
|
|||
$table->data = array ();
|
||||
$table->size = array ();
|
||||
$table->size = array ();
|
||||
$table->size[0] = '10%';
|
||||
$table->size[0] = '5%';
|
||||
$table->size[1] = '25%';
|
||||
$table->size[2] = '10%';
|
||||
$table->size[2] = '5%';
|
||||
$table->size[3] = '20%';
|
||||
$table->style[0] = 'font-weight: bold; ';
|
||||
$table->style[1] = 'font-weight: bold; ';
|
||||
|
@ -80,30 +80,8 @@ $table->data[0][1] .= '<span id="value"> </span></span>';
|
|||
$table->data[0][1] .= ' <span id="module_loading" class="invisible">';
|
||||
$table->data[0][1] .= html_print_image('images/spinner.png', true) . '</span>';
|
||||
|
||||
$table->data[0][2] = __('Template');
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
|
||||
$templates = alerts_get_alert_templates (false, array ('id', 'name'));
|
||||
else {
|
||||
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
|
||||
$filter_groups = '';
|
||||
$filter_groups = implode(',', array_keys($usr_groups));
|
||||
$templates = alerts_get_alert_templates (array ('id_group IN (' . $filter_groups . ')'), array ('id', 'name'));
|
||||
}
|
||||
|
||||
$table->data[0][3] = html_print_select (index_array ($templates, 'id', 'name'),
|
||||
'template', '', '', __('Select'), 0, true, false, true, '', false, 'width: 250px;');
|
||||
$table->data[0][3] .= ' <a class="template_details invisible" href="#">' .
|
||||
html_print_image("images/zoom.png", true, array("class" => 'img_help')) . '</a>';
|
||||
if (check_acl ($config['id_user'], 0, "LM")) {
|
||||
$table->data[0][3] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
|
||||
$table->data[0][3] .= html_print_image ('images/add.png', true);
|
||||
$table->data[0][3] .= "<div style='float:right;padding-top:5px;' >" . __('Create Template') . "</div>";
|
||||
$table->data[0][3] .= '</a>';
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Actions');
|
||||
|
||||
|
||||
$groups_user = users_get_groups($config["id_user"]);
|
||||
if (!empty($groups_user)) {
|
||||
$groups = implode(',', array_keys($groups_user));
|
||||
|
@ -124,14 +102,39 @@ $table->data[1][1] .= ui_print_help_icon ("alert-matches", true,
|
|||
ui_get_full_url(false, false, false, false));
|
||||
$table->data[1][1] .= '</span>';
|
||||
if (check_acl ($config['id_user'], 0, "LM")) {
|
||||
|
||||
$table->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
|
||||
$table->data[1][1] .= ' ' . __('Create Action');
|
||||
|
||||
|
||||
$table->data[1][1] .= '<a style="margin-left:5px;" href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
|
||||
$table->data[1][1] .= html_print_image ('images/add.png', true);
|
||||
$table->data[1][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Action').'</span>';
|
||||
$table->data[1][1] .= '</a>';
|
||||
}
|
||||
$table->data[1][2] = __('Threshold');
|
||||
$table->data[1][3] = html_print_extended_select_for_time ('module_action_threshold', 0, '', 0,
|
||||
__('None'), false, true) . ui_print_help_icon ('action_threshold', true, ui_get_full_url(false, false, false, false));
|
||||
|
||||
$table->data[2][0] = __('Template');
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
|
||||
$templates = alerts_get_alert_templates (false, array ('id', 'name'));
|
||||
else {
|
||||
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
|
||||
$filter_groups = '';
|
||||
$filter_groups = implode(',', array_keys($usr_groups));
|
||||
$templates = alerts_get_alert_templates (array ('id_group IN (' . $filter_groups . ')'), array ('id', 'name'));
|
||||
}
|
||||
|
||||
$table->data[2][1] = html_print_select (index_array ($templates, 'id', 'name'),
|
||||
'template', '', '', __('Select'), 0, true, false, true, '', false, 'width: 250px;');
|
||||
$table->data[2][1] .= ' <a class="template_details invisible" href="#">' .
|
||||
html_print_image("images/zoom.png", true, array("class" => 'img_help')) . '</a>';
|
||||
if (check_acl ($config['id_user'], 0, "LM")) {
|
||||
$table->data[2][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
|
||||
$table->data[2][1] .= html_print_image ('images/add.png', true);
|
||||
$table->data[2][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Template').'</span>';
|
||||
$table->data[2][1] .= '</a>';
|
||||
}
|
||||
$table->data[3][0] = __('Threshold');
|
||||
$table->data[3][1] = html_print_extended_select_for_time ('module_action_threshold', 0, '', 0,
|
||||
__('None'), false, true) . ui_print_help_icon ('action_threshold', true, ui_get_full_url(false, false, false, false));
|
||||
|
||||
|
||||
echo '<form class="add_alert_form" method="post">';
|
||||
|
||||
|
|
|
@ -401,10 +401,7 @@ else {
|
|||
$table->size[4] = '1%';
|
||||
}
|
||||
|
||||
$table->head[1] = __('Module') . ' ' .
|
||||
'<a href="' . $url . '&sort_field=module&sort=up&pure='.$pure.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' .
|
||||
'<a href="' . $url . '&sort_field=module&sort=down&pure='.$pure.'">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>' .
|
||||
'<br/>' . __('Template') . ' ' .
|
||||
$table->head[1] = __('Template') . ' ' .
|
||||
'<a href="' . $url . '&sort_field=template&sort=up&pure='.$pure.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '</a>' .
|
||||
'<a href="' . $url . '&sort_field=template&sort=down&pure='.$pure.'">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>';
|
||||
$table->head[2] = __('Actions');
|
||||
|
@ -417,6 +414,8 @@ $table->valign[2] = 'middle';
|
|||
$table->valign[3] = 'middle';
|
||||
$table->valign[4] = 'middle';
|
||||
|
||||
$table->style[4] = "min-width:80px";
|
||||
|
||||
$table->data = array ();
|
||||
|
||||
$url .= $sort_params;
|
||||
|
@ -469,8 +468,9 @@ foreach ($simple_alerts as $alert) {
|
|||
}
|
||||
|
||||
$module_name = modules_get_agentmodule_name ($alert['id_agent_module']);
|
||||
$data[1] = ui_print_truncate_text($module_name, 'module_medium', false, true, true, '[…]', 'display:block;font-size: 7.2pt') . '<br>';
|
||||
|
||||
$data[0] .= ui_print_truncate_text($module_name, 'module_medium', false, true, true, '[…]', 'display:block;font-size: 7.2pt') . '<br>';
|
||||
|
||||
|
||||
$template_group = db_get_value('id_group', 'talert_templates', 'id', $alert['id_alert_template']);
|
||||
|
||||
// The access to the template manage page is necessary have LW permissions on template group
|
||||
|
@ -507,13 +507,13 @@ foreach ($simple_alerts as $alert) {
|
|||
foreach ($actions as $action_id => $action) {
|
||||
$data[2] .= "<tr>";
|
||||
$data[2] .= "<td>";
|
||||
$data[2] .= '<ul class="action_list">';
|
||||
$data[2] .= '<li>';
|
||||
$data[2] .= '<ul class="action_list" style="display:inline;">';
|
||||
$data[2] .= '<li style="display:inline;">';
|
||||
if ($alert['disabled'])
|
||||
$data[2] .= '<font class="action_name" style="font-style: italic; color: #aaaaaa;">';
|
||||
else
|
||||
$data[2] .= '<font class="action_name">';
|
||||
$data[2] .= ui_print_truncate_text($action['name'], GENERIC_SIZE_TEXT, false);
|
||||
$data[2] .= ui_print_truncate_text($action['name'], (GENERIC_SIZE_TEXT+20), false);
|
||||
$data[2] .= ' <em>(';
|
||||
if ($action['fires_min'] == $action['fires_max']) {
|
||||
if ($action['fires_min'] == 0)
|
||||
|
|
|
@ -296,17 +296,17 @@ if ($get_extended_event) {
|
|||
|
||||
// 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 .= "<li><a href='#extended_event_general_page' id='link_general'>".html_print_image('images/lightning_go.png',true).__('General')."</a></li>";
|
||||
$tabs .= "<li><a href='#extended_event_details_page' id='link_details'>".html_print_image('images/zoom.png',true).__('Details')."</a></li>";
|
||||
$tabs .= "<li><a href='#extended_event_custom_fields_page' id='link_custom_fields'>".html_print_image('images/custom_field_col.png',true).__('Agent fields')."</a></li>";
|
||||
$tabs .= "<li><a href='#extended_event_comments_page' id='link_comments'>".html_print_image('images/pencil.png',true).__('Comments')."</a></li>";
|
||||
|
||||
if (!$readonly &&
|
||||
$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_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_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_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>";
|
||||
|
||||
if (!$readonly &&
|
||||
(tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) {
|
||||
$tabs .= "<li><a href='#extended_event_responses_page' id='link_responses'>".html_print_image('images/event_responses_col.png',true).__('Responses')."</a></li>";
|
||||
$tabs .= "<li><a href='#extended_event_responses_page' id='link_responses'>".html_print_image('images/event_responses_col.png',true)."<span style='position:relative;top:-6px;left:3px;margin-right:10px;'>".__('Responses')."</span></a></li>";
|
||||
}
|
||||
if ($event['custom_data'] != '') {
|
||||
$tabs .= "<li><a href='#extended_event_custom_data_page' id='link_custom_data'>".html_print_image('images/custom_field_col.png',true).__('Custom data')."</a></li>";
|
||||
$tabs .= "<li><a href='#extended_event_custom_data_page' id='link_custom_data'>".html_print_image('images/custom_field_col.png',true)."<span style='position:relative;top:-6px;left:3px;margin-right:10px;'>".__('Custom data')."</span></a></li>";
|
||||
}
|
||||
$tabs .= "</ul>";
|
||||
|
||||
|
|
Loading…
Reference in New Issue