Skip to content

Commit

Permalink
Refresh page when event gets saved/deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Jan 24, 2024
1 parent 9e8e87d commit d0a1435
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/org/openpsa/expenses/style/hours_week.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
$time = $data['week_start'];
$date_columns = [];

$data['grid']->set_column('task', $data['l10n']->get('task'), '', 'string')
->set_column('person', $data['l10n']->get('person'), '', 'string');
$data['grid']
->set_column('task', $data['l10n']->get('task'), '', 'string')
->set_column('person', $data['l10n']->get('person'), '', 'string');

$formatter = $data['l10n']->get_formatter();
while ($time < $data['week_end']) {
Expand Down Expand Up @@ -47,9 +48,10 @@ function calculate_subtotal(val, name, record)
midcom_grid_helper.bind_grouping_switch('&(grid_id);');

var grid = $("#&(grid_id);"),
date_columns = <?php echo json_encode($date_columns); ?>,
totals = {},
day_total;
date_columns = <?php echo json_encode($date_columns); ?>,
totals = {},
day_total;

date_columns.forEach(function(name) {
day_total = 0;
grid.jqGrid('getCol', 'index_' + name).forEach(function(value) {
Expand All @@ -58,4 +60,9 @@ function calculate_subtotal(val, name, record)
totals[name] = Math.round(day_total * 100) / 100;
});
grid.jqGrid('footerData', 'set', totals);

$('body')
.on('dialogsaved, dialogdeleted', '#midcom-dialog', function() {
location.href = location.href;
});
</script>

0 comments on commit d0a1435

Please sign in to comment.