Metaconsole view reports change

This commit is contained in:
Jonathan 2023-03-21 09:52:21 +01:00
parent 01e152a6e3
commit 82dd6ebb37
5 changed files with 277 additions and 653 deletions

View File

@ -1047,17 +1047,6 @@ $class = 'databox filters';
?>
<table id="table_item_edit_reporting" class="<?php echo $class; ?>" id="" border="0" cellpadding="4" cellspacing="4" width="100%">
<?php
if (defined('METACONSOLE')) {
echo '<thead>
<tr>
<th align=center colspan=5>
'.__('Item Editor').'
</th>
</tr>
</thead>';
}
?>
<tbody>
<tr id="row_type" class="datos">
<td class="bolder w220px">

View File

@ -201,139 +201,86 @@ if (($agentFilter == 0) && ($moduleFilter == 0) && ($typeFilter == 0)) {
$urlFilter = '&agent_filter='.$agentFilter.'&module_filter='.$moduleFilter.'&type_filter='.$typeFilter;
if (!defined('METACONSOLE')) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '33%';
$table->size[1] = '33%';
$table->size[1] = '33%';
$table->data[0][0] = html_print_label_input_block(
__('Agents'),
html_print_select(
$agents,
'agent_filter',
$agentFilter,
'',
__('All'),
0,
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Modules'),
html_print_select(
$modules,
'module_filter',
$moduleFilter,
'',
__('All'),
0,
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][2] = html_print_label_input_block(
__('Type'),
html_print_select(
$types,
'type_filter',
$typeFilter,
'',
__('All'),
0,
true,
false,
true,
'',
false,
'width:100%'
)
);
$form = '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report='.$idReport.'">';
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'filter',
false,
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= html_print_input_hidden('action', 'filter', true);
$form .= '</form>';
ui_toggle($form, __('Filters'), '', '', false);
} else {
$table = new stdClass();
$table->width = '96%';
$table->class = 'databox_filters';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->data[0][0] = __('Agents');
$table->data[0][1] = html_print_select(
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '33%';
$table->size[1] = '33%';
$table->size[1] = '33%';
$table->data[0][0] = html_print_label_input_block(
__('Agents'),
html_print_select(
$agents,
'agent_filter',
$agentFilter,
'',
__('All'),
0,
true
);
$table->data[0][2] = __('Modules');
$table->data[0][3] = html_print_select(
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Modules'),
html_print_select(
$modules,
'module_filter',
$moduleFilter,
'',
__('All'),
0,
true
);
$table->data[0][4] = __('Type');
$table->data[0][5] = html_print_select(
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][2] = html_print_label_input_block(
__('Type'),
html_print_select(
$types,
'type_filter',
$typeFilter,
'',
__('All'),
0,
true
);
$table->style[6] = 'text-align:right;';
$table->data[0][6] = html_print_submit_button(
__('Filter'),
'filter',
true,
false,
'class="sub upd"',
true
).html_print_input_hidden('action', 'filter', true);
true,
'',
false,
'width:100%'
)
);
$form = '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report='.$idReport.'">';
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'filter',
false,
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= html_print_input_hidden('action', 'filter', true);
$form .= '</form>';
$filters = '<form class="filters_form" method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=
list_items&action=filter&id_report='.$idReport.'">';
$filters .= html_print_table($table, true);
$filters .= '</form>';
ui_toggle($filters, __('Show Options'));
}
ui_toggle($form, __('Filters'), '', '', false);
$where = '1=1';
if ($typeFilter != '0') {
@ -412,16 +359,9 @@ $table->style[0] = 'text-align: right;';
if ($items) {
$table->width = '100%';
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
$arrow_up = 'images/sort_up.png';
$arrow_down = 'images/sort_down.png';
} else {
$table->class = 'info_table';
$arrow_up = 'images/sort_up_black.png';
$arrow_down = 'images/sort_down_black.png';
}
$table->class = 'info_table';
$arrow_up = 'images/sort_up_black.png';
$arrow_down = 'images/sort_down_black.png';
$table->size = [];
$table->size[0] = '5px';
@ -717,90 +657,65 @@ foreach ($items as $item) {
}
}
if (defined('METACONSOLE')) {
if ($items != false) {
ui_pagination($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter);
html_print_table($table);
ui_pagination($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
echo "<div class='right w100p'>";
if ($items != false) {
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
html_print_table($table);
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
if (check_acl($config['id_user'], 0, 'RM')) {
html_print_input_hidden('ids_items_to_delete', '');
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete right mrgn_btn_15px"');
}
echo "<form id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
echo '</div>';
echo '</form>';
}
} else {
if ($items != false) {
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
html_print_table($table);
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
echo "<form id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
echo '<div class="action-buttons w100p">';
html_print_input_hidden('ids_items_to_delete', '');
$ActionButtons[] = html_print_submit_button(
__('Delete'),
'delete_btn',
false,
[
'class' => 'sub ok',
'icon' => 'next',
],
true
);
html_print_action_buttons(
implode('', $ActionButtons),
['type' => 'form_action']
);
echo '</div>';
echo '</form>';
}
echo '<div class="action-buttons w100p">';
html_print_input_hidden('ids_items_to_delete', '');
$ActionButtons[] = html_print_submit_button(
__('Delete'),
'delete_btn',
false,
[
'class' => 'sub ok',
'icon' => 'next',
],
true
);
html_print_action_buttons(
implode('', $ActionButtons),
['type' => 'form_action']
);
echo '</div>';
echo '</form>';
}
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
if (defined('METACONSOLE')) {
$table->colspan[0][0] = 3;
$table->size = [];
$table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
$table->class = 'databox data';
$table->head[0] = __('Sort items');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
$table->data[1][0] = __('Sort selected items from position: ');
$table->data[1][1] = html_print_select_style(
$table->data[1][0] = html_print_label_input_block(
__('Sort selected items from position: '),
html_print_select_style(
[
'before' => __('Move before to'),
'after' => __('Move after to'),
],
'move_to',
'',
'',
'width:100%',
'',
'',
0,
true
);
$table->data[1][2] = html_print_input_text_extended(
true,
)
);
$table->data[1][2] = html_print_label_input_block(
__('Position'),
html_print_input_text_extended(
'position_to_sort',
1,
'text-position_to_sort',
@ -811,93 +726,42 @@ if (defined('METACONSOLE')) {
"only_numbers('position_to_sort');",
'',
true
);
$table->data[1][2] .= html_print_input_hidden('ids_items_to_sort', '', true);
$table->data[1][3] = html_print_submit_button(__('Sort'), 'sort_submit', false, 'class="sub upd"', true);
).html_print_input_hidden('ids_items_to_sort', '', true)
);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."'
method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
html_print_table($table);
echo '</form>';
} else {
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data[1][0] = html_print_label_input_block(
__('Sort selected items from position: '),
html_print_select_style(
[
'before' => __('Move before to'),
'after' => __('Move after to'),
],
'move_to',
'',
'width:100%',
'',
'',
0,
true,
)
);
$table->data[1][2] = html_print_label_input_block(
__('Position'),
html_print_input_text_extended(
'position_to_sort',
1,
'text-position_to_sort',
'',
3,
10,
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."' method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Sort'),
'sort_submit',
false,
"only_numbers('position_to_sort');",
'',
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
).html_print_input_hidden('ids_items_to_sort', '', true)
);
),
],
true
);
$form .= html_print_input_hidden('action', 'sort_items', true);
$form .= '</form>';
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."' method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Sort'),
'sort_submit',
false,
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= html_print_input_hidden('action', 'sort_items', true);
$form .= '</form>';
ui_toggle($form, __('Sort items'), '', '', false);
}
ui_toggle($form, __('Sort items'), '', '', false);
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
if (defined('METACONSOLE')) {
$table->colspan[0][0] = 3;
$table->size = [];
$table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
$table->class = 'databox data';
$table->head[0] = __('Delete items');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
$table->data[1][0] = __('Delete selected items from position: ');
$table->data[1][1] = html_print_select_style(
$table->data[0][0] = html_print_label_input_block(
__('Delete selected items from position: '),
html_print_select_style(
[
'above' => __('Delete above to'),
'below' => __('Delete below to'),
@ -909,8 +773,11 @@ if (defined('METACONSOLE')) {
'',
0,
true
);
$table->data[1][2] = html_print_input_text_extended(
)
);
$table->data[0][1] = html_print_label_input_block(
__('Poisition'),
html_print_input_text_extended(
'position_to_delete',
1,
'text-position_to_delete',
@ -921,75 +788,33 @@ if (defined('METACONSOLE')) {
"only_numbers('position_to_delete');",
'',
true
);
$table->data[1][2] .= html_print_input_hidden('ids_items_to_delete', '', true);
$table->data[1][3] = html_print_submit_button(__('Delete'), 'delete_submit', false, 'class="sub upd"', true);
)
);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
method='post'>";
html_print_table($table);
echo '</form>';
} else {
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data[0][0] = html_print_label_input_block(
__('Delete selected items from position: '),
html_print_select_style(
[
'above' => __('Delete above to'),
'below' => __('Delete below to'),
],
'delete_m',
'',
'',
'',
'',
0,
true
)
);
$table->data[0][1] = html_print_label_input_block(
__('Poisition'),
html_print_input_text_extended(
'position_to_delete',
1,
'text-position_to_delete',
'',
3,
10,
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
method='post'>";
$form .= html_print_input_hidden('ids_items_to_delete', '', true);
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Delete'),
'delete_submit',
false,
"only_numbers('position_to_delete');",
'',
[
'class' => 'mini',
'icon' => 'delete',
'mode' => 'secondary',
],
true
)
);
),
],
true
);
$form .= '</form>';
ui_toggle($form, __('Delete items'), '', '', false);
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
method='post'>";
$form .= html_print_input_hidden('ids_items_to_delete', '', true);
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Delete'),
'delete_submit',
false,
[
'class' => 'mini',
'icon' => 'delete',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= '</form>';
ui_toggle($form, __('Delete items'), '', '', false);
}
?>
<script type="text/javascript">

View File

@ -70,21 +70,13 @@ $table->head = [];
$table->data = [];
$table->size = [];
if (is_metaconsole() === true) {
$table->class = 'databox filters';
$table->head[0] = __('Main data');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
$table->size[0] = '15%';
$table->size[1] = '90%';
$table->style[0] = 'font-weight: bold; vertical-align: top;';
} else {
$table->class = 'filter-table-adv databox';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->size[2] = '50%';
$table->size[3] = '50%';
}
$table->class = 'filter-table-adv databox';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->size[2] = '50%';
$table->size[3] = '50%';
$write_groups = users_get_groups_for_select(
false,
@ -95,35 +87,20 @@ $write_groups = users_get_groups_for_select(
'id_grupo'
);
if (is_metaconsole() === true) {
$table->data['name'][0] = __('Name');
$table->data['name'][1] = html_print_input_text(
$table->data[0][0] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$reportName,
__('Name'),
80,
false,
100,
true,
false,
true
);
)
);
$table->data['group'][0] = __('Group');
} else {
$table->data[0][0] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$reportName,
__('Name'),
false,
100,
true,
false,
true
)
);
}
// If the report group is not among the
// RW groups (special permission) we add it.
@ -137,9 +114,10 @@ if (users_can_manage_group_all('RW') === true) {
$return_all_group = true;
}
if (is_metaconsole() === true) {
$table->data['group'][1] = '<div class="w290px inline">';
$table->data['group'][1] .= html_print_input(
$table->data[0][1] = html_print_label_input_block(
__('Group'),
html_print_input(
[
'type' => 'select_groups',
'id_user' => $config['id_user'],
@ -153,53 +131,23 @@ if (is_metaconsole() === true) {
'return' => true,
'required' => true,
]
);
$table->data['group'][1] .= '</div>';
} else {
$table->data[0][1] = html_print_label_input_block(
__('Group'),
html_print_input(
[
'type' => 'select_groups',
'id_user' => $config['id_user'],
'privilege' => 'AR',
'returnAllGroup' => $return_all_group,
'name' => 'id_group',
'selected' => $idGroupReport,
'script' => '',
'nothing' => '',
'nothing_value' => '',
'return' => true,
'required' => true,
]
)
);
}
)
);
if (is_metaconsole() === true) {
$table->data['description'][0] = __('Description');
$table->data['description'][1] = html_print_textarea(
$table->colspan[1][0] = 2;
$table->data[1][0] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
2,
80,
1,
$description,
'',
true
);
} else {
$table->colspan[1][0] = 2;
$table->data[1][0] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
2,
1,
$description,
'',
true
)
);
}
)
);
if ($report_id_user == $config['id_user']
|| is_user_admin($config['id_user'])
@ -210,13 +158,12 @@ if ($report_id_user == $config['id_user']
'group_edit' => __('The next group can edit the report'),
'user_edit' => __('Only the user and admin user can edit the report'),
];
if (is_metaconsole() === true) {
$table->data['access'][0] = __('Write Access');
$table->data['access'][0] .= ui_print_help_tip(
$table->data[2][0] = html_print_label_input_block(
__('Write Access').ui_print_help_tip(
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
true
);
$table->data['access'][1] = html_print_select(
),
html_print_select(
$type_access,
'type_access',
$type_access_selected,
@ -224,16 +171,18 @@ if ($report_id_user == $config['id_user']
'',
0,
true
);
)
);
$class = ' invisible_important ';
if ($type_access_selected == 'group_edit') {
$class = '';
}
$options['div_class'] = 'invisible_important';
$options['div_id'] = 'group_edit';
if ($type_access_selected == 'group_edit') {
$options['div_class'] = '';
}
$table->data['access'][1] .= '<span class="access_subform'.$class.'" id="group_edit">';
$table->data['access'][1] .= '<div class="w290px inline">';
$table->data['access'][1] .= html_print_select_groups(
$table->data[2][1] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'RW',
false,
@ -243,48 +192,9 @@ if ($report_id_user == $config['id_user']
'',
'',
true
);
$table->data['access'][1] .= '</div>';
$table->data['access'][1] .= '</span>';
} else {
$table->data[2][0] = html_print_label_input_block(
__('Write Access').ui_print_help_tip(
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
true
),
html_print_select(
$type_access,
'type_access',
$type_access_selected,
'change_type_access(this)',
'',
0,
true
)
);
$options['div_class'] = 'invisible_important';
$options['div_id'] = 'group_edit';
if ($type_access_selected == 'group_edit') {
$options['div_class'] = '';
}
$table->data[2][1] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'RW',
false,
'id_group_edit',
$id_group_edit,
false,
'',
'',
true
),
$options
);
}
),
$options
);
}
if ($enterpriseEnable) {
@ -293,68 +203,41 @@ if ($enterpriseEnable) {
$non_interactive_check = $non_interactive;
}
if (is_metaconsole() === true) {
$table->data['interactive_report'][0] = __('Non interactive report');
$table->data['interactive_report'][1] .= html_print_checkbox_switch(
$table->data[2][1] = html_print_label_input_block(
__('Non interactive report'),
html_print_checkbox_switch(
'non_interactive',
1,
$non_interactive_check,
true
);
} else {
$table->data[2][1] = html_print_label_input_block(
__('Non interactive report'),
html_print_checkbox_switch(
'non_interactive',
1,
$non_interactive_check,
true
)
);
}
)
);
}
if (enterprise_installed() === true) {
if (is_metaconsole() === true) {
$table->data['cover'][0] = __('Generate cover page in PDF render');
$table->data['cover'][1] = html_print_checkbox_switch(
$table->data[3][0] = html_print_label_input_block(
__('Generate cover page in PDF render'),
html_print_checkbox_switch(
'cover_page_render',
1,
$cover_page_render,
true
);
)
);
$table->data['index'][0] = __('Generate index in PDF render');
$table->data['index'][1] = html_print_checkbox_switch(
$table->data[3][1] = html_print_label_input_block(
__('Generate index in PDF render'),
html_print_checkbox_switch(
'index_render',
1,
$index_render,
true
);
} else {
$table->data[3][0] = html_print_label_input_block(
__('Generate cover page in PDF render'),
html_print_checkbox_switch(
'cover_page_render',
1,
$cover_page_render,
true
)
);
$table->data[3][1] = html_print_label_input_block(
__('Generate index in PDF render'),
html_print_checkbox_switch(
'index_render',
1,
$index_render,
true
)
);
}
)
);
}
echo '<form class="" method="post">';
html_print_table($table);

