Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a4774627d |
@@ -19,7 +19,6 @@
|
|||||||
/public/plugin_assets
|
/public/plugin_assets
|
||||||
/tmp/*
|
/tmp/*
|
||||||
/tmp/cache/*
|
/tmp/cache/*
|
||||||
/tmp/pdf/*
|
|
||||||
/tmp/sessions/*
|
/tmp/sessions/*
|
||||||
/tmp/sockets/*
|
/tmp/sockets/*
|
||||||
/tmp/test/*
|
/tmp/test/*
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ public/dispatch.*
|
|||||||
public/plugin_assets
|
public/plugin_assets
|
||||||
tmp/*
|
tmp/*
|
||||||
tmp/cache/*
|
tmp/cache/*
|
||||||
tmp/pdf/*
|
|
||||||
tmp/sessions/*
|
tmp/sessions/*
|
||||||
tmp/sockets/*
|
tmp/sockets/*
|
||||||
tmp/test/*
|
tmp/test/*
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ class AccountController < ApplicationController
|
|||||||
def onthefly_creation_failed(user, auth_source_options = { })
|
def onthefly_creation_failed(user, auth_source_options = { })
|
||||||
@user = user
|
@user = user
|
||||||
session[:auth_source_registration] = auth_source_options unless auth_source_options.empty?
|
session[:auth_source_registration] = auth_source_options unless auth_source_options.empty?
|
||||||
render :action => 'register'
|
render register_path
|
||||||
end
|
end
|
||||||
|
|
||||||
def invalid_credentials
|
def invalid_credentials
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ private
|
|||||||
end
|
end
|
||||||
|
|
||||||
@issue.project = @project
|
@issue.project = @project
|
||||||
@issue.author ||= User.current
|
@issue.author = User.current
|
||||||
# Tracker must be set before custom field values
|
# Tracker must be set before custom field values
|
||||||
@issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first)
|
@issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first)
|
||||||
if @issue.tracker.nil?
|
if @issue.tracker.nil?
|
||||||
|
|||||||
@@ -795,10 +795,11 @@ module ApplicationHelper
|
|||||||
if repository && User.current.allowed_to?(:browse_repository, project)
|
if repository && User.current.allowed_to?(:browse_repository, project)
|
||||||
name =~ %r{^[/\\]*(.*?)(@([0-9a-f]+))?(#(L\d+))?$}
|
name =~ %r{^[/\\]*(.*?)(@([0-9a-f]+))?(#(L\d+))?$}
|
||||||
path, rev, anchor = $1, $3, $5
|
path, rev, anchor = $1, $3, $5
|
||||||
link = link_to h("#{project_prefix}#{prefix}:#{repo_prefix}#{name}"), {:controller => 'repositories', :action => (prefix == 'export' ? 'raw' : 'entry'), :id => project, :repository_id => repository.identifier_param,
|
link = link_to h("#{project_prefix}#{prefix}:#{repo_prefix}#{name}"), {:controller => 'repositories', :action => 'entry', :id => project, :repository_id => repository.identifier_param,
|
||||||
:path => to_path_param(path),
|
:path => to_path_param(path),
|
||||||
:rev => rev,
|
:rev => rev,
|
||||||
:anchor => anchor},
|
:anchor => anchor,
|
||||||
|
:format => (prefix == 'export' ? 'raw' : nil)},
|
||||||
:class => (prefix == 'export' ? 'source download' : 'source')
|
:class => (prefix == 'export' ? 'source download' : 'source')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1028,11 +1029,6 @@ module ApplicationHelper
|
|||||||
content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(html_options))
|
content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(html_options))
|
||||||
end
|
end
|
||||||
|
|
||||||
# Helper to render JSON in views
|
|
||||||
def raw_json(arg)
|
|
||||||
arg.to_json.to_s.gsub('/', '\/').html_safe
|
|
||||||
end
|
|
||||||
|
|
||||||
def back_url
|
def back_url
|
||||||
url = params[:back_url]
|
url = params[:back_url]
|
||||||
if url.nil? && referer = request.env['HTTP_REFERER']
|
if url.nil? && referer = request.env['HTTP_REFERER']
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ module ContextMenusHelper
|
|||||||
end
|
end
|
||||||
if options.delete(:disabled)
|
if options.delete(:disabled)
|
||||||
options.delete(:method)
|
options.delete(:method)
|
||||||
options.delete(:data)
|
options.delete(:confirm)
|
||||||
options[:onclick] = 'return false;'
|
options.delete(:onclick)
|
||||||
options[:class] << ' disabled'
|
options[:class] << ' disabled'
|
||||||
url = '#'
|
url = '#'
|
||||||
end
|
end
|
||||||
|
|||||||
+18
-26
@@ -84,21 +84,17 @@ class Issue < ActiveRecord::Base
|
|||||||
# Returns a SQL conditions string used to find all issues visible by the specified user
|
# Returns a SQL conditions string used to find all issues visible by the specified user
|
||||||
def self.visible_condition(user, options={})
|
def self.visible_condition(user, options={})
|
||||||
Project.allowed_to_condition(user, :view_issues, options) do |role, user|
|
Project.allowed_to_condition(user, :view_issues, options) do |role, user|
|
||||||
if user.logged?
|
case role.issues_visibility
|
||||||
case role.issues_visibility
|
when 'all'
|
||||||
when 'all'
|
nil
|
||||||
nil
|
when 'default'
|
||||||
when 'default'
|
user_ids = [user.id] + user.groups.map(&:id)
|
||||||
user_ids = [user.id] + user.groups.map(&:id)
|
"(#{table_name}.is_private = #{connection.quoted_false} OR #{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
|
||||||
"(#{table_name}.is_private = #{connection.quoted_false} OR #{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
|
when 'own'
|
||||||
when 'own'
|
user_ids = [user.id] + user.groups.map(&:id)
|
||||||
user_ids = [user.id] + user.groups.map(&:id)
|
"(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
|
||||||
"(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
|
|
||||||
else
|
|
||||||
'1=0'
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
"(#{table_name}.is_private = #{connection.quoted_false})"
|
'1=0'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -106,19 +102,15 @@ class Issue < ActiveRecord::Base
|
|||||||
# Returns true if usr or current user is allowed to view the issue
|
# Returns true if usr or current user is allowed to view the issue
|
||||||
def visible?(usr=nil)
|
def visible?(usr=nil)
|
||||||
(usr || User.current).allowed_to?(:view_issues, self.project) do |role, user|
|
(usr || User.current).allowed_to?(:view_issues, self.project) do |role, user|
|
||||||
if user.logged?
|
case role.issues_visibility
|
||||||
case role.issues_visibility
|
when 'all'
|
||||||
when 'all'
|
true
|
||||||
true
|
when 'default'
|
||||||
when 'default'
|
!self.is_private? || self.author == user || user.is_or_belongs_to?(assigned_to)
|
||||||
!self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to))
|
when 'own'
|
||||||
when 'own'
|
self.author == user || user.is_or_belongs_to?(assigned_to)
|
||||||
self.author == user || user.is_or_belongs_to?(assigned_to)
|
|
||||||
else
|
|
||||||
false
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
!self.is_private?
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -373,8 +373,7 @@ class MailHandler < ActionMailer::Base
|
|||||||
# try to reencode to utf8 manually with ruby1.8
|
# try to reencode to utf8 manually with ruby1.8
|
||||||
begin
|
begin
|
||||||
if h = email.header[:subject]
|
if h = email.header[:subject]
|
||||||
# http://tools.ietf.org/html/rfc2047#section-4
|
if m = h.value.match(/^=\?([^\?]+)\?/)
|
||||||
if m = h.value.match(/=\?([^\?]+)\?[BbQq]\?/)
|
|
||||||
subject = Redmine::CodesetUtil.to_utf8(subject, m[1])
|
subject = Redmine::CodesetUtil.to_utf8(subject, m[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ class Principal < ActiveRecord::Base
|
|||||||
if q.blank?
|
if q.blank?
|
||||||
{}
|
{}
|
||||||
else
|
else
|
||||||
q = q.to_s
|
q = q.to_s.downcase
|
||||||
pattern = "%#{q}%"
|
pattern = "%#{q}%"
|
||||||
sql = "LOWER(login) LIKE LOWER(:p) OR LOWER(firstname) LIKE LOWER(:p) OR LOWER(lastname) LIKE LOWER(:p) OR LOWER(mail) LIKE LOWER(:p)"
|
sql = "LOWER(login) LIKE :p OR LOWER(firstname) LIKE :p OR LOWER(lastname) LIKE :p OR LOWER(mail) LIKE :p"
|
||||||
params = {:p => pattern}
|
params = {:p => pattern}
|
||||||
if q =~ /^(.+)\s+(.+)$/
|
if q =~ /^(.+)\s+(.+)$/
|
||||||
a, b = "#{$1}%", "#{$2}%"
|
a, b = "#{$1}%", "#{$2}%"
|
||||||
sql << " OR (LOWER(firstname) LIKE LOWER(:a) AND LOWER(lastname) LIKE LOWER(:b)) OR (LOWER(firstname) LIKE LOWER(:b) AND LOWER(lastname) LIKE LOWER(:a))"
|
sql << " OR (LOWER(firstname) LIKE :a AND LOWER(lastname) LIKE :b) OR (LOWER(firstname) LIKE :b AND LOWER(lastname) LIKE :a)"
|
||||||
params.merge!(:a => a, :b => b)
|
params.merge!(:a => a, :b => b)
|
||||||
end
|
end
|
||||||
{:conditions => [sql, params]}
|
{:conditions => [sql, params]}
|
||||||
|
|||||||
@@ -133,11 +133,6 @@ class Role < ActiveRecord::Base
|
|||||||
self.builtin != 0
|
self.builtin != 0
|
||||||
end
|
end
|
||||||
|
|
||||||
# Return true if the role is the anonymous role
|
|
||||||
def anonymous?
|
|
||||||
builtin == 2
|
|
||||||
end
|
|
||||||
|
|
||||||
# Return true if the role is a project member role
|
# Return true if the role is a project member role
|
||||||
def member?
|
def member?
|
||||||
!self.builtin?
|
!self.builtin?
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class UserPreference < ActiveRecord::Base
|
|||||||
if attribute_present? attr_name
|
if attribute_present? attr_name
|
||||||
super
|
super
|
||||||
else
|
else
|
||||||
h = (read_attribute(:others) || {}).dup
|
h = read_attribute(:others).dup || {}
|
||||||
h.update(attr_name => value)
|
h.update(attr_name => value)
|
||||||
write_attribute(:others, h)
|
write_attribute(:others, h)
|
||||||
value
|
value
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ class Version < ActiveRecord::Base
|
|||||||
validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :not_a_date, :allow_nil => true
|
validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :not_a_date, :allow_nil => true
|
||||||
validates_inclusion_of :status, :in => VERSION_STATUSES
|
validates_inclusion_of :status, :in => VERSION_STATUSES
|
||||||
validates_inclusion_of :sharing, :in => VERSION_SHARINGS
|
validates_inclusion_of :sharing, :in => VERSION_SHARINGS
|
||||||
validate :validate_version
|
|
||||||
|
|
||||||
scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}}
|
scope :named, lambda {|arg| { :conditions => ["LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip]}}
|
||||||
scope :open, :conditions => {:status => 'open'}
|
scope :open, :conditions => {:status => 'open'}
|
||||||
@@ -276,10 +275,4 @@ class Version < ActiveRecord::Base
|
|||||||
progress
|
progress
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_version
|
|
||||||
if effective_date.nil? && @attributes['effective_date'].present?
|
|
||||||
errors.add :effective_date, :not_a_date
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
<% if @message.present? %>
|
<% if @message.present? %>
|
||||||
<p id="errorExplanation"><%=h @message %></p>
|
<p id="errorExplanation"><%=h @message %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<p><a href="javascript:history.back()"><%= l(:button_back) %></a></p>
|
<p><a href="javascript:history.back()">Back</a></p>
|
||||||
|
|
||||||
<% html_title @status %>
|
<% html_title @status %>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<%= l(:field_delay) %>: <%= f.text_field :delay, :size => 3 %> <%= l(:label_day_plural) %>
|
<%= l(:field_delay) %>: <%= f.text_field :delay, :size => 3 %> <%= l(:label_day_plural) %>
|
||||||
</span>
|
</span>
|
||||||
<%= submit_tag l(:button_add) %>
|
<%= submit_tag l(:button_add) %>
|
||||||
<%= link_to_function l(:button_cancel), '$("#new-relation-form").hide();'%>
|
<%= toggle_link l(:button_cancel), 'new-relation-form'%>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<%= javascript_tag "observeAutocompleteField('relation_issue_to_id', '#{escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil))}')" %>
|
<%= javascript_tag "observeAutocompleteField('relation_issue_to_id', '#{escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil))}')" %>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<tr class="group open">
|
<tr class="group open">
|
||||||
<td colspan="<%= query.columns.size + 2 %>">
|
<td colspan="<%= query.columns.size + 2 %>">
|
||||||
<span class="expander" onclick="toggleRowGroup(this);"> </span>
|
<span class="expander" onclick="toggleRowGroup(this);"> </span>
|
||||||
<%= group.blank? ? l(:label_none) : column_content(@query.group_by_column, issue) %> <span class="count">(<%= @issue_count_by_group[group] %>)</span>
|
<%= group.blank? ? 'None' : column_content(@query.group_by_column, issue) %> <span class="count">(<%= @issue_count_by_group[group] %>)</span>
|
||||||
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}", "toggleAllRowGroups(this)", :class => 'toggle-all') %>
|
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}", "toggleAllRowGroups(this)", :class => 'toggle-all') %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<%= javascript_tag do %>
|
<%= javascript_tag do %>
|
||||||
var operatorLabels = <%= raw_json Query.operators_labels %>;
|
var operatorLabels = <%= raw Query.operators_labels.to_json %>;
|
||||||
var operatorByType = <%= raw_json Query.operators_by_filter_type %>;
|
var operatorByType = <%= raw Query.operators_by_filter_type.to_json %>;
|
||||||
var availableFilters = <%= raw_json query.available_filters_as_json %>;
|
var availableFilters = <%= raw query.available_filters_as_json.to_json %>;
|
||||||
var labelDayPlural = <%= raw_json l(:label_day_plural) %>;
|
var labelDayPlural = "<%= raw escape_javascript(l(:label_day_plural)) %>";
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
initFilters();
|
initFilters();
|
||||||
<% query.filters.each do |field, options| %>
|
<% query.filters.each do |field, options| %>
|
||||||
addFilter("<%= field %>", <%= raw_json query.operator_for(field) %>, <%= raw_json query.values_for(field) %>);
|
addFilter("<%= field %>", <%= raw query.operator_for(field).to_json %>, <%= raw query.values_for(field).to_json %>);
|
||||||
<% end %>
|
<% end %>
|
||||||
});
|
});
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
<h2><%= l(:label_revision) %> <%= @diff_format_revisions %> <%=h @path %></h2>
|
<h2><%= l(:label_revision) %> <%= @diff_format_revisions %> <%=h @path %></h2>
|
||||||
|
|
||||||
<!-- Choose view type -->
|
<!-- Choose view type -->
|
||||||
<%= form_tag({:action => 'diff', :id => @project,
|
<%= form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
|
||||||
:repository_id => @repository.identifier_param,
|
<%= hidden_field_tag('rev', params[:rev]) if params[:rev] %>
|
||||||
:path => to_path_param(@path), :rev=> @rev}, :method => 'get') do %>
|
|
||||||
<%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>
|
<%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>
|
||||||
<p>
|
<p>
|
||||||
<label><%= l(:label_view_diff) %></label>
|
<label><%= l(:label_view_diff) %></label>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<div class="contextual">
|
<div class="contextual">
|
||||||
<%= form_tag(
|
<%= form_tag(
|
||||||
{:controller => 'repositories', :action => 'revision', :id => @project,
|
{:controller => 'repositories', :action => 'revision', :id => @project,
|
||||||
:repository_id => @repository.identifier_param},
|
:repository_id => @repository.identifier_param}
|
||||||
:method => :get
|
|
||||||
) do %>
|
) do %>
|
||||||
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 8 %>
|
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 8 %>
|
||||||
<%= submit_tag 'OK' %>
|
<%= submit_tag 'OK' %>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<%= error_messages_for 'role' %>
|
<%= error_messages_for 'role' %>
|
||||||
|
|
||||||
<% unless @role.anonymous? %>
|
|
||||||
<div class="box tabular">
|
<div class="box tabular">
|
||||||
<% unless @role.builtin? %>
|
<% unless @role.builtin? %>
|
||||||
<p><%= f.text_field :name, :required => true %></p>
|
<p><%= f.text_field :name, :required => true %></p>
|
||||||
@@ -12,7 +11,6 @@
|
|||||||
<%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@roles, :id, :name, params[:copy_workflow_from] || @copy_from.try(:id))) %></p>
|
<%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@roles, :id, :name, params[:copy_workflow_from] || @copy_from.try(:id))) %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<h3><%= l(:label_permissions) %></h3>
|
<h3><%= l(:label_permissions) %></h3>
|
||||||
<div class="box tabular" id="permissions">
|
<div class="box tabular" id="permissions">
|
||||||
|
|||||||
@@ -80,8 +80,9 @@ bs:
|
|||||||
format:
|
format:
|
||||||
unit: 'KM'
|
unit: 'KM'
|
||||||
format: '%u %n'
|
format: '%u %n'
|
||||||
negative_format: '%u -%n'
|
separator:
|
||||||
delimiter: ''
|
delimiter:
|
||||||
|
precision:
|
||||||
percentage:
|
percentage:
|
||||||
format:
|
format:
|
||||||
delimiter: ""
|
delimiter: ""
|
||||||
|
|||||||
+14
-12
@@ -84,7 +84,9 @@ de:
|
|||||||
format:
|
format:
|
||||||
unit: '€'
|
unit: '€'
|
||||||
format: '%n %u'
|
format: '%n %u'
|
||||||
delimiter: ''
|
separator:
|
||||||
|
delimiter:
|
||||||
|
precision:
|
||||||
percentage:
|
percentage:
|
||||||
format:
|
format:
|
||||||
delimiter: ""
|
delimiter: ""
|
||||||
@@ -844,7 +846,7 @@ de:
|
|||||||
button_show: Anzeigen
|
button_show: Anzeigen
|
||||||
|
|
||||||
status_active: aktiv
|
status_active: aktiv
|
||||||
status_registered: nicht aktivierte
|
status_registered: angemeldet
|
||||||
status_locked: gesperrt
|
status_locked: gesperrt
|
||||||
|
|
||||||
version_status_open: offen
|
version_status_open: offen
|
||||||
@@ -1017,8 +1019,8 @@ de:
|
|||||||
description_date_from: Startdatum eintragen
|
description_date_from: Startdatum eintragen
|
||||||
description_date_to: Enddatum eintragen
|
description_date_to: Enddatum eintragen
|
||||||
|
|
||||||
label_parent_revision: Vorgänger
|
label_parent_revision: Parent
|
||||||
label_child_revision: Nachfolger
|
label_child_revision: Child
|
||||||
error_scm_annotate_big_text_file: Der Eintrag kann nicht umgesetzt werden, da er die maximale Textlänge überschreitet.
|
error_scm_annotate_big_text_file: Der Eintrag kann nicht umgesetzt werden, da er die maximale Textlänge überschreitet.
|
||||||
setting_default_issue_start_date_to_creation_date: Aktuelles Datum als Beginn für neue Tickets verwenden
|
setting_default_issue_start_date_to_creation_date: Aktuelles Datum als Beginn für neue Tickets verwenden
|
||||||
button_edit_section: Diesen Bereich bearbeiten
|
button_edit_section: Diesen Bereich bearbeiten
|
||||||
@@ -1068,14 +1070,14 @@ de:
|
|||||||
field_timeout: Auszeit (in Sekunden)
|
field_timeout: Auszeit (in Sekunden)
|
||||||
setting_thumbnails_enabled: Vorschaubilder von Dateianhängen anzeigen
|
setting_thumbnails_enabled: Vorschaubilder von Dateianhängen anzeigen
|
||||||
setting_thumbnails_size: Größe der Vorschaubilder (in Pixel)
|
setting_thumbnails_size: Größe der Vorschaubilder (in Pixel)
|
||||||
label_status_transitions: Statusänderungen
|
label_status_transitions: Status transitions
|
||||||
label_fields_permissions: Feldberechtigungen
|
label_fields_permissions: Fields permissions
|
||||||
label_readonly: Nur-Lese-Zugriff
|
label_readonly: Nur-Lese-Zugriff
|
||||||
label_required: Erforderlich
|
label_required: Erforderlich
|
||||||
text_repository_identifier_info: 'Kleinbuchstaben (a-z), Ziffern, Binde- und Unterstriche erlaubt.<br />Einmal gespeichert, kann die Kennung nicht mehr geändert werden.'
|
text_repository_identifier_info: 'Kleinbuchstaben (a-z), Ziffern, Binde- und Unterstriche erlaubt.<br />Einmal gespeichert, kann die Kennung nicht mehr geändert werden.'
|
||||||
field_board_parent: Übergeordnetes Forum
|
field_board_parent: Parent forum
|
||||||
label_attribute_of_project: "%{name} des Projekts"
|
label_attribute_of_project: Project's %{name}
|
||||||
label_attribute_of_author: "%{name} des Autors"
|
label_attribute_of_author: Author's %{name}
|
||||||
label_attribute_of_assigned_to: "%{name} des Bearbeiters"
|
label_attribute_of_assigned_to: Assignee's %{name}
|
||||||
label_attribute_of_fixed_version: "%{name} der Zielversion"
|
label_attribute_of_fixed_version: Target version's %{name}
|
||||||
label_copy_subtasks: Unteraufgaben kopieren
|
label_copy_subtasks: Copy subtasks
|
||||||
|
|||||||
+17
-17
@@ -1152,27 +1152,27 @@ ru:
|
|||||||
setting_session_lifetime: Session maximum lifetime
|
setting_session_lifetime: Session maximum lifetime
|
||||||
setting_session_timeout: Session inactivity timeout
|
setting_session_timeout: Session inactivity timeout
|
||||||
label_session_expiration: Session expiration
|
label_session_expiration: Session expiration
|
||||||
permission_close_project: Закрывать / открывать проекты
|
permission_close_project: Close / reopen the project
|
||||||
label_show_closed_projects: Просматривать закрытые проекты
|
label_show_closed_projects: View closed projects
|
||||||
button_close: Сделать закрытым
|
button_close: Close
|
||||||
button_reopen: Сделать открытым
|
button_reopen: Reopen
|
||||||
project_status_active: открытые
|
project_status_active: active
|
||||||
project_status_closed: закрытые
|
project_status_closed: closed
|
||||||
project_status_archived: архивированные
|
project_status_archived: archived
|
||||||
text_project_closed: Проект закрыт и находиться в режиме только для чтения.
|
text_project_closed: This project is closed and read-only.
|
||||||
notice_user_successful_create: Пользователь %{id} создан.
|
notice_user_successful_create: User %{id} created.
|
||||||
field_core_fields: Стандартные поля
|
field_core_fields: Standard fields
|
||||||
field_timeout: Timeout (in seconds)
|
field_timeout: Timeout (in seconds)
|
||||||
setting_thumbnails_enabled: Display attachment thumbnails
|
setting_thumbnails_enabled: Display attachment thumbnails
|
||||||
setting_thumbnails_size: Thumbnails size (in pixels)
|
setting_thumbnails_size: Thumbnails size (in pixels)
|
||||||
label_status_transitions: Статус-переходы
|
label_status_transitions: Status transitions
|
||||||
label_fields_permissions: Права на изменения полей
|
label_fields_permissions: Fields permissions
|
||||||
label_readonly: Не изменяется
|
label_readonly: Read-only
|
||||||
label_required: Обязательное
|
label_required: Required
|
||||||
text_repository_identifier_info: Допускаются только строчные латинские буквы (a-z), цифры, тире и подчеркивания.<br />После сохранения идентификатор изменить нельзя.
|
text_repository_identifier_info: Допускаются только строчные латинские буквы (a-z), цифры, тире и подчеркивания.<br />После сохранения идентификатор изменить нельзя.
|
||||||
field_board_parent: Родительский форум
|
field_board_parent: Parent forum
|
||||||
label_attribute_of_project: Project's %{name}
|
label_attribute_of_project: Project's %{name}
|
||||||
label_attribute_of_author: Имя автора %{name}
|
label_attribute_of_author: Author's %{name}
|
||||||
label_attribute_of_assigned_to: Assignee's %{name}
|
label_attribute_of_assigned_to: Assignee's %{name}
|
||||||
label_attribute_of_fixed_version: Target version's %{name}
|
label_attribute_of_fixed_version: Target version's %{name}
|
||||||
label_copy_subtasks: Копировать подзадачи
|
label_copy_subtasks: Copy subtasks
|
||||||
|
|||||||
@@ -939,7 +939,6 @@
|
|||||||
label_child_revision: 子項
|
label_child_revision: 子項
|
||||||
label_export_options: "%{export_format} 匯出選項"
|
label_export_options: "%{export_format} 匯出選項"
|
||||||
label_copy_attachments: 複製附件
|
label_copy_attachments: 複製附件
|
||||||
label_copy_subtasks: 複製子任務
|
|
||||||
label_item_position: "%{position} / %{count}"
|
label_item_position: "%{position} / %{count}"
|
||||||
label_completed_versions: 已完成版本
|
label_completed_versions: 已完成版本
|
||||||
label_search_for_watchers: 搜尋可供加入的監看者
|
label_search_for_watchers: 搜尋可供加入的監看者
|
||||||
@@ -1144,3 +1143,4 @@
|
|||||||
description_date_from: 輸入起始日期
|
description_date_from: 輸入起始日期
|
||||||
description_date_to: 輸入結束日期
|
description_date_to: 輸入結束日期
|
||||||
text_repository_identifier_info: '僅允許使用小寫英文字母 (a-z), 阿拉伯數字, 虛線與底線。<br />一旦儲存之後, 代碼便無法再次被更改。'
|
text_repository_identifier_info: '僅允許使用小寫英文字母 (a-z), 阿拉伯數字, 虛線與底線。<br />一旦儲存之後, 代碼便無法再次被更改。'
|
||||||
|
label_copy_subtasks: Copy subtasks
|
||||||
|
|||||||
@@ -1061,9 +1061,9 @@ zh:
|
|||||||
label_readonly: 只读
|
label_readonly: 只读
|
||||||
label_required: 必填
|
label_required: 必填
|
||||||
text_repository_identifier_info: 仅小写字母(a-z)、数字、破折号(-)和下划线(_)可以使用。<br />一旦保存,标识无法修改。
|
text_repository_identifier_info: 仅小写字母(a-z)、数字、破折号(-)和下划线(_)可以使用。<br />一旦保存,标识无法修改。
|
||||||
field_board_parent: 父论坛
|
field_board_parent: Parent forum
|
||||||
label_attribute_of_project: 项目 %{name}
|
label_attribute_of_project: Project's %{name}
|
||||||
label_attribute_of_author: 作者 %{name}
|
label_attribute_of_author: Author's %{name}
|
||||||
label_attribute_of_assigned_to: 分配给 %{name}
|
label_attribute_of_assigned_to: Assignee's %{name}
|
||||||
label_attribute_of_fixed_version: 目标版本 %{name}
|
label_attribute_of_fixed_version: Target version's %{name}
|
||||||
label_copy_subtasks: 复制子任务
|
label_copy_subtasks: Copy subtasks
|
||||||
|
|||||||
@@ -4,45 +4,6 @@ Redmine - project management software
|
|||||||
Copyright (C) 2006-2012 Jean-Philippe Lang
|
Copyright (C) 2006-2012 Jean-Philippe Lang
|
||||||
http://www.redmine.org/
|
http://www.redmine.org/
|
||||||
|
|
||||||
== 2012-11-17 v2.1.3
|
|
||||||
|
|
||||||
* Defect #12050: :export links to repository files lead to a 404 error
|
|
||||||
* Defect #12189: Missing tmp/pdf directory
|
|
||||||
* Defect #12195: Javascript error with IE7 / IE8 on new issue form
|
|
||||||
* Defect #12196: "Page not found" on OK button in SCM "View all revisions" page
|
|
||||||
* Defect #12199: Confirmation message displayed when clicking a disabled delete link in the context menu
|
|
||||||
* Defect #12231: Hardcoded "Back" in Repository
|
|
||||||
* Defect #12294: Incorrect german translation for "registered" users filter
|
|
||||||
* Defect #12349: Watchers auto-complete search on non-latin chars
|
|
||||||
* Defect #12358: 'None' grouped issue list section should be translated
|
|
||||||
* Defect #12359: Version date field regex validation accepts invalid date
|
|
||||||
* Defect #12375: Receiving mail subject encoding broken (MOJIBAKE) in some cases on Ruby 1.8
|
|
||||||
* Patch #9732: German translations
|
|
||||||
* Patch #12021: Russian locale translations
|
|
||||||
* Patch #12188: Simplified Chinese translation with zh.yml file based on Rev:10681
|
|
||||||
* Patch #12235: German translation for 2.1-stable
|
|
||||||
* Patch #12237: Added German Translation
|
|
||||||
|
|
||||||
== 2012-09-30 v2.1.2
|
|
||||||
|
|
||||||
* Defect #11929: XSS vulnerability in Redmine 2.1.x
|
|
||||||
|
|
||||||
== 2012-09-30 v2.1.1
|
|
||||||
|
|
||||||
* Defect #11290: ParseDate missing in Ruby 1.9x
|
|
||||||
* Defect #11844: "load_default_data" rake task fails to print the error message if one occurs
|
|
||||||
* Defect #11850: Can't create a user from ldap by on-the-fly on the redmine server using URI prefix
|
|
||||||
* Defect #11872: Private issue visible to anonymous users after its author is deleted
|
|
||||||
* Defect #11885: Filter misses Selectionfield on IE8
|
|
||||||
* Defect #11893: New relation form Cancel link is broken with Chrome 21
|
|
||||||
* Defect #11905: Potential "can't dup NilClass" error in UserPreference
|
|
||||||
* Defect #11909: Autocomplete results not reset after clearing search field
|
|
||||||
* Defect #11922: bs.yml and de.yml lead to error by number_to_currency()
|
|
||||||
* Defect #11945: rake task prints "can't convert Errno::EACCES into String" in case of no permission of public/plugin_assets
|
|
||||||
* Defect #11975: Undefined status transitions allowed in workflow (author of issue changes when selecting a new status)
|
|
||||||
* Defect #11982: SCM diff view generates extra parameter for switching mode
|
|
||||||
* Patch #11897: Traditional Chinese language file (to r10433)
|
|
||||||
|
|
||||||
== 2012-09-16 v2.1.0
|
== 2012-09-16 v2.1.0
|
||||||
|
|
||||||
* Defect #2071: Reordering priority-enumerations breaks alternate-theme's issue-colouring
|
* Defect #2071: Reordering priority-enumerations breaks alternate-theme's issue-colouring
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
require 'SVG/Graph/Plot'
|
require 'SVG/Graph/Plot'
|
||||||
|
require 'parsedate'
|
||||||
|
|
||||||
module SVG
|
module SVG
|
||||||
module Graph
|
module Graph
|
||||||
@@ -156,7 +157,8 @@ module SVG
|
|||||||
y = []
|
y = []
|
||||||
data[:data].each_index {|i|
|
data[:data].each_index {|i|
|
||||||
if i%2 == 0
|
if i%2 == 0
|
||||||
t = DateTime.parse( data[:data][i] ).to_time
|
arr = ParseDate.parsedate( data[:data][i] )
|
||||||
|
t = Time.local( *arr[0,6].compact )
|
||||||
x << t.to_i
|
x << t.to_i
|
||||||
else
|
else
|
||||||
y << data[:data][i]
|
y << data[:data][i]
|
||||||
@@ -171,7 +173,8 @@ module SVG
|
|||||||
protected
|
protected
|
||||||
|
|
||||||
def min_x_value=(value)
|
def min_x_value=(value)
|
||||||
@min_x_value = DateTime.parse( data[:data][i] ).to_time
|
arr = ParseDate.parsedate( value )
|
||||||
|
@min_x_value = Time.local( *arr[0,6].compact ).to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ module Redmine
|
|||||||
attachable_options[:delete_permission] = options.delete(:delete_permission) || "edit_#{self.name.pluralize.underscore}".to_sym
|
attachable_options[:delete_permission] = options.delete(:delete_permission) || "edit_#{self.name.pluralize.underscore}".to_sym
|
||||||
|
|
||||||
has_many :attachments, options.merge(:as => :container,
|
has_many :attachments, options.merge(:as => :container,
|
||||||
:order => "#{Attachment.table_name}.created_on ASC, #{Attachment.table_name}.id ASC",
|
:order => "#{Attachment.table_name}.created_on",
|
||||||
:dependent => :destroy)
|
:dependent => :destroy)
|
||||||
send :include, Redmine::Acts::Attachable::InstanceMethods
|
send :include, Redmine::Acts::Attachable::InstanceMethods
|
||||||
before_save :attach_saved_attachments
|
before_save :attach_saved_attachments
|
||||||
@@ -62,19 +62,7 @@ module Redmine
|
|||||||
|
|
||||||
def save_attachments(attachments, author=User.current)
|
def save_attachments(attachments, author=User.current)
|
||||||
if attachments.is_a?(Hash)
|
if attachments.is_a?(Hash)
|
||||||
attachments = attachments.stringify_keys
|
attachments = attachments.values
|
||||||
attachments = attachments.to_a.sort {|a, b|
|
|
||||||
if a.first.to_i > 0 && b.first.to_i > 0
|
|
||||||
a.first.to_i <=> b.first.to_i
|
|
||||||
elsif a.first.to_i > 0
|
|
||||||
1
|
|
||||||
elsif b.first.to_i > 0
|
|
||||||
-1
|
|
||||||
else
|
|
||||||
a.first <=> b.first
|
|
||||||
end
|
|
||||||
}
|
|
||||||
attachments = attachments.map(&:last)
|
|
||||||
end
|
end
|
||||||
if attachments.is_a?(Array)
|
if attachments.is_a?(Array)
|
||||||
attachments.each do |attachment|
|
attachments.each do |attachment|
|
||||||
|
|||||||
@@ -336,11 +336,7 @@ module Redmine #:nodoc:
|
|||||||
|
|
||||||
unless source_files.empty?
|
unless source_files.empty?
|
||||||
base_target_dir = File.join(destination, File.dirname(source_files.first).gsub(source, ''))
|
base_target_dir = File.join(destination, File.dirname(source_files.first).gsub(source, ''))
|
||||||
begin
|
FileUtils.mkdir_p(base_target_dir)
|
||||||
FileUtils.mkdir_p(base_target_dir)
|
|
||||||
rescue Exception => e
|
|
||||||
raise "Could not create directory #{base_target_dir}: " + e.message
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
source_dirs.each do |dir|
|
source_dirs.each do |dir|
|
||||||
@@ -350,7 +346,7 @@ module Redmine #:nodoc:
|
|||||||
begin
|
begin
|
||||||
FileUtils.mkdir_p(target_dir)
|
FileUtils.mkdir_p(target_dir)
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
raise "Could not create directory #{target_dir}: " + e.message
|
raise "Could not create directory #{target_dir}: \n" + e
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -361,7 +357,7 @@ module Redmine #:nodoc:
|
|||||||
FileUtils.cp(file, target)
|
FileUtils.cp(file, target)
|
||||||
end
|
end
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
raise "Could not copy #{file} to #{target}: " + e.message
|
raise "Could not copy #{file} to #{target}: \n" + e
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ module Redmine
|
|||||||
module VERSION #:nodoc:
|
module VERSION #:nodoc:
|
||||||
MAJOR = 2
|
MAJOR = 2
|
||||||
MINOR = 1
|
MINOR = 1
|
||||||
TINY = 3
|
TINY = 0
|
||||||
|
|
||||||
# Branch values:
|
# Branch values:
|
||||||
# * official release: nil
|
# * official release: nil
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ namespace :redmine do
|
|||||||
Redmine::DefaultData::Loader.load(current_language)
|
Redmine::DefaultData::Loader.load(current_language)
|
||||||
puts "Default configuration data loaded."
|
puts "Default configuration data loaded."
|
||||||
rescue Redmine::DefaultData::DataAlreadyLoaded => error
|
rescue Redmine::DefaultData::DataAlreadyLoaded => error
|
||||||
puts error.message
|
puts error
|
||||||
rescue => error
|
rescue => error
|
||||||
puts "Error: " + error.message
|
puts "Error: " + error
|
||||||
puts "Default configuration data was not loaded."
|
puts "Default configuration data was not loaded."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -152,10 +152,10 @@ function buildFilterRow(field, operator, values) {
|
|||||||
var option = $('<option>');
|
var option = $('<option>');
|
||||||
if ($.isArray(filterValue)) {
|
if ($.isArray(filterValue)) {
|
||||||
option.val(filterValue[1]).text(filterValue[0]);
|
option.val(filterValue[1]).text(filterValue[0]);
|
||||||
if ($.inArray(filterValue[1], values) > -1) {option.attr('selected', true);}
|
if (values.indexOf(filterValue[1]) > -1) {option.attr('selected', true)};
|
||||||
} else {
|
} else {
|
||||||
option.val(filterValue).text(filterValue);
|
option.val(filterValue).text(filterValue);
|
||||||
if ($.inArray(filterValue, values) > -1) {option.attr('selected', true);}
|
if (values.indexOf(filterValue) > -1) {option.attr('selected', true)};
|
||||||
}
|
}
|
||||||
select.append(option);
|
select.append(option);
|
||||||
}
|
}
|
||||||
@@ -163,9 +163,9 @@ function buildFilterRow(field, operator, values) {
|
|||||||
case "date":
|
case "date":
|
||||||
case "date_past":
|
case "date_past":
|
||||||
tr.find('td.values').append(
|
tr.find('td.values').append(
|
||||||
'<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_1" size="10" class="value date_value" /></span>' +
|
'<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_1" size="10" class="value date_value" value="'+values[0]+'" /></span>' +
|
||||||
' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_2" size="10" class="value date_value" /></span>' +
|
' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_2" size="10" class="value date_value" value="'+values[1]+'" /></span>' +
|
||||||
' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'" size="3" class="value" /> '+labelDayPlural+'</span>'
|
' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'" size="3" class="value" value="'+values[0]+'" /> '+labelDayPlural+'</span>'
|
||||||
);
|
);
|
||||||
$('#values_'+fieldId+'_1').val(values[0]).datepicker(datepickerOptions);
|
$('#values_'+fieldId+'_1').val(values[0]).datepicker(datepickerOptions);
|
||||||
$('#values_'+fieldId+'_2').val(values[1]).datepicker(datepickerOptions);
|
$('#values_'+fieldId+'_2').val(values[1]).datepicker(datepickerOptions);
|
||||||
@@ -174,15 +174,15 @@ function buildFilterRow(field, operator, values) {
|
|||||||
case "string":
|
case "string":
|
||||||
case "text":
|
case "text":
|
||||||
tr.find('td.values').append(
|
tr.find('td.values').append(
|
||||||
'<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'" size="30" class="value" /></span>'
|
'<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'" size="30" class="value" value="'+values[0]+'" /></span>'
|
||||||
);
|
);
|
||||||
$('#values_'+fieldId).val(values[0]);
|
$('#values_'+fieldId).val(values[0]);
|
||||||
break;
|
break;
|
||||||
case "integer":
|
case "integer":
|
||||||
case "float":
|
case "float":
|
||||||
tr.find('td.values').append(
|
tr.find('td.values').append(
|
||||||
'<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_1" size="6" class="value" /></span>' +
|
'<span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_1" size="6" class="value" value="'+values[0]+'" /></span>' +
|
||||||
' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_2" size="6" class="value" /></span>'
|
' <span style="display:none;"><input type="text" name="v['+field+'][]" id="values_'+fieldId+'_2" size="6" class="value" value="'+values[1]+'" /></span>'
|
||||||
);
|
);
|
||||||
$('#values_'+fieldId+'_1').val(values[0]);
|
$('#values_'+fieldId+'_1').val(values[0]);
|
||||||
$('#values_'+fieldId+'_2').val(values[1]);
|
$('#values_'+fieldId+'_2').val(values[1]);
|
||||||
@@ -204,7 +204,7 @@ function toggleFilter(field) {
|
|||||||
function enableValues(field, indexes) {
|
function enableValues(field, indexes) {
|
||||||
var fieldId = field.replace('.', '_');
|
var fieldId = field.replace('.', '_');
|
||||||
$('#tr_'+fieldId+' td.values .value').each(function(index) {
|
$('#tr_'+fieldId+' td.values .value').each(function(index) {
|
||||||
if ($.inArray(index, indexes) >= 0) {
|
if (indexes.indexOf(index) >= 0) {
|
||||||
$(this).removeAttr('disabled');
|
$(this).removeAttr('disabled');
|
||||||
$(this).parents('span').first().show();
|
$(this).parents('span').first().show();
|
||||||
} else {
|
} else {
|
||||||
@@ -464,11 +464,9 @@ function updateBulkEditFrom(url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function observeAutocompleteField(fieldId, url) {
|
function observeAutocompleteField(fieldId, url) {
|
||||||
$(document).ready(function() {
|
$('#'+fieldId).autocomplete({
|
||||||
$('#'+fieldId).autocomplete({
|
source: url,
|
||||||
source: url,
|
minLength: 2,
|
||||||
minLength: 2
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,14 +478,16 @@ function observeSearchfield(fieldId, targetId, url) {
|
|||||||
var val = $this.val();
|
var val = $this.val();
|
||||||
if ($this.attr('data-value-was') != val){
|
if ($this.attr('data-value-was') != val){
|
||||||
$this.attr('data-value-was', val);
|
$this.attr('data-value-was', val);
|
||||||
$.ajax({
|
if (val != '') {
|
||||||
url: url,
|
$.ajax({
|
||||||
type: 'get',
|
url: url,
|
||||||
data: {q: $this.val()},
|
type: 'get',
|
||||||
success: function(data){ $('#'+targetId).html(data); },
|
data: {q: $this.val()},
|
||||||
beforeSend: function(){ $this.addClass('ajax-loading'); },
|
success: function(data){ $('#'+targetId).html(data); },
|
||||||
complete: function(){ $this.removeClass('ajax-loading'); }
|
beforeSend: function(){ $this.addClass('ajax-loading'); },
|
||||||
});
|
complete: function(){ $this.removeClass('ajax-loading'); }
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var reset = function() {
|
var reset = function() {
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
From: John Smith <JSmith@somenet.foo>
|
|
||||||
To: "redmine@somenet.foo" <redmine@somenet.foo>
|
|
||||||
Subject: =?iso-2022-jp?b?GyRCJUYlOSVIGyhCCg=?=
|
|
||||||
Date: Fri, 1 Jun 2012 14:39:38 +0200
|
|
||||||
Message-ID: <87C31D42249DD0489D1A1444E3232DD7019D6183@foo.bar>
|
|
||||||
|
|
||||||
Fixture
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
From: John Smith <JSmith@somenet.foo>
|
|
||||||
To: "redmine@somenet.foo" <redmine@somenet.foo>
|
|
||||||
Subject: Re: =?iso-2022-jp?b?GyRCJUYlOSVIGyhCCg=?=
|
|
||||||
Date: Fri, 1 Jun 2012 14:39:38 +0200
|
|
||||||
Message-ID: <87C31D42249DD0489D1A1444E3232DD7019D6183@foo.bar>
|
|
||||||
|
|
||||||
Fixture
|
|
||||||
@@ -96,13 +96,8 @@ class AttachmentsControllerTest < ActionController::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_save_diff_type
|
def test_save_diff_type
|
||||||
user1 = User.find(1)
|
|
||||||
user1.pref[:diff_type] = nil
|
|
||||||
user1.preference.save
|
|
||||||
user = User.find(1)
|
|
||||||
assert_nil user.pref[:diff_type]
|
|
||||||
|
|
||||||
@request.session[:user_id] = 1 # admin
|
@request.session[:user_id] = 1 # admin
|
||||||
|
user = User.find(1)
|
||||||
get :show, :id => 5
|
get :show, :id => 5
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'diff'
|
assert_template 'diff'
|
||||||
|
|||||||
@@ -2521,18 +2521,6 @@ class IssuesControllerTest < ActionController::TestCase
|
|||||||
assert_equal 'This is the test_new issue', issue.subject
|
assert_equal 'This is the test_new issue', issue.subject
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_update_edit_form_should_keep_issue_author
|
|
||||||
@request.session[:user_id] = 3
|
|
||||||
xhr :put, :new, :project_id => 1, :id => 1, :issue => {:subject => 'Changed'}
|
|
||||||
assert_response :success
|
|
||||||
assert_equal 'text/javascript', response.content_type
|
|
||||||
|
|
||||||
issue = assigns(:issue)
|
|
||||||
assert_equal User.find(2), issue.author
|
|
||||||
assert_equal 2, issue.author_id
|
|
||||||
assert_not_equal User.current, issue.author
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_update_edit_form_should_propose_transitions_based_on_initial_status
|
def test_update_edit_form_should_propose_transitions_based_on_initial_status
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
WorkflowTransition.delete_all
|
WorkflowTransition.delete_all
|
||||||
|
|||||||
@@ -273,12 +273,4 @@ class QueriesControllerTest < ActionController::TestCase
|
|||||||
assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook', :set_filter => 1, :query_id => nil
|
assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook', :set_filter => 1, :query_id => nil
|
||||||
assert_nil Query.find_by_id(1)
|
assert_nil Query.find_by_id(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_backslash_should_be_escaped_in_filters
|
|
||||||
@request.session[:user_id] = 2
|
|
||||||
get :new, :subject => 'foo/bar'
|
|
||||||
assert_response :success
|
|
||||||
assert_template 'new'
|
|
||||||
assert_include 'addFilter("subject", "=", ["foo\/bar"]);', response.body
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ class RepositoriesGitControllerTest < ActionController::TestCase
|
|||||||
if @char_1.respond_to?(:force_encoding)
|
if @char_1.respond_to?(:force_encoding)
|
||||||
@char_1.force_encoding('UTF-8')
|
@char_1.force_encoding('UTF-8')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Setting.default_language = 'en'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_create_and_update
|
def test_create_and_update
|
||||||
@@ -261,8 +263,6 @@ class RepositoriesGitControllerTest < ActionController::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_diff
|
def test_diff
|
||||||
assert_equal true, @repository.is_default
|
|
||||||
assert_nil @repository.identifier
|
|
||||||
assert_equal 0, @repository.changesets.count
|
assert_equal 0, @repository.changesets.count
|
||||||
@repository.fetch_changesets
|
@repository.fetch_changesets
|
||||||
@project.reload
|
@project.reload
|
||||||
@@ -320,12 +320,10 @@ class RepositoriesGitControllerTest < ActionController::TestCase
|
|||||||
with_settings :diff_max_lines_displayed => 5 do
|
with_settings :diff_max_lines_displayed => 5 do
|
||||||
# Truncated diff of changeset 2f9c0091
|
# Truncated diff of changeset 2f9c0091
|
||||||
with_cache do
|
with_cache do
|
||||||
with_settings :default_language => 'en' do
|
get :diff, :id => PRJ_ID, :type => 'inline',
|
||||||
get :diff, :id => PRJ_ID, :type => 'inline',
|
:rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
|
||||||
:rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
|
assert_response :success
|
||||||
assert_response :success
|
assert @response.body.include?("... This diff was truncated")
|
||||||
assert @response.body.include?("... This diff was truncated")
|
|
||||||
end
|
|
||||||
with_settings :default_language => 'fr' do
|
with_settings :default_language => 'fr' do
|
||||||
get :diff, :id => PRJ_ID, :type => 'inline',
|
get :diff, :id => PRJ_ID, :type => 'inline',
|
||||||
:rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
|
:rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
|
||||||
@@ -353,55 +351,9 @@ class RepositoriesGitControllerTest < ActionController::TestCase
|
|||||||
diff = assigns(:diff)
|
diff = assigns(:diff)
|
||||||
assert_not_nil diff
|
assert_not_nil diff
|
||||||
assert_tag :tag => 'h2', :content => /2f9c0091:61b685fb/
|
assert_tag :tag => 'h2', :content => /2f9c0091:61b685fb/
|
||||||
assert_tag :tag => "form",
|
|
||||||
:attributes => {
|
|
||||||
:action => "/projects/subproject1/repository/revisions/" +
|
|
||||||
"61b685fbe55ab05b5ac68402d5720c1a6ac973d1/diff"
|
|
||||||
}
|
|
||||||
assert_tag :tag => 'input',
|
|
||||||
:attributes => {
|
|
||||||
:id => "rev_to",
|
|
||||||
:name => "rev_to",
|
|
||||||
:type => "hidden",
|
|
||||||
:value => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_diff_path_in_subrepo
|
|
||||||
repo = Repository::Git.create(
|
|
||||||
:project => @project,
|
|
||||||
:url => REPOSITORY_PATH,
|
|
||||||
:identifier => 'test-diff-path',
|
|
||||||
:path_encoding => 'ISO-8859-1'
|
|
||||||
);
|
|
||||||
assert repo
|
|
||||||
assert_equal false, repo.is_default
|
|
||||||
assert_equal 'test-diff-path', repo.identifier
|
|
||||||
get :diff,
|
|
||||||
:id => PRJ_ID,
|
|
||||||
:repository_id => 'test-diff-path',
|
|
||||||
:rev => '61b685fbe55ab05b',
|
|
||||||
:rev_to => '2f9c0091c754a91a',
|
|
||||||
:type => 'inline'
|
|
||||||
assert_response :success
|
|
||||||
assert_template 'diff'
|
|
||||||
diff = assigns(:diff)
|
|
||||||
assert_not_nil diff
|
|
||||||
assert_tag :tag => "form",
|
|
||||||
:attributes => {
|
|
||||||
:action => "/projects/subproject1/repository/test-diff-path/" +
|
|
||||||
"revisions/61b685fbe55ab05b/diff"
|
|
||||||
}
|
|
||||||
assert_tag :tag => 'input',
|
|
||||||
:attributes => {
|
|
||||||
:id => "rev_to",
|
|
||||||
:name => "rev_to",
|
|
||||||
:type => "hidden",
|
|
||||||
:value => '2f9c0091c754a91a'
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_diff_latin_1
|
def test_diff_latin_1
|
||||||
if @ruby19_non_utf8_pass
|
if @ruby19_non_utf8_pass
|
||||||
puts_ruby19_non_utf8_pass()
|
puts_ruby19_non_utf8_pass()
|
||||||
@@ -433,13 +385,8 @@ class RepositoriesGitControllerTest < ActionController::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_save_diff_type
|
def test_save_diff_type
|
||||||
user1 = User.find(1)
|
|
||||||
user1.pref[:diff_type] = nil
|
|
||||||
user1.preference.save
|
|
||||||
user = User.find(1)
|
|
||||||
assert_nil user.pref[:diff_type]
|
|
||||||
|
|
||||||
@request.session[:user_id] = 1 # admin
|
@request.session[:user_id] = 1 # admin
|
||||||
|
user = User.find(1)
|
||||||
get :diff,
|
get :diff,
|
||||||
:id => PRJ_ID,
|
:id => PRJ_ID,
|
||||||
:rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
|
:rev => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7'
|
||||||
@@ -532,21 +479,6 @@ class RepositoriesGitControllerTest < ActionController::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_revisions
|
|
||||||
assert_equal 0, @repository.changesets.count
|
|
||||||
@repository.fetch_changesets
|
|
||||||
@project.reload
|
|
||||||
assert_equal NUM_REV, @repository.changesets.count
|
|
||||||
get :revisions, :id => PRJ_ID
|
|
||||||
assert_response :success
|
|
||||||
assert_template 'revisions'
|
|
||||||
assert_tag :tag => 'form',
|
|
||||||
:attributes => {
|
|
||||||
:method => 'get',
|
|
||||||
:action => '/projects/subproject1/repository/revision'
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_revision
|
def test_revision
|
||||||
assert_equal 0, @repository.changesets.count
|
assert_equal 0, @repository.changesets.count
|
||||||
@repository.fetch_changesets
|
@repository.fetch_changesets
|
||||||
|
|||||||
@@ -110,14 +110,6 @@ class RolesControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'edit'
|
assert_template 'edit'
|
||||||
assert_equal Role.find(1), assigns(:role)
|
assert_equal Role.find(1), assigns(:role)
|
||||||
assert_select 'select[name=?]', 'role[issues_visibility]'
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_edit_anonymous
|
|
||||||
get :edit, :id => Role.anonymous.id
|
|
||||||
assert_response :success
|
|
||||||
assert_template 'edit'
|
|
||||||
assert_select 'select[name=?]', 'role[issues_visibility]', 0
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_edit_invalid_should_respond_with_404
|
def test_edit_invalid_should_respond_with_404
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class ApiTest::IssuesTest < ActionController::IntegrationTest
|
|||||||
:member_roles,
|
:member_roles,
|
||||||
:issues,
|
:issues,
|
||||||
:issue_statuses,
|
:issue_statuses,
|
||||||
:issue_relations,
|
|
||||||
:versions,
|
:versions,
|
||||||
:trackers,
|
:trackers,
|
||||||
:projects_trackers,
|
:projects_trackers,
|
||||||
|
|||||||
@@ -61,8 +61,6 @@ module ObjectHelpers
|
|||||||
|
|
||||||
def Issue.generate!(attributes={})
|
def Issue.generate!(attributes={})
|
||||||
issue = Issue.new(attributes)
|
issue = Issue.new(attributes)
|
||||||
issue.project ||= Project.find(1)
|
|
||||||
issue.tracker ||= issue.project.trackers.first
|
|
||||||
issue.subject = 'Generated' if issue.subject.blank?
|
issue.subject = 'Generated' if issue.subject.blank?
|
||||||
issue.author ||= User.find(2)
|
issue.author ||= User.find(2)
|
||||||
yield issue if block_given?
|
yield issue if block_given?
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
|||||||
class BoardTest < ActiveSupport::TestCase
|
class BoardTest < ActiveSupport::TestCase
|
||||||
fixtures :projects, :boards, :messages, :attachments, :watchers
|
fixtures :projects, :boards, :messages, :attachments, :watchers
|
||||||
|
|
||||||
include Redmine::I18n
|
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@project = Project.find(1)
|
@project = Project.find(1)
|
||||||
end
|
end
|
||||||
@@ -43,7 +41,6 @@ class BoardTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_parent_should_be_in_same_project
|
def test_parent_should_be_in_same_project
|
||||||
set_language_if_valid 'en'
|
|
||||||
board = Board.new(:project_id => 3, :name => 'Test', :description => 'Test', :parent_id => 1)
|
board = Board.new(:project_id => 3, :name => 'Test', :description => 'Test', :parent_id => 1)
|
||||||
assert !board.save
|
assert !board.save
|
||||||
assert_include "Parent forum is invalid", board.errors.full_messages
|
assert_include "Parent forum is invalid", board.errors.full_messages
|
||||||
|
|||||||
@@ -179,8 +179,7 @@ class ChangesetTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_commit_closing_a_subproject_issue
|
def test_commit_closing_a_subproject_issue
|
||||||
with_settings :commit_fix_status_id => 5, :commit_fix_keywords => 'closes',
|
with_settings :commit_fix_status_id => 5, :commit_fix_keywords => 'closes' do
|
||||||
:default_language => 'en' do
|
|
||||||
issue = Issue.find(5)
|
issue = Issue.find(5)
|
||||||
assert !issue.closed?
|
assert !issue.closed?
|
||||||
assert_difference 'Journal.count' do
|
assert_difference 'Journal.count' do
|
||||||
|
|||||||
@@ -253,15 +253,8 @@ RAW
|
|||||||
|
|
||||||
project_url = {:controller => 'projects', :action => 'show', :id => 'subproject1'}
|
project_url = {:controller => 'projects', :action => 'show', :id => 'subproject1'}
|
||||||
|
|
||||||
source_url = '/projects/ecookbook/repository/entry/some/file'
|
source_url = {:controller => 'repositories', :action => 'entry', :id => 'ecookbook', :path => ['some', 'file']}
|
||||||
source_url_with_rev = '/projects/ecookbook/repository/revisions/52/entry/some/file'
|
source_url_with_ext = {:controller => 'repositories', :action => 'entry', :id => 'ecookbook', :path => ['some', 'file.ext']}
|
||||||
source_url_with_ext = '/projects/ecookbook/repository/entry/some/file.ext'
|
|
||||||
source_url_with_rev_and_ext = '/projects/ecookbook/repository/revisions/52/entry/some/file.ext'
|
|
||||||
|
|
||||||
export_url = '/projects/ecookbook/repository/raw/some/file'
|
|
||||||
export_url_with_rev = '/projects/ecookbook/repository/revisions/52/raw/some/file'
|
|
||||||
export_url_with_ext = '/projects/ecookbook/repository/raw/some/file.ext'
|
|
||||||
export_url_with_rev_and_ext = '/projects/ecookbook/repository/revisions/52/raw/some/file.ext'
|
|
||||||
|
|
||||||
to_test = {
|
to_test = {
|
||||||
# tickets
|
# tickets
|
||||||
@@ -291,16 +284,12 @@ RAW
|
|||||||
'source:/some/file. ' => link_to('source:/some/file', source_url, :class => 'source') + ".",
|
'source:/some/file. ' => link_to('source:/some/file', source_url, :class => 'source') + ".",
|
||||||
'source:/some/file.ext. ' => link_to('source:/some/file.ext', source_url_with_ext, :class => 'source') + ".",
|
'source:/some/file.ext. ' => link_to('source:/some/file.ext', source_url_with_ext, :class => 'source') + ".",
|
||||||
'source:/some/file, ' => link_to('source:/some/file', source_url, :class => 'source') + ",",
|
'source:/some/file, ' => link_to('source:/some/file', source_url, :class => 'source') + ",",
|
||||||
'source:/some/file@52' => link_to('source:/some/file@52', source_url_with_rev, :class => 'source'),
|
'source:/some/file@52' => link_to('source:/some/file@52', source_url.merge(:rev => 52), :class => 'source'),
|
||||||
'source:/some/file.ext@52' => link_to('source:/some/file.ext@52', source_url_with_rev_and_ext, :class => 'source'),
|
'source:/some/file.ext@52' => link_to('source:/some/file.ext@52', source_url_with_ext.merge(:rev => 52), :class => 'source'),
|
||||||
'source:/some/file#L110' => link_to('source:/some/file#L110', source_url + "#L110", :class => 'source'),
|
'source:/some/file#L110' => link_to('source:/some/file#L110', source_url.merge(:anchor => 'L110'), :class => 'source'),
|
||||||
'source:/some/file.ext#L110' => link_to('source:/some/file.ext#L110', source_url_with_ext + "#L110", :class => 'source'),
|
'source:/some/file.ext#L110' => link_to('source:/some/file.ext#L110', source_url_with_ext.merge(:anchor => 'L110'), :class => 'source'),
|
||||||
'source:/some/file@52#L110' => link_to('source:/some/file@52#L110', source_url_with_rev + "#L110", :class => 'source'),
|
'source:/some/file@52#L110' => link_to('source:/some/file@52#L110', source_url.merge(:rev => 52, :anchor => 'L110'), :class => 'source'),
|
||||||
# export
|
'export:/some/file' => link_to('export:/some/file', source_url.merge(:format => 'raw'), :class => 'source download'),
|
||||||
'export:/some/file' => link_to('export:/some/file', export_url, :class => 'source download'),
|
|
||||||
'export:/some/file.ext' => link_to('export:/some/file.ext', export_url_with_ext, :class => 'source download'),
|
|
||||||
'export:/some/file@52' => link_to('export:/some/file@52', export_url_with_rev, :class => 'source download'),
|
|
||||||
'export:/some/file.ext@52' => link_to('export:/some/file.ext@52', export_url_with_rev_and_ext, :class => 'source download'),
|
|
||||||
# forum
|
# forum
|
||||||
'forum#2' => link_to('Discussion', board_url, :class => 'board'),
|
'forum#2' => link_to('Discussion', board_url, :class => 'board'),
|
||||||
'forum:Discussion' => link_to('Discussion', board_url, :class => 'board'),
|
'forum:Discussion' => link_to('Discussion', board_url, :class => 'board'),
|
||||||
|
|||||||
@@ -109,55 +109,51 @@ class IssuesHelperTest < ActionView::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with a start_date attribute" do
|
def test_with_a_start_date_attribute_should_format_the_current_date
|
||||||
should "format the current date" do
|
@detail = JournalDetail.new(
|
||||||
@detail = JournalDetail.new(
|
|
||||||
:property => 'attr',
|
:property => 'attr',
|
||||||
:old_value => '2010-01-01',
|
:old_value => '2010-01-01',
|
||||||
:value => '2010-01-31',
|
:value => '2010-01-31',
|
||||||
:prop_key => 'start_date'
|
:prop_key => 'start_date'
|
||||||
)
|
)
|
||||||
with_settings :date_format => '%m/%d/%Y' do
|
with_settings :date_format => '%m/%d/%Y' do
|
||||||
assert_match "01/31/2010", show_detail(@detail, true)
|
assert_match "01/31/2010", show_detail(@detail, true)
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
should "format the old date" do
|
|
||||||
@detail = JournalDetail.new(
|
|
||||||
:property => 'attr',
|
|
||||||
:old_value => '2010-01-01',
|
|
||||||
:value => '2010-01-31',
|
|
||||||
:prop_key => 'start_date'
|
|
||||||
)
|
|
||||||
with_settings :date_format => '%m/%d/%Y' do
|
|
||||||
assert_match "01/01/2010", show_detail(@detail, true)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with a due_date attribute" do
|
def test_with_a_start_date_attribute_should_format_the_old_date
|
||||||
should "format the current date" do
|
@detail = JournalDetail.new(
|
||||||
@detail = JournalDetail.new(
|
:property => 'attr',
|
||||||
:property => 'attr',
|
:old_value => '2010-01-01',
|
||||||
:old_value => '2010-01-01',
|
:value => '2010-01-31',
|
||||||
:value => '2010-01-31',
|
:prop_key => 'start_date'
|
||||||
:prop_key => 'due_date'
|
|
||||||
)
|
)
|
||||||
with_settings :date_format => '%m/%d/%Y' do
|
with_settings :date_format => '%m/%d/%Y' do
|
||||||
assert_match "01/31/2010", show_detail(@detail, true)
|
assert_match "01/01/2010", show_detail(@detail, true)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
should "format the old date" do
|
def test_with_a_due_date_attribute_should_with_a_due_date_attribute
|
||||||
@detail = JournalDetail.new(
|
@detail = JournalDetail.new(
|
||||||
:property => 'attr',
|
:property => 'attr',
|
||||||
:old_value => '2010-01-01',
|
:old_value => '2010-01-01',
|
||||||
:value => '2010-01-31',
|
:value => '2010-01-31',
|
||||||
:prop_key => 'due_date'
|
:prop_key => 'due_date'
|
||||||
)
|
)
|
||||||
with_settings :date_format => '%m/%d/%Y' do
|
with_settings :date_format => '%m/%d/%Y' do
|
||||||
assert_match "01/01/2010", show_detail(@detail, true)
|
assert_match "01/31/2010", show_detail(@detail, true)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_with_a_due_date_attribute_should_format_the_old_date
|
||||||
|
@detail = JournalDetail.new(
|
||||||
|
:property => 'attr',
|
||||||
|
:old_value => '2010-01-01',
|
||||||
|
:value => '2010-01-31',
|
||||||
|
:prop_key => 'due_date'
|
||||||
|
)
|
||||||
|
with_settings :date_format => '%m/%d/%Y' do
|
||||||
|
assert_match "01/01/2010", show_detail(@detail, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -18,17 +18,7 @@
|
|||||||
require File.expand_path('../../test_helper', __FILE__)
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
class IssueRelationTest < ActiveSupport::TestCase
|
class IssueRelationTest < ActiveSupport::TestCase
|
||||||
fixtures :projects,
|
fixtures :issue_relations, :issues
|
||||||
:users,
|
|
||||||
:roles,
|
|
||||||
:members,
|
|
||||||
:member_roles,
|
|
||||||
:issues,
|
|
||||||
:issue_statuses,
|
|
||||||
:issue_relations,
|
|
||||||
:enabled_modules,
|
|
||||||
:enumerations,
|
|
||||||
:trackers
|
|
||||||
|
|
||||||
def test_create
|
def test_create
|
||||||
from = Issue.find(1)
|
from = Issue.find(1)
|
||||||
|
|||||||
+13
-29
@@ -25,7 +25,7 @@ class IssueTest < ActiveSupport::TestCase
|
|||||||
:versions,
|
:versions,
|
||||||
:issue_statuses, :issue_categories, :issue_relations, :workflows,
|
:issue_statuses, :issue_categories, :issue_relations, :workflows,
|
||||||
:enumerations,
|
:enumerations,
|
||||||
:issues, :journals, :journal_details,
|
:issues,
|
||||||
:custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values,
|
:custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values,
|
||||||
:time_entries
|
:time_entries
|
||||||
|
|
||||||
@@ -105,6 +105,18 @@ class IssueTest < ActiveSupport::TestCase
|
|||||||
assert_visibility_match User.anonymous, issues
|
assert_visibility_match User.anonymous, issues
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_visible_scope_for_anonymous_with_own_issues_visibility
|
||||||
|
Role.anonymous.update_attribute :issues_visibility, 'own'
|
||||||
|
Issue.create!(:project_id => 1, :tracker_id => 1,
|
||||||
|
:author_id => User.anonymous.id,
|
||||||
|
:subject => 'Issue by anonymous')
|
||||||
|
|
||||||
|
issues = Issue.visible(User.anonymous).all
|
||||||
|
assert issues.any?
|
||||||
|
assert_nil issues.detect {|issue| issue.author != User.anonymous}
|
||||||
|
assert_visibility_match User.anonymous, issues
|
||||||
|
end
|
||||||
|
|
||||||
def test_visible_scope_for_anonymous_without_view_issues_permissions
|
def test_visible_scope_for_anonymous_without_view_issues_permissions
|
||||||
# Anonymous user should not see issues without permission
|
# Anonymous user should not see issues without permission
|
||||||
Role.anonymous.remove_permission!(:view_issues)
|
Role.anonymous.remove_permission!(:view_issues)
|
||||||
@@ -113,20 +125,6 @@ class IssueTest < ActiveSupport::TestCase
|
|||||||
assert_visibility_match User.anonymous, issues
|
assert_visibility_match User.anonymous, issues
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_anonymous_should_not_see_private_issues_with_issues_visibility_set_to_default
|
|
||||||
assert Role.anonymous.update_attribute(:issues_visibility, 'default')
|
|
||||||
issue = Issue.generate_for_project!(Project.find(1), :author => User.anonymous, :assigned_to => User.anonymous, :is_private => true)
|
|
||||||
assert_nil Issue.where(:id => issue.id).visible(User.anonymous).first
|
|
||||||
assert !issue.visible?(User.anonymous)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_anonymous_should_not_see_private_issues_with_issues_visibility_set_to_own
|
|
||||||
assert Role.anonymous.update_attribute(:issues_visibility, 'own')
|
|
||||||
issue = Issue.generate_for_project!(Project.find(1), :author => User.anonymous, :assigned_to => User.anonymous, :is_private => true)
|
|
||||||
assert_nil Issue.where(:id => issue.id).visible(User.anonymous).first
|
|
||||||
assert !issue.visible?(User.anonymous)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_visible_scope_for_non_member
|
def test_visible_scope_for_non_member
|
||||||
user = User.find(9)
|
user = User.find(9)
|
||||||
assert user.projects.empty?
|
assert user.projects.empty?
|
||||||
@@ -1576,18 +1574,4 @@ class IssueTest < ActiveSupport::TestCase
|
|||||||
def test_journals_after_with_blank_arg_should_return_all_journals
|
def test_journals_after_with_blank_arg_should_return_all_journals
|
||||||
assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('')
|
assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_save_attachments_with_hash_should_save_attachments_in_keys_order
|
|
||||||
set_tmp_attachments_directory
|
|
||||||
issue = Issue.generate!
|
|
||||||
issue.save_attachments({
|
|
||||||
'p0' => {'file' => mock_file_with_options(:original_filename => 'upload')},
|
|
||||||
'3' => {'file' => mock_file_with_options(:original_filename => 'bar')},
|
|
||||||
'1' => {'file' => mock_file_with_options(:original_filename => 'foo')}
|
|
||||||
})
|
|
||||||
issue.attach_saved_attachments
|
|
||||||
|
|
||||||
assert_equal 3, issue.reload.attachments.count
|
|
||||||
assert_equal %w(upload foo bar), issue.attachments.map(&:filename)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -171,24 +171,6 @@ class Redmine::I18nTest < ActiveSupport::TestCase
|
|||||||
assert_equal 'j', day_letter(4)
|
assert_equal 'j', day_letter(4)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_number_to_currency_for_each_language
|
|
||||||
valid_languages.each do |lang|
|
|
||||||
set_language_if_valid lang
|
|
||||||
assert_nothing_raised "#{lang} failure" do
|
|
||||||
number_to_currency(-1000.2)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_number_to_currency_default
|
|
||||||
set_language_if_valid 'bs'
|
|
||||||
assert_equal "KM -1000,20", number_to_currency(-1000.2)
|
|
||||||
set_language_if_valid 'de'
|
|
||||||
euro_sign = "\xe2\x82\xac"
|
|
||||||
euro_sign.force_encoding('UTF-8') if euro_sign.respond_to?(:force_encoding)
|
|
||||||
assert_equal "-1000,20 #{euro_sign}", number_to_currency(-1000.2)
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_valid_languages
|
def test_valid_languages
|
||||||
assert valid_languages.is_a?(Array)
|
assert valid_languages.is_a?(Array)
|
||||||
assert valid_languages.first.is_a?(Symbol)
|
assert valid_languages.first.is_a?(Symbol)
|
||||||
|
|||||||
@@ -382,28 +382,6 @@ class MailHandlerTest < ActiveSupport::TestCase
|
|||||||
assert_equal 'Testmail from Webmail: ä ö ü...', issue.subject
|
assert_equal 'Testmail from Webmail: ä ö ü...', issue.subject
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_add_issue_with_japanese_subject
|
|
||||||
issue = submit_email(
|
|
||||||
'subject_japanese_1.eml',
|
|
||||||
:issue => {:project => 'ecookbook'}
|
|
||||||
)
|
|
||||||
assert_kind_of Issue, issue
|
|
||||||
ja = "\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88"
|
|
||||||
ja.force_encoding('UTF-8') if ja.respond_to?(:force_encoding)
|
|
||||||
assert_equal ja, issue.subject
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_add_issue_with_mixed_japanese_subject
|
|
||||||
issue = submit_email(
|
|
||||||
'subject_japanese_2.eml',
|
|
||||||
:issue => {:project => 'ecookbook'}
|
|
||||||
)
|
|
||||||
assert_kind_of Issue, issue
|
|
||||||
ja = "Re: \xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88"
|
|
||||||
ja.force_encoding('UTF-8') if ja.respond_to?(:force_encoding)
|
|
||||||
assert_equal ja, issue.subject
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_should_ignore_emails_from_locked_users
|
def test_should_ignore_emails_from_locked_users
|
||||||
User.find(2).lock!
|
User.find(2).lock!
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# encoding: utf-8
|
|
||||||
#
|
|
||||||
# Redmine - project management software
|
# Redmine - project management software
|
||||||
# Copyright (C) 2006-2012 Jean-Philippe Lang
|
# Copyright (C) 2006-2012 Jean-Philippe Lang
|
||||||
#
|
#
|
||||||
@@ -108,11 +106,4 @@ class PrincipalTest < ActiveSupport::TestCase
|
|||||||
assert_equal @palmer, results.first
|
assert_equal @palmer, results.first
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_like_scope_with_cyrillic_name
|
|
||||||
user = User.generate!(:firstname => 'Соболев', :lastname => 'Денис')
|
|
||||||
results = Principal.like('Собо')
|
|
||||||
assert_equal 1, results.count
|
|
||||||
assert_equal user, results.first
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -54,19 +54,4 @@ class UserPreferenceTest < ActiveSupport::TestCase
|
|||||||
assert up.save
|
assert up.save
|
||||||
assert_kind_of Hash, up.others
|
assert_kind_of Hash, up.others
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_reading_value_from_nil_others_hash
|
|
||||||
up = UserPreference.new(:user => User.new)
|
|
||||||
up.others = nil
|
|
||||||
assert_nil up.others
|
|
||||||
assert_nil up[:foo]
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_writing_value_to_nil_others_hash
|
|
||||||
up = UserPreference.new(:user => User.new)
|
|
||||||
up.others = nil
|
|
||||||
assert_nil up.others
|
|
||||||
up[:foo] = 'bar'
|
|
||||||
assert_equal 'bar', up[:foo]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -32,13 +32,7 @@ class VersionTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
def test_invalid_effective_date_validation
|
def test_invalid_effective_date_validation
|
||||||
v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '99999-01-01')
|
v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '99999-01-01')
|
||||||
assert !v.valid?
|
assert !v.save
|
||||||
v.effective_date = '2012-11-33'
|
|
||||||
assert !v.valid?
|
|
||||||
v.effective_date = '2012-31-11'
|
|
||||||
assert !v.valid?
|
|
||||||
v.effective_date = 'ABC'
|
|
||||||
assert !v.valid?
|
|
||||||
assert_include I18n.translate('activerecord.errors.messages.not_a_date'),
|
assert_include I18n.translate('activerecord.errors.messages.not_a_date'),
|
||||||
v.errors[:effective_date]
|
v.errors[:effective_date]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user