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
673c2e5d
Commit
673c2e5d
authored
May 30, 2023
by
Nguyen Vo Huy Hoang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new workload
parent
15216523
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
12 deletions
+84
-12
app/controllers/issues_controller.rb
+2
-2
app/helpers/issues_helper.rb
+2
-0
app/helpers/timelog_helper.rb
+17
-3
app/models/time_entry_activity.rb
+7
-7
app/views/context_menus/issues.html.erb
+56
-0
No files found.
app/controllers/issues_controller.rb
View file @
673c2e5d
...
@@ -617,11 +617,11 @@ class IssuesController < ApplicationController
...
@@ -617,11 +617,11 @@ class IssuesController < ApplicationController
exclude_project_ids
=
[
106
,
107
,
108
,
109
,
110
,
111
]
#2zigexn
exclude_project_ids
=
[
106
,
107
,
108
,
109
,
110
,
111
]
#2zigexn
return
if
exclude_project_ids
.
include?
(
issue
.
project_id
)
return
if
exclude_project_ids
.
include?
(
issue
.
project_id
)
subtask_titles
=
%w(
Requirement Design Coding Code\ review Create\ Test\ case Testing Bug\ fixing
Release)
subtask_titles
=
%w(
1.\ Requirement 2.\ Design 3.\ Coding 4.\ Testing 5.\ Bug\ fixing 6.\
Release)
subtask_titles
.
each
do
|
subtask_title
|
subtask_titles
.
each
do
|
subtask_title
|
subtask
=
Issue
.
new
(
issue
.
attributes
.
except
(
'id'
,
'created_on'
,
'updated_on'
))
subtask
=
Issue
.
new
(
issue
.
attributes
.
except
(
'id'
,
'created_on'
,
'updated_on'
))
subtask
.
subject
=
subtask_title
+
' - '
+
subtask
.
subject
subtask
.
subject
=
subtask_title
+
' - '
+
subtask
.
subject
subtask
.
tracker_id
=
8
#Task
subtask
.
tracker_id
=
subtask_title
==
"4. Testing"
?
9
:
8
#Task
subtask
.
parent_issue_id
=
@issue
.
id
subtask
.
parent_issue_id
=
@issue
.
id
subtask
.
estimated_hours
=
nil
subtask
.
estimated_hours
=
nil
subtask
.
save!
subtask
.
save!
...
...
app/helpers/issues_helper.rb
View file @
673c2e5d
...
@@ -98,6 +98,8 @@ module IssuesHelper
...
@@ -98,6 +98,8 @@ module IssuesHelper
content_tag
(
'td'
,
check_box_tag
(
"ids[]"
,
child
.
id
,
false
,
:id
=>
nil
),
:class
=>
'checkbox'
)
+
content_tag
(
'td'
,
check_box_tag
(
"ids[]"
,
child
.
id
,
false
,
:id
=>
nil
),
:class
=>
'checkbox'
)
+
content_tag
(
'td'
,
link_to_issue
(
child
,
:project
=>
(
issue
.
project_id
!=
child
.
project_id
)),
:class
=>
'subject'
,
:style
=>
'width: 50%'
)
+
content_tag
(
'td'
,
link_to_issue
(
child
,
:project
=>
(
issue
.
project_id
!=
child
.
project_id
)),
:class
=>
'subject'
,
:style
=>
'width: 50%'
)
+
content_tag
(
'td'
,
select_tag
(
"status"
,
options_from_collection_for_select
(
IssueStatus
.
all
,
"id"
,
"name"
,
child
.
status
.
id
),
id:
"status_
#{
child
.
id
}
"
,
class:
"select_status"
),
:class
=>
'status'
)
+
content_tag
(
'td'
,
select_tag
(
"status"
,
options_from_collection_for_select
(
IssueStatus
.
all
,
"id"
,
"name"
,
child
.
status
.
id
),
id:
"status_
#{
child
.
id
}
"
,
class:
"select_status"
),
:class
=>
'status'
)
+
content_tag
(
'td'
,
text_field_tag
(
'esitmated_hours'
,
child
.
estimated_hours
,
disabled:
true
,
size:
10
),
:class
=>
'esitmated_hours'
)
+
content_tag
(
'td'
,
datetime_field_tag
(
'due_date'
,
child
.
due_date
,
disabled:
true
),
:class
=>
'due_date'
)
+
content_tag
(
'td'
,
link_to_user
(
child
.
assigned_to
),
:class
=>
'assigned_to'
)
+
content_tag
(
'td'
,
link_to_user
(
child
.
assigned_to
),
:class
=>
'assigned_to'
)
+
content_tag
(
'td'
,
child
.
disabled_core_fields
.
include?
(
'done_ratio'
)
?
''
:
progress_bar
(
child
.
done_ratio
),
:class
=>
'done_ratio'
),
content_tag
(
'td'
,
child
.
disabled_core_fields
.
include?
(
'done_ratio'
)
?
''
:
progress_bar
(
child
.
done_ratio
),
:class
=>
'done_ratio'
),
:class
=>
css
)
:class
=>
css
)
...
...
app/helpers/timelog_helper.rb
View file @
673c2e5d
...
@@ -39,11 +39,25 @@ module TimelogHelper
...
@@ -39,11 +39,25 @@ module TimelogHelper
end
end
collection
+=
case
@issue
&
.
tracker
&
.
name
collection
+=
case
@issue
&
.
tracker
&
.
name
when
'Task'
when
'Task'
@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'
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
])
}
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
when
'Bug'
when
'Bug'
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
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
'User story'
when
'User story'
[]
[]
when
'Support'
when
'Support'
...
...
app/models/time_entry_activity.rb
View file @
673c2e5d
...
@@ -21,11 +21,11 @@ class TimeEntryActivity < Enumeration
...
@@ -21,11 +21,11 @@ class TimeEntryActivity < Enumeration
OptionName
=
:enumeration_activities
OptionName
=
:enumeration_activities
TASK_BUGS_ACTIVITIES
=
[
TASK_BUGS_ACTIVITIES
=
[
"
Estimation"
,
"
Communication"
,
"
2. Estimation"
,
"1.
Communication"
,
"
Coding"
,
"Code Review"
,
"
Requirement"
,
"
3. Coding"
,
"3. Code Review"
,
"1.
Requirement"
,
"Design"
,
"Release"
,
"Reworking"
,
"Design"
,
"
6.
Release"
,
"Reworking"
,
"
Create Test-case"
,
"
Testing"
,
"
4. Create Test-case"
,
"4.
Testing"
,
"
Research - Investigate
"
"
2. Research - Investigate
"
].
freeze
].
freeze
TASK_WITH_TARGET_ACTIVITIES
=
[
TASK_WITH_TARGET_ACTIVITIES
=
[
...
@@ -57,10 +57,10 @@ class TimeEntryActivity < Enumeration
...
@@ -57,10 +57,10 @@ class TimeEntryActivity < Enumeration
end
end
def
is_activity_for_support?
def
is_activity_for_support?
SUPPORT_ACTIVITIES
.
include?
name
SUPPORT_ACTIVITIES
.
include?
name
&
.
strip
end
end
def
is_task_with_target?
def
is_task_with_target?
TASK_WITH_TARGET_ACTIVITIES
.
include?
name
TASK_WITH_TARGET_ACTIVITIES
.
include?
name
&
.
strip
end
end
end
end
app/views/context_menus/issues.html.erb
View file @
673c2e5d
...
@@ -117,6 +117,52 @@
...
@@ -117,6 +117,52 @@
</li>
</li>
<%
end
%>
<%
end
%>
<%
if
@safe_attributes
.
include?
(
'start_date'
)
||
@safe_attributes
.
include?
(
'due_date'
)
%>
<li>
<%=
context_menu_link
"
#{
l
(
:field_start_date
)
}
/
#{
l
(
:field_due_date
)
}
"
,
'#'
,
:onclick
=>
"showModal('bulk_update_date', '350px'); return false;"
%>
</li>
<div
id=
"bulk_update_date"
style=
"display:none;"
>
<h3
class=
"title"
>
<%=
"
#{
l
(
:field_start_date
)
}
/
#{
l
(
:field_due_date
)
}
"
%>
</h3>
<%=
form_tag
(
bulk_update_issues_path
(
:ids
=>
@issue_ids
,
:back_url
=>
@back
),
:id
=>
'bulk_update_date'
)
do
%>
<%
if
@safe_attributes
.
include?
(
'start_date'
)
%>
<p>
<label
for=
'issue_start_date'
>
<%=
l
(
:field_start_date
)
%>
</label>
<%=
date_field_tag
'issue[start_date]'
,
''
,
:value
=>
(
@issue
?
@issue
.
start_date
:
nil
),
:size
=>
10
%><%=
calendar_for
(
'issue_start_date'
)
%>
<label
class=
"inline"
>
<%=
check_box_tag
'issue[start_date]'
,
'none'
,
false
,
:id
=>
nil
,
:data
=>
{
:disables
=>
'#issue_start_date'
}
%><%=
l
(
:button_clear
)
%>
</label>
</p>
<%
end
%>
<%
if
@safe_attributes
.
include?
(
'due_date'
)
%>
<p>
<label
for=
'issue_due_date'
>
<%=
l
(
:field_due_date
)
%>
</label>
<%=
date_field_tag
'issue[due_date]'
,
''
,
:value
=>
(
@issue
?
@issue
.
due_date
:
nil
),
:size
=>
10
%><%=
calendar_for
(
'issue_due_date'
)
%>
<label
class=
"inline"
>
<%=
check_box_tag
'issue[due_date]'
,
'none'
,
false
,
:id
=>
nil
,
:data
=>
{
:disables
=>
'#issue_due_date'
}
%><%=
l
(
:button_clear
)
%>
</label>
</p>
<%
end
%>
<p
class=
"buttons"
>
<%=
button_tag
l
(
:button_submit
),
:name
=>
nil
,
:onclick
=>
"hideModal(this);$('form#bulk_update_date').submit();"
,
:data
=>
{
:disable_with
=>
false
}
%>
<%=
link_to_function
l
(
:button_cancel
),
"hideModal(this);"
%>
</p>
<%
end
%>
</div>
<%
end
%>
<%
if
@issue
.
tracker
.
name
!=
'User story'
&&
@safe_attributes
.
include?
(
'estimated_hours'
)
%>
<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>
<%=
form_tag
(
bulk_update_issues_path
(
:ids
=>
@issue_ids
,
:back_url
=>
@back
),
:id
=>
'bulk_update_estimation'
)
do
%>
<%
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
%>
</p>
<%
end
%>
<p
class=
"buttons"
>
<%=
button_tag
l
(
:button_submit
),
:name
=>
nil
,
:onclick
=>
"hideModal(this);$('form#bulk_update_estimation').submit();"
,
:data
=>
{
:disable_with
=>
false
}
%>
<%=
link_to_function
l
(
:button_cancel
),
"hideModal(this);"
%>
</p>
<%
end
%>
</div>
<%
end
%>
<%
if
@can
[
:add_watchers
]
%>
<%
if
@can
[
:add_watchers
]
%>
<li
class=
"folder"
>
<li
class=
"folder"
>
<a
href=
"#"
class=
"submenu"
>
<%=
l
(
:label_issue_watchers
)
%>
</a>
<a
href=
"#"
class=
"submenu"
>
<%=
l
(
:label_issue_watchers
)
%>
</a>
...
@@ -154,3 +200,13 @@
...
@@ -154,3 +200,13 @@
<%=
call_hook
(
:view_issues_context_menu_end
,
{
:issues
=>
@issues
,
:can
=>
@can
,
:back
=>
@back
})
%>
<%=
call_hook
(
:view_issues_context_menu_end
,
{
:issues
=>
@issues
,
:can
=>
@can
,
:back
=>
@back
})
%>
</ul>
</ul>
<%=
javascript_tag
do
%>
$('input[data-disables]').change(function() {
if ($(this).prop('checked')){
$($(this).data('disables')).attr('disabled', true).val('');
} else {
$($(this).data('disables')).attr('disabled', false);
}
});
<%
end
%>
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