Added several more plugin hooks:

* :controller_custom_fields_new_after_save
* :controller_custom_fields_edit_after_save
* :view_custom_fields_form_upper_box
* :view_custom_fields_form_* (type of custom field)
* :view_issue_statuses_form
* :view_issues_show_description_bottom
* :view_my_account
* :view_users_form

  #2599

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2611 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis 2009-03-21 00:22:59 +00:00
parent b67d624754
commit 451ef7f21f
6 changed files with 11 additions and 1 deletions

View File

@ -34,6 +34,7 @@ class CustomFieldsController < ApplicationController
if request.post? and @custom_field.save
flash[:notice] = l(:notice_successful_create)
call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field)
redirect_to :action => 'index', :tab => @custom_field.class.name
end
@trackers = Tracker.find(:all, :order => 'position')
@ -43,6 +44,7 @@ class CustomFieldsController < ApplicationController
@custom_field = CustomField.find(params[:id])
if request.post? and @custom_field.update_attributes(params[:custom_field])
flash[:notice] = l(:notice_successful_update)
call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
redirect_to :action => 'index', :tab => @custom_field.class.name
end
@trackers = Tracker.find(:all, :order => 'position')

View File

@ -65,6 +65,7 @@ function toggle_custom_field_format() {
:rows => 15 %>
<br /><em><%= l(:text_custom_field_possible_values_info) %></em></p>
<p><%= @custom_field.field_format == 'bool' ? f.check_box(:default_value) : f.text_field(:default_value) %></p>
<%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
</div>
<div class="box">
@ -94,5 +95,6 @@ when "IssueCustomField" %>
<p><%= f.check_box :is_required %></p>
<% end %>
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
</div>
<%= javascript_tag "toggle_custom_field_format();" %>

View File

@ -11,5 +11,7 @@
<p><label for="issue_status_is_default"><%=l(:field_is_default)%></label>
<%= check_box 'issue_status', 'is_default' %></p>
<%= call_hook(:view_issue_statuses_form, :issue_status => @issue_status) %>
<!--[eoform:issue_status]-->
</div>
</div>

View File

@ -69,6 +69,8 @@ end %>
<%= link_to_attachments @issue %>
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
<% if authorize_for('issue_relations', 'new') || @issue.relations.any? %>
<hr />
<div id="relations">

View File

@ -22,6 +22,7 @@
<% @user.custom_field_values.select(&:editable?).each do |value| %>
<p><%= custom_field_tag_with_label :user, value %></p>
<% end %>
<%= call_hook(:view_my_account, :user => @user, :form => f) %>
</div>
<%= submit_tag l(:button_save) %>

View File

@ -16,6 +16,7 @@
<% end %>
<p><%= f.check_box :admin, :disabled => (@user == User.current) %></p>
<%= call_hook(:view_users_form, :user => @user, :form => f) %>
</div>
<div class="box">