From 8dea5b4aa1d61cccb03e2ba851f6744632a287a0 Mon Sep 17 00:00:00 2001 From: Kevin Porras Date: Thu, 6 May 2021 14:00:03 -0600 Subject: [PATCH 1/2] refs #27690: Switching from details to spent time report should have is or subproject operator. --- .../redmine-time-entries-report.js | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/assets/javascripts/redmine-time-entries-report.js b/assets/javascripts/redmine-time-entries-report.js index 465e013..2ee6f2d 100644 --- a/assets/javascripts/redmine-time-entries-report.js +++ b/assets/javascripts/redmine-time-entries-report.js @@ -1,13 +1,21 @@ $(document).ready(function() { const urlParams = new URLSearchParams(window.location.search); var criteria = urlParams.getAll('criteria[]'); - // If urlParams are not set it's the first load of the page. - if (criteria.length === 0 && $("input[name='criteria[]']").length) { - $("input[name='criteria[]']").each(function() { - criteria.push($(this).val()); - }); - // If it's the first page load, use project_id hidden field. - setTimeout(function() { + + setTimeout(function() { + // Add subproject operator. + if ($("#operators_project_id").length) { + $("#operators_project_id").append(""); + if (!urlParams.get('op[project_id]') || urlParams.get('op[project_id]') === '=*') { + $('#operators_project_id').val('=*'); + } + } + // If urlParams are not set it's the first load of the page. + if (criteria.length === 0 && $("input[name='criteria[]']").length) { + $("input[name='criteria[]']").each(function() { + criteria.push($(this).val()); + }); + // Use project_id hidden field if it's the first page load. if ($('input[type=hidden][name=project_id]').length) { var project_id = $('input[type=hidden][name=project_id]').val(); $('select[name="v[project_id][]"] option').each(function() { @@ -18,8 +26,8 @@ $(document).ready(function() { } }); } - }, 100); - } + } + }, 100); // Week title attribute. if ($('#columns option:selected').val() == 'week') { @@ -51,16 +59,6 @@ $(document).ready(function() { } } - // Add subproject operator. - setTimeout(function() { - if ($("#operators_project_id").length) { - $("#operators_project_id").append(""); - if (!urlParams.get('op[project_id]') || urlParams.get('op[project_id]') === '=*') { - $('#operators_project_id').val('=*'); - } - } - }, 100); - if (criteria.length) { if ($('#time-report th')[criteria.length - 1]) { var originalCriteria = []; From cb5d4cdccf5b9b2e2d23e91b85e9a0d32d528a20 Mon Sep 17 00:00:00 2001 From: Kirk Brown Date: Thu, 16 May 2024 15:04:55 -0400 Subject: [PATCH 2/2] refs #27690: Update for merge conflicts. --- assets/javascripts/redmine-time-entries-report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/javascripts/redmine-time-entries-report.js b/assets/javascripts/redmine-time-entries-report.js index 2ee6f2d..eb41bb9 100644 --- a/assets/javascripts/redmine-time-entries-report.js +++ b/assets/javascripts/redmine-time-entries-report.js @@ -225,4 +225,4 @@ $(document).ready(function() { } makeLinksAbsolute(); -}); \ No newline at end of file +});