]> source.dussan.org Git - redmine.git/commitdiff
Added several more plugin hooks:
authorEric Davis <edavis@littlestreamsoftware.com>
Sat, 21 Mar 2009 00:22:59 +0000 (00:22 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Sat, 21 Mar 2009 00:22:59 +0000 (00:22 +0000)
* :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

app/controllers/custom_fields_controller.rb
app/views/custom_fields/_form.rhtml
app/views/issue_statuses/_form.rhtml
app/views/issues/show.rhtml
app/views/my/account.rhtml
app/views/users/_form.rhtml

index 73ae8096aef999d36ecd2703b77ceb9f6fd7ae61..ec101fe5a3f371726f4199e48adefd8932d6978f 100644 (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')
index d26af9420bc3ab91026c1aeeb9bc74e3e82415d2..b9d7ec017a86a7d4356fe6592d4c2e184287b59e 100644 (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();" %>
index 6ae0a7c330acf29b530a0f5d8ec192951d0aebfd..b6a5bc19f764af01f16ab47f224a4d983ed1ea47 100644 (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>
\ No newline at end of file
+</div>
index 2943f43958a62c04c9746d0f0bcf170af50ce12c..ed14fe3f857c4746e4f8c6a6ae7537c18d49c9f3 100644 (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">
index ea226f5cb93aec0a25f285ea15973bb0ab56f98e..b22f291f956ece9c8c9a26ecc75e5669dfe21bc3 100644 (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) %>
index 00b6aeac5482d9aa2f0cf4534e798908fefa7813..90d6ba577dc7b52c1464ef533962d2c100143fe4 100644 (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">