Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
033f595713 | ||
|
|
13ec81598b | ||
|
|
a677817003 | ||
|
|
abaeecbaa9 | ||
|
|
75d652d9e5 | ||
|
|
7e9dd78de8 | ||
|
|
bd7542cf98 | ||
|
|
a2c18b2037 | ||
|
|
eb86e5e7e1 | ||
|
|
fc26668cd9 | ||
|
|
2b42e3fc50 | ||
|
|
b4eafd9ea8 | ||
|
|
2bcd448dda | ||
|
|
1af9c47a27 | ||
|
|
ea35fff5bf | ||
|
|
124ef65c1f | ||
|
|
361c50c1f4 | ||
|
|
27d6334afa | ||
|
|
963b1283c2 | ||
|
|
777edc13c1 | ||
|
|
d1a3fbea40 | ||
|
|
58610ec52a | ||
|
|
38b185f1dc | ||
|
|
e69631f26c | ||
|
|
47f399104b | ||
|
|
86319feef2 | ||
|
|
eb7cbd481e | ||
|
|
17c7886791 | ||
|
|
48949f979a | ||
|
|
86d756d22d | ||
|
|
ab4ff48abc | ||
|
|
63ef594033 | ||
|
|
bd8eded670 | ||
|
|
d5cc40c9b6 | ||
|
|
76ed8cc200 | ||
|
|
3539bef96b | ||
|
|
e29539df9c | ||
|
|
7e9c454478 |
@@ -30,7 +30,7 @@ class AccountController < ApplicationController
|
||||
|
||||
# show only public projects and private projects that the logged in user is also a member of
|
||||
@memberships = @user.memberships.select do |membership|
|
||||
membership.project.is_public? || (User.current.role_for_project(membership.project))
|
||||
membership.project.is_public? || (User.current.member_of?(membership.project))
|
||||
end
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
|
||||
@@ -48,7 +48,7 @@ class AdminController < ApplicationController
|
||||
def mail_options
|
||||
@notifiables = %w(issue_added issue_updated news_added document_added file_added message_posted)
|
||||
if request.post?
|
||||
settings = (params[:settings] || {}).dup
|
||||
settings = (params[:settings] || {}).dup.symbolize_keys
|
||||
settings[:notified_events] ||= []
|
||||
settings.each { |name, value| Setting[name] = value }
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
|
||||
@@ -144,6 +144,19 @@ class ApplicationController < ActionController::Base
|
||||
def accept_key_auth_actions
|
||||
self.class.read_inheritable_attribute('accept_key_auth_actions') || []
|
||||
end
|
||||
|
||||
# TODO: move to model
|
||||
def attach_files(obj, files)
|
||||
attachments = []
|
||||
if files && files.is_a?(Array)
|
||||
files.each do |file|
|
||||
next unless file.size > 0
|
||||
a = Attachment.create(:container => obj, :file => file, :author => User.current)
|
||||
attachments << a unless a.new_record?
|
||||
end
|
||||
end
|
||||
attachments
|
||||
end
|
||||
|
||||
# qvalues http header parser
|
||||
# code taken from webrick
|
||||
|
||||
@@ -45,14 +45,8 @@ class DocumentsController < ApplicationController
|
||||
end
|
||||
|
||||
def add_attachment
|
||||
# Save the attachments
|
||||
@attachments = []
|
||||
params[:attachments].each { |file|
|
||||
next unless file.size > 0
|
||||
a = Attachment.create(:container => @document, :file => file, :author => User.current)
|
||||
@attachments << a unless a.new_record?
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
Mailer.deliver_attachments_added(@attachments) if !@attachments.empty? && Setting.notified_events.include?('document_added')
|
||||
attachments = attach_files(@document, params[:attachments])
|
||||
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('document_added')
|
||||
redirect_to :action => 'show', :id => @document
|
||||
end
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ class IssuesController < ApplicationController
|
||||
|
||||
def edit
|
||||
@priorities = Enumeration::get_values('IPRI')
|
||||
@custom_values = []
|
||||
if request.get?
|
||||
@custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| @issue.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x, :customized => @issue) }
|
||||
else
|
||||
@@ -115,13 +116,8 @@ class IssuesController < ApplicationController
|
||||
|
||||
def add_note
|
||||
journal = @issue.init_journal(User.current, params[:notes])
|
||||
params[:attachments].each { |file|
|
||||
next unless file.size > 0
|
||||
a = Attachment.create(:container => @issue, :file => file, :author => User.current)
|
||||
journal.details << JournalDetail.new(:property => 'attachment',
|
||||
:prop_key => a.id,
|
||||
:value => a.filename) unless a.new_record?
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
attachments = attach_files(@issue, params[:attachments])
|
||||
attachments.each {|a| journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}
|
||||
if journal.save
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated')
|
||||
@@ -139,15 +135,8 @@ class IssuesController < ApplicationController
|
||||
journal = @issue.init_journal(User.current, params[:notes])
|
||||
@issue.status = @new_status
|
||||
if @issue.update_attributes(params[:issue])
|
||||
# Save attachments
|
||||
params[:attachments].each { |file|
|
||||
next unless file.size > 0
|
||||
a = Attachment.create(:container => @issue, :file => file, :author => User.current)
|
||||
journal.details << JournalDetail.new(:property => 'attachment',
|
||||
:prop_key => a.id,
|
||||
:value => a.filename) unless a.new_record?
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
|
||||
attachments = attach_files(@issue, params[:attachments])
|
||||
attachments.each {|a| journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}
|
||||
# Log time
|
||||
if current_role.allowed_to?(:log_time)
|
||||
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
|
||||
|
||||
@@ -42,9 +42,7 @@ class MessagesController < ApplicationController
|
||||
@message.sticky = params[:message]['sticky']
|
||||
end
|
||||
if request.post? && @message.save
|
||||
params[:attachments].each { |file|
|
||||
Attachment.create(:container => @message, :file => file, :author => User.current) if file.size > 0
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
attach_files(@message, params[:attachments])
|
||||
redirect_to :action => 'show', :id => @message
|
||||
end
|
||||
end
|
||||
@@ -56,9 +54,7 @@ class MessagesController < ApplicationController
|
||||
@reply.board = @board
|
||||
@topic.children << @reply
|
||||
if !@reply.new_record?
|
||||
params[:attachments].each { |file|
|
||||
Attachment.create(:container => @reply, :file => file, :author => User.current) if file.size > 0
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
attach_files(@reply, params[:attachments])
|
||||
end
|
||||
redirect_to :action => 'show', :id => @topic
|
||||
end
|
||||
@@ -70,9 +66,7 @@ class MessagesController < ApplicationController
|
||||
@message.sticky = params[:message]['sticky']
|
||||
end
|
||||
if request.post? && @message.update_attributes(params[:message])
|
||||
params[:attachments].each { |file|
|
||||
Attachment.create(:container => @message, :file => file, :author => User.current) if file.size > 0
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
attach_files(@message, params[:attachments])
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_to :action => 'show', :id => @topic
|
||||
end
|
||||
|
||||
@@ -181,10 +181,7 @@ class ProjectsController < ApplicationController
|
||||
def add_document
|
||||
@document = @project.documents.build(params[:document])
|
||||
if request.post? and @document.save
|
||||
# Save the attachments
|
||||
params[:attachments].each { |a|
|
||||
Attachment.create(:container => @document, :file => a, :author => User.current) unless a.size == 0
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
attach_files(@document, params[:attachments])
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
Mailer.deliver_document_added(@document) if Setting.notified_events.include?('document_added')
|
||||
redirect_to :action => 'list_documents', :id => @project
|
||||
@@ -237,10 +234,7 @@ class ProjectsController < ApplicationController
|
||||
@custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
|
||||
@issue.custom_values = @custom_values
|
||||
if @issue.save
|
||||
if params[:attachments] && params[:attachments].is_a?(Array)
|
||||
# Save attachments
|
||||
params[:attachments].each {|a| Attachment.create(:container => @issue, :file => a, :author => User.current) unless a.size == 0}
|
||||
end
|
||||
attach_files(@issue, params[:attachments])
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
|
||||
redirect_to :controller => 'issues', :action => 'index', :project_id => @project
|
||||
@@ -345,14 +339,8 @@ class ProjectsController < ApplicationController
|
||||
def add_file
|
||||
if request.post?
|
||||
@version = @project.versions.find_by_id(params[:version_id])
|
||||
# Save the attachments
|
||||
@attachments = []
|
||||
params[:attachments].each { |file|
|
||||
next unless file.size > 0
|
||||
a = Attachment.create(:container => @version, :file => file, :author => User.current)
|
||||
@attachments << a unless a.new_record?
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
Mailer.deliver_attachments_added(@attachments) if !@attachments.empty? && Setting.notified_events.include?('file_added')
|
||||
attachments = attach_files(@version, params[:attachments])
|
||||
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('file_added')
|
||||
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
|
||||
end
|
||||
@versions = @project.versions.sort
|
||||
|
||||
@@ -92,6 +92,9 @@ class RepositoriesController < ApplicationController
|
||||
show_error and return unless @content
|
||||
if 'raw' == params[:format]
|
||||
send_data @content, :filename => @path.split('/').last
|
||||
else
|
||||
# Prevent empty lines when displaying a file with Windows style eol
|
||||
@content.gsub!("\r\n", "\n")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -109,12 +109,4 @@ class UsersController < ApplicationController
|
||||
end
|
||||
redirect_to :action => 'edit', :id => @user and return
|
||||
end
|
||||
|
||||
def destroy
|
||||
User.find(params[:id]).destroy
|
||||
redirect_to :action => 'list'
|
||||
rescue
|
||||
flash[:error] = "Unable to delete user"
|
||||
redirect_to :action => 'list'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -154,11 +154,7 @@ class WikiController < ApplicationController
|
||||
|
||||
def add_attachment
|
||||
@page = @wiki.find_page(params[:page])
|
||||
# Save the attachments
|
||||
params[:attachments].each { |file|
|
||||
next unless file.size > 0
|
||||
a = Attachment.create(:container => @page, :file => file, :author => User.current)
|
||||
} if params[:attachments] and params[:attachments].is_a? Array
|
||||
attach_files(@page, params[:attachments])
|
||||
redirect_to :action => 'index', :page => @page.title
|
||||
end
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class WikisController < ApplicationController
|
||||
def edit
|
||||
@wiki = @project.wiki || Wiki.new(:project => @project)
|
||||
@wiki.attributes = params[:wiki]
|
||||
@wiki.save if @request.post?
|
||||
@wiki.save if request.post?
|
||||
render(:update) {|page| page.replace_html "tab-content-wiki", :partial => 'projects/settings/wiki'}
|
||||
end
|
||||
|
||||
|
||||
@@ -179,9 +179,9 @@ module ProjectsHelper
|
||||
end
|
||||
|
||||
# today red line
|
||||
if Date.today >= @date_from and Date.today <= @date_to
|
||||
if Date.today >= date_from and Date.today <= date_to
|
||||
gc.stroke('red')
|
||||
x = (Date.today-@date_from+1)*zoom + subject_width
|
||||
x = (Date.today-date_from+1)*zoom + subject_width
|
||||
gc.line(x, headers_heigth, x, headers_heigth + g_height-1)
|
||||
end
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ class AuthSource < ActiveRecord::Base
|
||||
|
||||
validates_presence_of :name
|
||||
validates_uniqueness_of :name
|
||||
validates_length_of :name, :host, :account_password, :maximum => 60
|
||||
validates_length_of :name, :host, :maximum => 60
|
||||
validates_length_of :account_password, :maximum => 60, :allow_nil => true
|
||||
validates_length_of :account, :base_dn, :maximum => 255
|
||||
validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ class AuthSourceLdap < AuthSource
|
||||
end
|
||||
|
||||
def authenticate(login, password)
|
||||
return nil if login.blank? || password.blank?
|
||||
attrs = []
|
||||
# get user's DN
|
||||
ldap_con = initialize_ldap_con(self.account, self.account_password)
|
||||
|
||||
@@ -43,6 +43,9 @@ class CustomField < ActiveRecord::Base
|
||||
def before_validation
|
||||
# remove empty values
|
||||
self.possible_values = self.possible_values.collect{|v| v unless v.empty?}.compact
|
||||
# make sure these fields are not searchable
|
||||
self.searchable = false if %w(int float date bool).include?(field_format)
|
||||
true
|
||||
end
|
||||
|
||||
def validate
|
||||
|
||||
@@ -79,7 +79,8 @@ class Project < ActiveRecord::Base
|
||||
conditions = ["#{Issue.table_name}.project_id IN (#{ids.join(',')})"]
|
||||
end
|
||||
conditions ||= ["#{Issue.table_name}.project_id = ?", id]
|
||||
Issue.with_scope :find => { :conditions => conditions } do
|
||||
# Quick and dirty fix for Rails 2 compatibility
|
||||
Issue.send(:with_scope, :find => { :conditions => conditions }) do
|
||||
yield
|
||||
end
|
||||
end
|
||||
|
||||
@@ -54,7 +54,6 @@ class Query < ActiveRecord::Base
|
||||
serialize :column_names
|
||||
|
||||
attr_protected :project, :user
|
||||
attr_accessor :executed_by
|
||||
|
||||
validates_presence_of :name, :on => :save
|
||||
validates_length_of :name, :maximum => 255
|
||||
@@ -112,8 +111,7 @@ class Query < ActiveRecord::Base
|
||||
def initialize(attributes = nil)
|
||||
super attributes
|
||||
self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
|
||||
@executed_by = User.current.logged? ? User.current : nil
|
||||
set_language_if_valid(executed_by.language) if executed_by
|
||||
set_language_if_valid(User.current.language)
|
||||
end
|
||||
|
||||
def validate
|
||||
@@ -145,12 +143,12 @@ class Query < ActiveRecord::Base
|
||||
"done_ratio" => { :type => :integer, :order => 13 }}
|
||||
|
||||
user_values = []
|
||||
user_values << ["<< #{l(:label_me)} >>", "me"] if executed_by
|
||||
user_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
|
||||
if project
|
||||
user_values += project.users.sort.collect{|s| [s.name, s.id.to_s] }
|
||||
elsif executed_by
|
||||
else
|
||||
# members of the user's projects
|
||||
user_values += executed_by.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] }
|
||||
user_values += User.current.projects.collect(&:users).flatten.uniq.sort.collect{|s| [s.name, s.id.to_s] }
|
||||
end
|
||||
@available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => user_values } unless user_values.empty?
|
||||
@available_filters["author_id"] = { :type => :list, :order => 5, :values => user_values } unless user_values.empty?
|
||||
@@ -267,7 +265,7 @@ class Query < ActiveRecord::Base
|
||||
elsif project
|
||||
clause << "#{Issue.table_name}.project_id=%d" % project.id
|
||||
else
|
||||
clause << Project.visible_by(executed_by)
|
||||
clause << Project.visible_by(User.current)
|
||||
end
|
||||
|
||||
# filters clauses
|
||||
@@ -292,7 +290,7 @@ class Query < ActiveRecord::Base
|
||||
|
||||
# "me" value subsitution
|
||||
if %w(assigned_to_id author_id).include?(field)
|
||||
v.push(executed_by ? executed_by.id.to_s : "0") if v.delete("me")
|
||||
v.push(User.current.logged? ? User.current.id.to_s : "0") if v.delete("me")
|
||||
end
|
||||
|
||||
case operator_for field
|
||||
|
||||
@@ -74,6 +74,8 @@ class User < ActiveRecord::Base
|
||||
|
||||
# Returns the user that matches provided login and password, or nil
|
||||
def self.try_to_login(login, password)
|
||||
# Make sure no one can sign in with an empty password
|
||||
return nil if password.to_s.empty?
|
||||
user = find(:first, :conditions => ["login=?", login])
|
||||
if user
|
||||
# user is already in local database
|
||||
|
||||
@@ -25,8 +25,8 @@ class WikiContent < ActiveRecord::Base
|
||||
|
||||
acts_as_versioned
|
||||
class Version
|
||||
belongs_to :page, :class_name => 'WikiPage', :foreign_key => 'page_id'
|
||||
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
||||
belongs_to :page, :class_name => '::WikiPage', :foreign_key => 'page_id'
|
||||
belongs_to :author, :class_name => '::User', :foreign_key => 'author_id'
|
||||
attr_protected :data
|
||||
|
||||
acts_as_event :title => Proc.new {|o| "#{l(:label_wiki_edit)}: #{o.page.title} (##{o.version})"},
|
||||
|
||||
@@ -7,21 +7,32 @@ function toggle_custom_field_format() {
|
||||
p_length = $("custom_field_min_length");
|
||||
p_regexp = $("custom_field_regexp");
|
||||
p_values = $("custom_field_possible_values");
|
||||
p_searchable = $("custom_field_searchable");
|
||||
switch (format.value) {
|
||||
case "list":
|
||||
Element.hide(p_length.parentNode);
|
||||
Element.hide(p_regexp.parentNode);
|
||||
Element.show(p_searchable.parentNode);
|
||||
Element.show(p_values);
|
||||
break;
|
||||
case "date":
|
||||
case "bool":
|
||||
Element.hide(p_length.parentNode);
|
||||
Element.hide(p_regexp.parentNode);
|
||||
Element.hide(p_searchable.parentNode);
|
||||
Element.hide(p_values);
|
||||
break;
|
||||
case "float":
|
||||
case "int":
|
||||
Element.show(p_length.parentNode);
|
||||
Element.show(p_regexp.parentNode);
|
||||
Element.hide(p_searchable.parentNode);
|
||||
Element.hide(p_values);
|
||||
break;
|
||||
default:
|
||||
Element.show(p_length.parentNode);
|
||||
Element.show(p_regexp.parentNode);
|
||||
Element.show(p_searchable.parentNode);
|
||||
Element.hide(p_values);
|
||||
break;
|
||||
}
|
||||
@@ -47,7 +58,6 @@ function deleteValueField(e) {
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
<!--[form:custom_field]-->
|
||||
<div class="box">
|
||||
<p><%= f.text_field :name, :required => true %></p>
|
||||
<p><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();" %></p>
|
||||
@@ -59,11 +69,8 @@ function deleteValueField(e) {
|
||||
<% (@custom_field.possible_values.to_a + [""]).each do |value| %>
|
||||
<span><%= text_field_tag 'custom_field[possible_values][]', value, :size => 30 %> <%= image_to_function "delete.png", "deleteValueField(this);return false" %><br /></span>
|
||||
<% end %>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
<%= javascript_tag "toggle_custom_field_format();" %>
|
||||
<!--[eoform:custom_field]-->
|
||||
|
||||
<div class="box">
|
||||
<% case @custom_field.type.to_s
|
||||
@@ -78,6 +85,7 @@ when "IssueCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
<p><%= f.check_box :is_for_all %></p>
|
||||
<p><%= f.check_box :is_filter %></p>
|
||||
<p><%= f.check_box :searchable %></p>
|
||||
|
||||
<% when "UserCustomField" %>
|
||||
<p><%= f.check_box :is_required %></p>
|
||||
@@ -87,3 +95,4 @@ when "IssueCustomField" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<%= javascript_tag "toggle_custom_field_format();" %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %>
|
||||
<select onchange="if (this.value != '') { window.location = this.value; }">
|
||||
<option selected><%= l(:label_jump_to_a_project) %></option>
|
||||
<option disabled>---</option>
|
||||
<option selected="selected"><%= l(:label_jump_to_a_project) %></option>
|
||||
<option disabled="disabled">---</option>
|
||||
<% user_projects_by_root.keys.sort.each do |root| %>
|
||||
<%= content_tag('option', h(root.name), :value => url_for(:controller => 'projects', :action => 'show', :id => root)) %>
|
||||
<% user_projects_by_root[root].sort.each do |project| %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title><%=h html_title %></title>
|
||||
@@ -73,7 +73,7 @@
|
||||
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
|
||||
|
||||
<div id="footer">
|
||||
Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> <%= Redmine::VERSION %> © 2006-2007 Jean-Philippe Lang
|
||||
Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> <%= Redmine::VERSION %> © 2006-2007 Jean-Philippe Lang
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<p><%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless @project %>
|
||||
<%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %>
|
||||
<%= "(#{news.comments_count} #{lwr(:label_comment, news.comments_count).downcase})" if news.comments_count > 0 %></span>
|
||||
<%= "(#{news.comments_count} #{lwr(:label_comment, news.comments_count).downcase})" if news.comments_count > 0 %>
|
||||
<br />
|
||||
<% unless news.summary.blank? %><span class="summary"><%=h news.summary %></span><br /><% end %>
|
||||
<span class="author"><%= authoring news.created_on, news.author %></p>
|
||||
<span class="author"><%= authoring news.created_on, news.author %></span></p>
|
||||
|
||||
@@ -30,16 +30,17 @@
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
||||
</div>
|
||||
<%= simple_format(auto_link(h(comment.comments)))%>
|
||||
<%= textilizable(comment.comments) %>
|
||||
<% end if @news.comments_count > 0 %>
|
||||
</div>
|
||||
|
||||
<% if authorize_for 'news', 'add_comment' %>
|
||||
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
|
||||
<% form_tag({:action => 'add_comment', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
|
||||
<%= text_area 'comment', 'comments', :cols => 60, :rows => 6 %>
|
||||
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
|
||||
<%= wikitoolbar_for 'comment_comments' %>
|
||||
<p><%= submit_tag l(:button_add) %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% set_html_title h(@news.title) -%>
|
||||
<% set_html_title(h(@news.title)) -%>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</tr>
|
||||
<% line_num += 1 %>
|
||||
<% end %>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
<%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %></p>
|
||||
<% end %>
|
||||
|
||||
<div class="autoscroll">
|
||||
<% cache(@cache_key) do %>
|
||||
<% @diff.each do |table_file| %>
|
||||
<div class="autoscroll">
|
||||
<% if @diff_type == 'sbs' %>
|
||||
<table class="filecontent CodeRay">
|
||||
<thead>
|
||||
@@ -84,9 +84,9 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag "scm" %>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</tr>
|
||||
<% line_num += 1 %>
|
||||
<% end %>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
|
||||
<%= link_to_attachments @page.attachments, :delete_url => (authorize_for('wiki', 'destroy_attachment') ? {:controller => 'wiki', :action => 'destroy_attachment', :page => @page.title} : nil) %>
|
||||
|
||||
<div class="contextual">
|
||||
<%= l(:label_export_to) %>
|
||||
<%= link_to 'HTML', {:page => @page.title, :export => 'html', :version => @content.version}, :class => 'icon icon-html' %>,
|
||||
<%= link_to 'TXT', {:page => @page.title, :export => 'txt', :version => @content.version}, :class => 'icon icon-txt' %>
|
||||
</div>
|
||||
|
||||
<% if authorize_for('wiki', 'add_attachment') %>
|
||||
<p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p>
|
||||
<% form_tag({ :controller => 'wiki', :action => 'add_attachment', :page => @page.title }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %>
|
||||
@@ -38,6 +32,13 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="contextual">
|
||||
<%= l(:label_export_to) %>
|
||||
<%= link_to 'HTML', {:page => @page.title, :export => 'html', :version => @content.version}, :class => 'icon icon-html' %>,
|
||||
<%= link_to 'TXT', {:page => @page.title, :export => 'txt', :version => @content.version}, :class => 'icon icon-txt' %>
|
||||
</div>
|
||||
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag 'scm' %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class AllowNullVersionEffectiveDate < ActiveRecord::Migration
|
||||
def self.up
|
||||
change_column :versions, :effective_date, :date, :default => nil
|
||||
change_column :versions, :effective_date, :date, :default => nil, :null => true
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
class AllowNullPosition < ActiveRecord::Migration
|
||||
def self.up
|
||||
# removes the 'not null' constraint on position fields
|
||||
change_column :issue_statuses, :position, :integer, :default => 1
|
||||
change_column :roles, :position, :integer, :default => 1
|
||||
change_column :trackers, :position, :integer, :default => 1
|
||||
change_column :boards, :position, :integer, :default => 1
|
||||
change_column :enumerations, :position, :integer, :default => 1
|
||||
change_column :issue_statuses, :position, :integer, :default => 1, :null => true
|
||||
change_column :roles, :position, :integer, :default => 1, :null => true
|
||||
change_column :trackers, :position, :integer, :default => 1, :null => true
|
||||
change_column :boards, :position, :integer, :default => 1, :null => true
|
||||
change_column :enumerations, :position, :integer, :default => 1, :null => true
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
||||
9
db/migrate/086_add_custom_fields_searchable.rb
Normal file
9
db/migrate/086_add_custom_fields_searchable.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class AddCustomFieldsSearchable < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :custom_fields, :searchable, :boolean, :default => false
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :custom_fields, :searchable
|
||||
end
|
||||
end
|
||||
@@ -1,10 +1,46 @@
|
||||
== Redmine changelog
|
||||
|
||||
Redmine - project management software
|
||||
Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
Copyright (C) 2006-2008 Jean-Philippe Lang
|
||||
http://www.redmine.org/
|
||||
|
||||
|
||||
== 2007-03-12 v0.6.4
|
||||
|
||||
* Fixed: private projects name are displayed on account/show even if the current user doesn't have access to these private projects
|
||||
* Fixed: potential LDAP authentication security flaw
|
||||
* Fixed: context submenus on the issue list don't show up with IE6.
|
||||
* Fixed: Themes are not applied with Rails 2.0
|
||||
* Fixed: crash when fetching Mercurial changesets if changeset[:files] is nil
|
||||
* Fixed: Mercurial repository browsing
|
||||
* Fixed: undefined local variable or method 'log' in CvsAdapter when a cvs command fails
|
||||
* Fixed: not null constraints not removed with Postgresql
|
||||
* Doctype set to transitional
|
||||
|
||||
|
||||
== 2007-12-18 v0.6.3
|
||||
|
||||
* Fixed: upload doesn't work in 'Files' section
|
||||
|
||||
|
||||
== 2007-12-16 v0.6.2
|
||||
|
||||
* Search engine: issue custom fields can now be searched
|
||||
* News comments are now textilized
|
||||
* Updated Japanese translation (Satoru Kurashiki)
|
||||
* Updated Chinese translation (Shortie Lo)
|
||||
* Fixed Rails 2.0 compatibility bugs:
|
||||
* Unable to create a wiki
|
||||
* Gantt and calendar error
|
||||
* Trac importer error (readonly? is defined by ActiveRecord)
|
||||
* Fixed: 'assigned to me' filter broken
|
||||
* Fixed: crash when validation fails on issue edition with no custom fields
|
||||
* Fixed: reposman "can't find group" error
|
||||
* Fixed: 'LDAP account password is too long' error when leaving the field empty on creation
|
||||
* Fixed: empty lines when displaying repository files with Windows style eol
|
||||
* Fixed: missing body closing tag in repository annotate and entry views
|
||||
|
||||
|
||||
== 2007-12-10 v0.6.1
|
||||
|
||||
* Rails 2.0 compatibility
|
||||
@@ -26,7 +62,7 @@ http://www.redmine.org/
|
||||
* Diff style (inline or side by side) automatically saved as a user preference
|
||||
* Added issues status changes on the activity view (by Cyril Mougel)
|
||||
* Added forums topics on the activity view (disabled by default)
|
||||
* Added an option on 'My account' for users who don’t want to be notified of changes that they make
|
||||
* Added an option on 'My account' for users who don't want to be notified of changes that they make
|
||||
* Trac importer now supports mysql and postgresql databases
|
||||
* Trac importer improvements (by Mat Trudel)
|
||||
* 'fixed version' field can now be displayed on the issue list
|
||||
@@ -61,7 +97,7 @@ http://www.redmine.org/
|
||||
* Fixed: admin should be able to move issues to any project
|
||||
* Fixed: adding an attachment is not possible when changing the status of an issue
|
||||
* Fixed: No mime-types in documents/files downloading
|
||||
* Fixed: error when sorting the messages if there’s only one board for the project
|
||||
* Fixed: error when sorting the messages if there's only one board for the project
|
||||
* Fixed: 'me' doesn't appear in the drop down filters on a project issue list.
|
||||
|
||||
== 2007-11-04 v0.6.0
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
== Redmine installation
|
||||
|
||||
Redmine - project management software
|
||||
Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
Copyright (C) 2006-2008 Jean-Philippe Lang
|
||||
http://www.redmine.org/
|
||||
|
||||
|
||||
== Requirements
|
||||
|
||||
* Ruby on Rails 1.2.5 or 2.0.1
|
||||
* Ruby on Rails 1.2.6 or 2.0.2
|
||||
* A database (see compatibility below)
|
||||
|
||||
Optional:
|
||||
|
||||
@@ -8,6 +8,14 @@ Subversion
|
||||
svnadmin create tmp/test/subversion_repository
|
||||
gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load tmp/test/subversion_repository
|
||||
|
||||
CVS
|
||||
---
|
||||
gunzip < test/fixtures/repositories/cvs_repository.tar.gz | tar -xv -C tmp/test
|
||||
|
||||
Bazaar
|
||||
------
|
||||
gunzip < test/fixtures/repositories/bazaar_repository.tar.gz | tar -xv -C tmp/test
|
||||
gunzip < test/fixtures/repositories/bazaar_repository.tar.gz | tar -xv -C tmp/test
|
||||
|
||||
Mercurial
|
||||
---------
|
||||
gunzip < test/fixtures/repositories/mercurial_repository.tar.gz | tar -xv -C tmp/test
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
== Redmine upgrade procedure
|
||||
|
||||
Redmine - project management software
|
||||
Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
Copyright (C) 2006-2008 Jean-Philippe Lang
|
||||
http://www.redmine.org/
|
||||
|
||||
|
||||
@@ -20,16 +20,10 @@ http://www.redmine.org/
|
||||
|
||||
6. Copy the RAILS_ROOT/files directory content into your new installation
|
||||
|
||||
Note 1: Rails 1.2.2 or higher is required for version 0.4.2 and later.
|
||||
Note 1: Rails 1.2.6 or higher is required
|
||||
|
||||
Note 2: when upgrading your code with svn update, don't forget to clear
|
||||
the application cache (RAILS_ROOT/tmp/cache) before restarting.
|
||||
|
||||
Note 3: settings previously defined in custom_config.rb are now stored
|
||||
in database, as of version 0.4.2. Go to "Admin -> Settings" to edit them.
|
||||
|
||||
|
||||
== From 0.2.x and below
|
||||
|
||||
Due to major database changes since 0.2.x, there is no migration support
|
||||
from 0.2.x and previous versions.
|
||||
|
||||
@@ -78,6 +78,7 @@ $quiet = false
|
||||
$redmine_host = ''
|
||||
$repos_base = ''
|
||||
$svn_owner = 'root'
|
||||
$use_groupid = true
|
||||
$svn_url = false
|
||||
$test = false
|
||||
|
||||
@@ -92,7 +93,7 @@ begin
|
||||
case opt
|
||||
when '--svn-dir'; $repos_base = arg.dup
|
||||
when '--redmine-host'; $redmine_host = arg.dup
|
||||
when '--owner'; $svn_owner = arg.dup
|
||||
when '--owner'; $svn_owner = arg.dup; $use_groupid = false;
|
||||
when '--url'; $svn_url = arg.dup
|
||||
when '--verbose'; $verbose += 1
|
||||
when '--test'; $test = true
|
||||
@@ -144,7 +145,7 @@ def set_owner_and_rights(project, repos_path, &block)
|
||||
if RUBY_PLATFORM =~ /mswin/
|
||||
yield if block_given?
|
||||
else
|
||||
uid, gid = Etc.getpwnam($svn_owner).uid, Etc.getgrnam(project.identifier).gid
|
||||
uid, gid = Etc.getpwnam($svn_owner).uid, ($use_groupid ? Etc.getgrnam(project.identifier).gid : 0)
|
||||
right = project.is_public ? 0775 : 0770
|
||||
yield if block_given?
|
||||
Find.find(repos_path) do |f|
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Muss mindestens %d Zeichen lang sein.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -170,6 +170,7 @@ field_redirect_existing_links: Redirect existing links
|
||||
field_estimated_hours: Estimated time
|
||||
field_column_names: Columns
|
||||
field_time_zone: Time zone
|
||||
field_searchable: Searchable
|
||||
|
||||
setting_app_title: Application title
|
||||
setting_app_subtitle: Application subtitle
|
||||
|
||||
@@ -552,3 +552,4 @@ setting_time_format: Formato de hora
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -170,6 +170,7 @@ field_redirect_existing_links: Rediriger les liens existants
|
||||
field_estimated_hours: Temps estimé
|
||||
field_column_names: Colonnes
|
||||
field_time_zone: Fuseau horaire
|
||||
field_searchable: Utilisé pour les recherches
|
||||
|
||||
setting_app_title: Titre de l'application
|
||||
setting_app_subtitle: Sous-titre de l'application
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
81
lang/ja.yml
81
lang/ja.yml
@@ -72,13 +72,13 @@ notice_locking_conflict: 別のユーザがデータを更新しています。
|
||||
notice_scm_error: リポジトリに、エントリ/リビジョンが存在しません。
|
||||
notice_not_authorized: このページにアクセスするには認証が必要です。
|
||||
notice_email_sent: %s宛にメールを送信しました。
|
||||
notice_email_error: メール送信中にエラーが発生しました (%s)
|
||||
notice_email_error: メール送信中にエラーが発生しました(%s)
|
||||
notice_feeds_access_key_reseted: RSSアクセスキーを初期化しました。
|
||||
|
||||
mail_subject_lost_password: redMineパスワード
|
||||
mail_subject_lost_password: Redmineパスワード
|
||||
mail_body_lost_password: 'パスワードを変更するには、以下のリンクをたどってください:'
|
||||
mail_subject_register: redMineアカウントが有効になりました
|
||||
mail_body_register: 'Redmine アカウントをアクティブにするには、以下のリンクをたどってください:'
|
||||
mail_subject_register: Redmineアカウントが有効になりました
|
||||
mail_body_register: 'Redmineアカウントをアクティブにするには、以下のリンクをたどってください:'
|
||||
|
||||
gui_validation_error: 1件のエラー
|
||||
gui_validation_error_plural: %d件のエラー
|
||||
@@ -159,8 +159,8 @@ field_identifier: 識別子
|
||||
field_is_filter: フィルタとして使う
|
||||
field_issue_to_id: 関連する問題
|
||||
field_delay: 遅延
|
||||
field_assignable: Issues can be assigned to this role
|
||||
field_redirect_existing_links: Redirect existing links
|
||||
field_assignable: 問題はこのロールに割り当てることができます
|
||||
field_redirect_existing_links: 既存のリンクをリダイレクトする
|
||||
field_estimated_hours: 予定工数
|
||||
|
||||
setting_app_title: アプリケーションのタイトル
|
||||
@@ -410,18 +410,18 @@ label_message_last: 最新のメッセージ
|
||||
label_message_new: 新しいメッセージ
|
||||
label_reply_plural: 返答
|
||||
label_send_information: アカウント情報をユーザに送信
|
||||
label_year: Year
|
||||
label_month: Month
|
||||
label_week: Week
|
||||
label_date_from: From
|
||||
label_date_to: To
|
||||
label_year: 年
|
||||
label_month: 月
|
||||
label_week: 週
|
||||
label_date_from: から
|
||||
label_date_to: まで
|
||||
label_language_based: 既定の言語の設定に従う
|
||||
label_sort_by: Sort by %s
|
||||
label_sort_by: %sで並び替え
|
||||
label_send_test_email: テストメールを送信
|
||||
label_feeds_access_key_created_on: RSS access key created %s ago
|
||||
label_module_plural: Modules
|
||||
label_added_time_by: Added by %s %s ago
|
||||
label_updated_time: Updated %s ago
|
||||
label_feeds_access_key_created_on: RSSアクセスキーは%s前に作成されました
|
||||
label_module_plural: モジュール
|
||||
label_added_time_by: %sが%s前に追加しました
|
||||
label_updated_time: %s前に更新されました
|
||||
label_jump_to_a_project: プロジェクトへ移動...
|
||||
|
||||
button_login: ログイン
|
||||
@@ -454,8 +454,8 @@ button_unwatch: ウォッチをやめる
|
||||
button_reply: 返答
|
||||
button_archive: 書庫に保存
|
||||
button_unarchive: 書庫から戻す
|
||||
button_reset: Reset
|
||||
button_rename: Rename
|
||||
button_reset: リセット
|
||||
button_rename: 名前変更
|
||||
|
||||
status_active: 有効
|
||||
status_registered: 登録
|
||||
@@ -482,10 +482,10 @@ text_comma_separated: (カンマで区切った)複数の値が使えます
|
||||
text_issues_ref_in_commit_messages: コミットメッセージ内で問題の参照/修正
|
||||
text_issue_added: 問題 %s が報告されました。
|
||||
text_issue_updated: 問題 %s が更新されました。
|
||||
text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and all its content ?
|
||||
text_issue_category_destroy_question: Some issues (%d) are assigned to this category. What do you want to do ?
|
||||
text_issue_category_destroy_assignments: Remove category assignments
|
||||
text_issue_category_reassign_to: Reassing issues to this category
|
||||
text_wiki_destroy_confirmation: 本当にこのwikiとその内容の全てを削除しますか?
|
||||
text_issue_category_destroy_question: このカテゴリに割り当て済みの問題(%d)があります。何をしようとしていますか?
|
||||
text_issue_category_destroy_assignments: カテゴリの割り当てを削除する
|
||||
text_issue_category_reassign_to: 問題をこのカテゴリに再割り当てする
|
||||
|
||||
default_role_manager: 管理者
|
||||
default_role_developper: 開発者
|
||||
@@ -512,8 +512,8 @@ default_activity_development: 開発作業
|
||||
enumeration_issue_priorities: 問題の優先度
|
||||
enumeration_doc_categories: 文書カテゴリ
|
||||
enumeration_activities: 作業分類 (時間トラッキング)
|
||||
label_file_plural: Files
|
||||
label_changeset_plural: Changesets
|
||||
label_file_plural: ファイル
|
||||
label_changeset_plural: チェンジセット
|
||||
field_column_names: 項目
|
||||
label_default_columns: 既定の項目
|
||||
setting_issue_list_default_columns: 問題の一覧で表示する項目
|
||||
@@ -534,19 +534,20 @@ label_user_mail_option_none: "ウォッチまたは関係している問題の
|
||||
setting_emails_footer: メールのフッタ
|
||||
label_float: 小数
|
||||
button_copy: コピー
|
||||
mail_body_account_information_external: You can use your "%s" account to log into Redmine.
|
||||
mail_body_account_information: Your Redmine account information
|
||||
setting_protocol: Protocol
|
||||
label_user_mail_no_self_notified: "I don't want to be notified of changes that I make myself"
|
||||
setting_time_format: Time format
|
||||
label_registration_activation_by_email: account activation by email
|
||||
mail_subject_account_activation_request: Redmine account activation request
|
||||
mail_body_account_activation_request: 'A new user (%s) has registered. His account his pending your approval:'
|
||||
label_registration_automatic_activation: automatic account activation
|
||||
label_registration_manual_activation: manual account activation
|
||||
notice_account_pending: "Your account was created and is now pending administrator approval."
|
||||
field_time_zone: Time zone
|
||||
text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
mail_body_account_information_external: 「%s」アカウントを使ってRedmineにログインできます。
|
||||
mail_body_account_information: Redmineアカウント情報
|
||||
setting_protocol: プロトコル
|
||||
label_user_mail_no_self_notified: 自分自身による変更の通知は不要です
|
||||
setting_time_format: 時刻の形式
|
||||
label_registration_activation_by_email: メールでアカウントを有効化
|
||||
mail_subject_account_activation_request: Redminアカウントの有効化要求
|
||||
mail_body_account_activation_request: 新しいユーザ(%s)が登録しています。このアカウントはあなたの承認待ちです:
|
||||
label_registration_automatic_activation: 自動でアカウントを有効化
|
||||
label_registration_manual_activation: 手動でアカウントを有効化
|
||||
notice_account_pending: アカウントは作成済みで、管理者の承認待ちです。
|
||||
field_time_zone: タイムゾーン
|
||||
text_caracters_minimum: 最低%d文字の長さが必要です
|
||||
setting_bcc_recipients: ブラインドカーボンコピーで受信(bcc)
|
||||
button_annotate: 注釈
|
||||
label_issues_by: %s別の問題
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -550,3 +550,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Musi być nie krótsze niż %d znaków.
|
||||
setting_bcc_recipients: Odbiorcy kopii tajnej (kt/bcc)
|
||||
button_annotate: Adnotuj
|
||||
label_issues_by: Zagadnienia wprowadzone przez %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -549,3 +549,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -550,3 +550,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -550,3 +550,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -5,8 +5,8 @@ actionview_datehelper_select_month_names: 一月,二月,三月,四月,五月,六
|
||||
actionview_datehelper_select_month_names_abbr: 一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月
|
||||
actionview_datehelper_select_month_prefix:
|
||||
actionview_datehelper_select_year_prefix:
|
||||
actionview_datehelper_time_in_words_day: 1 日
|
||||
actionview_datehelper_time_in_words_day_plural: %d 日
|
||||
actionview_datehelper_time_in_words_day: 1 天
|
||||
actionview_datehelper_time_in_words_day_plural: %d 天
|
||||
actionview_datehelper_time_in_words_hour_about: 約 1 小時
|
||||
actionview_datehelper_time_in_words_hour_about_plural: 約 %d 小時
|
||||
actionview_datehelper_time_in_words_hour_about_single: 約 1 小時
|
||||
@@ -46,10 +46,10 @@ general_text_No: 'No'
|
||||
general_text_Yes: 'Yes'
|
||||
general_text_no: 'no'
|
||||
general_text_yes: 'yes'
|
||||
general_lang_name: 'Traditional Chinese (繁體中文)'
|
||||
general_lang_name: 'Chinese (繁體中文)'
|
||||
general_csv_separator: ','
|
||||
general_csv_encoding: ISO-8859-1
|
||||
general_pdf_encoding: big5
|
||||
general_csv_encoding: Big5
|
||||
general_pdf_encoding: Big5
|
||||
general_day_names: 星期一,星期二,星期三,星期四,星期五,星期六,星期日
|
||||
general_first_day_of_week: '7'
|
||||
|
||||
@@ -62,9 +62,9 @@ notice_account_unknown_email: Unknown user.
|
||||
notice_can_t_change_password: This account uses an external authentication source. Impossible to change the password.
|
||||
notice_account_lost_email_sent: An email with instructions to choose a new password has been sent to you.
|
||||
notice_account_activated: Your account has been activated. You can now log in.
|
||||
notice_successful_create: Successful creation.
|
||||
notice_successful_update: Successful update.
|
||||
notice_successful_delete: Successful deletion.
|
||||
notice_successful_create: 建立成功
|
||||
notice_successful_update: 更新成功
|
||||
notice_successful_delete: 刪除成功
|
||||
notice_successful_connection: Successful connection.
|
||||
notice_file_not_found: The page you were trying to access doesn't exist or has been removed.
|
||||
notice_locking_conflict: Data have been updated by another user.
|
||||
@@ -122,7 +122,7 @@ field_subject: 主旨
|
||||
field_due_date: 完成日期
|
||||
field_assigned_to: 分派給
|
||||
field_priority: 重要性
|
||||
field_fixed_version: Fixed version
|
||||
field_fixed_version: 版本
|
||||
field_user: 用戶
|
||||
field_role: 角色
|
||||
field_homepage: 網站首頁
|
||||
@@ -151,21 +151,21 @@ field_attr_lastname: Lastname attribute
|
||||
field_attr_mail: Email attribute
|
||||
field_onthefly: On-the-fly user creation
|
||||
field_start_date: 開始日期
|
||||
field_done_ratio: %% 已完成
|
||||
field_done_ratio: 完成百分比
|
||||
field_auth_source: 認證模式
|
||||
field_hide_mail: 隱藏我的電子郵件
|
||||
field_comments: 註解
|
||||
field_url: URL
|
||||
field_start_page: Start page
|
||||
field_start_page: 首頁
|
||||
field_subproject: 子專案
|
||||
field_hours: 小時
|
||||
field_activity: Activity
|
||||
field_activity: 活動
|
||||
field_spent_on: 日期
|
||||
field_identifier: 代碼
|
||||
field_is_filter: Used as a filter
|
||||
field_issue_to_id: Related issue
|
||||
field_delay: 逾期
|
||||
field_assignable: Issues can be assigned to this role
|
||||
field_assignable: 項目可被分派至此角色
|
||||
field_redirect_existing_links: Redirect existing links
|
||||
field_estimated_hours: 預估工時
|
||||
field_column_names: Columns
|
||||
@@ -304,9 +304,9 @@ label_open_issues: 進行中
|
||||
label_open_issues_plural: 進行中
|
||||
label_closed_issues: 已結束
|
||||
label_closed_issues_plural: 已結束
|
||||
label_total: Total
|
||||
label_total: 總計
|
||||
label_permissions: 權限
|
||||
label_current_status: Current status
|
||||
label_current_status: 目前狀態
|
||||
label_new_statuses_allowed: New statuses allowed
|
||||
label_all: 全部
|
||||
label_none: 空值
|
||||
@@ -314,11 +314,11 @@ label_nobody: nobody
|
||||
label_next: Next
|
||||
label_previous: Previous
|
||||
label_used_by: Used by
|
||||
label_details: Details
|
||||
label_details: 明細
|
||||
label_add_note: 加入一個新筆記
|
||||
label_per_page: 每頁
|
||||
label_calendar: 日曆
|
||||
label_months_from: months from
|
||||
label_months_from: 個月, 開始月份
|
||||
label_gantt: 甘特圖
|
||||
label_internal: Internal
|
||||
label_last_changes: 最近 %d 個變更
|
||||
@@ -360,7 +360,7 @@ label_latest_revision: 最新版次
|
||||
label_latest_revision_plural: 最近版次清單
|
||||
label_view_revisions: 檢視版次清單
|
||||
label_max_size: 最大長度
|
||||
label_on: 'on'
|
||||
label_on: 總共
|
||||
label_sort_highest: 移動至開頭
|
||||
label_sort_higher: 往上移動
|
||||
label_sort_lower: 往下移動
|
||||
@@ -368,7 +368,7 @@ label_sort_lowest: 移動至結尾
|
||||
label_roadmap: 版本藍圖
|
||||
label_roadmap_due_in: 倒數天數:
|
||||
label_roadmap_overdue: %s 逾期
|
||||
label_roadmap_no_issues: No issues for this version
|
||||
label_roadmap_no_issues: 此版本尚未包含任何項目
|
||||
label_search: 搜尋
|
||||
label_result_plural: 結果
|
||||
label_all_words: All words
|
||||
@@ -382,13 +382,13 @@ label_index_by_date: 依日期索引
|
||||
label_current_version: 現行版本
|
||||
label_preview: 預覽
|
||||
label_feed_plural: Feeds
|
||||
label_changes_details: Details of all changes
|
||||
label_changes_details: 所有變更的明細
|
||||
label_issue_tracking: 項目追蹤
|
||||
label_spent_time: 耗用時間
|
||||
label_f_hour: %.2f hour
|
||||
label_f_hour_plural: %.2f hours
|
||||
label_f_hour: %.2f 小時
|
||||
label_f_hour_plural: %.2f 小時
|
||||
label_time_tracking: Time tracking
|
||||
label_change_plural: Changes
|
||||
label_change_plural: 變更
|
||||
label_statistics: Statistics
|
||||
label_commits_per_month: Commits per month
|
||||
label_commits_per_author: Commits per author
|
||||
@@ -405,11 +405,11 @@ label_loading: 載入中...
|
||||
label_relation_new: 建立新關聯
|
||||
label_relation_delete: 刪除關聯
|
||||
label_relates_to: 關聯至
|
||||
label_duplicates: duplicates
|
||||
label_blocks: blocks
|
||||
label_blocked_by: blocked by
|
||||
label_precedes: precedes
|
||||
label_follows: follows
|
||||
label_duplicates: 已重複
|
||||
label_blocks: 阻擋
|
||||
label_blocked_by: 被阻擋
|
||||
label_precedes: 優先於
|
||||
label_follows: 跟隨於
|
||||
label_end_to_start: end to start
|
||||
label_end_to_end: end to end
|
||||
label_start_to_start: start to start
|
||||
@@ -501,9 +501,9 @@ text_regexp_info: eg. ^[A-Z0-9]+$
|
||||
text_min_max_length_info: 0 means no restriction
|
||||
text_project_destroy_confirmation: Are you sure you want to delete this project and all related data ?
|
||||
text_workflow_edit: Select a role and a tracker to edit the workflow
|
||||
text_are_you_sure: Are you sure ?
|
||||
text_journal_changed: changed from %s to %s
|
||||
text_journal_set_to: set to %s
|
||||
text_are_you_sure: 確定執行?
|
||||
text_journal_changed: 從 %s 變更為 %s
|
||||
text_journal_set_to: 設定為 %s
|
||||
text_journal_deleted: deleted
|
||||
text_tip_task_begin_day: task beginning this day
|
||||
text_tip_task_end_day: task ending this day
|
||||
@@ -541,11 +541,12 @@ default_doc_category_tech: 技術文件
|
||||
default_priority_low: 低
|
||||
default_priority_normal: 正常
|
||||
default_priority_high: 高
|
||||
default_priority_urgent: 急
|
||||
default_priority_immediate: 特急
|
||||
default_priority_urgent: 速
|
||||
default_priority_immediate: 急
|
||||
default_activity_design: 設計
|
||||
default_activity_development: 開發
|
||||
|
||||
enumeration_issue_priorities: 項目重要性
|
||||
enumeration_doc_categories: 文件分類
|
||||
enumeration_activities: 活動 (time tracking)
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -552,3 +552,4 @@ text_caracters_minimum: Must be at least %d characters long.
|
||||
setting_bcc_recipients: Blind carbon copy recipients (bcc)
|
||||
button_annotate: Annotate
|
||||
label_issues_by: Issues by %s
|
||||
field_searchable: Searchable
|
||||
|
||||
@@ -112,9 +112,15 @@ module Redmine
|
||||
|
||||
def shellout(cmd, &block)
|
||||
logger.debug "Shelling out: #{cmd}" if logger && logger.debug?
|
||||
IO.popen(cmd, "r+") do |io|
|
||||
io.close_write
|
||||
block.call(io) if block_given?
|
||||
begin
|
||||
IO.popen(cmd, "r+") do |io|
|
||||
io.close_write
|
||||
block.call(io) if block_given?
|
||||
end
|
||||
rescue Errno::ENOENT => e
|
||||
# The command failed, log it and re-raise
|
||||
logger.error("SCM command failed: #{cmd}\n with: #{e.message}")
|
||||
raise CommandFailed
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -40,7 +40,7 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
info
|
||||
rescue Errno::ENOENT => e
|
||||
rescue CommandFailed
|
||||
return nil
|
||||
end
|
||||
|
||||
@@ -81,8 +81,6 @@ module Redmine
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?
|
||||
entries.sort_by_name
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
||||
@@ -144,8 +142,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
revisions
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
||||
@@ -163,9 +159,7 @@ module Redmine
|
||||
end
|
||||
end
|
||||
#return nil if $? && $?.exitstatus != 0
|
||||
DiffTableList.new diff, type
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
DiffTableList.new diff, type
|
||||
end
|
||||
|
||||
def cat(path, identifier=nil)
|
||||
@@ -179,8 +173,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
cat
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def annotate(path, identifier=nil)
|
||||
@@ -198,8 +190,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
blame
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -103,8 +103,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
entries.sort_by_name
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
STARTLOG="----------------------------"
|
||||
@@ -234,8 +232,6 @@ module Redmine
|
||||
end
|
||||
end
|
||||
end
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
||||
@@ -250,8 +246,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
DiffTableList.new diff, type
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def cat(path, identifier=nil)
|
||||
@@ -265,8 +259,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
cat
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def annotate(path, identifier=nil)
|
||||
@@ -283,8 +275,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
blame
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -70,8 +70,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
entries.sort_by_name
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
||||
@@ -99,8 +97,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
revisions
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
||||
@@ -117,8 +113,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
DiffTableList.new diff, type
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
private
|
||||
@@ -154,7 +148,7 @@ module Redmine
|
||||
end
|
||||
end
|
||||
paths
|
||||
rescue Errno::ENOENT => e
|
||||
rescue CommandFailed
|
||||
paths
|
||||
end
|
||||
end
|
||||
|
||||
@@ -36,19 +36,19 @@ module Redmine
|
||||
:lastrev => revisions(nil,nil,nil,{:limit => 1}).last
|
||||
})
|
||||
info
|
||||
rescue Errno::ENOENT => e
|
||||
rescue CommandFailed
|
||||
return nil
|
||||
end
|
||||
|
||||
def entries(path=nil, identifier=nil)
|
||||
path ||= ''
|
||||
entries = Entries.new
|
||||
cmd = "#{HG_BIN} -R #{target('')} --cwd #{target(path)} locate -X */*/*"
|
||||
cmd = "#{HG_BIN} -R #{target('')} --cwd #{target(path)} locate"
|
||||
cmd << " -r #{identifier.to_i}" if identifier
|
||||
cmd << " * */*"
|
||||
cmd << " " + shell_quote('glob:**')
|
||||
shellout(cmd) do |io|
|
||||
io.each_line do |line|
|
||||
e = line.chomp.split('\\')
|
||||
e = line.chomp.split(%r{[\/\\]})
|
||||
entries << Entry.new({:name => e.first,
|
||||
:path => (path.empty? ? e.first : "#{path}/#{e.first}"),
|
||||
:kind => (e.size > 1 ? 'dir' : 'file'),
|
||||
@@ -58,8 +58,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
entries.sort_by_name
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def entry(path=nil, identifier=nil)
|
||||
@@ -114,13 +112,11 @@ module Redmine
|
||||
:author => changeset[:user],
|
||||
:time => Time.parse(changeset[:date]),
|
||||
:message => changeset[:description],
|
||||
:paths => changeset[:files].split.collect{|path| {:action => 'X', :path => "/#{path}"}}
|
||||
:paths => changeset[:files].to_s.split.collect{|path| {:action => 'X', :path => "/#{path}"}}
|
||||
})
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
revisions
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
||||
@@ -140,9 +136,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
DiffTableList.new diff, type
|
||||
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def cat(path, identifier=nil)
|
||||
@@ -154,8 +147,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
cat
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def annotate(path, identifier=nil)
|
||||
@@ -173,8 +164,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
blame
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -47,7 +47,7 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
info
|
||||
rescue Errno::ENOENT => e
|
||||
rescue CommandFailed
|
||||
return nil
|
||||
end
|
||||
|
||||
@@ -91,8 +91,6 @@ module Redmine
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
logger.debug("Found #{entries.size} entries in the repository for #{target(path)}") if logger && logger.debug?
|
||||
entries.sort_by_name
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
|
||||
@@ -130,8 +128,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
revisions
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def diff(path, identifier_from, identifier_to=nil, type="inline")
|
||||
@@ -154,8 +150,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
DiffTableList.new diff, type
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def cat(path, identifier=nil)
|
||||
@@ -169,8 +163,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
cat
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
def annotate(path, identifier=nil)
|
||||
@@ -186,8 +178,6 @@ module Redmine
|
||||
end
|
||||
return nil if $? && $?.exitstatus != 0
|
||||
blame
|
||||
rescue Errno::ENOENT => e
|
||||
raise CommandFailed
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -69,4 +69,8 @@ module ApplicationHelper
|
||||
super((@current_theme && @current_theme.stylesheets.include?(source)) ?
|
||||
"/themes/#{@current_theme.dir}/stylesheets/#{source}" : source)
|
||||
end
|
||||
|
||||
def path_to_stylesheet(source)
|
||||
stylesheet_path source
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ module Redmine
|
||||
module VERSION #:nodoc:
|
||||
MAJOR = 0
|
||||
MINOR = 6
|
||||
TINY = 1
|
||||
TINY = 4
|
||||
|
||||
def self.revision
|
||||
revision = nil
|
||||
|
||||
@@ -145,6 +145,11 @@ namespace :redmine do
|
||||
|
||||
class TracWikiPage < ActiveRecord::Base
|
||||
set_table_name :wiki
|
||||
|
||||
def self.columns
|
||||
# Hides readonly Trac field to prevent clash with AR readonly? method (Rails 2.0)
|
||||
super.select {|column| column.name.to_s != 'readonly'}
|
||||
end
|
||||
end
|
||||
|
||||
class TracPermission < ActiveRecord::Base
|
||||
|
||||
@@ -39,6 +39,9 @@ ContextMenu.prototype = {
|
||||
this.selection = tr;
|
||||
var id = tr.id.substring(6, tr.id.length);
|
||||
/* TODO: do not hard code path */
|
||||
new Ajax.Updater({success:'context-menu'}, '../../issues/context_menu/' + id, {asynchronous:true, evalScripts:true, onComplete:function(request){Effect.Appear('context-menu', {duration: 0.20})}})
|
||||
new Ajax.Updater({success:'context-menu'}, '../../issues/context_menu/' + id, {asynchronous:true, evalScripts:true, onComplete:function(request){
|
||||
Effect.Appear('context-menu', {duration: 0.20});
|
||||
if (window.parseStylesheets) { window.parseStylesheets(); }
|
||||
}})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ hr { width: 100%; height: 1px; background: #ccc; border: 0;}
|
||||
textarea.wiki-edit { width: 99%; }
|
||||
li p {margin-top: 0;}
|
||||
div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
|
||||
.autoscroll {overflow-x: auto; padding:1px; width:100%;}
|
||||
.autoscroll {overflow-x: auto; padding:1px; width:100%; margin-bottom: 1.2em;}
|
||||
#user_firstname, #user_lastname, #user_mail, #my_account_form select { width: 90%; }
|
||||
|
||||
/***** Tabular forms ******/
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
}
|
||||
#context-menu li.folder ul {
|
||||
position:absolute;
|
||||
left:128px; /* IE */
|
||||
left:168px; /* IE6 */
|
||||
top:-2px;
|
||||
}
|
||||
#context-menu li.folder>ul { left:148px; }
|
||||
|
||||
@@ -117,4 +117,6 @@ function getElementsBySelect(rule) {
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
window.parseStylesheets = parseStylesheets;
|
||||
</script>
|
||||
5
test/fixtures/custom_fields.yml
vendored
5
test/fixtures/custom_fields.yml
vendored
@@ -11,16 +11,17 @@ custom_fields_001:
|
||||
is_required: false
|
||||
field_format: list
|
||||
custom_fields_002:
|
||||
name: Build
|
||||
name: Searchable field
|
||||
min_length: 1
|
||||
regexp: ""
|
||||
is_for_all: true
|
||||
type: IssueCustomField
|
||||
max_length: 10
|
||||
max_length: 100
|
||||
possible_values: ""
|
||||
id: 2
|
||||
is_required: false
|
||||
field_format: string
|
||||
searchable: true
|
||||
custom_fields_003:
|
||||
name: Development status
|
||||
min_length: 0
|
||||
|
||||
9
test/fixtures/custom_values.yml
vendored
9
test/fixtures/custom_values.yml
vendored
@@ -46,4 +46,11 @@ custom_values_008:
|
||||
custom_field_id: 1
|
||||
customized_id: 3
|
||||
id: 11
|
||||
value: "MySQL"
|
||||
value: "MySQL"
|
||||
custom_values_009:
|
||||
customized_type: Issue
|
||||
custom_field_id: 2
|
||||
customized_id: 3
|
||||
id: 12
|
||||
value: "this is a stringforcustomfield search"
|
||||
|
||||
9
test/fixtures/enabled_modules.yml
vendored
9
test/fixtures/enabled_modules.yml
vendored
@@ -31,3 +31,12 @@ enabled_modules_008:
|
||||
name: boards
|
||||
project_id: 1
|
||||
id: 8
|
||||
enabled_modules_009:
|
||||
name: repository
|
||||
project_id: 3
|
||||
id: 9
|
||||
enabled_modules_010:
|
||||
name: wiki
|
||||
project_id: 3
|
||||
id: 10
|
||||
|
||||
2
test/fixtures/issues.yml
vendored
2
test/fixtures/issues.yml
vendored
@@ -41,6 +41,8 @@ issues_003:
|
||||
assigned_to_id:
|
||||
author_id: 2
|
||||
status_id: 1
|
||||
start_date: <%= 1.day.from_now.to_date.to_s(:db) %>
|
||||
due_date: <%= 40.day.ago.to_date.to_s(:db) %>
|
||||
issues_004:
|
||||
created_on: 2006-07-19 21:07:27 +02:00
|
||||
project_id: 2
|
||||
|
||||
6
test/fixtures/repositories.yml
vendored
6
test/fixtures/repositories.yml
vendored
@@ -1,11 +1,12 @@
|
||||
---
|
||||
repositories_001:
|
||||
project_id: 1
|
||||
url: svn://localhost/test
|
||||
url: file:///<%= RAILS_ROOT.gsub(%r{config\/\.\.}, '') %>/tmp/test/subversion_repository
|
||||
id: 10
|
||||
root_url: svn://localhost
|
||||
root_url: file:///<%= RAILS_ROOT.gsub(%r{config\/\.\.}, '') %>/tmp/test/subversion_repository
|
||||
password: ""
|
||||
login: ""
|
||||
type: Subversion
|
||||
repositories_002:
|
||||
project_id: 2
|
||||
url: svn://localhost/test
|
||||
@@ -13,3 +14,4 @@ repositories_002:
|
||||
root_url: svn://localhost
|
||||
password: ""
|
||||
login: ""
|
||||
type: Subversion
|
||||
|
||||
BIN
test/fixtures/repositories/cvs_repository.tar.gz
vendored
Normal file
BIN
test/fixtures/repositories/cvs_repository.tar.gz
vendored
Normal file
Binary file not shown.
BIN
test/fixtures/repositories/mercurial_repository.tar.gz
vendored
Normal file
BIN
test/fixtures/repositories/mercurial_repository.tar.gz
vendored
Normal file
Binary file not shown.
4
test/fixtures/roles.yml
vendored
4
test/fixtures/roles.yml
vendored
@@ -39,7 +39,6 @@ roles_005:
|
||||
- :view_time_entries
|
||||
- :view_documents
|
||||
- :view_wiki_pages
|
||||
- :edit_wiki_pages
|
||||
- :view_files
|
||||
- :browse_repository
|
||||
- :view_changesets
|
||||
@@ -75,7 +74,10 @@ roles_001:
|
||||
- :view_wiki_pages
|
||||
- :edit_wiki_pages
|
||||
- :delete_wiki_pages
|
||||
- :rename_wiki_pages
|
||||
- :add_messages
|
||||
- :edit_messages
|
||||
- :delete_messages
|
||||
- :manage_boards
|
||||
- :view_files
|
||||
- :manage_files
|
||||
|
||||
14
test/fixtures/wiki_content_versions.yml
vendored
14
test/fixtures/wiki_content_versions.yml
vendored
@@ -37,4 +37,16 @@ wiki_content_versions_003:
|
||||
author_id: 1
|
||||
comments: ""
|
||||
wiki_content_id: 1
|
||||
compression: ""
|
||||
compression: ""
|
||||
data: |-
|
||||
h1. CookBook documentation
|
||||
Some updated [[documentation]] here...
|
||||
wiki_content_versions_004:
|
||||
data: |-
|
||||
h1. Another page
|
||||
|
||||
This is a link to a ticket: #2
|
||||
updated_on: 2007-03-08 00:18:07 +01:00
|
||||
page_id: 2
|
||||
wiki_content_id: 2
|
||||
id: 4
|
||||
|
||||
12
test/fixtures/wiki_contents.yml
vendored
12
test/fixtures/wiki_contents.yml
vendored
@@ -10,3 +10,15 @@ wiki_contents_001:
|
||||
page_id: 1
|
||||
id: 1
|
||||
version: 3
|
||||
author_id: 1
|
||||
comments: Gzip compression activated
|
||||
wiki_contents_002:
|
||||
text: |-
|
||||
h1. Another page
|
||||
|
||||
This is a link to a ticket: #2
|
||||
updated_on: 2007-03-08 00:18:07 +01:00
|
||||
page_id: 2
|
||||
id: 2
|
||||
version: 1
|
||||
author_id: 1
|
||||
6
test/fixtures/wiki_pages.yml
vendored
6
test/fixtures/wiki_pages.yml
vendored
@@ -4,3 +4,9 @@ wiki_pages_001:
|
||||
title: CookBook_documentation
|
||||
id: 1
|
||||
wiki_id: 1
|
||||
wiki_pages_002:
|
||||
created_on: 2007-03-08 00:18:07 +01:00
|
||||
title: Another_page
|
||||
id: 2
|
||||
wiki_id: 1
|
||||
|
||||
73
test/functional/account_controller_test.rb
Normal file
73
test/functional/account_controller_test.rb
Normal file
@@ -0,0 +1,73 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
require 'account_controller'
|
||||
|
||||
# Re-raise errors caught by the controller.
|
||||
class AccountController; def rescue_action(e) raise e end; end
|
||||
|
||||
class AccountControllerTest < Test::Unit::TestCase
|
||||
fixtures :users
|
||||
|
||||
def setup
|
||||
@controller = AccountController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def test_show
|
||||
get :show, :id => 2
|
||||
assert_response :success
|
||||
assert_template 'show'
|
||||
assert_not_nil assigns(:user)
|
||||
end
|
||||
|
||||
def test_show_inactive
|
||||
get :show, :id => 5
|
||||
assert_response 404
|
||||
assert_nil assigns(:user)
|
||||
end
|
||||
|
||||
def test_login_with_wrong_password
|
||||
post :login, :login => 'admin', :password => 'bad'
|
||||
assert_response :success
|
||||
assert_template 'login'
|
||||
assert_tag 'div',
|
||||
:attributes => { :class => "flash error" },
|
||||
:content => /Invalid user or password/
|
||||
end
|
||||
|
||||
def test_autologin
|
||||
Setting.autologin = "7"
|
||||
Token.delete_all
|
||||
post :login, :login => 'admin', :password => 'admin', :autologin => 1
|
||||
assert_redirected_to 'my/page'
|
||||
token = Token.find :first
|
||||
assert_not_nil token
|
||||
assert_equal User.find_by_login('admin'), token.user
|
||||
assert_equal 'autologin', token.action
|
||||
end
|
||||
|
||||
def test_logout
|
||||
@request.session[:user_id] = 2
|
||||
get :logout
|
||||
assert_redirected_to ''
|
||||
assert_nil @request.session[:user_id]
|
||||
end
|
||||
end
|
||||
61
test/functional/admin_controller_test.rb
Normal file
61
test/functional/admin_controller_test.rb
Normal file
@@ -0,0 +1,61 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
require 'admin_controller'
|
||||
|
||||
# Re-raise errors caught by the controller.
|
||||
class AdminController; def rescue_action(e) raise e end; end
|
||||
|
||||
class AdminControllerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :users
|
||||
|
||||
def setup
|
||||
@controller = AdminController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
User.current = nil
|
||||
@request.session[:user_id] = 1 # admin
|
||||
end
|
||||
|
||||
def test_get_mail_options
|
||||
get :mail_options
|
||||
assert_response :success
|
||||
assert_template 'mail_options'
|
||||
end
|
||||
|
||||
def test_post_mail_options
|
||||
post :mail_options, :settings => {'mail_from' => 'functional@test.foo'}
|
||||
assert_redirected_to 'admin/mail_options'
|
||||
assert_equal 'functional@test.foo', Setting.mail_from
|
||||
end
|
||||
|
||||
def test_test_email
|
||||
get :test_email
|
||||
assert_redirected_to 'admin/mail_options'
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
assert_kind_of TMail::Mail, mail
|
||||
user = User.find(1)
|
||||
assert_equal [user.mail], mail.bcc
|
||||
end
|
||||
|
||||
def test_info
|
||||
get :info
|
||||
assert_response :success
|
||||
assert_template 'info'
|
||||
end
|
||||
end
|
||||
@@ -22,7 +22,17 @@ require 'issues_controller'
|
||||
class IssuesController; def rescue_action(e) raise e end; end
|
||||
|
||||
class IssuesControllerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :users, :roles, :members, :issues, :enabled_modules, :enumerations
|
||||
fixtures :projects,
|
||||
:users,
|
||||
:roles,
|
||||
:members,
|
||||
:issues,
|
||||
:issue_statuses,
|
||||
:trackers,
|
||||
:issue_categories,
|
||||
:enabled_modules,
|
||||
:enumerations,
|
||||
:attachments
|
||||
|
||||
def setup
|
||||
@controller = IssuesController.new
|
||||
@@ -83,4 +93,71 @@ class IssuesControllerTest < Test::Unit::TestCase
|
||||
assert_not_nil assigns(:changes)
|
||||
assert_equal 'application/atom+xml', @response.content_type
|
||||
end
|
||||
|
||||
def test_show
|
||||
get :show, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'show.rhtml'
|
||||
assert_not_nil assigns(:issue)
|
||||
end
|
||||
|
||||
def test_get_edit
|
||||
@request.session[:user_id] = 2
|
||||
get :edit, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'edit'
|
||||
assert_not_nil assigns(:issue)
|
||||
assert_equal Issue.find(1), assigns(:issue)
|
||||
end
|
||||
|
||||
def test_post_edit
|
||||
@request.session[:user_id] = 2
|
||||
post :edit, :id => 1, :issue => {:subject => 'Modified subject'}
|
||||
assert_redirected_to 'issues/show/1'
|
||||
assert_equal 'Modified subject', Issue.find(1).subject
|
||||
end
|
||||
|
||||
def test_post_change_status
|
||||
issue = Issue.find(1)
|
||||
assert_equal 1, issue.status_id
|
||||
@request.session[:user_id] = 2
|
||||
post :change_status, :id => 1,
|
||||
:new_status_id => 2,
|
||||
:issue => { :assigned_to_id => 3 },
|
||||
:notes => 'Assigned to dlopper',
|
||||
:confirm => 1
|
||||
assert_redirected_to 'issues/show/1'
|
||||
issue.reload
|
||||
assert_equal 2, issue.status_id
|
||||
j = issue.journals.find(:first, :order => 'created_on DESC')
|
||||
assert_equal 'Assigned to dlopper', j.notes
|
||||
assert_equal 2, j.details.size
|
||||
end
|
||||
|
||||
def test_context_menu
|
||||
@request.session[:user_id] = 2
|
||||
get :context_menu, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'context_menu'
|
||||
end
|
||||
|
||||
def test_destroy
|
||||
@request.session[:user_id] = 2
|
||||
post :destroy, :id => 1
|
||||
assert_redirected_to 'projects/1/issues'
|
||||
assert_nil Issue.find_by_id(1)
|
||||
end
|
||||
|
||||
def test_destroy_attachment
|
||||
issue = Issue.find(3)
|
||||
a = issue.attachments.size
|
||||
@request.session[:user_id] = 2
|
||||
post :destroy_attachment, :id => 3, :attachment_id => 1
|
||||
assert_redirected_to 'issues/show/3'
|
||||
assert_nil Attachment.find_by_id(1)
|
||||
issue.reload
|
||||
assert_equal((a-1), issue.attachments.size)
|
||||
j = issue.journals.find(:first, :order => 'created_on DESC')
|
||||
assert_equal 'attachment', j.details.first.property
|
||||
end
|
||||
end
|
||||
|
||||
@@ -40,10 +40,60 @@ class MessagesControllerTest < Test::Unit::TestCase
|
||||
assert_not_nil assigns(:topic)
|
||||
end
|
||||
|
||||
def test_show_message_not_found
|
||||
get :show, :board_id => 1, :id => 99999
|
||||
assert_response 404
|
||||
end
|
||||
|
||||
def test_get_new
|
||||
@request.session[:user_id] = 2
|
||||
get :new, :board_id => 1
|
||||
assert_response :success
|
||||
assert_template 'new'
|
||||
end
|
||||
|
||||
def test_post_new
|
||||
@request.session[:user_id] = 2
|
||||
post :new, :board_id => 1,
|
||||
:message => { :subject => 'Test created message',
|
||||
:content => 'Message body'}
|
||||
assert_redirected_to 'messages/show'
|
||||
message = Message.find_by_subject('Test created message')
|
||||
assert_not_nil message
|
||||
assert_equal 'Message body', message.content
|
||||
assert_equal 2, message.author_id
|
||||
assert_equal 1, message.board_id
|
||||
end
|
||||
|
||||
def test_get_edit
|
||||
@request.session[:user_id] = 2
|
||||
get :edit, :board_id => 1, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'edit'
|
||||
end
|
||||
|
||||
def test_post_edit
|
||||
@request.session[:user_id] = 2
|
||||
post :edit, :board_id => 1, :id => 1,
|
||||
:message => { :subject => 'New subject',
|
||||
:content => 'New body'}
|
||||
assert_redirected_to 'messages/show'
|
||||
message = Message.find(1)
|
||||
assert_equal 'New subject', message.subject
|
||||
assert_equal 'New body', message.content
|
||||
end
|
||||
|
||||
def test_reply
|
||||
@request.session[:user_id] = 2
|
||||
post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }
|
||||
assert_redirected_to 'messages/show'
|
||||
assert Message.find_by_subject('Test reply')
|
||||
end
|
||||
|
||||
def test_destroy_topic
|
||||
@request.session[:user_id] = 2
|
||||
post :destroy, :board_id => 1, :id => 1
|
||||
assert_redirected_to 'boards/show'
|
||||
assert_nil Message.find_by_id(1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,7 +22,7 @@ require 'my_controller'
|
||||
class MyController; def rescue_action(e) raise e end; end
|
||||
|
||||
class MyControllerTest < Test::Unit::TestCase
|
||||
fixtures :users
|
||||
fixtures :users, :issues, :issue_statuses, :trackers, :enumerations
|
||||
|
||||
def setup
|
||||
@controller = MyController.new
|
||||
|
||||
@@ -22,7 +22,7 @@ require 'projects_controller'
|
||||
class ProjectsController; def rescue_action(e) raise e end; end
|
||||
|
||||
class ProjectsControllerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :users, :roles, :members, :issues, :journals, :journal_details, :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations
|
||||
fixtures :projects, :versions, :users, :roles, :members, :issues, :journals, :journal_details, :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations
|
||||
|
||||
def setup
|
||||
@controller = ProjectsController.new
|
||||
@@ -41,6 +41,10 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
||||
assert_response :success
|
||||
assert_template 'list'
|
||||
assert_not_nil assigns(:project_tree)
|
||||
# Root project as hash key
|
||||
assert assigns(:project_tree).has_key?(Project.find(1))
|
||||
# Subproject in corresponding value
|
||||
assert assigns(:project_tree)[Project.find(1)].include?(Project.find(3))
|
||||
end
|
||||
|
||||
def test_show
|
||||
@@ -48,7 +52,37 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
||||
assert_response :success
|
||||
assert_template 'show'
|
||||
assert_not_nil assigns(:project)
|
||||
end
|
||||
|
||||
def test_settings
|
||||
@request.session[:user_id] = 2 # manager
|
||||
get :settings, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'settings'
|
||||
end
|
||||
|
||||
def test_edit
|
||||
@request.session[:user_id] = 2 # manager
|
||||
post :edit, :id => 1, :project => {:name => 'Test changed name'}
|
||||
assert_redirected_to 'projects/settings/1'
|
||||
project = Project.find(1)
|
||||
assert_equal 'Test changed name', project.name
|
||||
end
|
||||
|
||||
def test_get_destroy
|
||||
@request.session[:user_id] = 1 # admin
|
||||
get :destroy, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'destroy'
|
||||
assert_not_nil Project.find_by_id(1)
|
||||
end
|
||||
|
||||
def test_post_destroy
|
||||
@request.session[:user_id] = 1 # admin
|
||||
post :destroy, :id => 1, :confirm => 1
|
||||
assert_redirected_to 'admin/projects'
|
||||
assert_nil Project.find_by_id(1)
|
||||
end
|
||||
|
||||
def test_list_documents
|
||||
get :list_documents, :id => 1
|
||||
@@ -66,7 +100,23 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
||||
assert_equal [7, 7], Issue.find_all_by_id([1, 2]).collect {|i| i.priority.id}
|
||||
assert_equal 'Bulk editing', Issue.find(1).journals.find(:first, :order => 'created_on DESC').notes
|
||||
end
|
||||
|
||||
|
||||
def test_move_issues_to_another_project
|
||||
@request.session[:user_id] = 1
|
||||
post :move_issues, :id => 1, :issue_ids => [1, 2], :new_project_id => 2
|
||||
assert_redirected_to 'projects/1/issues'
|
||||
assert_equal 2, Issue.find(1).project_id
|
||||
assert_equal 2, Issue.find(2).project_id
|
||||
end
|
||||
|
||||
def test_move_issues_to_another_tracker
|
||||
@request.session[:user_id] = 1
|
||||
post :move_issues, :id => 1, :issue_ids => [1, 2], :new_tracker_id => 3
|
||||
assert_redirected_to 'projects/1/issues'
|
||||
assert_equal 3, Issue.find(1).tracker_id
|
||||
assert_equal 3, Issue.find(2).tracker_id
|
||||
end
|
||||
|
||||
def test_list_files
|
||||
get :list_files, :id => 1
|
||||
assert_response :success
|
||||
@@ -86,6 +136,21 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
||||
assert_response :success
|
||||
assert_template 'roadmap'
|
||||
assert_not_nil assigns(:versions)
|
||||
# Version with no date set appears
|
||||
assert assigns(:versions).include?(Version.find(3))
|
||||
# Completed version doesn't appear
|
||||
assert !assigns(:versions).include?(Version.find(1))
|
||||
end
|
||||
|
||||
def test_roadmap_with_completed_versions
|
||||
get :roadmap, :id => 1, :completed => 1
|
||||
assert_response :success
|
||||
assert_template 'roadmap'
|
||||
assert_not_nil assigns(:versions)
|
||||
# Version with no date set appears
|
||||
assert assigns(:versions).include?(Version.find(3))
|
||||
# Completed version appears
|
||||
assert assigns(:versions).include?(Version.find(1))
|
||||
end
|
||||
|
||||
def test_activity
|
||||
@@ -120,6 +185,42 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
||||
}
|
||||
end
|
||||
|
||||
def test_calendar
|
||||
get :calendar, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'calendar'
|
||||
assert_not_nil assigns(:calendar)
|
||||
end
|
||||
|
||||
def test_calendar_with_subprojects
|
||||
get :calendar, :id => 1, :with_subprojects => 1, :tracker_ids => [1, 2]
|
||||
assert_response :success
|
||||
assert_template 'calendar'
|
||||
assert_not_nil assigns(:calendar)
|
||||
end
|
||||
|
||||
def test_gantt
|
||||
get :gantt, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'gantt.rhtml'
|
||||
assert_not_nil assigns(:events)
|
||||
end
|
||||
|
||||
def test_gantt_with_subprojects
|
||||
get :gantt, :id => 1, :with_subprojects => 1, :tracker_ids => [1, 2]
|
||||
assert_response :success
|
||||
assert_template 'gantt.rhtml'
|
||||
assert_not_nil assigns(:events)
|
||||
end
|
||||
|
||||
def test_gantt_export_to_pdf
|
||||
get :gantt, :id => 1, :format => 'pdf'
|
||||
assert_response :success
|
||||
assert_template 'gantt.rfpdf'
|
||||
assert_equal 'application/pdf', @response.content_type
|
||||
assert_not_nil assigns(:events)
|
||||
end
|
||||
|
||||
def test_archive
|
||||
@request.session[:user_id] = 1 # admin
|
||||
post :archive, :id => 1
|
||||
|
||||
@@ -31,6 +31,13 @@ class RepositoriesControllerTest < Test::Unit::TestCase
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def test_revisions
|
||||
get :revisions, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'revisions'
|
||||
assert_not_nil assigns(:changesets)
|
||||
end
|
||||
|
||||
def test_revision_with_before_nil_and_afer_normal
|
||||
get :revision, {:id => 1, :rev => 1}
|
||||
assert_response :success
|
||||
@@ -43,4 +50,15 @@ class RepositoriesControllerTest < Test::Unit::TestCase
|
||||
}
|
||||
end
|
||||
|
||||
def test_graph_commits_per_month
|
||||
get :graph, :id => 1, :graph => 'commits_per_month'
|
||||
assert_response :success
|
||||
assert_equal 'image/svg+xml', @response.content_type
|
||||
end
|
||||
|
||||
def test_graph_commits_per_author
|
||||
get :graph, :id => 1, :graph => 'commits_per_author'
|
||||
assert_response :success
|
||||
assert_equal 'image/svg+xml', @response.content_type
|
||||
end
|
||||
end
|
||||
|
||||
122
test/functional/repositories_mercurial_controller_test.rb
Normal file
122
test/functional/repositories_mercurial_controller_test.rb
Normal file
@@ -0,0 +1,122 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
require 'repositories_controller'
|
||||
|
||||
# Re-raise errors caught by the controller.
|
||||
class RepositoriesController; def rescue_action(e) raise e end; end
|
||||
|
||||
class RepositoriesMercurialControllerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :users, :roles, :members, :repositories, :enabled_modules
|
||||
|
||||
# No '..' in the repository path
|
||||
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/mercurial_repository'
|
||||
|
||||
def setup
|
||||
@controller = RepositoriesController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
User.current = nil
|
||||
Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
|
||||
end
|
||||
|
||||
if File.directory?(REPOSITORY_PATH)
|
||||
def test_show
|
||||
get :show, :id => 3
|
||||
assert_response :success
|
||||
assert_template 'show'
|
||||
assert_not_nil assigns(:entries)
|
||||
assert_not_nil assigns(:changesets)
|
||||
end
|
||||
|
||||
def test_browse_root
|
||||
get :browse, :id => 3
|
||||
assert_response :success
|
||||
assert_template 'browse'
|
||||
assert_not_nil assigns(:entries)
|
||||
assert_equal 3, assigns(:entries).size
|
||||
assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
|
||||
assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
|
||||
assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
|
||||
end
|
||||
|
||||
def test_browse_directory
|
||||
get :browse, :id => 3, :path => ['images']
|
||||
assert_response :success
|
||||
assert_template 'browse'
|
||||
assert_not_nil assigns(:entries)
|
||||
assert_equal 2, assigns(:entries).size
|
||||
entry = assigns(:entries).detect {|e| e.name == 'edit.png'}
|
||||
assert_not_nil entry
|
||||
assert_equal 'file', entry.kind
|
||||
assert_equal 'images/edit.png', entry.path
|
||||
end
|
||||
|
||||
def test_changes
|
||||
get :changes, :id => 3, :path => ['images', 'edit.png']
|
||||
assert_response :success
|
||||
assert_template 'changes'
|
||||
assert_tag :tag => 'h2', :content => 'edit.png'
|
||||
end
|
||||
|
||||
def test_entry_show
|
||||
get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb']
|
||||
assert_response :success
|
||||
assert_template 'entry'
|
||||
# Line 19
|
||||
assert_tag :tag => 'th',
|
||||
:content => /10/,
|
||||
:attributes => { :class => /line-num/ },
|
||||
:sibling => { :tag => 'td', :content => /WITHOUT ANY WARRANTY/ }
|
||||
end
|
||||
|
||||
def test_entry_download
|
||||
get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb'], :format => 'raw'
|
||||
assert_response :success
|
||||
# File content
|
||||
assert @response.body.include?('WITHOUT ANY WARRANTY')
|
||||
end
|
||||
|
||||
def test_diff
|
||||
# Full diff of changeset 4
|
||||
get :diff, :id => 3, :rev => 4
|
||||
assert_response :success
|
||||
assert_template 'diff'
|
||||
# Line 22 removed
|
||||
assert_tag :tag => 'th',
|
||||
:content => /22/,
|
||||
:sibling => { :tag => 'td',
|
||||
:attributes => { :class => /diff_out/ },
|
||||
:content => /def remove/ }
|
||||
end
|
||||
|
||||
def test_annotate
|
||||
get :annotate, :id => 3, :path => ['sources', 'watchers_controller.rb']
|
||||
assert_response :success
|
||||
assert_template 'annotate'
|
||||
# Line 23, revision 4
|
||||
assert_tag :tag => 'th', :content => /23/,
|
||||
:sibling => { :tag => 'td', :child => { :tag => 'a', :content => /4/ } },
|
||||
:sibling => { :tag => 'td', :content => /jsmith/ },
|
||||
:sibling => { :tag => 'td', :content => /watcher =/ }
|
||||
end
|
||||
else
|
||||
puts "Mercurial test repository NOT FOUND. Skipping functional tests !!!"
|
||||
def test_fake; assert true end
|
||||
end
|
||||
end
|
||||
91
test/functional/repositories_subversion_controller_test.rb
Normal file
91
test/functional/repositories_subversion_controller_test.rb
Normal file
@@ -0,0 +1,91 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
require 'repositories_controller'
|
||||
|
||||
# Re-raise errors caught by the controller.
|
||||
class RepositoriesController; def rescue_action(e) raise e end; end
|
||||
|
||||
class RepositoriesSubversionControllerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :users, :roles, :members, :repositories, :issues, :issue_statuses, :changesets, :changes, :issue_categories, :enumerations, :custom_fields, :custom_values, :trackers
|
||||
|
||||
# No '..' in the repository path for svn
|
||||
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/subversion_repository'
|
||||
|
||||
def setup
|
||||
@controller = RepositoriesController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
if File.directory?(REPOSITORY_PATH)
|
||||
def test_show
|
||||
get :show, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'show'
|
||||
assert_not_nil assigns(:entries)
|
||||
assert_not_nil assigns(:changesets)
|
||||
end
|
||||
|
||||
def test_browse_root
|
||||
get :browse, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'browse'
|
||||
assert_not_nil assigns(:entries)
|
||||
entry = assigns(:entries).detect {|e| e.name == 'subversion_test'}
|
||||
assert_equal 'dir', entry.kind
|
||||
end
|
||||
|
||||
def test_browse_directory
|
||||
get :browse, :id => 1, :path => ['subversion_test']
|
||||
assert_response :success
|
||||
assert_template 'browse'
|
||||
assert_not_nil assigns(:entries)
|
||||
entry = assigns(:entries).detect {|e| e.name == 'helloworld.c'}
|
||||
assert_equal 'file', entry.kind
|
||||
assert_equal 'subversion_test/helloworld.c', entry.path
|
||||
end
|
||||
|
||||
def test_entry
|
||||
get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c']
|
||||
assert_response :success
|
||||
assert_template 'entry'
|
||||
end
|
||||
|
||||
def test_entry_download
|
||||
get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c'], :format => 'raw'
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
def test_diff
|
||||
get :diff, :id => 1, :rev => 3
|
||||
assert_response :success
|
||||
assert_template 'diff'
|
||||
end
|
||||
|
||||
def test_annotate
|
||||
get :annotate, :id => 1, :path => ['subversion_test', 'helloworld.c']
|
||||
assert_response :success
|
||||
assert_template 'annotate'
|
||||
end
|
||||
else
|
||||
puts "Subversion test repository NOT FOUND. Skipping functional tests !!!"
|
||||
def test_fake; assert true end
|
||||
end
|
||||
end
|
||||
@@ -5,7 +5,7 @@ require 'search_controller'
|
||||
class SearchController; def rescue_action(e) raise e end; end
|
||||
|
||||
class SearchControllerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :issues
|
||||
fixtures :projects, :issues, :custom_fields, :custom_values
|
||||
|
||||
def setup
|
||||
@controller = SearchController.new
|
||||
@@ -25,7 +25,9 @@ class SearchControllerTest < Test::Unit::TestCase
|
||||
assert assigns(:results).include?(Project.find(1))
|
||||
end
|
||||
|
||||
def test_search_in_project
|
||||
def test_search_without_searchable_custom_fields
|
||||
CustomField.update_all "searchable = #{ActiveRecord::Base.connection.quoted_false}"
|
||||
|
||||
get :index, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'index'
|
||||
@@ -36,6 +38,15 @@ class SearchControllerTest < Test::Unit::TestCase
|
||||
assert_template 'index'
|
||||
end
|
||||
|
||||
def test_search_with_searchable_custom_fields
|
||||
get :index, :id => 1, :q => "stringforcustomfield"
|
||||
assert_response :success
|
||||
results = assigns(:results)
|
||||
assert_not_nil results
|
||||
assert_equal 1, results.size
|
||||
assert results.include?(Issue.find(3))
|
||||
end
|
||||
|
||||
def test_quick_jump_to_issue
|
||||
# issue of a public project
|
||||
get :index, :q => "3"
|
||||
|
||||
62
test/functional/users_controller_test.rb
Normal file
62
test/functional/users_controller_test.rb
Normal file
@@ -0,0 +1,62 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
require 'users_controller'
|
||||
|
||||
# Re-raise errors caught by the controller.
|
||||
class UsersController; def rescue_action(e) raise e end; end
|
||||
|
||||
class UsersControllerTest < Test::Unit::TestCase
|
||||
fixtures :users, :projects, :members
|
||||
|
||||
def setup
|
||||
@controller = UsersController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
User.current = nil
|
||||
@request.session[:user_id] = 1 # admin
|
||||
end
|
||||
|
||||
def test_index
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_template 'list'
|
||||
end
|
||||
|
||||
def test_list
|
||||
get :list
|
||||
assert_response :success
|
||||
assert_template 'list'
|
||||
assert_not_nil assigns(:users)
|
||||
# active users only
|
||||
assert_nil assigns(:users).detect {|u| !u.active?}
|
||||
end
|
||||
|
||||
def test_edit_membership
|
||||
post :edit_membership, :id => 2, :membership_id => 1,
|
||||
:membership => { :role_id => 2}
|
||||
assert_redirected_to 'users/edit/2'
|
||||
assert_equal 2, Member.find(1).role_id
|
||||
end
|
||||
|
||||
def test_destroy_membership
|
||||
post :destroy_membership, :id => 2, :membership_id => 1
|
||||
assert_redirected_to 'users/edit/2'
|
||||
assert_nil Member.find_by_id(1)
|
||||
end
|
||||
end
|
||||
@@ -39,4 +39,35 @@ class VersionsControllerTest < Test::Unit::TestCase
|
||||
|
||||
assert_tag :tag => 'h2', :content => /1.0/
|
||||
end
|
||||
|
||||
def test_get_edit
|
||||
@request.session[:user_id] = 2
|
||||
get :edit, :id => 2
|
||||
assert_response :success
|
||||
assert_template 'edit'
|
||||
end
|
||||
|
||||
def test_post_edit
|
||||
@request.session[:user_id] = 2
|
||||
post :edit, :id => 2,
|
||||
:version => { :name => 'New version name',
|
||||
:effective_date => Date.today.strftime("%Y-%m-%d")}
|
||||
assert_redirected_to 'projects/settings/1'
|
||||
version = Version.find(2)
|
||||
assert_equal 'New version name', version.name
|
||||
assert_equal Date.today, version.effective_date
|
||||
end
|
||||
|
||||
def test_destroy
|
||||
@request.session[:user_id] = 2
|
||||
post :destroy, :id => 2
|
||||
assert_redirected_to 'projects/settings/1'
|
||||
assert_nil Version.find_by_id(2)
|
||||
end
|
||||
|
||||
def test_issue_status_by
|
||||
xhr :get, :status_by, :id => 2
|
||||
assert_response :success
|
||||
assert_template '_issue_counts'
|
||||
end
|
||||
end
|
||||
|
||||
49
test/functional/welcome_controller_test.rb
Normal file
49
test/functional/welcome_controller_test.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
require 'welcome_controller'
|
||||
|
||||
# Re-raise errors caught by the controller.
|
||||
class WelcomeController; def rescue_action(e) raise e end; end
|
||||
|
||||
class WelcomeControllerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :news
|
||||
|
||||
def setup
|
||||
@controller = WelcomeController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def test_index
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_template 'index'
|
||||
assert_not_nil assigns(:news)
|
||||
assert_not_nil assigns(:projects)
|
||||
assert !assigns(:projects).include?(Project.find(:first, :conditions => {:is_public => false}))
|
||||
end
|
||||
|
||||
def test_browser_language
|
||||
Setting.default_language = 'en'
|
||||
@request.env['HTTP_ACCEPT_LANGUAGE'] = 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3'
|
||||
get :index
|
||||
assert_equal :fr, @controller.current_language
|
||||
end
|
||||
end
|
||||
145
test/functional/wiki_controller_test.rb
Normal file
145
test/functional/wiki_controller_test.rb
Normal file
@@ -0,0 +1,145 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
require 'wiki_controller'
|
||||
|
||||
# Re-raise errors caught by the controller.
|
||||
class WikiController; def rescue_action(e) raise e end; end
|
||||
|
||||
class WikiControllerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :users, :roles, :members, :enabled_modules, :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
|
||||
|
||||
def setup
|
||||
@controller = WikiController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def test_show_start_page
|
||||
get :index, :id => 1
|
||||
assert_response :success
|
||||
assert_template 'show'
|
||||
assert_tag :tag => 'h1', :content => /CookBook documentation/
|
||||
end
|
||||
|
||||
def test_show_page_with_name
|
||||
get :index, :id => 1, :page => 'Another_page'
|
||||
assert_response :success
|
||||
assert_template 'show'
|
||||
assert_tag :tag => 'h1', :content => /Another page/
|
||||
end
|
||||
|
||||
def test_show_unexistent_page_without_edit_right
|
||||
get :index, :id => 1, :page => 'Unexistent page'
|
||||
assert_response 404
|
||||
end
|
||||
|
||||
def test_show_unexistent_page_with_edit_right
|
||||
@request.session[:user_id] = 2
|
||||
get :index, :id => 1, :page => 'Unexistent page'
|
||||
assert_response :success
|
||||
assert_template 'edit'
|
||||
end
|
||||
|
||||
def test_create_page
|
||||
@request.session[:user_id] = 2
|
||||
post :edit, :id => 1,
|
||||
:page => 'New page',
|
||||
:content => {:comments => 'Created the page',
|
||||
:text => "h1. New page\n\nThis is a new page",
|
||||
:version => 0}
|
||||
assert_redirected_to 'wiki/1/New_page'
|
||||
page = Project.find(1).wiki.find_page('New page')
|
||||
assert !page.new_record?
|
||||
assert_not_nil page.content
|
||||
assert_equal 'Created the page', page.content.comments
|
||||
end
|
||||
|
||||
def test_preview
|
||||
@request.session[:user_id] = 2
|
||||
xhr :post, :preview, :id => 1, :page => 'CookBook_documentation',
|
||||
:content => { :comments => '',
|
||||
:text => 'this is a *previewed text*',
|
||||
:version => 3 }
|
||||
assert_response :success
|
||||
assert_template 'common/_preview'
|
||||
assert_tag :tag => 'strong', :content => /previewed text/
|
||||
end
|
||||
|
||||
def test_history
|
||||
get :history, :id => 1, :page => 'CookBook_documentation'
|
||||
assert_response :success
|
||||
assert_template 'history'
|
||||
assert_not_nil assigns(:versions)
|
||||
assert_equal 3, assigns(:versions).size
|
||||
end
|
||||
|
||||
def test_diff
|
||||
get :diff, :id => 1, :page => 'CookBook_documentation', :version => 2, :version_from => 1
|
||||
assert_response :success
|
||||
assert_template 'diff'
|
||||
assert_tag :tag => 'span', :attributes => { :class => 'diff_in'},
|
||||
:content => /updated/
|
||||
end
|
||||
|
||||
def test_rename_with_redirect
|
||||
@request.session[:user_id] = 2
|
||||
post :rename, :id => 1, :page => 'Another_page',
|
||||
:wiki_page => { :title => 'Another renamed page',
|
||||
:redirect_existing_links => 1 }
|
||||
assert_redirected_to 'wiki/1/Another_renamed_page'
|
||||
wiki = Project.find(1).wiki
|
||||
# Check redirects
|
||||
assert_not_nil wiki.find_page('Another page')
|
||||
assert_nil wiki.find_page('Another page', :with_redirect => false)
|
||||
end
|
||||
|
||||
def test_rename_without_redirect
|
||||
@request.session[:user_id] = 2
|
||||
post :rename, :id => 1, :page => 'Another_page',
|
||||
:wiki_page => { :title => 'Another renamed page',
|
||||
:redirect_existing_links => "0" }
|
||||
assert_redirected_to 'wiki/1/Another_renamed_page'
|
||||
wiki = Project.find(1).wiki
|
||||
# Check that there's no redirects
|
||||
assert_nil wiki.find_page('Another page')
|
||||
end
|
||||
|
||||
def test_destroy
|
||||
@request.session[:user_id] = 2
|
||||
post :destroy, :id => 1, :page => 'CookBook_documentation'
|
||||
assert_redirected_to 'wiki/1/Page_index/special'
|
||||
end
|
||||
|
||||
def test_page_index
|
||||
get :special, :id => 1, :page => 'Page_index'
|
||||
assert_response :success
|
||||
assert_template 'special_page_index'
|
||||
pages = assigns(:pages)
|
||||
assert_not_nil pages
|
||||
assert_equal 2, pages.size
|
||||
assert_tag :tag => 'a', :attributes => { :href => '/wiki/1/CookBook_documentation' },
|
||||
:content => /CookBook documentation/
|
||||
end
|
||||
|
||||
def test_not_found
|
||||
get :index, :id => 999
|
||||
assert_response 404
|
||||
end
|
||||
end
|
||||
56
test/functional/wikis_controller_test.rb
Normal file
56
test/functional/wikis_controller_test.rb
Normal file
@@ -0,0 +1,56 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
require 'wikis_controller'
|
||||
|
||||
# Re-raise errors caught by the controller.
|
||||
class WikisController; def rescue_action(e) raise e end; end
|
||||
|
||||
class WikisControllerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :users, :roles, :members, :enabled_modules, :wikis
|
||||
|
||||
def setup
|
||||
@controller = WikisController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def test_create
|
||||
@request.session[:user_id] = 1
|
||||
assert_nil Project.find(3).wiki
|
||||
post :edit, :id => 3, :wiki => { :start_page => 'Start page' }
|
||||
assert_response :success
|
||||
wiki = Project.find(3).wiki
|
||||
assert_not_nil wiki
|
||||
assert_equal 'Start page', wiki.start_page
|
||||
end
|
||||
|
||||
def test_destroy
|
||||
@request.session[:user_id] = 1
|
||||
post :destroy, :id => 1, :confirm => 1
|
||||
assert_redirected_to 'projects/settings/1'
|
||||
assert_nil Project.find(1).wiki
|
||||
end
|
||||
|
||||
def test_not_found
|
||||
@request.session[:user_id] = 1
|
||||
post :destroy, :id => 999, :confirm => 1
|
||||
assert_response 404
|
||||
end
|
||||
end
|
||||
41
test/unit/helpers/projects_helper_test.rb
Normal file
41
test/unit/helpers/projects_helper_test.rb
Normal file
@@ -0,0 +1,41 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../../test_helper'
|
||||
|
||||
class ProjectsHelperTest < HelperTestCase
|
||||
include ProjectsHelper
|
||||
include ActionView::Helpers::TextHelper
|
||||
fixtures :projects, :trackers, :issue_statuses, :issues, :enumerations, :users, :issue_categories
|
||||
|
||||
def setup
|
||||
super
|
||||
end
|
||||
|
||||
if Object.const_defined?(:Magick)
|
||||
def test_gantt_image
|
||||
assert gantt_image(Issue.find(:all, :conditions => "start_date IS NOT NULL AND due_date IS NOT NULL"), Date.today, 6, 2)
|
||||
end
|
||||
|
||||
def test_gantt_image_with_days
|
||||
assert gantt_image(Issue.find(:all, :conditions => "start_date IS NOT NULL AND due_date IS NOT NULL"), Date.today, 3, 4)
|
||||
end
|
||||
else
|
||||
puts "RMagick not installed. Skipping tests !!!"
|
||||
def test_fake; assert true end
|
||||
end
|
||||
end
|
||||
@@ -21,8 +21,9 @@ class RepositoryBazaarTest < Test::Unit::TestCase
|
||||
fixtures :projects
|
||||
|
||||
# No '..' in the repository path
|
||||
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + 'tmp/test/bazaar_repository'
|
||||
|
||||
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/bazaar_repository'
|
||||
REPOSITORY_PATH.gsub!(/\/+/, '/')
|
||||
|
||||
def setup
|
||||
@project = Project.find(1)
|
||||
assert @repository = Repository::Bazaar.create(:project => @project, :url => "file:///#{REPOSITORY_PATH}")
|
||||
@@ -81,7 +82,7 @@ class RepositoryBazaarTest < Test::Unit::TestCase
|
||||
assert_equal 'mkdir', annotate.lines[0]
|
||||
end
|
||||
else
|
||||
puts "Bazaar test repository NOT FOUND. Skipping tests !!!"
|
||||
puts "Bazaar test repository NOT FOUND. Skipping unit tests !!!"
|
||||
def test_fake; assert true end
|
||||
end
|
||||
end
|
||||
|
||||
60
test/unit/repository_cvs_test.rb
Normal file
60
test/unit/repository_cvs_test.rb
Normal file
@@ -0,0 +1,60 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
require 'pp'
|
||||
class RepositoryCvsTest < Test::Unit::TestCase
|
||||
fixtures :projects
|
||||
|
||||
# No '..' in the repository path
|
||||
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/cvs_repository'
|
||||
REPOSITORY_PATH.gsub!(/\//, "\\") if RUBY_PLATFORM =~ /mswin/
|
||||
# CVS module
|
||||
MODULE_NAME = 'test'
|
||||
|
||||
def setup
|
||||
@project = Project.find(1)
|
||||
assert @repository = Repository::Cvs.create(:project => @project,
|
||||
:root_url => REPOSITORY_PATH,
|
||||
:url => MODULE_NAME)
|
||||
end
|
||||
|
||||
if File.directory?(REPOSITORY_PATH)
|
||||
def test_fetch_changesets_from_scratch
|
||||
@repository.fetch_changesets
|
||||
@repository.reload
|
||||
|
||||
assert_equal 5, @repository.changesets.count
|
||||
assert_equal 14, @repository.changes.count
|
||||
assert_equal 'Two files changed', @repository.changesets.find_by_revision(3).comments
|
||||
end
|
||||
|
||||
def test_fetch_changesets_incremental
|
||||
@repository.fetch_changesets
|
||||
# Remove changesets with revision > 2
|
||||
@repository.changesets.find(:all, :conditions => 'revision > 2').each(&:destroy)
|
||||
@repository.reload
|
||||
assert_equal 2, @repository.changesets.count
|
||||
|
||||
@repository.fetch_changesets
|
||||
assert_equal 5, @repository.changesets.count
|
||||
end
|
||||
else
|
||||
puts "CVS test repository NOT FOUND. Skipping unit tests !!!"
|
||||
def test_fake; assert true end
|
||||
end
|
||||
end
|
||||
55
test/unit/repository_mercurial_test.rb
Normal file
55
test/unit/repository_mercurial_test.rb
Normal file
@@ -0,0 +1,55 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
|
||||
class RepositoryMercurialTest < Test::Unit::TestCase
|
||||
fixtures :projects
|
||||
|
||||
# No '..' in the repository path
|
||||
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/mercurial_repository'
|
||||
|
||||
def setup
|
||||
@project = Project.find(1)
|
||||
assert @repository = Repository::Mercurial.create(:project => @project, :url => REPOSITORY_PATH)
|
||||
end
|
||||
|
||||
if File.directory?(REPOSITORY_PATH)
|
||||
def test_fetch_changesets_from_scratch
|
||||
@repository.fetch_changesets
|
||||
@repository.reload
|
||||
|
||||
assert_equal 6, @repository.changesets.count
|
||||
assert_equal 11, @repository.changes.count
|
||||
assert_equal "Initial import.\nThe repository contains 3 files.", @repository.changesets.find_by_revision(0).comments
|
||||
end
|
||||
|
||||
def test_fetch_changesets_incremental
|
||||
@repository.fetch_changesets
|
||||
# Remove changesets with revision > 2
|
||||
@repository.changesets.find(:all, :conditions => 'revision > 2').each(&:destroy)
|
||||
@repository.reload
|
||||
assert_equal 3, @repository.changesets.count
|
||||
|
||||
@repository.fetch_changesets
|
||||
assert_equal 6, @repository.changesets.count
|
||||
end
|
||||
else
|
||||
puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!"
|
||||
def test_fake; assert true end
|
||||
end
|
||||
end
|
||||
@@ -49,7 +49,7 @@ class RepositorySubversionTest < Test::Unit::TestCase
|
||||
assert_equal 8, @repository.changesets.count
|
||||
end
|
||||
else
|
||||
puts "Subversion test repository NOT FOUND. Skipping tests !!!"
|
||||
puts "Subversion test repository NOT FOUND. Skipping unit tests !!!"
|
||||
def test_fake; assert true end
|
||||
end
|
||||
end
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user