diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index 99f7bcf..2abda90 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -40,7 +40,7 @@ class SettingsController < ApplicationController @options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] } @deliveries = ActionMailer::Base.perform_deliveries - @guessed_host_and_path = request.host_with_port + @guessed_host_and_path = request.host_with_port.dup @guessed_host_and_path << ('/'+ request.relative_url_root.gsub(%r{^\/}, '')) unless request.relative_url_root.blank? end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 35d1670..c1acc5e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -291,16 +291,15 @@ module ApplicationHelper attachments = attachments.sort_by(&:created_on).reverse text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(bmp|gif|jpg|jpeg|png))!/i) do |m| style = $1 - filename = $6 - rf = Regexp.new(Regexp.escape(filename), Regexp::IGNORECASE) + filename = $6.downcase # search for the picture in attachments - if found = attachments.detect { |att| att.filename =~ rf } + if found = attachments.detect { |att| att.filename.downcase == filename } image_url = url_for :only_path => only_path, :controller => 'attachments', :action => 'download', :id => found desc = found.description.to_s.gsub(/^([^\(\)]*).*$/, "\\1") alt = desc.blank? ? nil : "(#{desc})" "!#{style}#{image_url}#{alt}!" else - "!#{style}#{filename}!" + m end end end diff --git a/app/models/message.rb b/app/models/message.rb index 080e757..716c53b 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -23,7 +23,7 @@ class Message < ActiveRecord::Base belongs_to :last_reply, :class_name => 'Message', :foreign_key => 'last_reply_id' acts_as_searchable :columns => ['subject', 'content'], - :include => {:board, :project}, + :include => {:board => :project}, :project_key => 'project_id', :date_column => "#{table_name}.created_on" acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"}, diff --git a/app/models/role.rb b/app/models/role.rb index beb13c0..b07e7a0 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -31,9 +31,9 @@ class Role < ActiveRecord::Base raise "Can not copy workflow from a #{role.class}" unless role.is_a?(Role) raise "Can not copy workflow from/to an unsaved role" if proxy_owner.new_record? || role.new_record? clear - connection.insert "INSERT INTO workflows (tracker_id, old_status_id, new_status_id, role_id)" + + connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" + " SELECT tracker_id, old_status_id, new_status_id, #{proxy_owner.id}" + - " FROM workflows" + + " FROM #{Workflow.table_name}" + " WHERE role_id = #{role.id}" end end diff --git a/app/models/tracker.rb b/app/models/tracker.rb index ecee908..7c5bae2 100644 --- a/app/models/tracker.rb +++ b/app/models/tracker.rb @@ -23,9 +23,9 @@ class Tracker < ActiveRecord::Base raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker) raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record? clear - connection.insert "INSERT INTO workflows (tracker_id, old_status_id, new_status_id, role_id)" + + connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" + " SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" + - " FROM workflows" + + " FROM #{Workflow.table_name}" + " WHERE tracker_id = #{tracker.id}" end end diff --git a/app/views/issues/_form.rhtml b/app/views/issues/_form.rhtml index 0ca1255..b447190 100644 --- a/app/views/issues/_form.rhtml +++ b/app/views/issues/_form.rhtml @@ -24,11 +24,13 @@
<%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %>
<%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %>
+<% unless @project.issue_categories.empty? %><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %> <%= prompt_to_remote(l(:label_issue_category_new), l(:label_issue_category_new), 'category[name]', {:controller => 'projects', :action => 'add_issue_category', :id => @project}, :class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %>
+<% end %> <%= content_tag('p', f.select(:fixed_version_id, (@project.versions.sort.collect {|v| [v.name, v.id]}), { :include_blank => true })) unless @project.versions.empty? %> diff --git a/app/views/issues/bulk_edit.rhtml b/app/views/issues/bulk_edit.rhtml index b916cf0..01e4e2e 100644 --- a/app/views/issues/bulk_edit.rhtml +++ b/app/views/issues/bulk_edit.rhtml @@ -44,6 +44,7 @@<%= submit_tag l(:button_submit) %> diff --git a/app/views/my/blocks/_timelog.rhtml b/app/views/my/blocks/_timelog.rhtml index a3f74e5..ca66f7e 100644 --- a/app/views/my/blocks/_timelog.rhtml +++ b/app/views/my/blocks/_timelog.rhtml @@ -47,6 +47,6 @@ entries_by_day = entries.group_by(&:spent_on) <% end -%> <% end -%> - + <% end %> diff --git a/app/views/projects/settings/_versions.rhtml b/app/views/projects/settings/_versions.rhtml index 7329c7f..79d92d8 100644 --- a/app/views/projects/settings/_versions.rhtml +++ b/app/views/projects/settings/_versions.rhtml @@ -17,7 +17,6 @@
Wiki links are displayed in red if the page doesn't exist yet, eg: Nonexistent page.
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 5f1a589..03a4db3 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -89,7 +89,9 @@ class ApplicationHelperTest < HelperTestCase def test_attached_images to_test = { 'Inline image: !logo.gif!' => 'Inline image:#{result}
", textilizable(text, :attachments => attachments) }