summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-03-21 00:22:59 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2009-03-21 00:22:59 +0000
commit451ef7f21f411d4bfe4138a71be269f566cd4647 (patch)
tree80440f6f58bdfe818e770317789e9bc6ff07a853 /app
parentb67d624754f7f02815f7ef2a80c2405f036f92d7 (diff)
downloadredmine-451ef7f21f411d4bfe4138a71be269f566cd4647.tar.gz
redmine-451ef7f21f411d4bfe4138a71be269f566cd4647.zip
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
Diffstat (limited to 'app')
-rw-r--r--app/controllers/custom_fields_controller.rb2
-rw-r--r--app/views/custom_fields/_form.rhtml2
-rw-r--r--app/views/issue_statuses/_form.rhtml4
-rw-r--r--app/views/issues/show.rhtml2
-rw-r--r--app/views/my/account.rhtml1
-rw-r--r--app/views/users/_form.rhtml1
6 files changed, 11 insertions, 1 deletions
diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rb
index 73ae8096a..ec101fe5a 100644
--- a/app/controllers/custom_fields_controller.rb
+++ b/app/controllers/custom_fields_controller.rb
@@ -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')
diff --git a/app/views/custom_fields/_form.rhtml b/app/views/custom_fields/_form.rhtml
index d26af9420..b9d7ec017 100644
--- a/app/views/custom_fields/_form.rhtml
+++ b/app/views/custom_fields/_form.rhtml
@@ -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();" %>
diff --git a/app/views/issue_statuses/_form.rhtml b/app/views/issue_statuses/_form.rhtml
index 6ae0a7c33..b6a5bc19f 100644
--- a/app/views/issue_statuses/_form.rhtml
+++ b/app/views/issue_statuses/_form.rhtml
@@ -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> \ No newline at end of file
+</div>
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml
index 2943f4395..ed14fe3f8 100644
--- a/app/views/issues/show.rhtml
+++ b/app/views/issues/show.rhtml
@@ -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">
diff --git a/app/views/my/account.rhtml b/app/views/my/account.rhtml
index ea226f5cb..b22f291f9 100644
--- a/app/views/my/account.rhtml
+++ b/app/views/my/account.rhtml
@@ -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) %>
diff --git a/app/views/users/_form.rhtml b/app/views/users/_form.rhtml
index 00b6aeac5..90d6ba577 100644
--- a/app/views/users/_form.rhtml
+++ b/app/views/users/_form.rhtml
@@ -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">