Merged r2164 to r2167, r2188 and r2189 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2216 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
6abd32be9e
commit
dea10c54f9
@ -123,7 +123,10 @@ class IssuesController < ApplicationController
|
|||||||
render :nothing => true, :layout => true
|
render :nothing => true, :layout => true
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@issue.attributes = params[:issue]
|
if params[:issue].is_a?(Hash)
|
||||||
|
@issue.attributes = params[:issue]
|
||||||
|
@issue.watcher_user_ids = params[:issue]['watcher_user_ids'] if User.current.allowed_to?(:add_issue_watchers, @project)
|
||||||
|
end
|
||||||
@issue.author = User.current
|
@issue.author = User.current
|
||||||
|
|
||||||
default_status = IssueStatus.default
|
default_status = IssueStatus.default
|
||||||
|
@ -127,6 +127,9 @@ class RepositoriesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def annotate
|
def annotate
|
||||||
|
@entry = @repository.entry(@path, @rev)
|
||||||
|
show_error_not_found and return unless @entry
|
||||||
|
|
||||||
@annotate = @repository.scm.annotate(@path, @rev)
|
@annotate = @repository.scm.annotate(@path, @rev)
|
||||||
render_error l(:error_scm_annotate) and return if @annotate.nil? || @annotate.empty?
|
render_error l(:error_scm_annotate) and return if @annotate.nil? || @annotate.empty?
|
||||||
end
|
end
|
||||||
|
@ -28,6 +28,7 @@ class Mailer < ActionMailer::Base
|
|||||||
'Issue-Author' => issue.author.login
|
'Issue-Author' => issue.author.login
|
||||||
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
|
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
|
||||||
recipients issue.recipients
|
recipients issue.recipients
|
||||||
|
cc(issue.watcher_recipients - @recipients)
|
||||||
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
|
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
|
||||||
body :issue => issue,
|
body :issue => issue,
|
||||||
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
|
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
|
||||||
|
@ -48,6 +48,14 @@
|
|||||||
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
|
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% if @issue.new_record? && User.current.allowed_to?(:add_issue_watchers, @project) -%>
|
||||||
|
<p><label><%= l(:label_issue_watchers) %></label>
|
||||||
|
<% @issue.project.users.sort.each do |user| -%>
|
||||||
|
<label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, @issue.watcher_user_ids.include?(user.id) %> <%=h user %></label>
|
||||||
|
<% end -%>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %>
|
<%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %>
|
||||||
|
|
||||||
<%= wikitoolbar_for 'issue_description' %>
|
<%= wikitoolbar_for 'issue_description' %>
|
||||||
|
10
app/views/repositories/_link_to_functions.rhtml
Normal file
10
app/views/repositories/_link_to_functions.rhtml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<p>
|
||||||
|
<% if @repository.supports_cat? %>
|
||||||
|
<%= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
|
||||||
|
<% end %>
|
||||||
|
<% if @repository.supports_annotate? %>
|
||||||
|
<%= link_to_if action_name != 'annotate', l(:button_annotate), {:action => 'annotate', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
|
||||||
|
<% end %>
|
||||||
|
<%= link_to(l(:button_download), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %>
|
||||||
|
<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
|
||||||
|
</p>
|
@ -1,5 +1,7 @@
|
|||||||
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
||||||
|
|
||||||
|
<p><%= render :partial => 'link_to_functions' %></p>
|
||||||
|
|
||||||
<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
|
<% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
|
||||||
|
|
||||||
<div class="autoscroll">
|
<div class="autoscroll">
|
||||||
|
@ -1,15 +1,6 @@
|
|||||||
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %></h2>
|
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %></h2>
|
||||||
|
|
||||||
<p>
|
<p><%= render :partial => 'link_to_functions' %></p>
|
||||||
<% if @repository.supports_cat? %>
|
|
||||||
<%= link_to l(:button_view), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
|
|
||||||
<% end %>
|
|
||||||
<% if @repository.supports_annotate? %>
|
|
||||||
<%= link_to l(:button_annotate), {:action => 'annotate', :id => @project, :path => to_path_param(@path), :rev => @rev } %> |
|
|
||||||
<% end %>
|
|
||||||
<%= link_to(l(:button_download), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %>
|
|
||||||
<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<%= render_properties(@properties) %>
|
<%= render_properties(@properties) %>
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
|
||||||
|
|
||||||
|
<p><%= render :partial => 'link_to_functions' %></p>
|
||||||
|
|
||||||
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
|
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
|
||||||
|
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
|
@ -5,6 +5,13 @@ Copyright (C) 2006-2008 Jean-Philippe Lang
|
|||||||
http://www.redmine.org/
|
http://www.redmine.org/
|
||||||
|
|
||||||
|
|
||||||
|
== v0.8.1
|
||||||
|
|
||||||
|
* Select watchers on new issue form
|
||||||
|
* Show view/annotate/download links on entry and annotate views
|
||||||
|
* Fixed: Deleted files are shown when using Darcs
|
||||||
|
|
||||||
|
|
||||||
== 2008-12-30 v0.8.0
|
== 2008-12-30 v0.8.0
|
||||||
|
|
||||||
* Setting added in order to limit the number of diff lines that should be displayed
|
* Setting added in order to limit the number of diff lines that should be displayed
|
||||||
|
@ -580,7 +580,7 @@ label_reverse_chronological_order: Dans l'ordre chronologique inverse
|
|||||||
label_planning: Planning
|
label_planning: Planning
|
||||||
label_incoming_emails: Emails entrants
|
label_incoming_emails: Emails entrants
|
||||||
label_generate_key: Générer une clé
|
label_generate_key: Générer une clé
|
||||||
label_issue_watchers: Utilisateurs surveillant cette demande
|
label_issue_watchers: Observateurs
|
||||||
label_example: Exemple
|
label_example: Exemple
|
||||||
|
|
||||||
button_login: Connexion
|
button_login: Connexion
|
||||||
|
@ -84,7 +84,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
entries.sort_by_name
|
entries.compact.sort_by_name
|
||||||
end
|
end
|
||||||
|
|
||||||
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
||||||
@ -148,15 +148,22 @@ module Redmine
|
|||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
# Returns an Entry from the given XML element
|
||||||
|
# or nil if the entry was deleted
|
||||||
def entry_from_xml(element, path_prefix)
|
def entry_from_xml(element, path_prefix)
|
||||||
|
modified_element = element.elements['modified']
|
||||||
|
if modified_element.elements['modified_how'].text.match(/removed/)
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
Entry.new({:name => element.attributes['name'],
|
Entry.new({:name => element.attributes['name'],
|
||||||
:path => path_prefix + element.attributes['name'],
|
:path => path_prefix + element.attributes['name'],
|
||||||
:kind => element.name == 'file' ? 'file' : 'dir',
|
:kind => element.name == 'file' ? 'file' : 'dir',
|
||||||
:size => nil,
|
:size => nil,
|
||||||
:lastrev => Revision.new({
|
:lastrev => Revision.new({
|
||||||
:identifier => nil,
|
:identifier => nil,
|
||||||
:scmid => element.elements['modified'].elements['patch'].attributes['hash']
|
:scmid => modified_element.elements['patch'].attributes['hash']
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -332,6 +332,30 @@ class IssuesControllerTest < Test::Unit::TestCase
|
|||||||
assert_equal 'activerecord_error_invalid', issue.errors.on(:custom_values)
|
assert_equal 'activerecord_error_invalid', issue.errors.on(:custom_values)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_post_new_with_watchers
|
||||||
|
@request.session[:user_id] = 2
|
||||||
|
ActionMailer::Base.deliveries.clear
|
||||||
|
|
||||||
|
assert_difference 'Watcher.count', 2 do
|
||||||
|
post :new, :project_id => 1,
|
||||||
|
:issue => {:tracker_id => 1,
|
||||||
|
:subject => 'This is a new issue with watchers',
|
||||||
|
:description => 'This is the description',
|
||||||
|
:priority_id => 5,
|
||||||
|
:watcher_user_ids => ['2', '3']}
|
||||||
|
end
|
||||||
|
assert_redirected_to 'issues/show'
|
||||||
|
|
||||||
|
issue = Issue.find_by_subject('This is a new issue with watchers')
|
||||||
|
# Watchers added
|
||||||
|
assert_equal [2, 3], issue.watcher_user_ids.sort
|
||||||
|
assert issue.watched_by?(User.find(3))
|
||||||
|
# Watchers notified
|
||||||
|
mail = ActionMailer::Base.deliveries.last
|
||||||
|
assert_kind_of TMail::Mail, mail
|
||||||
|
assert [mail.bcc, mail.cc].flatten.include?(User.find(3).mail)
|
||||||
|
end
|
||||||
|
|
||||||
def test_post_should_preserve_fields_values_on_validation_failure
|
def test_post_should_preserve_fields_values_on_validation_failure
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
post :new, :project_id => 1,
|
post :new, :project_id => 1,
|
||||||
|
@ -49,6 +49,12 @@ class RepositoryDarcsTest < Test::Unit::TestCase
|
|||||||
assert_equal 6, @repository.changesets.count
|
assert_equal 6, @repository.changesets.count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_deleted_files_should_not_be_listed
|
||||||
|
entries = @repository.entries('sources')
|
||||||
|
assert entries.detect {|e| e.name == 'watchers_controller.rb'}
|
||||||
|
assert_nil entries.detect {|e| e.name == 'welcome_controller.rb'}
|
||||||
|
end
|
||||||
|
|
||||||
def test_cat
|
def test_cat
|
||||||
@repository.fetch_changesets
|
@repository.fetch_changesets
|
||||||
cat = @repository.cat("sources/welcome_controller.rb", 2)
|
cat = @repository.cat("sources/welcome_controller.rb", 2)
|
||||||
|
@ -14,6 +14,8 @@ module Redmine
|
|||||||
class_eval do
|
class_eval do
|
||||||
has_many :watchers, :as => :watchable, :dependent => :delete_all
|
has_many :watchers, :as => :watchable, :dependent => :delete_all
|
||||||
has_many :watcher_users, :through => :watchers, :source => :user
|
has_many :watcher_users, :through => :watchers, :source => :user
|
||||||
|
|
||||||
|
attr_protected :watcher_ids, :watcher_user_ids
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user