mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Reporting view new style
This commit is contained in:
parent
1d28762d22
commit
8d44bb7af1
@ -42,7 +42,7 @@ switch ($action) {
|
|||||||
default:
|
default:
|
||||||
case 'new':
|
case 'new':
|
||||||
$actionButtons = html_print_submit_button(
|
$actionButtons = html_print_submit_button(
|
||||||
__('Save'),
|
__('Create'),
|
||||||
'add',
|
'add',
|
||||||
false,
|
false,
|
||||||
[ 'icon' => 'next' ],
|
[ 'icon' => 'next' ],
|
||||||
@ -66,26 +66,36 @@ switch ($action) {
|
|||||||
$table = new stdClass();
|
$table = new stdClass();
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->id = 'add_alert_table';
|
$table->id = 'add_alert_table';
|
||||||
$table->class = 'databox filters';
|
|
||||||
$table->head = [];
|
$table->head = [];
|
||||||
|
$table->data = [];
|
||||||
|
$table->size = [];
|
||||||
|
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
|
$table->class = 'databox filters';
|
||||||
$table->head[0] = __('Main data');
|
$table->head[0] = __('Main data');
|
||||||
$table->head_colspan[0] = 4;
|
$table->head_colspan[0] = 4;
|
||||||
$table->headstyle[0] = 'text-align: center';
|
$table->headstyle[0] = 'text-align: center';
|
||||||
}
|
|
||||||
|
|
||||||
$table->data = [];
|
|
||||||
$table->size = [];
|
|
||||||
$table->size = [];
|
|
||||||
$table->size[0] = '15%';
|
$table->size[0] = '15%';
|
||||||
$table->size[1] = '90%';
|
$table->size[1] = '90%';
|
||||||
if (is_metaconsole() === false) {
|
|
||||||
$table->style[0] = 'font-weight: bold; vertical-align: top;';
|
$table->style[0] = 'font-weight: bold; vertical-align: top;';
|
||||||
} else {
|
} else {
|
||||||
$table->style[0] = 'font-weight: bold;';
|
$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,
|
||||||
|
'AR',
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
'id_grupo'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
$table->data['name'][0] = __('Name');
|
$table->data['name'][0] = __('Name');
|
||||||
$table->data['name'][1] = html_print_input_text(
|
$table->data['name'][1] = html_print_input_text(
|
||||||
'name',
|
'name',
|
||||||
@ -99,14 +109,21 @@ $table->data['name'][1] = html_print_input_text(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$table->data['group'][0] = __('Group');
|
$table->data['group'][0] = __('Group');
|
||||||
$write_groups = users_get_groups_for_select(
|
} else {
|
||||||
|
$table->data[0][0] = html_print_label_input_block(
|
||||||
|
__('Name'),
|
||||||
|
html_print_input_text(
|
||||||
|
'name',
|
||||||
|
$reportName,
|
||||||
|
__('Name'),
|
||||||
false,
|
false,
|
||||||
'AR',
|
100,
|
||||||
true,
|
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
'id_grupo'
|
true
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// If the report group is not among the
|
// If the report group is not among the
|
||||||
// RW groups (special permission) we add it.
|
// RW groups (special permission) we add it.
|
||||||
@ -120,6 +137,7 @@ if (users_can_manage_group_all('RW') === true) {
|
|||||||
$return_all_group = true;
|
$return_all_group = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
$table->data['group'][1] = '<div class="w290px inline">';
|
$table->data['group'][1] = '<div class="w290px inline">';
|
||||||
$table->data['group'][1] .= html_print_input(
|
$table->data['group'][1] .= html_print_input(
|
||||||
[
|
[
|
||||||
@ -137,6 +155,26 @@ $table->data['group'][1] .= html_print_input(
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
$table->data['group'][1] .= '</div>';
|
$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 ($report_id_user == $config['id_user']
|
if ($report_id_user == $config['id_user']
|
||||||
|| is_user_admin($config['id_user'])
|
|| is_user_admin($config['id_user'])
|
||||||
@ -147,6 +185,7 @@ if ($report_id_user == $config['id_user']
|
|||||||
'group_edit' => __('The next group can edit the report'),
|
'group_edit' => __('The next group can edit the report'),
|
||||||
'user_edit' => __('Only the user and admin user 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] = __('Write Access');
|
||||||
$table->data['access'][0] .= ui_print_help_tip(
|
$table->data['access'][0] .= 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.'),
|
__('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.'),
|
||||||
@ -162,12 +201,12 @@ if ($report_id_user == $config['id_user']
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
$style = 'display: none;';
|
$class = ' invisible_important ';
|
||||||
if ($type_access_selected == 'group_edit') {
|
if ($type_access_selected == 'group_edit') {
|
||||||
$style = '';
|
$class = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->data['access'][1] .= '<span style="'.$style.'" class="access_subform" id="group_edit">';
|
$table->data['access'][1] .= '<span class="access_subform'.$class.'" id="group_edit">';
|
||||||
$table->data['access'][1] .= '<div class="w290px inline">';
|
$table->data['access'][1] .= '<div class="w290px inline">';
|
||||||
$table->data['access'][1] .= html_print_select_groups(
|
$table->data['access'][1] .= html_print_select_groups(
|
||||||
false,
|
false,
|
||||||
@ -182,6 +221,45 @@ if ($report_id_user == $config['id_user']
|
|||||||
);
|
);
|
||||||
$table->data['access'][1] .= '</div>';
|
$table->data['access'][1] .= '</div>';
|
||||||
$table->data['access'][1] .= '</span>';
|
$table->data['access'][1] .= '</span>';
|
||||||
|
} else {
|
||||||
|
$table->data[1][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[1][1] = html_print_label_input_block(
|
||||||
|
__('Group'),
|
||||||
|
html_print_select_groups(
|
||||||
|
false,
|
||||||
|
'RW',
|
||||||
|
false,
|
||||||
|
'id_group_edit',
|
||||||
|
$id_group_edit,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
true
|
||||||
|
),
|
||||||
|
$options
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($enterpriseEnable) {
|
if ($enterpriseEnable) {
|
||||||
@ -190,6 +268,7 @@ if ($enterpriseEnable) {
|
|||||||
$non_interactive_check = $non_interactive;
|
$non_interactive_check = $non_interactive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
$table->data['interactive_report'][0] = __('Non interactive report');
|
$table->data['interactive_report'][0] = __('Non interactive report');
|
||||||
$table->data['interactive_report'][1] .= html_print_checkbox_switch(
|
$table->data['interactive_report'][1] .= html_print_checkbox_switch(
|
||||||
'non_interactive',
|
'non_interactive',
|
||||||
@ -197,8 +276,20 @@ if ($enterpriseEnable) {
|
|||||||
$non_interactive_check,
|
$non_interactive_check,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
$table->data[2][0] = html_print_label_input_block(
|
||||||
|
__('Non interactive report'),
|
||||||
|
html_print_checkbox_switch(
|
||||||
|
'non_interactive',
|
||||||
|
1,
|
||||||
|
$non_interactive_check,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
$table->data['description'][0] = __('Description');
|
$table->data['description'][0] = __('Description');
|
||||||
$table->data['description'][1] = html_print_textarea(
|
$table->data['description'][1] = html_print_textarea(
|
||||||
'description',
|
'description',
|
||||||
@ -208,8 +299,22 @@ $table->data['description'][1] = html_print_textarea(
|
|||||||
'',
|
'',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
$table->data[2][1] = html_print_label_input_block(
|
||||||
|
__('Description'),
|
||||||
|
html_print_textarea(
|
||||||
|
'description',
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
$description,
|
||||||
|
'',
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (enterprise_installed() === true) {
|
if (enterprise_installed() === true) {
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
$table->data['cover'][0] = __('Generate cover page in PDF render');
|
$table->data['cover'][0] = __('Generate cover page in PDF render');
|
||||||
$table->data['cover'][1] = html_print_checkbox_switch(
|
$table->data['cover'][1] = html_print_checkbox_switch(
|
||||||
'cover_page_render',
|
'cover_page_render',
|
||||||
@ -225,6 +330,27 @@ if (enterprise_installed() === true) {
|
|||||||
$index_render,
|
$index_render,
|
||||||
true
|
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">';
|
echo '<form class="" method="post">';
|
||||||
@ -238,11 +364,10 @@ echo '</div></form>';
|
|||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function change_type_access(select_item) {
|
function change_type_access(select_item) {
|
||||||
$(".access_subform").hide();
|
|
||||||
if ($(select_item).val() == "group_edit") {
|
if ($(select_item).val() == "group_edit") {
|
||||||
$("#group_edit").show()
|
$("#group_edit").removeClass('invisible_important');
|
||||||
} else {
|
} else {
|
||||||
$("#group_edit").hide()
|
$("#group_edit").addClass('invisible_important');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -46,35 +46,14 @@ function dialog_message(message_id) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('[id^=checkbox-massive_report_check]').change(function(){
|
|
||||||
if($(this).parent().parent().parent().hasClass('checkselected')){
|
|
||||||
$(this).parent().parent().parent().removeClass('checkselected');
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$(this).parent().parent().parent().addClass('checkselected');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('[id^=checkbox-all_delete]').change(function(){
|
$('[id^=checkbox-all_delete]').change(function(){
|
||||||
if ($("#checkbox-all_delete").prop("checked")) {
|
if ($("#checkbox-all_delete").prop("checked")) {
|
||||||
$('[id^=checkbox-massive_report_check]')
|
|
||||||
.parent()
|
|
||||||
.parent()
|
|
||||||
.parent()
|
|
||||||
.addClass('checkselected');
|
|
||||||
$(".check_delete").prop("checked", true);
|
$(".check_delete").prop("checked", true);
|
||||||
console.log($('.check_delete'));
|
|
||||||
$('.check_delete').each(function(){
|
$('.check_delete').each(function(){
|
||||||
$('#hidden-id_report_'+$(this).val()).prop("disabled", false);
|
$('#hidden-id_report_'+$(this).val()).prop("disabled", false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$('[id^=checkbox-massive_report_check]')
|
|
||||||
.parent()
|
|
||||||
.parent()
|
|
||||||
.parent()
|
|
||||||
.removeClass('checkselected');
|
|
||||||
console.log($('.check_delete'));
|
|
||||||
$(".check_delete").prop("checked", false);
|
$(".check_delete").prop("checked", false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -752,9 +731,8 @@ switch ($action) {
|
|||||||
|
|
||||||
$table_aux = new stdClass();
|
$table_aux = new stdClass();
|
||||||
$table_aux->width = '100%';
|
$table_aux->width = '100%';
|
||||||
|
if (is_metaconsole()) {
|
||||||
$table_aux->class = 'databox filters';
|
$table_aux->class = 'databox filters';
|
||||||
$table_aux->cellpadding = 0;
|
|
||||||
$table_aux->cellspacing = 0;
|
|
||||||
|
|
||||||
$table_aux->colspan[0][0] = 4;
|
$table_aux->colspan[0][0] = 4;
|
||||||
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
|
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
|
||||||
@ -786,14 +764,59 @@ switch ($action) {
|
|||||||
);
|
);
|
||||||
$table_aux->data[0][2] .= '</b>';
|
$table_aux->data[0][2] .= '</b>';
|
||||||
$table_aux->data[0][3] = html_print_input_text(
|
$table_aux->data[0][3] = html_print_input_text(
|
||||||
'search',
|
__('search'),
|
||||||
$search,
|
$search,
|
||||||
'',
|
'',
|
||||||
30,
|
30,
|
||||||
'',
|
'',
|
||||||
true
|
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(
|
$table_aux->data[0][6] = html_print_submit_button(
|
||||||
__('Search'),
|
__('Search'),
|
||||||
'search_submit',
|
'search_submit',
|
||||||
@ -801,6 +824,7 @@ switch ($action) {
|
|||||||
'class="sub upd"',
|
'class="sub upd"',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$url_rb = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder';
|
$url_rb = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder';
|
||||||
if (is_metaconsole()) {
|
if (is_metaconsole()) {
|
||||||
@ -809,9 +833,37 @@ switch ($action) {
|
|||||||
$filter .= '</form>';
|
$filter .= '</form>';
|
||||||
ui_toggle($filter, __('Show Option'));
|
ui_toggle($filter, __('Show Option'));
|
||||||
} else {
|
} else {
|
||||||
echo '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
|
$searchForm = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
|
||||||
html_print_table($table_aux);
|
$searchForm .= html_print_table($table_aux, true);
|
||||||
echo '</form>';
|
$searchForm .= html_print_div(
|
||||||
|
[
|
||||||
|
'class' => 'action-buttons',
|
||||||
|
'content' => html_print_submit_button(
|
||||||
|
__('Search'),
|
||||||
|
'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_require_jquery_file('pandora.controls');
|
ui_require_jquery_file('pandora.controls');
|
||||||
@ -1116,7 +1168,13 @@ switch ($action) {
|
|||||||
|
|
||||||
$data[$next] = ui_print_group_icon(
|
$data[$next] = ui_print_group_icon(
|
||||||
$report['id_group'],
|
$report['id_group'],
|
||||||
true
|
true,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'invert_filter'
|
||||||
);
|
);
|
||||||
$next++;
|
$next++;
|
||||||
}
|
}
|
||||||
|
@ -10555,7 +10555,8 @@ table#simple tr td,
|
|||||||
table#advanced tr td,
|
table#advanced tr td,
|
||||||
table.principal_table tr td,
|
table.principal_table tr td,
|
||||||
.white_table_flex > table tr td,
|
.white_table_flex > table tr td,
|
||||||
.table_section table tr td {
|
.table_section table tr td,
|
||||||
|
#agent_controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -11367,3 +11368,13 @@ div[role="dialog"] {
|
|||||||
-webkit-mask: url(../../images/alert@svg.svg) no-repeat center / contain;
|
-webkit-mask: url(../../images/alert@svg.svg) no-repeat center / contain;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.flex-colum-center {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-colum-center > img {
|
||||||
|
margin: 5px;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user