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
This commit is contained in:
Jean-Philippe Lang 2009-04-05 11:52:49 +00:00
parent 37da5ba187
commit b6600d5fe9
12 changed files with 37 additions and 11 deletions

View File

@ -38,6 +38,8 @@ module IssuesHelper
s = "issue status-#{issue.status.position} priority-#{issue.priority.position}" s = "issue status-#{issue.status.position} priority-#{issue.priority.position}"
s << ' closed' if issue.closed? s << ' closed' if issue.closed?
s << ' overdue' if issue.overdue? 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 s
end end

View File

@ -40,7 +40,7 @@ module QueriesHelper
else else
case column.name case column.name
when :subject 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) link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
when :done_ratio when :done_ratio
progress_bar(value, :width => '80px') progress_bar(value, :width => '80px')

View File

@ -33,7 +33,7 @@ class Attachment < ActiveRecord::Base
:author_key => :author_id, :author_key => :author_id,
:find_options => {:select => "#{Attachment.table_name}.*", :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 " + :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', acts_as_activity_provider :type => 'documents',
:permission => :view_documents, :permission => :view_documents,

View File

@ -93,6 +93,7 @@ class Query < ActiveRecord::Base
cattr_reader :operators_by_filter_type cattr_reader :operators_by_filter_type
@@available_columns = [ @@available_columns = [
QueryColumn.new(:project, :sortable => "#{Project.table_name}.name"),
QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position"), QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position"),
QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position"), QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position"),
QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position", :default_order => 'desc'), QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position", :default_order => 'desc'),
@ -234,7 +235,10 @@ class Query < ActiveRecord::Base
def columns def columns
if has_default_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 else
# preserve the column_names order # preserve the column_names order
column_names.collect {|name| available_columns.find {|col| col.name == name}}.compact column_names.collect {|name| available_columns.find {|col| col.name == name}}.compact

View File

@ -54,8 +54,8 @@ class Repository::Subversion < Repository
# loads changesets by batches of 200 # loads changesets by batches of 200
identifier_to = [identifier_from + 199, scm_revision].min identifier_to = [identifier_from + 199, scm_revision].min
revisions = scm.revisions('', identifier_to, identifier_from, :with_paths => true) 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, changeset = Changeset.create(:repository => self,
:revision => revision.identifier, :revision => revision.identifier,
:committer => revision.author, :committer => revision.author,
@ -68,7 +68,7 @@ class Repository::Subversion < Repository
:path => change[:path], :path => change[:path],
:from_path => change[:from_path], :from_path => change[:from_path],
:from_revision => change[:from_revision]) :from_revision => change[:from_revision])
end end unless changeset.new_record?
end end
end unless revisions.nil? end unless revisions.nil?
identifier_from = identifier_to + 1 identifier_from = identifier_to + 1

View File

@ -11,7 +11,7 @@ while day <= calendar.enddt %>
<p class="day-num"><%= day.day %></p> <p class="day-num"><%= day.day %></p>
<% calendar.events_on(day).each do |i| %> <% calendar.events_on(day).each do |i| %>
<% if i.is_a? Issue %> <% if i.is_a? Issue %>
<div class="tooltip"> <div class="<%= css_issue_classes(i) %> tooltip">
<%= if day == i.start_date && day == i.due_date <%= if day == i.start_date && day == i.due_date
image_tag('arrow_bw.png') image_tag('arrow_bw.png')
elsif day == i.start_date elsif day == i.start_date

View File

@ -9,7 +9,7 @@
<h2><%= @issue.tracker.name %> #<%= @issue.id %></h2> <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") %> <%= avatar(@issue.author, :size => "64") %>
<h3><%=h @issue.subject %></h3> <h3><%=h @issue.subject %></h3>
<p class="author"> <p class="author">

View File

@ -7,7 +7,7 @@
<h2><%= l(:label_spent_time) %></h2> <h2><%= l(:label_spent_time) %></h2>
<% form_remote_tag( :url => {}, :method => :get, :update => 'content' ) do %> <% 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 %> <%= hidden_field_tag 'issue_id', params[:issue_id] if @issue %>
<%= render :partial => 'date_range' %> <%= render :partial => 'date_range' %>
<% end %> <% end %>

View File

@ -10,7 +10,7 @@
<% @criterias.each do |criteria| %> <% @criterias.each do |criteria| %>
<%= hidden_field_tag 'criterias[]', criteria, :id => nil %> <%= hidden_field_tag 'criterias[]', criteria, :id => nil %>
<% end %> <% end %>
<%= hidden_field_tag 'project_id', params[:project_id] %> <%= hidden_field_tag('project_id', params[:project_id]) if @project %>
<%= render :partial => 'date_range' %> <%= render :partial => 'date_range' %>
<p><%= l(:label_details) %>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'], <p><%= l(:label_details) %>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],

View File

@ -7,9 +7,13 @@ http://www.redmine.org/
== 2009-xx-xx v0.8.3 == 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 * 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 * 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 * 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 == 2009-03-07 v0.8.2

View File

@ -51,6 +51,8 @@ class IssuesControllerTest < Test::Unit::TestCase
end end
def test_index def test_index
Setting.default_language = 'en'
get :index get :index
assert_response :success assert_response :success
assert_template 'index.rhtml' assert_template 'index.rhtml'
@ -61,6 +63,8 @@ class IssuesControllerTest < Test::Unit::TestCase
# private projects hidden # private projects hidden
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/ assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
assert_no_tag :tag => 'a', :content => /Issue on project 2/ assert_no_tag :tag => 'a', :content => /Issue on project 2/
# project column
assert_tag :tag => 'th', :content => /Project/
end end
def test_index_should_not_list_issues_when_module_disabled def test_index_should_not_list_issues_when_module_disabled

View File

@ -18,7 +18,7 @@
require File.dirname(__FILE__) + '/../test_helper' require File.dirname(__FILE__) + '/../test_helper'
class ActivityTest < Test::Unit::TestCase 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 :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages
def setup def setup
@ -72,6 +72,18 @@ class ActivityTest < Test::Unit::TestCase
assert_nil(events.detect {|e| e.event_author != user}) assert_nil(events.detect {|e| e.event_author != user})
end 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 private
def find_events(user, options={}) def find_events(user, options={})