Redmine 4.1.7
This commit is contained in:
parent
55458d3479
commit
3ca3c37487
103 changed files with 2426 additions and 431 deletions
|
@ -74,7 +74,7 @@ module Redmine
|
|||
all.each do |object|
|
||||
clear = object.send(attribute)
|
||||
object.send "#{attribute}=", clear
|
||||
raise(ActiveRecord::Rollback) unless object.save(:validation => false)
|
||||
raise(ActiveRecord::Rollback) unless object.save(validate: false)
|
||||
end
|
||||
end ? true : false
|
||||
end
|
||||
|
@ -84,7 +84,7 @@ module Redmine
|
|||
all.each do |object|
|
||||
clear = object.send(attribute)
|
||||
object.send :write_attribute, attribute, clear
|
||||
raise(ActiveRecord::Rollback) unless object.save(:validation => false)
|
||||
raise(ActiveRecord::Rollback) unless object.save(validate: false)
|
||||
end
|
||||
end ? true : false
|
||||
end
|
||||
|
|
|
@ -341,6 +341,7 @@ module Redmine
|
|||
if options[:format] == :html
|
||||
data_options = {}
|
||||
data_options[:collapse_expand] = "issue-#{issue.id}"
|
||||
data_options[:number_of_rows] = number_of_rows
|
||||
style = "position: absolute;top: #{options[:top]}px; font-size: 0.8em;"
|
||||
content = view.content_tag(:div, view.column_content(options[:column], issue), :style => style, :class => "issue_#{options[:column].name}", :id => "#{options[:column].name}_issue_#{issue.id}", :data => data_options)
|
||||
@columns[options[:column].name] << content if @columns.has_key?(options[:column].name)
|
||||
|
@ -378,6 +379,9 @@ module Redmine
|
|||
unless Redmine::Configuration['rmagick_font_path'].nil?
|
||||
font_path = Redmine::Configuration['minimagick_font_path'].presence || Redmine::Configuration['rmagick_font_path'].presence
|
||||
img = MiniMagick::Image.create(".#{format}", false)
|
||||
if Redmine::Configuration['imagemagick_convert_command'].present?
|
||||
MiniMagick.cli_path = File.dirname(Redmine::Configuration['imagemagick_convert_command'])
|
||||
end
|
||||
MiniMagick::Tool::Convert.new do |gc|
|
||||
gc.size('%dx%d' % [subject_width + g_width + 1, height])
|
||||
gc.xc('white')
|
||||
|
@ -623,14 +627,14 @@ module Redmine
|
|||
def coordinates(start_date, end_date, progress, zoom=nil)
|
||||
zoom ||= @zoom
|
||||
coords = {}
|
||||
if start_date && end_date && start_date < self.date_to && end_date > self.date_from
|
||||
if start_date > self.date_from
|
||||
if start_date && end_date && start_date <= self.date_to && end_date >= self.date_from
|
||||
if start_date >= self.date_from
|
||||
coords[:start] = start_date - self.date_from
|
||||
coords[:bar_start] = start_date - self.date_from
|
||||
else
|
||||
coords[:bar_start] = 0
|
||||
end
|
||||
if end_date < self.date_to
|
||||
if end_date <= self.date_to
|
||||
coords[:end] = end_date - self.date_from + 1
|
||||
coords[:bar_end] = end_date - self.date_from + 1
|
||||
else
|
||||
|
@ -768,6 +772,7 @@ module Redmine
|
|||
:top_increment => params[:top_increment],
|
||||
:obj_id => "#{object.class}-#{object.id}".downcase,
|
||||
},
|
||||
:number_of_rows => number_of_rows,
|
||||
}
|
||||
end
|
||||
if has_children
|
||||
|
@ -823,7 +828,10 @@ module Redmine
|
|||
def html_task(params, coords, markers, label, object)
|
||||
output = +''
|
||||
data_options = {}
|
||||
data_options[:collapse_expand] = "#{object.class}-#{object.id}".downcase if object
|
||||
if object
|
||||
data_options[:collapse_expand] = "#{object.class}-#{object.id}".downcase
|
||||
data_options[:number_of_rows] = number_of_rows
|
||||
end
|
||||
css = "task " +
|
||||
case object
|
||||
when Project
|
||||
|
|
|
@ -35,6 +35,7 @@ module Redmine
|
|||
projects = projects.like(query)
|
||||
end
|
||||
projects.
|
||||
visible.
|
||||
index_by(&:id).
|
||||
values_at(*project_ids). # sort according to stored order
|
||||
compact
|
||||
|
|
|
@ -178,6 +178,14 @@ module Redmine
|
|||
(path[-1,1] == "/") ? path[0..-2] : path
|
||||
end
|
||||
|
||||
def valid_name?(name)
|
||||
return true if name.nil?
|
||||
return true if name.is_a?(Integer) && name > 0
|
||||
return true if name.is_a?(String) && name =~ /\A[0-9]*\z/
|
||||
|
||||
false
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def retrieve_root_url
|
||||
|
|
|
@ -388,6 +388,18 @@ module Redmine
|
|||
nil
|
||||
end
|
||||
|
||||
def valid_name?(name)
|
||||
return false unless name.is_a?(String)
|
||||
|
||||
return false if name.start_with?('-', '/', 'refs/heads/', 'refs/remotes/')
|
||||
return false if name == 'HEAD'
|
||||
|
||||
git_cmd ['show-ref', '--heads', '--tags', '--quiet', '--', name]
|
||||
true
|
||||
rescue ScmCommandAborted
|
||||
false
|
||||
end
|
||||
|
||||
class Revision < Redmine::Scm::Adapters::Revision
|
||||
# Returns the readable identifier
|
||||
def format_identifier
|
||||
|
|
|
@ -291,6 +291,15 @@ module Redmine
|
|||
Annotate.new
|
||||
end
|
||||
|
||||
def valid_name?(name)
|
||||
return false unless name.nil? || name.is_a?(String)
|
||||
|
||||
# Mercurials names don't need to be checked further as its CLI
|
||||
# interface is restrictive enough to reject any invalid names on its
|
||||
# own.
|
||||
true
|
||||
end
|
||||
|
||||
class Revision < Redmine::Scm::Adapters::Revision
|
||||
# Returns the readable identifier
|
||||
def format_identifier
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require 'fileutils'
|
||||
require 'mimemagic'
|
||||
|
||||
module Redmine
|
||||
module Thumbnail
|
||||
|
@ -33,15 +32,11 @@ module Redmine
|
|||
return nil unless convert_available?
|
||||
return nil if is_pdf && !gs_available?
|
||||
unless File.exists?(target)
|
||||
mime_type = File.open(source) {|f| MimeMagic.by_magic(f).try(:type) }
|
||||
return nil if mime_type.nil?
|
||||
# Make sure we only invoke Imagemagick if the file type is allowed
|
||||
mime_type = File.open(source) {|f| Marcel::MimeType.for(f)}
|
||||
return nil if !ALLOWED_TYPES.include? mime_type
|
||||
return nil if is_pdf && mime_type != "application/pdf"
|
||||
|
||||
# Make sure we only invoke Imagemagick if the file type is allowed
|
||||
unless File.open(source) {|f| ALLOWED_TYPES.include? MimeMagic.by_magic(f).try(:type) }
|
||||
return nil
|
||||
end
|
||||
directory = File.dirname(target)
|
||||
unless File.exists?(directory)
|
||||
FileUtils.mkdir_p directory
|
||||
|
|
|
@ -7,7 +7,7 @@ module Redmine
|
|||
module VERSION
|
||||
MAJOR = 4
|
||||
MINOR = 1
|
||||
TINY = 1
|
||||
TINY = 7
|
||||
|
||||
# Branch values:
|
||||
# * official release: nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue