Changed Hook API to use a Manager class. #1296
This commit is contained in:
@@ -233,9 +233,8 @@ class IssuesController < ApplicationController
|
||||
issue.start_date = params[:start_date] unless params[:start_date].blank?
|
||||
issue.due_date = params[:due_date] unless params[:due_date].blank?
|
||||
issue.done_ratio = params[:done_ratio] unless params[:done_ratio].blank?
|
||||
if Redmine::Plugin::Hook.hook_registered?(:issue_bulk_edit_save)
|
||||
Redmine::Plugin::Hook.call_hook(:issue_bulk_edit_save, {:params => params, :issue => issue })
|
||||
end
|
||||
|
||||
Redmine::Plugin::Hook::Manager.call_hook(:issue_bulk_edit_save, {:params => params, :issue => issue })
|
||||
|
||||
# Don't save any change to the issue if the user is not authorized to apply the requested status
|
||||
if (status.nil? || (issue.status.new_status_allowed_to?(status, current_role, issue.tracker) && issue.status = status)) && issue.save
|
||||
|
||||
@@ -87,7 +87,7 @@ module IssuesHelper
|
||||
label = l(:label_attachment)
|
||||
end
|
||||
|
||||
Redmine::Plugin::Hook.call_hook(:issues_helper_show_details, {:detail => detail, :label => label, :value => value, :old_value => old_value })
|
||||
Redmine::Plugin::Hook::Manager.call_hook(:issues_helper_show_details, {:detail => detail, :label => label, :value => value, :old_value => old_value })
|
||||
|
||||
label ||= detail.prop_key
|
||||
value ||= detail.value
|
||||
|
||||
@@ -48,8 +48,6 @@
|
||||
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
|
||||
<% end %>
|
||||
|
||||
<% if Redmine::Plugin::Hook.hook_registered?(:issue_edit) %>
|
||||
<%= Redmine::Plugin::Hook.call_hook(:issue_edit, {:project => @project, :issue => @issue, :form => f }) %>
|
||||
<% end %>
|
||||
<%= Redmine::Plugin::Hook::Manager.call_hook(:issue_edit, {:project => @project, :issue => @issue, :form => f }) %>
|
||||
|
||||
<%= wikitoolbar_for 'issue_description' %>
|
||||
|
||||
@@ -38,9 +38,7 @@
|
||||
<label><%= l(:field_done_ratio) %>:
|
||||
<%= select_tag 'done_ratio', options_for_select([[l(:label_no_change_option), '']] + (0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %></label>
|
||||
</p>
|
||||
<% if Redmine::Plugin::Hook.hook_registered?(:issue_bulk_edit) %>
|
||||
<%= Redmine::Plugin::Hook.call_hook(:issue_bulk_edit, {:project => @project, :issue => @issues }) %>
|
||||
<% end %>
|
||||
<%= Redmine::Plugin::Hook::Manager.call_hook(:issue_bulk_edit, {:project => @project, :issue => @issues }) %>
|
||||
</fieldset>
|
||||
|
||||
<fieldset><legend><%= l(:field_notes) %></legend>
|
||||
|
||||
@@ -53,9 +53,7 @@
|
||||
<%end
|
||||
end %>
|
||||
</tr>
|
||||
<% if Redmine::Plugin::Hook.hook_registered?(:issue_show) %>
|
||||
<%= Redmine::Plugin::Hook.call_hook(:issue_show, {:project => @project, :issue => @issue}) %>
|
||||
<% end %>
|
||||
<%= Redmine::Plugin::Hook::Manager.call_hook(:issue_show, {:project => @project, :issue => @issue}) %>
|
||||
|
||||
</table>
|
||||
<hr />
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
<thead>
|
||||
<th><%= l(:label_user) %></th>
|
||||
<th><%= l(:label_role) %></th>
|
||||
<% if Redmine::Plugin::Hook.hook_registered?(:project_member_list_header) %>
|
||||
<%= Redmine::Plugin::Hook.call_hook(:project_member_list_header, {:project => @project }) %>
|
||||
<% end %>
|
||||
<%= Redmine::Plugin::Hook::Manager.call_hook(:project_member_list_header, {:project => @project }) %>
|
||||
<th style="width:15%"></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -27,9 +25,7 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% if Redmine::Plugin::Hook.hook_registered?(:project_member_list_column_three) %>
|
||||
<%= Redmine::Plugin::Hook.call_hook(:project_member_list_column_three, {:project => @project, :member => member }) %>
|
||||
<% end %>
|
||||
<%= Redmine::Plugin::Hook::Manager.call_hook(:project_member_list_column_three, {:project => @project, :member => member }) %>
|
||||
|
||||
<td align="center">
|
||||
<%= link_to_remote l(:button_delete), { :url => {:controller => 'members', :action => 'destroy', :id => member},
|
||||
|
||||
Reference in New Issue
Block a user