##// END OF EJS Templates
Merged r2768, r2773, r2774, r2775, r2796 from trunk....
Jean-Philippe Lang -
r2768:94488269d1c3
parent child
Show More
@@ -46,6 +46,7 class MessagesController < ApplicationController
46 @message.sticky = params[:message]['sticky']
46 @message.sticky = params[:message]['sticky']
47 end
47 end
48 if request.post? && @message.save
48 if request.post? && @message.save
49 call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
49 attach_files(@message, params[:attachments])
50 attach_files(@message, params[:attachments])
50 redirect_to :action => 'show', :id => @message
51 redirect_to :action => 'show', :id => @message
51 end
52 end
@@ -58,6 +59,7 class MessagesController < ApplicationController
58 @reply.board = @board
59 @reply.board = @board
59 @topic.children << @reply
60 @topic.children << @reply
60 if !@reply.new_record?
61 if !@reply.new_record?
62 call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
61 attach_files(@reply, params[:attachments])
63 attach_files(@reply, params[:attachments])
62 end
64 end
63 redirect_to :action => 'show', :id => @topic
65 redirect_to :action => 'show', :id => @topic
@@ -197,6 +197,9 class TimelogController < ApplicationController
197 render_403 and return if @time_entry && !@time_entry.editable_by?(User.current)
197 render_403 and return if @time_entry && !@time_entry.editable_by?(User.current)
198 @time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
198 @time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
199 @time_entry.attributes = params[:time_entry]
199 @time_entry.attributes = params[:time_entry]
200
201 call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
202
200 if request.post? and @time_entry.save
203 if request.post? and @time_entry.save
201 flash[:notice] = l(:notice_successful_update)
204 flash[:notice] = l(:notice_successful_update)
202 redirect_back_or_default :action => 'details', :project_id => @time_entry.project
205 redirect_back_or_default :action => 'details', :project_id => @time_entry.project
@@ -82,6 +82,7 class WikiController < ApplicationController
82 @content.author = User.current
82 @content.author = User.current
83 # if page is new @page.save will also save content, but not if page isn't a new record
83 # if page is new @page.save will also save content, but not if page isn't a new record
84 if (@page.new_record? ? @page.save : @content.save)
84 if (@page.new_record? ? @page.save : @content.save)
85 call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
85 redirect_to :action => 'index', :id => @project, :page => @page.title
86 redirect_to :action => 'index', :id => @project, :page => @page.title
86 end
87 end
87 end
88 end
@@ -112,6 +112,8 class Changeset < ActiveRecord::Base
112 journal = issue.init_journal(user || User.anonymous, l(:text_status_changed_by_changeset, csettext))
112 journal = issue.init_journal(user || User.anonymous, l(:text_status_changed_by_changeset, csettext))
113 issue.status = fix_status
113 issue.status = fix_status
114 issue.done_ratio = done_ratio if done_ratio
114 issue.done_ratio = done_ratio if done_ratio
115 Redmine::Hook.call_hook(:model_changeset_scan_commit_for_issue_ids_pre_issue_update,
116 { :changeset => self, :issue => issue })
115 issue.save
117 issue.save
116 Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
118 Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
117 end
119 end
@@ -368,9 +368,9 class Query < ActiveRecord::Base
368 Time.now.at_beginning_of_week
368 Time.now.at_beginning_of_week
369 sql = "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date(from), connection.quoted_date(from + 7.days)]
369 sql = "#{db_table}.#{db_field} BETWEEN '%s' AND '%s'" % [connection.quoted_date(from), connection.quoted_date(from + 7.days)]
370 when "~"
370 when "~"
371 sql = "#{db_table}.#{db_field} LIKE '%#{connection.quote_string(value.first)}%'"
371 sql = "LOWER(#{db_table}.#{db_field}) LIKE '%#{connection.quote_string(value.first.to_s.downcase)}%'"
372 when "!~"
372 when "!~"
373 sql = "#{db_table}.#{db_field} NOT LIKE '%#{connection.quote_string(value.first)}%'"
373 sql = "LOWER(#{db_table}.#{db_field}) NOT LIKE '%#{connection.quote_string(value.first.to_s.downcase)}%'"
374 end
374 end
375
375
376 return sql
376 return sql
@@ -24,7 +24,7 xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
24 xml.email(author.mail) if author.is_a?(User) && !author.mail.blank? && !author.pref.hide_mail
24 xml.email(author.mail) if author.is_a?(User) && !author.mail.blank? && !author.pref.hide_mail
25 end if author
25 end if author
26 xml.content "type" => "html" do
26 xml.content "type" => "html" do
27 xml.text! textilizable(item.event_description)
27 xml.text! textilizable(item, :event_description, :only_path => false)
28 end
28 end
29 end
29 end
30 end
30 end
@@ -23,7 +23,7 xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
23 xml.text! '<li>' + show_detail(detail, false) + '</li>'
23 xml.text! '<li>' + show_detail(detail, false) + '</li>'
24 end
24 end
25 xml.text! '</ul>'
25 xml.text! '</ul>'
26 xml.text! textilizable(change.notes) unless change.notes.blank?
26 xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
27 end
27 end
28 end
28 end
29 end
29 end
@@ -11,8 +11,10 http://www.redmine.org/
11 * Do not require a non-word character after a comma in Redmine links
11 * Do not require a non-word character after a comma in Redmine links
12 * Include issue hyperlinks in reminder emails
12 * Include issue hyperlinks in reminder emails
13 * Fixed: 500 Internal Server Error is raised if add an empty comment to the news
13 * Fixed: 500 Internal Server Error is raised if add an empty comment to the news
14 * Fixes: Atom links for wiki pages are not correct
14 * Fixed: Atom links for wiki pages are not correct
15 * Fixed: Atom feeds leak email address
15 * Fixed: Atom feeds leak email address
16 * Fixed: Case sensitivity in Issue filtering
17 * Fixed: When reading RSS feed, the inline-embedded images are not properly shown
16
18
17
19
18 == 2009-05-17 v0.8.4
20 == 2009-05-17 v0.8.4
@@ -109,4 +109,16 attachments_009:
109 filename: version_file.zip
109 filename: version_file.zip
110 author_id: 2
110 author_id: 2
111 content_type: application/octet-stream
111 content_type: application/octet-stream
112 attachments_010:
113 created_on: 2006-07-19 21:07:27 +02:00
114 container_type: Issue
115 container_id: 2
116 downloads: 0
117 disk_filename: 060719210727_picture.jpg
118 digest: b91e08d0cf966d5c6ff411bd8c4cc3a2
119 id: 10
120 filesize: 452
121 filename: picture.jpg
122 author_id: 2
123 content_type: image/jpeg
112 No newline at end of file
124
@@ -13,4 +13,11 journals_002:
13 journalized_type: Issue
13 journalized_type: Issue
14 user_id: 2
14 user_id: 2
15 journalized_id: 1
15 journalized_id: 1
16 journals_003:
17 created_on: <%= 1.days.ago.to_date.to_s(:db) %>
18 notes: "A comment with inline image: !picture.jpg!"
19 id: 3
20 journalized_type: Issue
21 user_id: 2
22 journalized_id: 2
16 No newline at end of file
23
@@ -255,6 +255,14 class IssuesControllerTest < Test::Unit::TestCase
255 :child => { :tag => 'legend',
255 :child => { :tag => 'legend',
256 :content => /Notes/ } }
256 :content => /Notes/ } }
257 end
257 end
258
259 def test_show_atom
260 get :show, :id => 2, :format => 'atom'
261 assert_response :success
262 assert_template 'changes'
263 # Inline image
264 assert @response.body.include?("&lt;img src=\"http://test.host/attachments/download/10\" alt=\"\" /&gt;")
265 end
258
266
259 def test_show_export_to_pdf
267 def test_show_export_to_pdf
260 get :show, :id => 3, :format => 'pdf'
268 get :show, :id => 3, :format => 'pdf'
@@ -150,15 +150,17 class QueryTest < Test::Unit::TestCase
150
150
151 def test_operator_contains
151 def test_operator_contains
152 query = Query.new(:project => Project.find(1), :name => '_')
152 query = Query.new(:project => Project.find(1), :name => '_')
153 query.add_filter('subject', '~', ['string'])
153 query.add_filter('subject', '~', ['uNable'])
154 assert query.statement.include?("#{Issue.table_name}.subject LIKE '%string%'")
154 assert query.statement.include?("LOWER(#{Issue.table_name}.subject) LIKE '%unable%'")
155 find_issues_with_query(query)
155 result = find_issues_with_query(query)
156 assert result.empty?
157 result.each {|issue| assert issue.subject.downcase.include?('unable') }
156 end
158 end
157
159
158 def test_operator_does_not_contains
160 def test_operator_does_not_contains
159 query = Query.new(:project => Project.find(1), :name => '_')
161 query = Query.new(:project => Project.find(1), :name => '_')
160 query.add_filter('subject', '!~', ['string'])
162 query.add_filter('subject', '!~', ['uNable'])
161 assert query.statement.include?("#{Issue.table_name}.subject NOT LIKE '%string%'")
163 assert query.statement.include?("LOWER(#{Issue.table_name}.subject) NOT LIKE '%unable%'")
162 find_issues_with_query(query)
164 find_issues_with_query(query)
163 end
165 end
164
166
General Comments 0
You need to be logged in to leave comments. Login now