View File

@ -713,13 +713,14 @@ switch ($action) {
$table_aux = new stdClass();
$table_aux->width = '100%';
if (is_metaconsole()) {
$table_aux->class = 'databox filters';
$table_aux->class = 'filter-table-adv';
$table_aux->size[0] = '30%';
$table_aux->size[1] = '30%';
$table_aux->size[2] = '30%';
$table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
$table_aux->data[0][1] = html_print_select_groups(
$table_aux->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
$access,
true,
@ -737,116 +738,56 @@ switch ($action) {
false,
false,
'id_grupo'
).'<br>';
)
);
$table_aux->data[0][2] = '<b>'.__('Free text for search: ');
$table_aux->data[0][2] .= ui_print_help_tip(
$table_aux->data[0][1] = html_print_label_input_block(
__('Free text for search: ').ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
);
$table_aux->data[0][2] .= '</b>';
$table_aux->data[0][3] = html_print_input_text(
),
html_print_input_text(
__('search'),
$search,
'',
30,
'',
true
);
} else {
$table_aux->class = 'filter-table-adv';
$table_aux->size[0] = '30%';
$table_aux->size[1] = '30%';
$table_aux->size[2] = '30%';
$table_aux->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
$access,
true,
'id_group',
$id_group,
'',
'',
'',
true,
false,
true,
'',
false,
'',
false,
false,
'id_grupo'
)
);
$table_aux->data[0][1] = html_print_label_input_block(
__('Free text for search: ').ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
),
html_print_input_text(
__('search'),
$search,
'',
30,
'',
true
)
);
}
if (is_metaconsole()) {
$table_aux->data[0][6] = html_print_submit_button(
__('Search'),
'search_submit',
false,
'class="sub upd"',
true
);
}
)
);
$url_rb = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder';
if (is_metaconsole()) {
$filter = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
$filter .= html_print_table($table_aux, true);
$filter .= '</form>';
ui_toggle($filter, __('Show Option'));
} else {
$searchForm = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
$searchForm .= html_print_table($table_aux, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'search_submit',
false,
[
'mode' => 'mini',
'icon' => 'search',
],
true
),
],
true
);
$searchForm .= '</form>';
$searchForm = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
$searchForm .= html_print_table($table_aux, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'search_submit',
false,
[
'mode' => 'mini',
'icon' => 'search',
],
true
),
],
true
);
$searchForm .= '</form>';
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
false,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
}
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
false,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('ajaxqueue');

