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
eb548d7e
Commit
eb548d7e
authored
Jun 01, 2023
by
Nguyen Vo Huy Hoang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/new_workflow' into 'master'
Feature/new workflow See merge request
!5
parents
f731ac94
22abb71c
Pipeline
#1551
failed with stages
in 0 seconds
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
88 additions
and
13 deletions
+88
-13
app/controllers/issues_controller.rb
+2
-2
app/helpers/issues_helper.rb
+2
-0
app/helpers/timelog_helper.rb
+16
-2
app/models/time_entry_activity.rb
+7
-7
app/views/context_menus/issues.html.erb
+56
-0
config/application.rb
+1
-1
lib/redmine/helpers/time_report.rb
+4
-1
No files found.
app/controllers/issues_controller.rb
View file @
eb548d7e
...
...
@@ -617,11 +617,11 @@ class IssuesController < ApplicationController
exclude_project_ids
=
[
106
,
107
,
108
,
109
,
110
,
111
]
#2zigexn
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
=
Issue
.
new
(
issue
.
attributes
.
except
(
'id'
,
'created_on'
,
'updated_on'
))
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
.
estimated_hours
=
nil
subtask
.
save!
...
...
app/helpers/issues_helper.rb
View file @
eb548d7e
...
...
@@ -98,6 +98,8 @@ module IssuesHelper
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'
,
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'
,
child
.
disabled_core_fields
.
include?
(
'done_ratio'
)
?
''
:
progress_bar
(
child
.
done_ratio
),
:class
=>
'done_ratio'
),
:class
=>
css
)
...
...
app/helpers/timelog_helper.rb
View file @
eb548d7e
...
...
@@ -39,11 +39,25 @@ module TimelogHelper
end
collection
+=
case
@issue
&
.
tracker
&
.
name
when
'Task'
@issue
.
is_task_with_target?
?
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
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
])
}
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?
}
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
])
}
else
activities
.
collect
{
|
a
|
[
a
.
name
,
a
.
id
]
if
a
.
is_activity_for_task?
}
end
when
'User story'
[]
when
'Support'
...
...
app/models/time_entry_activity.rb
View file @
eb548d7e
...
...
@@ -21,11 +21,11 @@ class TimeEntryActivity < Enumeration
OptionName
=
:enumeration_activities
TASK_BUGS_ACTIVITIES
=
[
"
Estimation"
,
"
Communication"
,
"
Coding"
,
"Code Review"
,
"
Requirement"
,
"Design"
,
"Release"
,
"Reworking"
,
"
Create Test-case"
,
"
Testing"
,
"
Research - Investigate
"
"
2. Estimation"
,
"1.
Communication"
,
"
3. Coding"
,
"3. Code Review"
,
"1.
Requirement"
,
"Design"
,
"
6.
Release"
,
"Reworking"
,
"
4. Create Test-case"
,
"4.
Testing"
,
"
2. Research - Investigate
"
].
freeze
TASK_WITH_TARGET_ACTIVITIES
=
[
...
...
@@ -57,10 +57,10 @@ class TimeEntryActivity < Enumeration
end
def
is_activity_for_support?
SUPPORT_ACTIVITIES
.
include?
name
SUPPORT_ACTIVITIES
.
include?
name
&
.
strip
end
def
is_task_with_target?
TASK_WITH_TARGET_ACTIVITIES
.
include?
name
TASK_WITH_TARGET_ACTIVITIES
.
include?
name
&
.
strip
end
end
app/views/context_menus/issues.html.erb
View file @
eb548d7e
...
...
@@ -117,6 +117,52 @@
</li>
<%
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
]
%>
<li
class=
"folder"
>
<a
href=
"#"
class=
"submenu"
>
<%=
l
(
:label_issue_watchers
)
%>
</a>
...
...
@@ -154,3 +200,13 @@
<%=
call_hook
(
:view_issues_context_menu_end
,
{
:issues
=>
@issues
,
:can
=>
@can
,
:back
=>
@back
})
%>
</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
%>
config/application.rb
View file @
eb548d7e
...
...
@@ -42,7 +42,7 @@ module RedmineApp
# Version of your assets, change this if you want to expire all your assets
config
.
assets
.
version
=
'1.0'
config
.
action_mailer
.
perform_deliveries
=
fals
e
config
.
action_mailer
.
perform_deliveries
=
tru
e
# Do not include all helpers
config
.
action_controller
.
include_all_helpers
=
false
...
...
lib/redmine/helpers/time_report.rb
View file @
eb548d7e
...
...
@@ -125,7 +125,10 @@ module Redmine
:label
=>
:label_activity
},
'issue'
=>
{
:sql
=>
"
#{
TimeEntry
.
table_name
}
.issue_id"
,
:klass
=>
Issue
,
:label
=>
:label_issue
}
:label
=>
:label_issue
},
'parent_issue'
=>
{
:sql
=>
"
#{
Issue
.
table_name
}
.parent_id"
,
:klass
=>
Issue
,
:label
=>
:field_parent_issue
}
}
# Add time entry custom fields
...
...
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