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
63e59bd2
Commit
63e59bd2
authored
Jun 16, 2023
by
Nguyen Vo Huy Hoang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update report and fixbug
parent
eb548d7e
Pipeline
#1553
canceled with stages
in 0 seconds
Changes
4
Pipelines
1
Hide 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 @
63e59bd2
...
@@ -25,6 +25,8 @@ module TimelogHelper
...
@@ -25,6 +25,8 @@ module TimelogHelper
def
activity_collection_for_select_options
(
time_entry
=
nil
,
project
=
nil
)
def
activity_collection_for_select_options
(
time_entry
=
nil
,
project
=
nil
)
project
||=
time_entry
.
try
(
:project
)
project
||=
time_entry
.
try
(
:project
)
project
||=
@project
project
||=
@project
issue
=
@issue
issue
||=
time_entry
.
issue
if
project
.
nil?
if
project
.
nil?
activities
=
TimeEntryActivity
.
shared
.
active
activities
=
TimeEntryActivity
.
shared
.
active
else
else
...
@@ -37,24 +39,24 @@ module TimelogHelper
...
@@ -37,24 +39,24 @@ module TimelogHelper
else
else
collection
<<
[
"---
#{
l
(
:actionview_instancetag_blank_option
)
}
---"
,
''
]
unless
activities
.
detect
(
&
:is_default
)
collection
<<
[
"---
#{
l
(
:actionview_instancetag_blank_option
)
}
---"
,
''
]
unless
activities
.
detect
(
&
:is_default
)
end
end
collection
+=
case
@
issue
&
.
tracker
&
.
name
collection
+=
case
issue
&
.
tracker
&
.
name
when
'Task'
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?
}
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_task_with_target?
}
elsif
@
issue
.
parent
&
.
tracker
&
.
name
==
'User story'
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
])
}
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
name
[
0
,
1
].
to_i
!=
0
&&
issue
.
subject
.
include?
(
a
.
name
[
0
,
2
])
}
else
else
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
end
end
when
'Test'
when
'Test'
if
@
issue
.
parent
&
.
tracker
&
.
name
==
'User story'
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
])
}
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
name
[
0
,
1
].
to_i
!=
0
&&
issue
.
subject
.
include?
(
a
.
name
[
0
,
2
])
}
else
else
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
end
end
when
'Bug'
when
'Bug'
if
@
issue
.
parent
&
.
tracker
&
.
name
==
'User story'
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
])
}
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
name
[
0
,
1
].
to_i
!=
0
&&
issue
.
subject
.
include?
(
a
.
name
[
0
,
2
])
}
else
else
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
end
end
...
...
app/views/context_menus/issues.html.erb
View file @
63e59bd2
...
@@ -144,7 +144,7 @@
...
@@ -144,7 +144,7 @@
</div>
</div>
<%
end
%>
<%
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>
<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;"
>
<div
id=
"bulk_update_estimation"
style=
"display:none;"
>
<h3
class=
"title"
>
<%=
"
#{
l
(
:field_estimated_hours
)
}
"
%>
</h3>
<h3
class=
"title"
>
<%=
"
#{
l
(
:field_estimated_hours
)
}
"
%>
</h3>
...
@@ -152,7 +152,11 @@
...
@@ -152,7 +152,11 @@
<%
if
@safe_attributes
.
include?
(
'estimated_hours'
)
%>
<%
if
@safe_attributes
.
include?
(
'estimated_hours'
)
%>
<p>
<p>
<label
for=
'issue_estimated_hours'
>
<%=
l
(
:field_estimated_hours
)
%>
</label>
<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>
</p>
<%
end
%>
<%
end
%>
<p
class=
"buttons"
>
<p
class=
"buttons"
>
...
...
app/views/timelog/_report_criteria.html.erb
View file @
63e59bd2
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<%
total
=
0
-%>
<%
total
=
0
-%>
<%
@report
.
periods
.
each
do
|
period
|
-%>
<%
@report
.
periods
.
each
do
|
period
|
-%>
<%
sum
=
sum_hours
(
select_hours
(
hours_for_value
,
@report
.
columns
,
period
.
to_s
));
total
+=
sum
-%>
<%
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
-%>
<%
end
-%>
<td
class=
"hours"
>
<%=
html_hours
(
format_hours
(
total
))
if
total
>
0
%>
</td>
<td
class=
"hours"
>
<%=
html_hours
(
format_hours
(
total
))
if
total
>
0
%>
</td>
</tr>
</tr>
...
...
plugins/redmine_work_time/app/views/work_time/_user_day_table.html.erb
View file @
63e59bd2
...
@@ -134,7 +134,7 @@ prj_pack[:odr_issues].each do |issue_pack|
...
@@ -134,7 +134,7 @@ prj_pack[:odr_issues].each do |issue_pack|
</td>
</td>
<%
end
%>
<%
end
%>
<td>
<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>
<td>
<td>
<%
if
issue
.
new_statuses_allowed_to
(
User
.
current
).
length
==
0
then
%>
<%
if
issue
.
new_statuses_allowed_to
(
User
.
current
).
length
==
0
then
%>
...
@@ -229,7 +229,7 @@ prj_pack[:odr_issues].each do |issue_pack|
...
@@ -229,7 +229,7 @@ prj_pack[:odr_issues].each do |issue_pack|
</td>
</td>
<%
end
%>
<%
end
%>
<td>
<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>
<td>
<td>
<%
if
issue
.
new_statuses_allowed_to
(
User
.
current
).
length
==
0
then
%>
<%
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