Commit eb548d7e by Nguyen Vo Huy Hoang

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
...@@ -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!
......
...@@ -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)
......
...@@ -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'
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 'User story' when 'User story'
[] []
when 'Support' when 'Support'
......
...@@ -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
...@@ -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 %>
...@@ -42,7 +42,7 @@ module RedmineApp ...@@ -42,7 +42,7 @@ module RedmineApp
# Version of your assets, change this if you want to expire all your assets # Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0' config.assets.version = '1.0'
config.action_mailer.perform_deliveries = false config.action_mailer.perform_deliveries = true
# Do not include all helpers # Do not include all helpers
config.action_controller.include_all_helpers = false config.action_controller.include_all_helpers = false
......
...@@ -125,7 +125,10 @@ module Redmine ...@@ -125,7 +125,10 @@ module Redmine
:label => :label_activity}, :label => :label_activity},
'issue' => {:sql => "#{TimeEntry.table_name}.issue_id", 'issue' => {:sql => "#{TimeEntry.table_name}.issue_id",
:klass => Issue, :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 # Add time entry custom fields
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment