introduce hooks for issue change
This commit is contained in:
parent
61f69f812f
commit
ca0642adc4
@ -8,7 +8,8 @@ Changelog
|
||||
- D3 7.3.0 support
|
||||
- Updated clipboardJS to 2.0.10
|
||||
- d3plus 2.0.1 support
|
||||
- support controller_issues_edit_after_save hook for status change and assign to me
|
||||
- introduce hooks controller_additionals_assign_to_me_before_save, controller_additionals_assign_to_me_after_save (see #127)
|
||||
- introduce hooks controller_additionals_change_status_before_save, controller_additionals_change_status_after_save (see #127)
|
||||
|
||||
3.0.4
|
||||
+++++
|
||||
|
@ -16,15 +16,20 @@ class AdditionalsAssignToMeController < ApplicationController
|
||||
@issue.init_journal User.current
|
||||
@issue.assigned_to = User.current
|
||||
|
||||
call_hook :controller_additionals_assign_to_me_before_save,
|
||||
params: params,
|
||||
issue: @issue,
|
||||
journal: @issue.current_journal
|
||||
|
||||
if !@issue.save || old_user == @issue.assigned_to
|
||||
flash[:error] = l :error_issues_could_not_be_assigned_to_me
|
||||
return redirect_to(issue_path(@issue))
|
||||
end
|
||||
|
||||
call_hook :controller_issues_edit_after_save, params: params,
|
||||
issue: @issue,
|
||||
time_entry: nil,
|
||||
journal: @issue.current_journal
|
||||
call_hook :controller_additionals_assign_to_me_after_save,
|
||||
params: params,
|
||||
issue: @issue,
|
||||
journal: @issue.current_journal
|
||||
|
||||
last_journal = @issue.journals.visible.order(:created_on).last
|
||||
return redirect_to(issue_path(@issue)) unless last_journal
|
||||
|
@ -19,15 +19,20 @@ class AdditionalsChangeStatusController < ApplicationController
|
||||
@issue.status_id = new_status_id
|
||||
@issue.assigned_to = User.current if @issue.status_x_affected?(new_status_id) && issue_old_user != User.current
|
||||
|
||||
call_hook :controller_additionals_change_status_before_save,
|
||||
params: params,
|
||||
issue: @issue,
|
||||
journal: @issue.current_journal
|
||||
|
||||
if !@issue.save || issue_old_status_id == @issue.status_id
|
||||
flash[:error] = l :error_issue_status_could_not_changed
|
||||
return redirect_to(issue_path(@issue))
|
||||
end
|
||||
|
||||
call_hook :controller_issues_edit_after_save, params: params,
|
||||
issue: @issue,
|
||||
time_entry: nil,
|
||||
journal: @issue.current_journal
|
||||
call_hook :controller_additionals_change_status_after_save,
|
||||
params: params,
|
||||
issue: @issue,
|
||||
journal: @issue.current_journal
|
||||
|
||||
last_journal = @issue.journals.visible.order(:created_on).last
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user