Redmine 3.4.4
This commit is contained in:
commit
64924a6376
2112 changed files with 259028 additions and 0 deletions
10
config/additional_environment.rb.example
Normal file
10
config/additional_environment.rb.example
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Copy this file to additional_environment.rb and add any statements
|
||||
# that need to be passed to the Rails::Initializer. `config` is
|
||||
# available in this context.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# config.log_level = :debug
|
||||
# ...
|
||||
#
|
||||
|
83
config/application.rb
Normal file
83
config/application.rb
Normal file
|
@ -0,0 +1,83 @@
|
|||
require File.expand_path('../boot', __FILE__)
|
||||
|
||||
require 'rails/all'
|
||||
|
||||
Bundler.require(*Rails.groups)
|
||||
|
||||
module RedmineApp
|
||||
class Application < Rails::Application
|
||||
# Settings in config/environments/* take precedence over those specified here.
|
||||
# Application configuration should go into files in config/initializers
|
||||
# -- all .rb files in that directory are automatically loaded.
|
||||
|
||||
# Custom directories with classes and modules you want to be autoloadable.
|
||||
config.autoload_paths += %W(#{config.root}/lib)
|
||||
|
||||
# Only load the plugins named here, in the order given (default is alphabetical).
|
||||
# :all can be used as a placeholder for all plugins not explicitly named.
|
||||
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
||||
|
||||
config.active_record.store_full_sti_class = true
|
||||
config.active_record.default_timezone = :local
|
||||
|
||||
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
||||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
||||
# config.time_zone = 'Central Time (US & Canada)'
|
||||
|
||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||
# config.i18n.default_locale = :de
|
||||
|
||||
I18n.enforce_available_locales = true
|
||||
|
||||
# Configure the default encoding used in templates for Ruby 1.9.
|
||||
config.encoding = "utf-8"
|
||||
|
||||
# Configure sensitive parameters which will be filtered from the log file.
|
||||
config.filter_parameters += [:password]
|
||||
|
||||
# Enable the asset pipeline
|
||||
config.assets.enabled = false
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets
|
||||
config.assets.version = '1.0'
|
||||
|
||||
config.action_mailer.perform_deliveries = false
|
||||
|
||||
# Do not include all helpers
|
||||
config.action_controller.include_all_helpers = false
|
||||
|
||||
# Do not suppress errors in after_rollback and after_commit callbacks
|
||||
config.active_record.raise_in_transactional_callbacks = true
|
||||
|
||||
# XML parameter parser removed from core in Rails 4.0
|
||||
# and extracted to actionpack-xml_parser gem
|
||||
config.middleware.insert_after ActionDispatch::ParamsParser, ActionDispatch::XmlParamsParser
|
||||
|
||||
# Sets the Content-Length header on responses with fixed-length bodies
|
||||
config.middleware.insert_after Rack::Sendfile, Rack::ContentLength
|
||||
|
||||
# Verify validity of user sessions
|
||||
config.redmine_verify_sessions = true
|
||||
|
||||
# Specific cache for search results, the default file store cache is not
|
||||
# a good option as it could grow fast. A memory store (32MB max) is used
|
||||
# as the default. If you're running multiple server processes, it's
|
||||
# recommended to switch to a shared cache store (eg. mem_cache_store).
|
||||
# See http://guides.rubyonrails.org/caching_with_rails.html#cache-stores
|
||||
# for more options (same options as config.cache_store).
|
||||
config.redmine_search_cache_store = :memory_store
|
||||
|
||||
# Configure log level here so that additional environment file
|
||||
# can change it (environments/ENV.rb would take precedence over it)
|
||||
config.log_level = Rails.env.production? ? :info : :debug
|
||||
|
||||
config.session_store :cookie_store,
|
||||
:key => '_redmine_session',
|
||||
:path => config.relative_url_root || '/'
|
||||
|
||||
if File.exists?(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
|
||||
instance_eval File.read(File.join(File.dirname(__FILE__), 'additional_environment.rb'))
|
||||
end
|
||||
end
|
||||
end
|
4
config/boot.rb
Normal file
4
config/boot.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Set up gems listed in the Gemfile.
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||
|
||||
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
221
config/configuration.yml.example
Normal file
221
config/configuration.yml.example
Normal file
|
@ -0,0 +1,221 @@
|
|||
# = Redmine configuration file
|
||||
#
|
||||
# Each environment has it's own configuration options. If you are only
|
||||
# running in production, only the production block needs to be configured.
|
||||
# Environment specific configuration options override the default ones.
|
||||
#
|
||||
# Note that this file needs to be a valid YAML file.
|
||||
# DO NOT USE TABS! Use 2 spaces instead of tabs for identation.
|
||||
|
||||
# default configuration options for all environments
|
||||
default:
|
||||
# Outgoing emails configuration
|
||||
# See the examples below and the Rails guide for more configuration options:
|
||||
# http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration
|
||||
email_delivery:
|
||||
|
||||
# ==== Simple SMTP server at localhost
|
||||
#
|
||||
# email_delivery:
|
||||
# delivery_method: :smtp
|
||||
# smtp_settings:
|
||||
# address: "localhost"
|
||||
# port: 25
|
||||
#
|
||||
# ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com
|
||||
#
|
||||
# email_delivery:
|
||||
# delivery_method: :smtp
|
||||
# smtp_settings:
|
||||
# address: "example.com"
|
||||
# port: 25
|
||||
# authentication: :login
|
||||
# domain: 'foo.com'
|
||||
# user_name: 'myaccount'
|
||||
# password: 'password'
|
||||
#
|
||||
# ==== SMTP server at example.com using PLAIN authentication
|
||||
#
|
||||
# email_delivery:
|
||||
# delivery_method: :smtp
|
||||
# smtp_settings:
|
||||
# address: "example.com"
|
||||
# port: 25
|
||||
# authentication: :plain
|
||||
# domain: 'example.com'
|
||||
# user_name: 'myaccount'
|
||||
# password: 'password'
|
||||
#
|
||||
# ==== SMTP server at using TLS (GMail)
|
||||
# This might require some additional configuration. See the guides at:
|
||||
# http://www.redmine.org/projects/redmine/wiki/EmailConfiguration
|
||||
#
|
||||
# email_delivery:
|
||||
# delivery_method: :smtp
|
||||
# smtp_settings:
|
||||
# enable_starttls_auto: true
|
||||
# address: "smtp.gmail.com"
|
||||
# port: 587
|
||||
# domain: "smtp.gmail.com" # 'your.domain.com' for GoogleApps
|
||||
# authentication: :plain
|
||||
# user_name: "your_email@gmail.com"
|
||||
# password: "your_password"
|
||||
#
|
||||
# ==== Sendmail command
|
||||
#
|
||||
# email_delivery:
|
||||
# delivery_method: :sendmail
|
||||
|
||||
# Absolute path to the directory where attachments are stored.
|
||||
# The default is the 'files' directory in your Redmine instance.
|
||||
# Your Redmine instance needs to have write permission on this
|
||||
# directory.
|
||||
# Examples:
|
||||
# attachments_storage_path: /var/redmine/files
|
||||
# attachments_storage_path: D:/redmine/files
|
||||
attachments_storage_path:
|
||||
|
||||
# Configuration of the autologin cookie.
|
||||
# autologin_cookie_name: the name of the cookie (default: autologin)
|
||||
# autologin_cookie_path: the cookie path (default: /)
|
||||
# autologin_cookie_secure: true sets the cookie secure flag (default: false)
|
||||
autologin_cookie_name:
|
||||
autologin_cookie_path:
|
||||
autologin_cookie_secure:
|
||||
|
||||
# Configuration of SCM executable command.
|
||||
#
|
||||
# Absolute path (e.g. /usr/local/bin/hg) or command name (e.g. hg.exe, bzr.exe)
|
||||
# On Windows + CRuby, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.
|
||||
#
|
||||
# On Windows + JRuby 1.6.2, path which contains spaces does not work.
|
||||
# For example, "C:\Program Files\TortoiseHg\hg.exe".
|
||||
# If you want to this feature, you need to install to the path which does not contains spaces.
|
||||
# For example, "C:\TortoiseHg\hg.exe".
|
||||
#
|
||||
# Examples:
|
||||
# scm_subversion_command: svn # (default: svn)
|
||||
# scm_mercurial_command: C:\Program Files\TortoiseHg\hg.exe # (default: hg)
|
||||
# scm_git_command: /usr/local/bin/git # (default: git)
|
||||
# scm_cvs_command: cvs # (default: cvs)
|
||||
# scm_bazaar_command: bzr.exe # (default: bzr)
|
||||
# scm_darcs_command: darcs-1.0.9-i386-linux # (default: darcs)
|
||||
#
|
||||
scm_subversion_command:
|
||||
scm_mercurial_command:
|
||||
scm_git_command:
|
||||
scm_cvs_command:
|
||||
scm_bazaar_command:
|
||||
scm_darcs_command:
|
||||
|
||||
# SCM paths validation.
|
||||
#
|
||||
# You can configure a regular expression for each SCM that will be used to
|
||||
# validate the path of new repositories (eg. path entered by users with the
|
||||
# "Manage repositories" permission and path returned by reposman.rb).
|
||||
# The regexp will be wrapped with \A \z, so it must match the whole path.
|
||||
# And the regexp is case sensitive.
|
||||
#
|
||||
# You can match the project identifier by using %project% in the regexp.
|
||||
#
|
||||
# You can also set a custom hint message for each SCM that will be displayed
|
||||
# on the repository form instead of the default one.
|
||||
#
|
||||
# Examples:
|
||||
# scm_subversion_path_regexp: file:///svnpath/[a-z0-9_]+
|
||||
# scm_subversion_path_info: SVN URL (eg. file:///svnpath/foo)
|
||||
#
|
||||
# scm_git_path_regexp: /gitpath/%project%(\.[a-z0-9_])?/
|
||||
#
|
||||
scm_subversion_path_regexp:
|
||||
scm_mercurial_path_regexp:
|
||||
scm_git_path_regexp:
|
||||
scm_cvs_path_regexp:
|
||||
scm_bazaar_path_regexp:
|
||||
scm_darcs_path_regexp:
|
||||
scm_filesystem_path_regexp:
|
||||
|
||||
# Absolute path to the SCM commands errors (stderr) log file.
|
||||
# The default is to log in the 'log' directory of your Redmine instance.
|
||||
# Example:
|
||||
# scm_stderr_log_file: /var/log/redmine_scm_stderr.log
|
||||
scm_stderr_log_file:
|
||||
|
||||
# Key used to encrypt sensitive data in the database (SCM and LDAP passwords).
|
||||
# If you don't want to enable data encryption, just leave it blank.
|
||||
# WARNING: losing/changing this key will make encrypted data unreadable.
|
||||
#
|
||||
# If you want to encrypt existing passwords in your database:
|
||||
# * set the cipher key here in your configuration file
|
||||
# * encrypt data using 'rake db:encrypt RAILS_ENV=production'
|
||||
#
|
||||
# If you have encrypted data and want to change this key, you have to:
|
||||
# * decrypt data using 'rake db:decrypt RAILS_ENV=production' first
|
||||
# * change the cipher key here in your configuration file
|
||||
# * encrypt data using 'rake db:encrypt RAILS_ENV=production'
|
||||
database_cipher_key:
|
||||
|
||||
# Set this to false to disable plugins' assets mirroring on startup.
|
||||
# You can use `rake redmine:plugins:assets` to manually mirror assets
|
||||
# to public/plugin_assets when you install/upgrade a Redmine plugin.
|
||||
#
|
||||
#mirror_plugins_assets_on_startup: false
|
||||
|
||||
# Your secret key for verifying cookie session data integrity. If you
|
||||
# change this key, all old sessions will become invalid! Make sure the
|
||||
# secret is at least 30 characters and all random, no regular words or
|
||||
# you'll be exposed to dictionary attacks.
|
||||
#
|
||||
# If you have a load-balancing Redmine cluster, you have to use the
|
||||
# same secret token on each machine.
|
||||
#secret_token: 'change it to a long random string'
|
||||
|
||||
# Requires users to re-enter their password for sensitive actions (editing
|
||||
# of account data, project memberships, application settings, user, group,
|
||||
# role, auth source management and project deletion). Disabled by default.
|
||||
# Timeout is set in minutes.
|
||||
#
|
||||
#sudo_mode: true
|
||||
#sudo_mode_timeout: 15
|
||||
|
||||
# Absolute path (e.g. /usr/bin/convert, c:/im/convert.exe) to
|
||||
# the ImageMagick's `convert` binary. Used to generate attachment thumbnails.
|
||||
#imagemagick_convert_command:
|
||||
|
||||
# Configuration of RMagick font.
|
||||
#
|
||||
# Redmine uses RMagick in order to export gantt png.
|
||||
# You don't need this setting if you don't install RMagick.
|
||||
#
|
||||
# In CJK (Chinese, Japanese and Korean),
|
||||
# in order to show CJK characters correctly,
|
||||
# you need to set this configuration.
|
||||
#
|
||||
# Because there is no standard font across platforms in CJK,
|
||||
# you need to set a font installed in your server.
|
||||
#
|
||||
# This setting is not necessary in non CJK.
|
||||
#
|
||||
# Examples for Japanese:
|
||||
# Windows:
|
||||
# rmagick_font_path: C:\windows\fonts\msgothic.ttc
|
||||
# Linux:
|
||||
# rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
|
||||
#
|
||||
rmagick_font_path:
|
||||
|
||||
# Maximum number of simultaneous AJAX uploads
|
||||
#max_concurrent_ajax_uploads: 2
|
||||
|
||||
# Configure OpenIdAuthentication.store
|
||||
#
|
||||
# allowed values: :memory, :file, :memcache
|
||||
#openid_authentication_store: :memory
|
||||
|
||||
# specific configuration options for production environment
|
||||
# that overrides the default ones
|
||||
production:
|
||||
|
||||
# specific configuration options for development environment
|
||||
# that overrides the default ones
|
||||
development:
|
51
config/database.yml.example
Normal file
51
config/database.yml.example
Normal file
|
@ -0,0 +1,51 @@
|
|||
# Default setup is given for MySQL with ruby1.9.
|
||||
# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.
|
||||
# Line indentation must be 2 spaces (no tabs).
|
||||
|
||||
production:
|
||||
adapter: mysql2
|
||||
database: redmine
|
||||
host: localhost
|
||||
username: root
|
||||
password: ""
|
||||
encoding: utf8
|
||||
|
||||
development:
|
||||
adapter: mysql2
|
||||
database: redmine_development
|
||||
host: localhost
|
||||
username: root
|
||||
password: ""
|
||||
encoding: utf8
|
||||
|
||||
# Warning: The database defined as "test" will be erased and
|
||||
# re-generated from your development database when you run "rake".
|
||||
# Do not set this db to the same as development or production.
|
||||
test:
|
||||
adapter: mysql2
|
||||
database: redmine_test
|
||||
host: localhost
|
||||
username: root
|
||||
password: ""
|
||||
encoding: utf8
|
||||
|
||||
# PostgreSQL configuration example
|
||||
#production:
|
||||
# adapter: postgresql
|
||||
# database: redmine
|
||||
# host: localhost
|
||||
# username: postgres
|
||||
# password: "postgres"
|
||||
|
||||
# SQLite3 configuration example
|
||||
#production:
|
||||
# adapter: sqlite3
|
||||
# database: db/redmine.sqlite3
|
||||
|
||||
# SQL Server configuration example
|
||||
#production:
|
||||
# adapter: sqlserver
|
||||
# database: redmine
|
||||
# host: localhost
|
||||
# username: jenkins
|
||||
# password: jenkins
|
14
config/environment.rb
Normal file
14
config/environment.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Load the Rails application
|
||||
require File.expand_path('../application', __FILE__)
|
||||
|
||||
# Make sure there's no plugin in vendor/plugin before starting
|
||||
vendor_plugins_dir = File.join(Rails.root, "vendor", "plugins")
|
||||
if Dir.glob(File.join(vendor_plugins_dir, "*")).any?
|
||||
$stderr.puts "Plugins in vendor/plugins (#{vendor_plugins_dir}) are no longer allowed. " +
|
||||
"Please, put your Redmine plugins in the `plugins` directory at the root of your " +
|
||||
"Redmine directory (#{File.join(Rails.root, "plugins")})"
|
||||
exit 1
|
||||
end
|
||||
|
||||
# Initialize the Rails application
|
||||
Rails.application.initialize!
|
21
config/environments/development.rb
Normal file
21
config/environments/development.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
# In the development environment your application's code is reloaded on
|
||||
# every request. This slows down response time but is perfect for development
|
||||
# since you don't have to restart the webserver when you make code changes.
|
||||
config.cache_classes = false
|
||||
|
||||
# Do not eager load code on boot.
|
||||
config.eager_load = false
|
||||
|
||||
# Show full error reports and disable caching
|
||||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
# Disable delivery errors
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Print deprecation notices to stderr and the Rails logger.
|
||||
config.active_support.deprecation = [:stderr, :log]
|
||||
end
|
25
config/environments/production.rb
Normal file
25
config/environments/production.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
# Code is not reloaded between requests.
|
||||
config.cache_classes = true
|
||||
|
||||
# Eager load code on boot. This eager loads most of Rails and
|
||||
# your application in memory, allowing both threaded web servers
|
||||
# and those relying on copy on write to perform better.
|
||||
# Rake tasks automatically ignore this option for performance.
|
||||
config.eager_load = true
|
||||
|
||||
# Full error reports are disabled and caching is turned on.
|
||||
config.consider_all_requests_local = false
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# Disable delivery errors
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# No email in production log
|
||||
config.action_mailer.logger = nil
|
||||
|
||||
# Print deprecation notices to the Rails logger.
|
||||
config.active_support.deprecation = :log
|
||||
end
|
38
config/environments/test.rb
Normal file
38
config/environments/test.rb
Normal file
|
@ -0,0 +1,38 @@
|
|||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
# The test environment is used exclusively to run your application's
|
||||
# test suite. You never need to work with it otherwise. Remember that
|
||||
# your test database is "scratch space" for the test suite and is wiped
|
||||
# and recreated between test runs. Don't rely on the data there!
|
||||
config.cache_classes = true
|
||||
|
||||
# Do not eager load code on boot. This avoids loading your whole application
|
||||
# just for the purpose of running a single test. If you are using a tool that
|
||||
# preloads Rails for running tests, you may have to set it to true.
|
||||
config.eager_load = false
|
||||
|
||||
# Show full error reports and disable caching
|
||||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
config.action_mailer.perform_deliveries = true
|
||||
|
||||
# Tell Action Mailer not to deliver emails to the real world.
|
||||
# The :test delivery method accumulates sent emails in the
|
||||
# ActionMailer::Base.deliveries array.
|
||||
config.action_mailer.delivery_method = :test
|
||||
|
||||
# Disable request forgery protection in test environment.
|
||||
config.action_controller.allow_forgery_protection = false
|
||||
|
||||
# Disable sessions verifications in test environment.
|
||||
config.redmine_verify_sessions = false
|
||||
|
||||
# Print deprecation notices to stderr and the Rails logger.
|
||||
config.active_support.deprecation = [:stderr, :log]
|
||||
|
||||
config.secret_key_base = 'a secret token for running the tests'
|
||||
|
||||
config.active_support.test_order = :random
|
||||
end
|
2
config/environments/test_pgsql.rb
Normal file
2
config/environments/test_pgsql.rb
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Same as test.rb
|
||||
instance_eval File.read(File.join(File.dirname(__FILE__), 'test.rb'))
|
2
config/environments/test_sqlite3.rb
Normal file
2
config/environments/test_sqlite3.rb
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Same as test.rb
|
||||
instance_eval File.read(File.join(File.dirname(__FILE__), 'test.rb'))
|
15
config/initializers/00-core_plugins.rb
Normal file
15
config/initializers/00-core_plugins.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Loads the core plugins located in lib/plugins
|
||||
Dir.glob(File.join(Rails.root, "lib/plugins/*")).sort.each do |directory|
|
||||
if File.directory?(directory)
|
||||
lib = File.join(directory, "lib")
|
||||
if File.directory?(lib)
|
||||
$:.unshift lib
|
||||
ActiveSupport::Dependencies.autoload_paths += [lib]
|
||||
end
|
||||
initializer = File.join(directory, "init.rb")
|
||||
if File.file?(initializer)
|
||||
config = RedmineApp::Application.config
|
||||
eval(File.read(initializer), binding, initializer)
|
||||
end
|
||||
end
|
||||
end
|
240
config/initializers/10-patches.rb
Normal file
240
config/initializers/10-patches.rb
Normal file
|
@ -0,0 +1,240 @@
|
|||
require 'active_record'
|
||||
|
||||
module ActiveRecord
|
||||
class Base
|
||||
include Redmine::I18n
|
||||
# Translate attribute names for validation errors display
|
||||
def self.human_attribute_name(attr, options = {})
|
||||
prepared_attr = attr.to_s.sub(/_id$/, '').sub(/^.+\./, '')
|
||||
class_prefix = name.underscore.gsub('/', '_')
|
||||
|
||||
redmine_default = [
|
||||
:"field_#{class_prefix}_#{prepared_attr}",
|
||||
:"field_#{prepared_attr}"
|
||||
]
|
||||
|
||||
options[:default] = redmine_default + Array(options[:default])
|
||||
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
# Undefines private Kernel#open method to allow using `open` scopes in models.
|
||||
# See Defect #11545 (http://www.redmine.org/issues/11545) for details.
|
||||
class Base
|
||||
class << self
|
||||
undef open
|
||||
end
|
||||
end
|
||||
class Relation ; undef open ; end
|
||||
end
|
||||
|
||||
module ActionView
|
||||
module Helpers
|
||||
module DateHelper
|
||||
# distance_of_time_in_words breaks when difference is greater than 30 years
|
||||
def distance_of_date_in_words(from_date, to_date = 0, options = {})
|
||||
from_date = from_date.to_date if from_date.respond_to?(:to_date)
|
||||
to_date = to_date.to_date if to_date.respond_to?(:to_date)
|
||||
distance_in_days = (to_date - from_date).abs
|
||||
|
||||
I18n.with_options :locale => options[:locale], :scope => :'datetime.distance_in_words' do |locale|
|
||||
case distance_in_days
|
||||
when 0..60 then locale.t :x_days, :count => distance_in_days.round
|
||||
when 61..720 then locale.t :about_x_months, :count => (distance_in_days / 30).round
|
||||
else locale.t :over_x_years, :count => (distance_in_days / 365).floor
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Resolver
|
||||
def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
|
||||
cached(key, [name, prefix, partial], details, locals) do
|
||||
if (details[:formats] & [:xml, :json]).any?
|
||||
details = details.dup
|
||||
details[:formats] = details[:formats].dup + [:api]
|
||||
end
|
||||
find_templates(name, prefix, partial, details)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| html_tag || ''.html_safe }
|
||||
|
||||
# HTML5: <option value=""></option> is invalid, use <option value=""> </option> instead
|
||||
module ActionView
|
||||
module Helpers
|
||||
module Tags
|
||||
class Base
|
||||
private
|
||||
alias :add_options_without_non_empty_blank_option :add_options
|
||||
def add_options(option_tags, options, value = nil)
|
||||
if options[:include_blank] == true
|
||||
options = options.dup
|
||||
options[:include_blank] = ' '.html_safe
|
||||
end
|
||||
add_options_without_non_empty_blank_option(option_tags, options, value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module FormTagHelper
|
||||
alias :select_tag_without_non_empty_blank_option :select_tag
|
||||
def select_tag(name, option_tags = nil, options = {})
|
||||
if options.delete(:include_blank)
|
||||
options[:prompt] = ' '.html_safe
|
||||
end
|
||||
select_tag_without_non_empty_blank_option(name, option_tags, options)
|
||||
end
|
||||
end
|
||||
|
||||
module FormOptionsHelper
|
||||
alias :options_for_select_without_non_empty_blank_option :options_for_select
|
||||
def options_for_select(container, selected = nil)
|
||||
if container.is_a?(Array)
|
||||
container = container.map {|element| element.blank? ? [" ".html_safe, ""] : element}
|
||||
end
|
||||
options_for_select_without_non_empty_blank_option(container, selected)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require 'mail'
|
||||
|
||||
module DeliveryMethods
|
||||
class AsyncSMTP < ::Mail::SMTP
|
||||
def deliver!(*args)
|
||||
Thread.start do
|
||||
super *args
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class AsyncSendmail < ::Mail::Sendmail
|
||||
def deliver!(*args)
|
||||
Thread.start do
|
||||
super *args
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class TmpFile
|
||||
def initialize(*args); end
|
||||
|
||||
def deliver!(mail)
|
||||
dest_dir = File.join(Rails.root, 'tmp', 'emails')
|
||||
Dir.mkdir(dest_dir) unless File.directory?(dest_dir)
|
||||
File.open(File.join(dest_dir, mail.message_id.gsub(/[<>]/, '') + '.eml'), 'wb') {|f| f.write(mail.encoded) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ActionMailer::Base.add_delivery_method :async_smtp, DeliveryMethods::AsyncSMTP
|
||||
ActionMailer::Base.add_delivery_method :async_sendmail, DeliveryMethods::AsyncSendmail
|
||||
ActionMailer::Base.add_delivery_method :tmp_file, DeliveryMethods::TmpFile
|
||||
|
||||
# Changes how sent emails are logged
|
||||
# Rails doesn't log cc and bcc which is misleading when using bcc only (#12090)
|
||||
module ActionMailer
|
||||
class LogSubscriber < ActiveSupport::LogSubscriber
|
||||
def deliver(event)
|
||||
recipients = [:to, :cc, :bcc].inject("") do |s, header|
|
||||
r = Array.wrap(event.payload[header])
|
||||
if r.any?
|
||||
s << "\n #{header}: #{r.join(', ')}"
|
||||
end
|
||||
s
|
||||
end
|
||||
info("\nSent email \"#{event.payload[:subject]}\" (%1.fms)#{recipients}" % event.duration)
|
||||
debug(event.payload[:mail])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# #deliver is deprecated in Rails 4.2
|
||||
# Prevents massive deprecation warnings
|
||||
module ActionMailer
|
||||
class MessageDelivery < Delegator
|
||||
def deliver
|
||||
deliver_now
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module ActionController
|
||||
module MimeResponds
|
||||
class Collector
|
||||
def api(&block)
|
||||
any(:xml, :json, &block)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module ActionController
|
||||
class Base
|
||||
# Displays an explicit message instead of a NoMethodError exception
|
||||
# when trying to start Redmine with an old session_store.rb
|
||||
# TODO: remove it in a later version
|
||||
def self.session=(*args)
|
||||
$stderr.puts "Please remove config/initializers/session_store.rb and run `rake generate_secret_token`.\n" +
|
||||
"Setting the session secret with ActionController.session= is no longer supported."
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Adds asset_id parameters to assets like Rails 3 to invalidate caches in browser
|
||||
module ActionView
|
||||
module Helpers
|
||||
module AssetUrlHelper
|
||||
@@cache_asset_timestamps = Rails.env.production?
|
||||
@@asset_timestamps_cache = {}
|
||||
@@asset_timestamps_cache_guard = Mutex.new
|
||||
|
||||
def asset_path_with_asset_id(source, options = {})
|
||||
asset_id = rails_asset_id(source, options)
|
||||
unless asset_id.blank?
|
||||
source += "?#{asset_id}"
|
||||
end
|
||||
asset_path(source, options)
|
||||
end
|
||||
alias :path_to_asset :asset_path_with_asset_id
|
||||
|
||||
def rails_asset_id(source, options = {})
|
||||
if asset_id = ENV["RAILS_ASSET_ID"]
|
||||
asset_id
|
||||
else
|
||||
if @@cache_asset_timestamps && (asset_id = @@asset_timestamps_cache[source])
|
||||
asset_id
|
||||
else
|
||||
extname = compute_asset_extname(source, options)
|
||||
path = File.join(Rails.public_path, "#{source}#{extname}")
|
||||
exist = false
|
||||
if File.exist? path
|
||||
exist = true
|
||||
else
|
||||
path = File.join(Rails.public_path, compute_asset_path("#{source}#{extname}", options))
|
||||
if File.exist? path
|
||||
exist = true
|
||||
end
|
||||
end
|
||||
asset_id = exist ? File.mtime(path).to_i.to_s : ''
|
||||
|
||||
if @@cache_asset_timestamps
|
||||
@@asset_timestamps_cache_guard.synchronize do
|
||||
@@asset_timestamps_cache[source] = asset_id
|
||||
end
|
||||
end
|
||||
|
||||
asset_id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
4
config/initializers/20-mime_types.rb
Normal file
4
config/initializers/20-mime_types.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Add new mime types for use in respond_to blocks:
|
||||
|
||||
Mime::SET << Mime::CSV unless Mime::SET.include?(Mime::CSV)
|
||||
|
30
config/initializers/30-redmine.rb
Normal file
30
config/initializers/30-redmine.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
I18n.default_locale = 'en'
|
||||
I18n.backend = Redmine::I18n::Backend.new
|
||||
# Forces I18n to load available locales from the backend
|
||||
I18n.config.available_locales = nil
|
||||
|
||||
require 'redmine'
|
||||
|
||||
# Load the secret token from the Redmine configuration file
|
||||
secret = Redmine::Configuration['secret_token']
|
||||
if secret.present?
|
||||
RedmineApp::Application.config.secret_token = secret
|
||||
end
|
||||
|
||||
if Object.const_defined?(:OpenIdAuthentication)
|
||||
openid_authentication_store = Redmine::Configuration['openid_authentication_store']
|
||||
OpenIdAuthentication.store =
|
||||
openid_authentication_store.present? ?
|
||||
openid_authentication_store : :memory
|
||||
end
|
||||
|
||||
Redmine::Plugin.load
|
||||
unless Redmine::Configuration['mirror_plugins_assets_on_startup'] == false
|
||||
Redmine::Plugin.mirror_assets
|
||||
end
|
||||
|
||||
Rails.application.config.to_prepare do
|
||||
Redmine::FieldFormat::RecordList.subclasses.each do |klass|
|
||||
klass.instance.reset_target_class
|
||||
end
|
||||
end
|
11
config/initializers/backtrace_silencers.rb
Normal file
11
config/initializers/backtrace_silencers.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
||||
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
||||
|
||||
# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
|
||||
# Rails.backtrace_cleaner.remove_silencers!
|
||||
|
||||
# Do not remove plugins backtrace
|
||||
Rails.backtrace_cleaner.remove_silencers!
|
||||
Rails.backtrace_cleaner.add_silencer { |line| line !~ /^\/?(app|config|lib|plugins|test)/ }
|
10
config/initializers/inflections.rb
Normal file
10
config/initializers/inflections.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Add new inflection rules using the following format
|
||||
# (all these examples are active by default):
|
||||
# ActiveSupport::Inflector.inflections do |inflect|
|
||||
# inflect.plural /^(ox)$/i, '\1en'
|
||||
# inflect.singular /^(ox)en/i, '\1'
|
||||
# inflect.irregular 'person', 'people'
|
||||
# inflect.uncountable %w( fish sheep )
|
||||
# end
|
1230
config/locales/ar.yml
Normal file
1230
config/locales/ar.yml
Normal file
File diff suppressed because it is too large
Load diff
1325
config/locales/az.yml
Normal file
1325
config/locales/az.yml
Normal file
File diff suppressed because it is too large
Load diff
1214
config/locales/bg.yml
Normal file
1214
config/locales/bg.yml
Normal file
File diff suppressed because it is too large
Load diff
1243
config/locales/bs.yml
Normal file
1243
config/locales/bs.yml
Normal file
File diff suppressed because it is too large
Load diff
1220
config/locales/ca.yml
Normal file
1220
config/locales/ca.yml
Normal file
File diff suppressed because it is too large
Load diff
1229
config/locales/cs.yml
Normal file
1229
config/locales/cs.yml
Normal file
File diff suppressed because it is too large
Load diff
1247
config/locales/da.yml
Normal file
1247
config/locales/da.yml
Normal file
File diff suppressed because it is too large
Load diff
1229
config/locales/de.yml
Normal file
1229
config/locales/de.yml
Normal file
File diff suppressed because it is too large
Load diff
1230
config/locales/el.yml
Normal file
1230
config/locales/el.yml
Normal file
File diff suppressed because it is too large
Load diff
1232
config/locales/en-GB.yml
Normal file
1232
config/locales/en-GB.yml
Normal file
File diff suppressed because it is too large
Load diff
1211
config/locales/en.yml
Normal file
1211
config/locales/en.yml
Normal file
File diff suppressed because it is too large
Load diff
1260
config/locales/es-PA.yml
Normal file
1260
config/locales/es-PA.yml
Normal file
File diff suppressed because it is too large
Load diff
1258
config/locales/es.yml
Normal file
1258
config/locales/es.yml
Normal file
File diff suppressed because it is too large
Load diff
1235
config/locales/et.yml
Normal file
1235
config/locales/et.yml
Normal file
File diff suppressed because it is too large
Load diff
1231
config/locales/eu.yml
Normal file
1231
config/locales/eu.yml
Normal file
File diff suppressed because it is too large
Load diff
1231
config/locales/fa.yml
Normal file
1231
config/locales/fa.yml
Normal file
File diff suppressed because it is too large
Load diff
1251
config/locales/fi.yml
Normal file
1251
config/locales/fi.yml
Normal file
File diff suppressed because it is too large
Load diff
1231
config/locales/fr.yml
Normal file
1231
config/locales/fr.yml
Normal file
File diff suppressed because it is too large
Load diff
1238
config/locales/gl.yml
Normal file
1238
config/locales/gl.yml
Normal file
File diff suppressed because it is too large
Load diff
1235
config/locales/he.yml
Normal file
1235
config/locales/he.yml
Normal file
File diff suppressed because it is too large
Load diff
1229
config/locales/hr.yml
Normal file
1229
config/locales/hr.yml
Normal file
File diff suppressed because it is too large
Load diff
1249
config/locales/hu.yml
Normal file
1249
config/locales/hu.yml
Normal file
File diff suppressed because it is too large
Load diff
1234
config/locales/id.yml
Normal file
1234
config/locales/id.yml
Normal file
File diff suppressed because it is too large
Load diff
1225
config/locales/it.yml
Normal file
1225
config/locales/it.yml
Normal file
File diff suppressed because it is too large
Load diff
1237
config/locales/ja.yml
Normal file
1237
config/locales/ja.yml
Normal file
File diff suppressed because it is too large
Load diff
1269
config/locales/ko.yml
Normal file
1269
config/locales/ko.yml
Normal file
File diff suppressed because it is too large
Load diff
1220
config/locales/lt.yml
Normal file
1220
config/locales/lt.yml
Normal file
File diff suppressed because it is too large
Load diff
1224
config/locales/lv.yml
Normal file
1224
config/locales/lv.yml
Normal file
File diff suppressed because it is too large
Load diff
1230
config/locales/mk.yml
Normal file
1230
config/locales/mk.yml
Normal file
File diff suppressed because it is too large
Load diff
1231
config/locales/mn.yml
Normal file
1231
config/locales/mn.yml
Normal file
File diff suppressed because it is too large
Load diff
1205
config/locales/nl.yml
Normal file
1205
config/locales/nl.yml
Normal file
File diff suppressed because it is too large
Load diff
1220
config/locales/no.yml
Normal file
1220
config/locales/no.yml
Normal file
File diff suppressed because it is too large
Load diff
1245
config/locales/pl.yml
Normal file
1245
config/locales/pl.yml
Normal file
File diff suppressed because it is too large
Load diff
1244
config/locales/pt-BR.yml
Normal file
1244
config/locales/pt-BR.yml
Normal file
File diff suppressed because it is too large
Load diff
1223
config/locales/pt.yml
Normal file
1223
config/locales/pt.yml
Normal file
File diff suppressed because it is too large
Load diff
1225
config/locales/ro.yml
Normal file
1225
config/locales/ro.yml
Normal file
File diff suppressed because it is too large
Load diff
1329
config/locales/ru.yml
Normal file
1329
config/locales/ru.yml
Normal file
File diff suppressed because it is too large
Load diff
1220
config/locales/sk.yml
Normal file
1220
config/locales/sk.yml
Normal file
File diff suppressed because it is too large
Load diff
1230
config/locales/sl.yml
Normal file
1230
config/locales/sl.yml
Normal file
File diff suppressed because it is too large
Load diff
1226
config/locales/sq.yml
Normal file
1226
config/locales/sq.yml
Normal file
File diff suppressed because it is too large
Load diff
1232
config/locales/sr-YU.yml
Normal file
1232
config/locales/sr-YU.yml
Normal file
File diff suppressed because it is too large
Load diff
1231
config/locales/sr.yml
Normal file
1231
config/locales/sr.yml
Normal file
File diff suppressed because it is too large
Load diff
1263
config/locales/sv.yml
Normal file
1263
config/locales/sv.yml
Normal file
File diff suppressed because it is too large
Load diff
1227
config/locales/th.yml
Normal file
1227
config/locales/th.yml
Normal file
File diff suppressed because it is too large
Load diff
1238
config/locales/tr.yml
Normal file
1238
config/locales/tr.yml
Normal file
File diff suppressed because it is too large
Load diff
1226
config/locales/uk.yml
Normal file
1226
config/locales/uk.yml
Normal file
File diff suppressed because it is too large
Load diff
1283
config/locales/vi.yml
Normal file
1283
config/locales/vi.yml
Normal file
File diff suppressed because it is too large
Load diff
1297
config/locales/zh-TW.yml
Normal file
1297
config/locales/zh-TW.yml
Normal file
File diff suppressed because it is too large
Load diff
1219
config/locales/zh.yml
Normal file
1219
config/locales/zh.yml
Normal file
File diff suppressed because it is too large
Load diff
392
config/routes.rb
Normal file
392
config/routes.rb
Normal file
|
@ -0,0 +1,392 @@
|
|||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2017 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.
|
||||
|
||||
Rails.application.routes.draw do
|
||||
root :to => 'welcome#index', :as => 'home'
|
||||
|
||||
match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
|
||||
match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
|
||||
match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register'
|
||||
match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password'
|
||||
match 'account/activate', :to => 'account#activate', :via => :get
|
||||
get 'account/activation_email', :to => 'account#activation_email', :as => 'activation_email'
|
||||
|
||||
match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post, :put, :patch]
|
||||
match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put, :patch]
|
||||
match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put, :patch]
|
||||
match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put, :patch]
|
||||
|
||||
match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
|
||||
match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
|
||||
|
||||
match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
|
||||
get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
|
||||
match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
|
||||
get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
|
||||
|
||||
post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message'
|
||||
post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
|
||||
post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
|
||||
post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
|
||||
|
||||
# Misc issue routes. TODO: move into resources
|
||||
match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
|
||||
match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post]
|
||||
match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get
|
||||
match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue'
|
||||
|
||||
resources :journals, :only => [:edit, :update] do
|
||||
member do
|
||||
get 'diff'
|
||||
end
|
||||
end
|
||||
|
||||
get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt'
|
||||
get '/issues/gantt', :to => 'gantts#show'
|
||||
|
||||
get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar'
|
||||
get '/issues/calendar', :to => 'calendars#show'
|
||||
|
||||
get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report'
|
||||
get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details'
|
||||
|
||||
get '/issues/imports/new', :to => 'imports#new', :as => 'new_issues_import'
|
||||
post '/imports', :to => 'imports#create', :as => 'imports'
|
||||
get '/imports/:id', :to => 'imports#show', :as => 'import'
|
||||
match '/imports/:id/settings', :to => 'imports#settings', :via => [:get, :post], :as => 'import_settings'
|
||||
match '/imports/:id/mapping', :to => 'imports#mapping', :via => [:get, :post], :as => 'import_mapping'
|
||||
match '/imports/:id/run', :to => 'imports#run', :via => [:get, :post], :as => 'import_run'
|
||||
|
||||
match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
|
||||
match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
|
||||
match 'my/page', :controller => 'my', :action => 'page', :via => :get
|
||||
post 'my/page', :to => 'my#update_page'
|
||||
match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
|
||||
get 'my/api_key', :to => 'my#show_api_key', :as => 'my_api_key'
|
||||
post 'my/api_key', :to => 'my#reset_api_key'
|
||||
post 'my/rss_key', :to => 'my#reset_rss_key', :as => 'my_rss_key'
|
||||
match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
|
||||
match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
|
||||
match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
|
||||
match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
|
||||
|
||||
resources :users do
|
||||
resources :memberships, :controller => 'principal_memberships'
|
||||
resources :email_addresses, :only => [:index, :create, :update, :destroy]
|
||||
end
|
||||
|
||||
post 'watchers/watch', :to => 'watchers#watch', :as => 'watch'
|
||||
delete 'watchers/watch', :to => 'watchers#unwatch'
|
||||
get 'watchers/new', :to => 'watchers#new', :as => 'new_watchers'
|
||||
post 'watchers', :to => 'watchers#create'
|
||||
post 'watchers/append', :to => 'watchers#append'
|
||||
delete 'watchers', :to => 'watchers#destroy'
|
||||
get 'watchers/autocomplete_for_user', :to => 'watchers#autocomplete_for_user'
|
||||
# Specific routes for issue watchers API
|
||||
post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
|
||||
delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
|
||||
|
||||
resources :projects do
|
||||
collection do
|
||||
get 'autocomplete'
|
||||
end
|
||||
|
||||
member do
|
||||
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
|
||||
post 'modules'
|
||||
post 'archive'
|
||||
post 'unarchive'
|
||||
post 'close'
|
||||
post 'reopen'
|
||||
match 'copy', :via => [:get, :post]
|
||||
end
|
||||
|
||||
shallow do
|
||||
resources :memberships, :controller => 'members' do
|
||||
collection do
|
||||
get 'autocomplete'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy]
|
||||
|
||||
get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue'
|
||||
resources :issues, :only => [:index, :new, :create]
|
||||
# Used when updating the form of a new issue
|
||||
post 'issues/new', :to => 'issues#new'
|
||||
|
||||
resources :files, :only => [:index, :new, :create]
|
||||
|
||||
resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
|
||||
collection do
|
||||
put 'close_completed'
|
||||
end
|
||||
end
|
||||
get 'versions.:format', :to => 'versions#index'
|
||||
get 'roadmap', :to => 'versions#index', :format => false
|
||||
get 'versions', :to => 'versions#index'
|
||||
|
||||
resources :news, :except => [:show, :edit, :update, :destroy]
|
||||
resources :time_entries, :controller => 'timelog', :except => [:show, :edit, :update, :destroy] do
|
||||
get 'report', :on => :collection
|
||||
end
|
||||
resources :queries, :only => [:new, :create]
|
||||
shallow do
|
||||
resources :issue_categories
|
||||
end
|
||||
resources :documents, :except => [:show, :edit, :update, :destroy]
|
||||
resources :boards
|
||||
shallow do
|
||||
resources :repositories, :except => [:index, :show] do
|
||||
member do
|
||||
match 'committers', :via => [:get, :post]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
|
||||
resources :wiki, :except => [:index, :create], :as => 'wiki_page' do
|
||||
member do
|
||||
get 'rename'
|
||||
post 'rename'
|
||||
get 'history'
|
||||
get 'diff'
|
||||
match 'preview', :via => [:post, :put, :patch]
|
||||
post 'protect'
|
||||
post 'add_attachment'
|
||||
end
|
||||
collection do
|
||||
get 'export'
|
||||
get 'date_index'
|
||||
post 'new'
|
||||
end
|
||||
end
|
||||
match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
|
||||
get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/}
|
||||
delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
|
||||
get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
|
||||
get 'wiki/:id/:version/diff', :to => 'wiki#diff'
|
||||
end
|
||||
|
||||
resources :issues do
|
||||
member do
|
||||
# Used when updating the form of an existing issue
|
||||
patch 'edit', :to => 'issues#edit'
|
||||
end
|
||||
collection do
|
||||
match 'bulk_edit', :via => [:get, :post]
|
||||
post 'bulk_update'
|
||||
end
|
||||
resources :time_entries, :controller => 'timelog', :only => [:new, :create]
|
||||
shallow do
|
||||
resources :relations, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
|
||||
end
|
||||
end
|
||||
# Used when updating the form of a new issue outside a project
|
||||
post '/issues/new', :to => 'issues#new'
|
||||
match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
|
||||
|
||||
resources :queries, :except => [:show]
|
||||
get '/queries/filter', :to => 'queries#filter', :as => 'queries_filter'
|
||||
|
||||
resources :news, :only => [:index, :show, :edit, :update, :destroy]
|
||||
match '/news/:id/comments', :to => 'comments#create', :via => :post
|
||||
match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
|
||||
|
||||
resources :versions, :only => [:show, :edit, :update, :destroy] do
|
||||
post 'status_by', :on => :member
|
||||
end
|
||||
|
||||
resources :documents, :only => [:show, :edit, :update, :destroy] do
|
||||
post 'add_attachment', :on => :member
|
||||
end
|
||||
|
||||
match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post]
|
||||
|
||||
resources :time_entries, :controller => 'timelog', :except => :destroy do
|
||||
member do
|
||||
# Used when updating the edit form of an existing time entry
|
||||
patch 'edit', :to => 'timelog#edit'
|
||||
end
|
||||
collection do
|
||||
get 'report'
|
||||
get 'bulk_edit'
|
||||
post 'bulk_update'
|
||||
end
|
||||
end
|
||||
match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/
|
||||
# TODO: delete /time_entries for bulk deletion
|
||||
match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete
|
||||
# Used to update the new time entry form
|
||||
post '/time_entries/new', :to => 'timelog#new'
|
||||
|
||||
get 'projects/:id/activity', :to => 'activities#index', :as => :project_activity
|
||||
get 'activity', :to => 'activities#index'
|
||||
|
||||
# repositories routes
|
||||
get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
|
||||
get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
|
||||
|
||||
get 'projects/:id/repository/:repository_id/changes(/*path)',
|
||||
:to => 'repositories#changes',
|
||||
:format => false
|
||||
|
||||
get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
|
||||
get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
|
||||
post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
|
||||
delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
|
||||
get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
|
||||
%w(browse show entry raw annotate diff).each do |action|
|
||||
get "projects/:id/repository/:repository_id/revisions/:rev/#{action}(/*path)",
|
||||
:controller => 'repositories',
|
||||
:action => action,
|
||||
:format => false,
|
||||
:constraints => {:rev => /[a-z0-9\.\-_]+/}
|
||||
end
|
||||
|
||||
get 'projects/:id/repository/statistics', :to => 'repositories#stats'
|
||||
get 'projects/:id/repository/graph', :to => 'repositories#graph'
|
||||
|
||||
get 'projects/:id/repository/changes(/*path)',
|
||||
:to => 'repositories#changes',
|
||||
:format => false
|
||||
|
||||
get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
|
||||
get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
|
||||
get 'projects/:id/repository/revision', :to => 'repositories#revision'
|
||||
post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
|
||||
delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
|
||||
%w(browse show entry raw annotate diff).each do |action|
|
||||
get "projects/:id/repository/revisions/:rev/#{action}(/*path)",
|
||||
:controller => 'repositories',
|
||||
:action => action,
|
||||
:format => false,
|
||||
:constraints => {:rev => /[a-z0-9\.\-_]+/}
|
||||
end
|
||||
%w(browse entry raw changes annotate diff).each do |action|
|
||||
get "projects/:id/repository/:repository_id/#{action}(/*path)",
|
||||
:controller => 'repositories',
|
||||
:action => action,
|
||||
:format => false
|
||||
end
|
||||
%w(browse entry raw changes annotate diff).each do |action|
|
||||
get "projects/:id/repository/#{action}(/*path)",
|
||||
:controller => 'repositories',
|
||||
:action => action,
|
||||
:format => false
|
||||
end
|
||||
|
||||
get 'projects/:id/repository/:repository_id/show/*path', :to => 'repositories#show', :format => false
|
||||
get 'projects/:id/repository/show/*path', :to => 'repositories#show', :format => false
|
||||
|
||||
get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
|
||||
get 'projects/:id/repository', :to => 'repositories#show', :path => nil
|
||||
|
||||
# additional routes for having the file name at the end of url
|
||||
get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'
|
||||
get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment'
|
||||
get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/
|
||||
get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail'
|
||||
resources :attachments, :only => [:show, :update, :destroy]
|
||||
get 'attachments/:object_type/:object_id/edit', :to => 'attachments#edit_all', :as => :object_attachments_edit
|
||||
patch 'attachments/:object_type/:object_id', :to => 'attachments#update_all', :as => :object_attachments
|
||||
|
||||
resources :groups do
|
||||
resources :memberships, :controller => 'principal_memberships'
|
||||
member do
|
||||
get 'autocomplete_for_user'
|
||||
end
|
||||
end
|
||||
|
||||
get 'groups/:id/users/new', :to => 'groups#new_users', :id => /\d+/, :as => 'new_group_users'
|
||||
post 'groups/:id/users', :to => 'groups#add_users', :id => /\d+/, :as => 'group_users'
|
||||
delete 'groups/:id/users/:user_id', :to => 'groups#remove_user', :id => /\d+/, :as => 'group_user'
|
||||
|
||||
resources :trackers, :except => :show do
|
||||
collection do
|
||||
match 'fields', :via => [:get, :post]
|
||||
end
|
||||
end
|
||||
resources :issue_statuses, :except => :show do
|
||||
collection do
|
||||
post 'update_issue_done_ratio'
|
||||
end
|
||||
end
|
||||
resources :custom_fields, :except => :show do
|
||||
resources :enumerations, :controller => 'custom_field_enumerations', :except => [:show, :new, :edit]
|
||||
put 'enumerations', :to => 'custom_field_enumerations#update_each'
|
||||
end
|
||||
resources :roles do
|
||||
collection do
|
||||
match 'permissions', :via => [:get, :post]
|
||||
end
|
||||
end
|
||||
resources :enumerations, :except => :show
|
||||
match 'enumerations/:type', :to => 'enumerations#index', :via => :get
|
||||
|
||||
get 'projects/:id/search', :controller => 'search', :action => 'index'
|
||||
get 'search', :controller => 'search', :action => 'index'
|
||||
|
||||
|
||||
get 'mail_handler', :to => 'mail_handler#new'
|
||||
post 'mail_handler', :to => 'mail_handler#index'
|
||||
|
||||
get 'admin', :to => 'admin#index'
|
||||
get 'admin/projects', :to => 'admin#projects'
|
||||
get 'admin/plugins', :to => 'admin#plugins'
|
||||
get 'admin/info', :to => 'admin#info'
|
||||
post 'admin/test_email', :to => 'admin#test_email', :as => 'test_email'
|
||||
post 'admin/default_configuration', :to => 'admin#default_configuration'
|
||||
|
||||
resources :auth_sources do
|
||||
member do
|
||||
get 'test_connection', :as => 'try_connection'
|
||||
end
|
||||
collection do
|
||||
get 'autocomplete_for_new_user'
|
||||
end
|
||||
end
|
||||
|
||||
match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
|
||||
match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
|
||||
match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
|
||||
match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
|
||||
match 'settings', :controller => 'settings', :action => 'index', :via => :get
|
||||
match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
|
||||
match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post], :as => 'plugin_settings'
|
||||
|
||||
match 'sys/projects', :to => 'sys#projects', :via => :get
|
||||
match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
|
||||
match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => [:get, :post]
|
||||
|
||||
match 'uploads', :to => 'attachments#upload', :via => :post
|
||||
|
||||
get 'robots.txt', :to => 'welcome#robots'
|
||||
|
||||
Dir.glob File.expand_path("#{Redmine::Plugin.directory}/*") do |plugin_dir|
|
||||
file = File.join(plugin_dir, "config/routes.rb")
|
||||
if File.exists?(file)
|
||||
begin
|
||||
instance_eval File.read(file)
|
||||
rescue Exception => e
|
||||
puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}."
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
292
config/settings.yml
Normal file
292
config/settings.yml
Normal file
|
@ -0,0 +1,292 @@
|
|||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2017 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.
|
||||
|
||||
|
||||
# DO NOT MODIFY THIS FILE !!!
|
||||
# Settings can be defined through the application in Admin -> Settings
|
||||
|
||||
app_title:
|
||||
default: Redmine
|
||||
app_subtitle:
|
||||
default: Project management
|
||||
welcome_text:
|
||||
default:
|
||||
login_required:
|
||||
default: 0
|
||||
security_notifications: 1
|
||||
self_registration:
|
||||
default: '2'
|
||||
security_notifications: 1
|
||||
show_custom_fields_on_registration:
|
||||
default: 1
|
||||
lost_password:
|
||||
default: 1
|
||||
security_notifications: 1
|
||||
unsubscribe:
|
||||
default: 1
|
||||
password_min_length:
|
||||
format: int
|
||||
default: 8
|
||||
security_notifications: 1
|
||||
# Maximum password age in days
|
||||
password_max_age:
|
||||
format: int
|
||||
default: 0
|
||||
security_notifications: 1
|
||||
# Maximum number of additional email addresses per user
|
||||
max_additional_emails:
|
||||
format: int
|
||||
default: 5
|
||||
# Maximum lifetime of user sessions in minutes
|
||||
session_lifetime:
|
||||
format: int
|
||||
default: 0
|
||||
security_notifications: 1
|
||||
# User session timeout in minutes
|
||||
session_timeout:
|
||||
format: int
|
||||
default: 0
|
||||
security_notifications: 1
|
||||
attachment_max_size:
|
||||
format: int
|
||||
default: 5120
|
||||
attachment_extensions_allowed:
|
||||
default:
|
||||
attachment_extensions_denied:
|
||||
default:
|
||||
issues_export_limit:
|
||||
format: int
|
||||
default: 500
|
||||
activity_days_default:
|
||||
format: int
|
||||
default: 30
|
||||
per_page_options:
|
||||
default: '25,50,100'
|
||||
search_results_per_page:
|
||||
default: 10
|
||||
mail_from:
|
||||
default: redmine@example.net
|
||||
bcc_recipients:
|
||||
default: 1
|
||||
plain_text_mail:
|
||||
default: 0
|
||||
text_formatting:
|
||||
default: textile
|
||||
cache_formatted_text:
|
||||
default: 0
|
||||
wiki_compression:
|
||||
default: ""
|
||||
default_language:
|
||||
default: en
|
||||
force_default_language_for_anonymous:
|
||||
default: 0
|
||||
force_default_language_for_loggedin:
|
||||
default: 0
|
||||
host_name:
|
||||
default: localhost:3000
|
||||
protocol:
|
||||
default: http
|
||||
security_notifications: 1
|
||||
feeds_limit:
|
||||
format: int
|
||||
default: 15
|
||||
gantt_items_limit:
|
||||
format: int
|
||||
default: 500
|
||||
# Maximum size of files that can be displayed
|
||||
# inline through the file viewer (in KB)
|
||||
file_max_size_displayed:
|
||||
format: int
|
||||
default: 512
|
||||
diff_max_lines_displayed:
|
||||
format: int
|
||||
default: 1500
|
||||
enabled_scm:
|
||||
serialized: true
|
||||
default:
|
||||
- Subversion
|
||||
- Darcs
|
||||
- Mercurial
|
||||
- Cvs
|
||||
- Bazaar
|
||||
- Git
|
||||
security_notifications: 1
|
||||
autofetch_changesets:
|
||||
default: 1
|
||||
sys_api_enabled:
|
||||
default: 0
|
||||
security_notifications: 1
|
||||
sys_api_key:
|
||||
default: ''
|
||||
security_notifications: 1
|
||||
commit_cross_project_ref:
|
||||
default: 0
|
||||
commit_ref_keywords:
|
||||
default: 'refs,references,IssueID'
|
||||
commit_update_keywords:
|
||||
serialized: true
|
||||
default: []
|
||||
commit_logtime_enabled:
|
||||
default: 0
|
||||
commit_logtime_activity_id:
|
||||
format: int
|
||||
default: 0
|
||||
# autologin duration in days
|
||||
# 0 means autologin is disabled
|
||||
autologin:
|
||||
format: int
|
||||
default: 0
|
||||
# date format
|
||||
date_format:
|
||||
default: ''
|
||||
time_format:
|
||||
default: ''
|
||||
timespan_format:
|
||||
default: 'decimal'
|
||||
user_format:
|
||||
default: :firstname_lastname
|
||||
format: symbol
|
||||
cross_project_issue_relations:
|
||||
default: 0
|
||||
# Enables subtasks to be in other projects
|
||||
cross_project_subtasks:
|
||||
default: 'tree'
|
||||
parent_issue_dates:
|
||||
default: 'derived'
|
||||
parent_issue_priority:
|
||||
default: 'derived'
|
||||
parent_issue_done_ratio:
|
||||
default: 'derived'
|
||||
link_copied_issue:
|
||||
default: 'ask'
|
||||
issue_group_assignment:
|
||||
default: 0
|
||||
default_issue_start_date_to_creation_date:
|
||||
default: 1
|
||||
notified_events:
|
||||
serialized: true
|
||||
default:
|
||||
- issue_added
|
||||
- issue_updated
|
||||
mail_handler_body_delimiters:
|
||||
default: ''
|
||||
mail_handler_enable_regex_delimiters:
|
||||
default: 0
|
||||
mail_handler_excluded_filenames:
|
||||
default: ''
|
||||
mail_handler_api_enabled:
|
||||
default: 0
|
||||
security_notifications: 1
|
||||
mail_handler_api_key:
|
||||
default:
|
||||
security_notifications: 1
|
||||
issue_list_default_columns:
|
||||
serialized: true
|
||||
default:
|
||||
- tracker
|
||||
- status
|
||||
- priority
|
||||
- subject
|
||||
- assigned_to
|
||||
- updated_on
|
||||
issue_list_default_totals:
|
||||
serialized: true
|
||||
default: []
|
||||
display_subprojects_issues:
|
||||
default: 1
|
||||
issue_done_ratio:
|
||||
default: 'issue_field'
|
||||
default_projects_public:
|
||||
default: 1
|
||||
default_projects_modules:
|
||||
serialized: true
|
||||
default:
|
||||
- issue_tracking
|
||||
- time_tracking
|
||||
- news
|
||||
- documents
|
||||
- files
|
||||
- wiki
|
||||
- repository
|
||||
- boards
|
||||
- calendar
|
||||
- gantt
|
||||
default_projects_tracker_ids:
|
||||
serialized: true
|
||||
default:
|
||||
# Role given to a non-admin user who creates a project
|
||||
new_project_user_role_id:
|
||||
format: int
|
||||
default: ''
|
||||
sequential_project_identifiers:
|
||||
default: 0
|
||||
# encodings used to convert repository files content to UTF-8
|
||||
# multiple values accepted, comma separated
|
||||
default_users_hide_mail:
|
||||
default: 1
|
||||
default_users_time_zone:
|
||||
default: ""
|
||||
repositories_encodings:
|
||||
default: ''
|
||||
# encoding used to convert commit logs to UTF-8
|
||||
commit_logs_encoding:
|
||||
default: 'UTF-8'
|
||||
commit_logs_formatting:
|
||||
default: 1
|
||||
repository_log_display_limit:
|
||||
format: int
|
||||
default: 100
|
||||
ui_theme:
|
||||
default: ''
|
||||
emails_footer:
|
||||
default: |-
|
||||
You have received this notification because you have either subscribed to it, or are involved in it.
|
||||
To change your notification preferences, please click here: http://hostname/my/account
|
||||
gravatar_enabled:
|
||||
default: 0
|
||||
openid:
|
||||
default: 0
|
||||
security_notifications: 1
|
||||
gravatar_default:
|
||||
default: ''
|
||||
start_of_week:
|
||||
default: ''
|
||||
rest_api_enabled:
|
||||
default: 0
|
||||
security_notifications: 1
|
||||
jsonp_enabled:
|
||||
default: 0
|
||||
security_notifications: 1
|
||||
default_notification_option:
|
||||
default: 'only_my_events'
|
||||
emails_header:
|
||||
default: ''
|
||||
thumbnails_enabled:
|
||||
default: 0
|
||||
thumbnails_size:
|
||||
format: int
|
||||
default: 100
|
||||
non_working_week_days:
|
||||
serialized: true
|
||||
default:
|
||||
- '6'
|
||||
- '7'
|
||||
new_item_menu_tab:
|
||||
default: 2
|
||||
timelog_required_fields:
|
||||
serialized: true
|
||||
default: []
|
Loading…
Add table
Add a link
Reference in a new issue