]> source.dussan.org Git - redmine.git/commitdiff
Added plugin hooks around Journal editing
authorEric Davis <edavis@littlestreamsoftware.com>
Wed, 10 Dec 2008 23:44:22 +0000 (23:44 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Wed, 10 Dec 2008 23:44:22 +0000 (23:44 +0000)
* :controller_journals_edit_post
* :view_journals_notes_form_after_notes
* :view_journals_update_rjs_bottom

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2121 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/journals_controller.rb
app/views/journals/_notes_form.rhtml
app/views/journals/update.rjs

index 6df54f09881868c39b646abf58605c0b44871e39..d479855f2c4455a6802e2bc02364c6c71cc25c1d 100644 (file)
@@ -22,6 +22,7 @@ class JournalsController < ApplicationController
     if request.post?
       @journal.update_attributes(:notes => params[:notes]) if params[:notes]
       @journal.destroy if @journal.details.empty? && @journal.notes.blank?
+      call_hook(:controller_journals_edit_post, { :journal => @journal, :params => params})
       respond_to do |format|
         format.html { redirect_to :controller => 'issues', :action => 'show', :id => @journal.journalized_id }
         format.js { render :action => 'update' }
index 9baec03faf5cb1bb1101d3f6d345885517b92fbe..94c710ebd8e8e41fd80443289bd0f37bd3ec0ebd 100644 (file)
@@ -1,6 +1,7 @@
 <% form_remote_tag(:url => {}, :html => { :id => "journal-#{@journal.id}-form" }) do %>
     <%= text_area_tag :notes, @journal.notes, :class => 'wiki-edit', 
                                               :rows => (@journal.notes.blank? ? 10 : [[10, @journal.notes.length / 50].max, 100].min) %>
+    <%= call_hook(:view_journals_notes_form_after_notes, { :journal => @journal}) %>
     <p><%= submit_tag l(:button_save) %>
     <%= link_to l(:button_cancel), '#', :onclick => "Element.remove('journal-#{@journal.id}-form'); " +
                                                     "Element.show('journal-#{@journal.id}-notes'); return false;" %></p>
index 2b5a54c0a40832f1d205208644129a0fa11cb4d9..55efb9bf373a5d386a25b59f517db39585891eb4 100644 (file)
@@ -6,3 +6,5 @@ else
   page.show "journal-#{@journal.id}-notes"
   page.remove "journal-#{@journal.id}-form"
 end
+
+call_hook(:view_journals_update_rjs_bottom, { :page => page, :journal => @journal })