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
8636b97c
Commit
8636b97c
authored
Jun 16, 2023
by
Nguyen Vo Huy Hoang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/update_report_and_fixbug' into 'master'
Update report and fixbug See merge request
!7
parents
eb548d7e
63e59bd2
Pipeline
#1554
failed with stages
in 0 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
13 deletions
+19
-13
app/helpers/timelog_helper.rb
+10
-8
app/views/context_menus/issues.html.erb
+6
-2
app/views/timelog/_report_criteria.html.erb
+1
-1
plugins/redmine_work_time/app/views/work_time/_user_day_table.html.erb
+2
-2
No files found.
app/helpers/timelog_helper.rb
View file @
8636b97c
...
...
@@ -25,6 +25,8 @@ module TimelogHelper
def
activity_collection_for_select_options
(
time_entry
=
nil
,
project
=
nil
)
project
||=
time_entry
.
try
(
:project
)
project
||=
@project
issue
=
@issue
issue
||=
time_entry
.
issue
if
project
.
nil?
activities
=
TimeEntryActivity
.
shared
.
active
else
...
...
@@ -37,24 +39,24 @@ module TimelogHelper
else
collection
<<
[
"---
#{
l
(
:actionview_instancetag_blank_option
)
}
---"
,
''
]
unless
activities
.
detect
(
&
:is_default
)
end
collection
+=
case
@
issue
&
.
tracker
&
.
name
collection
+=
case
issue
&
.
tracker
&
.
name
when
'Task'
if
@
issue
.
is_task_with_target?
if
issue
.
is_task_with_target?
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_task_with_target?
}
elsif
@
issue
.
parent
&
.
tracker
&
.
name
==
'User story'
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
name
[
0
,
1
].
to_i
!=
0
&&
@
issue
.
subject
.
include?
(
a
.
name
[
0
,
2
])
}
elsif
issue
.
parent
&
.
tracker
&
.
name
==
'User story'
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
name
[
0
,
1
].
to_i
!=
0
&&
issue
.
subject
.
include?
(
a
.
name
[
0
,
2
])
}
else
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
end
when
'Test'
if
@
issue
.
parent
&
.
tracker
&
.
name
==
'User story'
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
name
[
0
,
1
].
to_i
!=
0
&&
@
issue
.
subject
.
include?
(
a
.
name
[
0
,
2
])
}
if
issue
.
parent
&
.
tracker
&
.
name
==
'User story'
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
name
[
0
,
1
].
to_i
!=
0
&&
issue
.
subject
.
include?
(
a
.
name
[
0
,
2
])
}
else
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
end
when
'Bug'
if
@
issue
.
parent
&
.
tracker
&
.
name
==
'User story'
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
name
[
0
,
1
].
to_i
!=
0
&&
@
issue
.
subject
.
include?
(
a
.
name
[
0
,
2
])
}
if
issue
.
parent
&
.
tracker
&
.
name
==
'User story'
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
name
[
0
,
1
].
to_i
!=
0
&&
issue
.
subject
.
include?
(
a
.
name
[
0
,
2
])
}
else
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
end
...
...
app/views/context_menus/issues.html.erb
View file @
8636b97c
...
...
@@ -144,7 +144,7 @@
</div>
<%
end
%>
<%
if
@
issue
.
tracker
.
name
!=
'User story'
&&
@safe_attributes
.
include?
(
'estimated_hours'
)
%>
<%
if
@
safe_attributes
.
include?
(
'estimated_hours'
)
&&
!
@issue
.
nil?
&&
@issue
.
tracker
.
name
!=
'User story'
%>
<li>
<%=
context_menu_link
"
#{
l
(
:field_estimated_hours
)
}
"
,
'#'
,
:onclick
=>
"showModal('bulk_update_estimation', '350px'); return false;"
%>
</li>
<div
id=
"bulk_update_estimation"
style=
"display:none;"
>
<h3
class=
"title"
>
<%=
"
#{
l
(
:field_estimated_hours
)
}
"
%>
</h3>
...
...
@@ -152,7 +152,11 @@
<%
if
@safe_attributes
.
include?
(
'estimated_hours'
)
%>
<p>
<label
for=
'issue_estimated_hours'
>
<%=
l
(
:field_estimated_hours
)
%>
</label>
<%=
text_field_tag
'issue[estimated_hours]'
,
''
,
:value
=>
(
@issue
?
@issue
.
estimated_hours
:
nil
),
:size
=>
10
%>
<%=
text_field_tag
'issue[estimated_hours]'
,
''
,
:value
=>
(
@issue
?
@issue
.
estimated_hours
:
nil
),
:size
=>
21
%>
</p>
<p>
<label
for=
'issue_notes'
style=
'margin-right: 58px;'
>
<%=
l
(
:field_notes
)
%>
</label>
<%=
text_area_tag
'issue[notes]'
,
''
,
:value
=>
nil
,
rows:
5
,
cols:
20
%>
</p>
<%
end
%>
<p
class=
"buttons"
>
...
...
app/views/timelog/_report_criteria.html.erb
View file @
8636b97c
...
...
@@ -8,7 +8,7 @@
<%
total
=
0
-%>
<%
@report
.
periods
.
each
do
|
period
|
-%>
<%
sum
=
sum_hours
(
select_hours
(
hours_for_value
,
@report
.
columns
,
period
.
to_s
));
total
+=
sum
-%>
<td
class=
"hours"
>
<%=
html_hours
(
format_hours
(
sum
))
if
sum
>
0
%>
</td>
<td
class=
"hours"
style=
"
<%=
'color: red;'
if
sum
!=
8
&&
@report
.
columns
==
'day'
&&
level
==
0
%>
"
>
<%=
if
sum
>
0
then
html_hours
(
format_hours
(
sum
))
elsif
level
==
0
then
'N/A'
end
%>
</td>
<%
end
-%>
<td
class=
"hours"
>
<%=
html_hours
(
format_hours
(
total
))
if
total
>
0
%>
</td>
</tr>
...
...
plugins/redmine_work_time/app/views/work_time/_user_day_table.html.erb
View file @
8636b97c
...
...
@@ -134,7 +134,7 @@ prj_pack[:odr_issues].each do |issue_pack|
</td>
<%
end
%>
<td>
<%=
select_tag
"new_time_entry["
+
issue_id
.
to_s
+
"][0][activity_id]"
,
options_for_select
(
activities
,
activity_default
)
%>
<%=
select_tag
"new_time_entry["
+
issue_id
.
to_s
+
"][0][activity_id]"
,
options_for_select
(
activities
.
sort_by
{
|
w
|
issue
.
subject
.
include?
(
w
[
0
][
0
,
2
])
?
0
:
1
}
,
activity_default
)
%>
</td>
<td>
<%
if
issue
.
new_statuses_allowed_to
(
User
.
current
).
length
==
0
then
%>
...
...
@@ -229,7 +229,7 @@ prj_pack[:odr_issues].each do |issue_pack|
</td>
<%
end
%>
<td>
<%=
select_tag
"time_entry["
+
hour_id
.
to_s
+
"][activity_id]"
,
options_for_select
(
activities
,
hour
.
activity_id
),
:required
=>
true
%>
<%=
select_tag
"time_entry["
+
hour_id
.
to_s
+
"][activity_id]"
,
options_for_select
(
activities
.
sort_by
{
|
w
|
issue
.
subject
.
include?
(
w
[
0
][
0
,
2
])
?
0
:
1
}
,
hour
.
activity_id
),
:required
=>
true
%>
</td>
<td>
<%
if
issue
.
new_statuses_allowed_to
(
User
.
current
).
length
==
0
then
%>
...
...
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