View File

@ -184,7 +184,7 @@ if (empty($messages) === true) {
$table->size[3] = '80px';
$table->size[4] = '60px';
$table->head[5] = html_print_checkbox('all_delete_messages', 0, false, true, false);
$table->head[5] = html_print_checkbox('all_delete_messages', 0, false, true, false, 'check_all_checkboxes()');
$table->head[0] = __('Status');
if ($show_sent === true) {
$table->head[1] = __('Destination');
@ -351,28 +351,14 @@ if (empty($messages) === false) {
<script type="text/javascript">
$( document ).ready(function() {
function check_all_checkboxes() {
if ($("input[name=all_delete_messages]").prop("checked")) {
$("[name^='delete_multiple']").prop("checked", true);
}
else {
$("[name^='delete_multiple']").prop("checked", false);
}
}
$('[id^=checkbox-delete_multiple_messages]').change(function(){
if($(this).parent().parent().hasClass('checkselected')){
$(this).parent().parent().removeClass('checkselected');
}
else{
$(this).parent().parent().addClass('checkselected');
}
});
$('[id^=checkbox-all_delete_messages]').change(function(){
if ($("#checkbox-all_delete_messages").prop("checked")) {
$('[id^=checkbox-delete_multiple_messages]').parent().parent().addClass('checkselected');
$(".check_delete_messages").prop("checked", true);
}
else{
$('[id^=checkbox-delete_multiple_messages]').parent().parent().removeClass('checkselected');
$(".check_delete_messages").prop("checked", false);
}
});
});
</script>