Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redmine_v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
redmine_v2
Commits
6a82e8a1
Commit
6a82e8a1
authored
Jun 12, 2023
by
Nguyen Vo Huy Hoang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add issue report
parent
eb548d7e
Pipeline
#1552
canceled with stages
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
0 deletions
+66
-0
app/controllers/reports_controller.rb
+1
-0
app/models/issue.rb
+21
-0
app/views/reports/issue_report.html.erb
+44
-0
No files found.
app/controllers/reports_controller.rb
View file @
6a82e8a1
...
@@ -35,6 +35,7 @@ class ReportsController < ApplicationController
...
@@ -35,6 +35,7 @@ class ReportsController < ApplicationController
@issues_by_assigned_to
=
Issue
.
by_assigned_to
(
@project
)
@issues_by_assigned_to
=
Issue
.
by_assigned_to
(
@project
)
@issues_by_author
=
Issue
.
by_author
(
@project
)
@issues_by_author
=
Issue
.
by_author
(
@project
)
@issues_by_subproject
=
Issue
.
by_subproject
(
@project
)
||
[]
@issues_by_subproject
=
Issue
.
by_subproject
(
@project
)
||
[]
@issue_by_custom
=
Issue
.
by_custom_issues
(
@project
)
render
:template
=>
"reports/issue_report"
render
:template
=>
"reports/issue_report"
end
end
...
...
app/models/issue.rb
View file @
6a82e8a1
...
@@ -1496,6 +1496,27 @@ class Issue < ActiveRecord::Base
...
@@ -1496,6 +1496,27 @@ class Issue < ActiveRecord::Base
r
.
reject
{
|
r
|
r
[
"project_id"
]
==
project
.
id
.
to_s
}
r
.
reject
{
|
r
|
r
[
"project_id"
]
==
project
.
id
.
to_s
}
end
end
def
self
.
by_custom_issues
(
project
)
root_id
=
TimeEntry
.
joins
(
:issue
).
select
(
:root_id
).
where
({
:tyear
=>
Date
.
current
.
year
,
:tmonth
=>
Date
.
current
.
month
}).
group
(
:root_id
)
self
.
find_by_sql
([
"select * from (
select a.tracker_id, a.root_id, id,subject, due_date, estimated_hours, hours,activity,status,target_version,name,created_on, closed_on,lead_time,spent_on from (
SELECT tracker_id,root_id,subject, due_date, estimated_hours, issue_statuses.name as status, versions.name as target_version, projects.name, issues.created_on, issues.closed_on, DATEDIFF(issues.closed_on,issues.created_on) as lead_time
FROM issues INNER JOIN `projects` ON `projects`.`id` = `issues`.`project_id`
JOIN `issue_statuses` ON status_id=issue_statuses.id
LEFT JOIN `versions` ON fixed_version_id = versions.id
where issues.id in (?) and tracker_id != 1 # not bug
) a
JOIN
(SELECT root_id, hours, enumerations.name as activity, issues.id, spent_on
FROM issues
INNER JOIN `time_entries` ON `issues`.`id` = `time_entries`.`issue_id`
LEFT OUTER JOIN `enumerations` ON `enumerations`.`id` = `time_entries`.`activity_id` AND `enumerations`.`type` IN ('TimeEntryActivity')
where root_id in (?)
order by spent_on desc
) b
on a.root_id = b.root_id) as total"
,
root_id
,
root_id
])
end
# Query generator for selecting groups of issue counts for a project
# Query generator for selecting groups of issue counts for a project
# based on specific criteria
# based on specific criteria
#
#
...
...
app/views/reports/issue_report.html.erb
View file @
6a82e8a1
<h2>
<%=
l
(
:label_report_plural
)
%>
</h2>
<h2>
<%=
l
(
:label_report_plural
)
%>
</h2>
<div>
<canvas
id=
"myChart"
></canvas>
</div>
<script
src=
"https://cdn.jsdelivr.net/npm/chart.js"
></script>
<script>
const
ctx
=
document
.
getElementById
(
'myChart'
);
new
Chart
(
ctx
,
{
type
:
'bar'
,
data
:
{
labels
:
[
'Red'
,
'Blue'
,
'Yellow'
,
'Green'
,
'Purple'
,
'Orange'
],
datasets
:
[{
label
:
'# of Votes'
,
data
:
[
12
,
19
,
3
,
5
,
2
,
3
],
borderWidth
:
1
}]
},
options
:
{
scales
:
{
y
:
{
beginAtZero
:
true
}
}
}
});
</script>
<h3>
<%=
l
(
:field_issue
)
%>
<%=
link_to
l
(
:label_details
),
project_issues_report_details_path
(
@project
,
:detail
=>
'tracker'
),
:class
=>
'icon-only icon-zoom-in'
,
:title
=>
l
(
:label_details
)
%>
Open/closed at the moment per target version, speed
your average speed, open/closed rate
</h3>
<%=
render
:partial
=>
'simple'
,
:locals
=>
{
:data
=>
@issue_by_custom
,
:field_name
=>
"tracker_id"
,
:rows
=>
@trackers
}
%>
<br
/>
<h3>
Possible delay tasks. Its depend on estimate/closed of "open" tasks
</h3>
<div
class=
"splitcontentleft"
>
<div
class=
"splitcontentleft"
>
<h3>
<h3>
<%=
l
(
:field_tracker
)
%>
<%=
l
(
:field_tracker
)
%>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment