summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-04-05 11:52:49 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-04-05 11:52:49 +0000
commitb6600d5fe97261ef03fc334b36af877499225d07 (patch)
tree46abec1667e476c65783bf85e6af0df9895640b1
parent37da5ba18776a7a1e4549e7bc2af48d87d67234a (diff)
downloadredmine-b6600d5fe97261ef03fc334b36af877499225d07.tar.gz
redmine-b6600d5fe97261ef03fc334b36af877499225d07.zip
Merged r2563, r2566, r2567, r2568, r2569, r2582 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2650 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/issues_helper.rb2
-rw-r--r--app/helpers/queries_helper.rb2
-rw-r--r--app/models/attachment.rb2
-rw-r--r--app/models/query.rb6
-rw-r--r--app/models/repository/subversion.rb6
-rw-r--r--app/views/common/_calendar.rhtml2
-rw-r--r--app/views/issues/show.rhtml2
-rw-r--r--app/views/timelog/details.rhtml2
-rw-r--r--app/views/timelog/report.rhtml2
-rw-r--r--doc/CHANGELOG4
-rw-r--r--test/functional/issues_controller_test.rb4
-rw-r--r--test/unit/activity_test.rb14
12 files changed, 37 insertions, 11 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index b2b85ee4c..a271e1205 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -38,6 +38,8 @@ module IssuesHelper
s = "issue status-#{issue.status.position} priority-#{issue.priority.position}"
s << ' closed' if issue.closed?
s << ' overdue' if issue.overdue?
+ s << ' created-by-me' if User.current.logged? && issue.author_id == User.current.id
+ s << ' assigned-to-me' if User.current.logged? && issue.assigned_to_id == User.current.id
s
end
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index 63d6a5356..b41e66afd 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -40,7 +40,7 @@ module QueriesHelper
else
case column.name
when :subject
- h((@project.nil? || @project != issue.project) ? "#{issue.project.name} - " : '') +
+ h((!@project.nil? && @project != issue.project) ? "#{issue.project.name} - " : '') +
link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
when :done_ratio
progress_bar(value, :width => '80px')
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 2ba75a3fd..2957b9dd1 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -33,7 +33,7 @@ class Attachment < ActiveRecord::Base
:author_key => :author_id,
:find_options => {:select => "#{Attachment.table_name}.*",
:joins => "LEFT JOIN #{Version.table_name} ON #{Attachment.table_name}.container_type='Version' AND #{Version.table_name}.id = #{Attachment.table_name}.container_id " +
- "LEFT JOIN #{Project.table_name} ON #{Version.table_name}.project_id = #{Project.table_name}.id"}
+ "LEFT JOIN #{Project.table_name} ON #{Version.table_name}.project_id = #{Project.table_name}.id OR ( #{Attachment.table_name}.container_type='Project' AND #{Attachment.table_name}.container_id = #{Project.table_name}.id )"}
acts_as_activity_provider :type => 'documents',
:permission => :view_documents,
diff --git a/app/models/query.rb b/app/models/query.rb
index 1a4845975..f3dedf04d 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -93,6 +93,7 @@ class Query < ActiveRecord::Base
cattr_reader :operators_by_filter_type
@@available_columns = [
+ QueryColumn.new(:project, :sortable => "#{Project.table_name}.name"),
QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position"),
QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position"),
QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position", :default_order => 'desc'),
@@ -234,7 +235,10 @@ class Query < ActiveRecord::Base
def columns
if has_default_columns?
- available_columns.select {|c| Setting.issue_list_default_columns.include?(c.name.to_s) }
+ available_columns.select do |c|
+ # Adds the project column by default for cross-project lists
+ Setting.issue_list_default_columns.include?(c.name.to_s) || (c.name == :project && project.nil?)
+ end
else
# preserve the column_names order
column_names.collect {|name| available_columns.find {|col| col.name == name}}.compact
diff --git a/app/models/repository/subversion.rb b/app/models/repository/subversion.rb
index 9515e6b76..d97528ee7 100644
--- a/app/models/repository/subversion.rb
+++ b/app/models/repository/subversion.rb
@@ -54,8 +54,8 @@ class Repository::Subversion < Repository
# loads changesets by batches of 200
identifier_to = [identifier_from + 199, scm_revision].min
revisions = scm.revisions('', identifier_to, identifier_from, :with_paths => true)
- transaction do
- revisions.reverse_each do |revision|
+ revisions.reverse_each do |revision|
+ transaction do
changeset = Changeset.create(:repository => self,
:revision => revision.identifier,
:committer => revision.author,
@@ -68,7 +68,7 @@ class Repository::Subversion < Repository
:path => change[:path],
:from_path => change[:from_path],
:from_revision => change[:from_revision])
- end
+ end unless changeset.new_record?
end
end unless revisions.nil?
identifier_from = identifier_to + 1
diff --git a/app/views/common/_calendar.rhtml b/app/views/common/_calendar.rhtml
index 1095cd501..18c812478 100644
--- a/app/views/common/_calendar.rhtml
+++ b/app/views/common/_calendar.rhtml
@@ -11,7 +11,7 @@ while day <= calendar.enddt %>
<p class="day-num"><%= day.day %></p>
<% calendar.events_on(day).each do |i| %>
<% if i.is_a? Issue %>
- <div class="tooltip">
+ <div class="<%= css_issue_classes(i) %> tooltip">
<%= if day == i.start_date && day == i.due_date
image_tag('arrow_bw.png')
elsif day == i.start_date
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml
index 41d2abe95..e056ef5ef 100644
--- a/app/views/issues/show.rhtml
+++ b/app/views/issues/show.rhtml
@@ -9,7 +9,7 @@
<h2><%= @issue.tracker.name %> #<%= @issue.id %></h2>
-<div class="<%= css_issue_classes(@issue) %>">
+<div class="<%= css_issue_classes(@issue) %> details">
<%= avatar(@issue.author, :size => "64") %>
<h3><%=h @issue.subject %></h3>
<p class="author">
diff --git a/app/views/timelog/details.rhtml b/app/views/timelog/details.rhtml
index db62fae66..a6aea5798 100644
--- a/app/views/timelog/details.rhtml
+++ b/app/views/timelog/details.rhtml
@@ -7,7 +7,7 @@
<h2><%= l(:label_spent_time) %></h2>
<% form_remote_tag( :url => {}, :method => :get, :update => 'content' ) do %>
-<%= hidden_field_tag 'project_id', params[:project_id] %>
+<%= hidden_field_tag('project_id', params[:project_id]) if @project %>
<%= hidden_field_tag 'issue_id', params[:issue_id] if @issue %>
<%= render :partial => 'date_range' %>
<% end %>
diff --git a/app/views/timelog/report.rhtml b/app/views/timelog/report.rhtml
index eea0d0fc7..b90ab8276 100644
--- a/app/views/timelog/report.rhtml
+++ b/app/views/timelog/report.rhtml
@@ -10,7 +10,7 @@
<% @criterias.each do |criteria| %>
<%= hidden_field_tag 'criterias[]', criteria, :id => nil %>
<% end %>
- <%= hidden_field_tag 'project_id', params[:project_id] %>
+ <%= hidden_field_tag('project_id', params[:project_id]) if @project %>
<%= render :partial => 'date_range' %>
<p><%= l(:label_details) %>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],
diff --git a/doc/CHANGELOG b/doc/CHANGELOG
index cabd5f9bf..9c85e4bfb 100644
--- a/doc/CHANGELOG
+++ b/doc/CHANGELOG
@@ -7,9 +7,13 @@ http://www.redmine.org/
== 2009-xx-xx v0.8.3
+* Separate project field and subject in cross-project issue view
* Ability to set language for redmine:load_default_data task using REDMINE_LANG environment variable
* Rescue Redmine::DefaultData::DataAlreadyLoaded in redmine:load_default_data task
+* CSS classes to highlight own and assigned issues
* Flush buffer when asking for language in redmine:load_default_data task
+* Fixed: Time entries csv export links for all projects are malformed
+* Fixed: Files without Version aren't visible in the Activity page
== 2009-03-07 v0.8.2
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 9228f7c02..842f9f35d 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -51,6 +51,8 @@ class IssuesControllerTest < Test::Unit::TestCase
end
def test_index
+ Setting.default_language = 'en'
+
get :index
assert_response :success
assert_template 'index.rhtml'
@@ -61,6 +63,8 @@ class IssuesControllerTest < Test::Unit::TestCase
# private projects hidden
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
assert_no_tag :tag => 'a', :content => /Issue on project 2/
+ # project column
+ assert_tag :tag => 'th', :content => /Project/
end
def test_index_should_not_list_issues_when_module_disabled
diff --git a/test/unit/activity_test.rb b/test/unit/activity_test.rb
index e5bc0d266..d47694e48 100644
--- a/test/unit/activity_test.rb
+++ b/test/unit/activity_test.rb
@@ -18,7 +18,7 @@
require File.dirname(__FILE__) + '/../test_helper'
class ActivityTest < Test::Unit::TestCase
- fixtures :projects, :versions, :users, :roles, :members, :issues, :journals, :journal_details,
+ fixtures :projects, :versions, :attachments, :users, :roles, :members, :issues, :journals, :journal_details,
:trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages
def setup
@@ -72,6 +72,18 @@ class ActivityTest < Test::Unit::TestCase
assert_nil(events.detect {|e| e.event_author != user})
end
+ def test_files_activity
+ f = Redmine::Activity::Fetcher.new(User.anonymous, :project => Project.find(1))
+ f.scope = ['files']
+ events = f.events
+
+ assert_kind_of Array, events
+ assert events.include?(Attachment.find_by_container_type_and_container_id('Project', 1))
+ assert events.include?(Attachment.find_by_container_type_and_container_id('Version', 1))
+ assert_equal [Attachment], events.collect(&:class).uniq
+ assert_equal %w(Project Version), events.collect(&:container_type).uniq.sort
+ end
+
private
def find_events(user, options={})