summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-09-13 11:46:39 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-09-13 11:46:39 +0000
commit94488269d1c3e117fad4acc9be27af10141a32cf (patch)
tree9bf7535e985981316233bb72adb39faaa7d656a7 /app
parent3d0fbea9fdfdea61eaade8bb11d30c472a7c0e7e (diff)
downloadredmine-94488269d1c3e117fad4acc9be27af10141a32cf.tar.gz
redmine-94488269d1c3e117fad4acc9be27af10141a32cf.zip
Merged r2768, r2773, r2774, r2775, r2796 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2882 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/messages_controller.rb2
-rw-r--r--app/controllers/timelog_controller.rb3
-rw-r--r--app/controllers/wiki_controller.rb1
-rw-r--r--app/models/changeset.rb2
-rw-r--r--app/models/query.rb4
-rw-r--r--app/views/common/feed.atom.rxml2
-rw-r--r--app/views/issues/changes.rxml2
7 files changed, 12 insertions, 4 deletions
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index af39efb21..ae11fd2e0 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -46,6 +46,7 @@ class MessagesController < ApplicationController
@message.sticky = params[:message]['sticky']
end
if request.post? && @message.save
+ call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
attach_files(@message, params[:attachments])
redirect_to :action => 'show', :id => @message
end
@@ -58,6 +59,7 @@ class MessagesController < ApplicationController
@reply.board = @board
@topic.children << @reply
if !@reply.new_record?
+ call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
attach_files(@reply, params[:attachments])
end
redirect_to :action => 'show', :id => @topic
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index 58df1f5bc..60cc3916b 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -197,6 +197,9 @@ class TimelogController < ApplicationController
render_403 and return if @time_entry && !@time_entry.editable_by?(User.current)
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
@time_entry.attributes = params[:time_entry]
+
+ call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
+
if request.post? and @time_entry.save
flash[:notice] = l(:notice_successful_update)
redirect_back_or_default :action => 'details', :project_id => @time_entry.project
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index 2dcc6f971..2828941ee 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -82,6 +82,7 @@ class WikiController < ApplicationController
@content.author = User.current
# if page is new @page.save will also save content, but not if page isn't a new record
if (@page.new_record? ? @page.save : @content.save)
+ call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
redirect_to :action => 'index', :id => @project, :page => @page.title
end
end
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index 759d240df..d8b0c18f3 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -112,6 +112,8 @@ class Changeset < ActiveRecord::Base
journal = issue.init_journal(user || User.anonymous, l(:text_status_changed_by_changeset, csettext))
issue.status = fix_status
issue.done_ratio = done_ratio if done_ratio
+ Redmine::Hook.call_hook(:model_changeset_scan_commit_for_issue_ids_pre_issue_update,
+ { :changeset => self, :issue => issue })
issue.save
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
end
diff --git a/app/models/query.rb b/app/models/query.rb
index f3dedf04d..5edefdadf 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -368,9 +368,9 @@ class Query < ActiveRecord::Base
Time.now.at_beginning_of_week
sql = "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date(from), connection.quoted_date(from + 7.days)]
when "~"
- sql = "#{db_table}.#{db_field} LIKE '%#{connection.quote_string(value.first)}%'"
+ sql = "LOWER(#{db_table}.#{db_field}) LIKE '%#{connection.quote_string(value.first.to_s.downcase)}%'"
when "!~"
- sql = "#{db_table}.#{db_field} NOT LIKE '%#{connection.quote_string(value.first)}%'"
+ sql = "LOWER(#{db_table}.#{db_field}) NOT LIKE '%#{connection.quote_string(value.first.to_s.downcase)}%'"
end
return sql
diff --git a/app/views/common/feed.atom.rxml b/app/views/common/feed.atom.rxml
index a24a33de6..f50b1f2f8 100644
--- a/app/views/common/feed.atom.rxml
+++ b/app/views/common/feed.atom.rxml
@@ -24,7 +24,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.email(author.mail) if author.is_a?(User) && !author.mail.blank? && !author.pref.hide_mail
end if author
xml.content "type" => "html" do
- xml.text! textilizable(item.event_description)
+ xml.text! textilizable(item, :event_description, :only_path => false)
end
end
end
diff --git a/app/views/issues/changes.rxml b/app/views/issues/changes.rxml
index 43324cfb8..4c1e678bf 100644
--- a/app/views/issues/changes.rxml
+++ b/app/views/issues/changes.rxml
@@ -23,7 +23,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.text! '<li>' + show_detail(detail, false) + '</li>'
end
xml.text! '</ul>'
- xml.text! textilizable(change.notes) unless change.notes.blank?
+ xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
end
end
end