Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
Kolan Sh | 65b94d2014 | |
Kolan Sh | 786e92349b |
|
@ -29,6 +29,3 @@ doc/app
|
||||||
/Gemfile.lock
|
/Gemfile.lock
|
||||||
/Gemfile.local
|
/Gemfile.local
|
||||||
/.rvmrc*
|
/.rvmrc*
|
||||||
/*.iml
|
|
||||||
/.idea
|
|
||||||
.rbx
|
|
||||||
|
|
59
.travis.yml
59
.travis.yml
|
@ -1,59 +0,0 @@
|
||||||
language: ruby
|
|
||||||
rvm:
|
|
||||||
- 1.8.7
|
|
||||||
- 1.9.2
|
|
||||||
- 1.9.3
|
|
||||||
- rbx-18mode
|
|
||||||
env:
|
|
||||||
- "TEST_SUITE=units RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- "TEST_SUITE=units RAILS_ENV=test DB=mysql2 BUNDLE_WITHOUT=rmagick:mysql:postgres:sqlite"
|
|
||||||
- "TEST_SUITE=units RAILS_ENV=test DB=postgres BUNDLE_WITHOUT=rmagick:mysql:mysql2:sqlite"
|
|
||||||
- "TEST_SUITE=units RAILS_ENV=test DB=sqlite BUNDLE_WITHOUT=rmagick:mysql:mysql2:postgres"
|
|
||||||
- "TEST_SUITE=functionals RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- "TEST_SUITE=functionals RAILS_ENV=test DB=mysql2 BUNDLE_WITHOUT=rmagick:mysql:postgres:sqlite"
|
|
||||||
- "TEST_SUITE=functionals RAILS_ENV=test DB=postgres BUNDLE_WITHOUT=rmagick:mysql:mysql2:sqlite"
|
|
||||||
- "TEST_SUITE=functionals RAILS_ENV=test DB=sqlite BUNDLE_WITHOUT=rmagick:mysql:mysql2:postgres"
|
|
||||||
- "TEST_SUITE=integration RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- "TEST_SUITE=integration RAILS_ENV=test DB=mysql2 BUNDLE_WITHOUT=rmagick:mysql:postgres:sqlite"
|
|
||||||
- "TEST_SUITE=integration RAILS_ENV=test DB=postgres BUNDLE_WITHOUT=rmagick:mysql:mysql2:sqlite"
|
|
||||||
- "TEST_SUITE=integration RAILS_ENV=test DB=sqlite BUNDLE_WITHOUT=rmagick:mysql:mysql2:postgres"
|
|
||||||
matrix:
|
|
||||||
exclude:
|
|
||||||
- rvm: 1.9.2
|
|
||||||
env: "TEST_SUITE=units RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- rvm: 1.9.2
|
|
||||||
env: "TEST_SUITE=functionals RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- rvm: 1.9.2
|
|
||||||
env: "TEST_SUITE=integration RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- rvm: 1.9.3
|
|
||||||
env: "TEST_SUITE=units RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- rvm: 1.9.3
|
|
||||||
env: "TEST_SUITE=functionals RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- rvm: 1.9.3
|
|
||||||
env: "TEST_SUITE=integration RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- rvm: rbx-18mode
|
|
||||||
env: "TEST_SUITE=units RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- rvm: rbx-18mode
|
|
||||||
env: "TEST_SUITE=functionals RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
- rvm: rbx-18mode
|
|
||||||
env: "TEST_SUITE=integration RAILS_ENV=test DB=mysql BUNDLE_WITHOUT=rmagick:mysql2:postgres:sqlite"
|
|
||||||
allow_failures:
|
|
||||||
- rvm: rbx-18mode
|
|
||||||
before_install:
|
|
||||||
- "sudo apt-get update -qq"
|
|
||||||
- "sudo apt-get --no-install-recommends install bzr cvs git mercurial subversion"
|
|
||||||
before_script:
|
|
||||||
- "rvm rubygems 1.8.25" # Rubygems 2.0.x fails with Rails 2.3
|
|
||||||
- "rake ci:travis:prepare"
|
|
||||||
- "rm -rf tmp/test/darcs_repository" # Don't test Darcs on Travis. It breaks there :(
|
|
||||||
script: "bundle exec rake test:$TEST_SUITE"
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- unstable
|
|
||||||
- master
|
|
||||||
- stable
|
|
||||||
- /^stable-.*$/
|
|
||||||
- /^release-.*$/
|
|
||||||
notifications:
|
|
||||||
email: false
|
|
||||||
irc: "irc.freenode.org#chiliproject"
|
|
|
@ -1,33 +0,0 @@
|
||||||
For the impatient: [report][cpo_new-issue], confirm, claim,
|
|
||||||
[fork][gh_chiliproject], [branch][cpo_contribute-code-branch],
|
|
||||||
[write][cpo_code-standards], [test][cpo_code-review], push.
|
|
||||||
|
|
||||||
The short version:
|
|
||||||
|
|
||||||
* Make sure the issue you are working on is reported and confirmed, add a note
|
|
||||||
to the issue to claim your intention to work on it.
|
|
||||||
* Fork [ChiliProject on GitHub][gh_chiliproject]
|
|
||||||
* Create a new branch from `master` with a descriptive name prefixed by the
|
|
||||||
issue ID (Example: `123-change_background_from_black_to_blue`).
|
|
||||||
* Make changes according to our [Code Standards][cpo_code-standards].
|
|
||||||
1. Be sure to include tests as necessary.
|
|
||||||
1. Make sure to not break existing tests.
|
|
||||||
1. Please try to make sure your code is going to pass a [Code
|
|
||||||
Review][cpo_code-review] prior to submitting the patch. If in doubt, just ask.
|
|
||||||
* Either upload your branch to GitHub and send a pull request to the
|
|
||||||
ChiliProject repository, or attach a patch to the issue on ChiliProject. If
|
|
||||||
you send a pull request on GitHub, remember to link to the pull request in the
|
|
||||||
issue you create on ChiliProject and to link to the issue on ChiliProject in
|
|
||||||
the pull request on GitHub.
|
|
||||||
* Make sure you watch the corresponding issue in case any discussion arises or
|
|
||||||
improvements are needed.
|
|
||||||
|
|
||||||
The long version is on the [Contribute Code][cpo_contribute-code] page.
|
|
||||||
|
|
||||||
|
|
||||||
[cpo_new-issue]: https://www.chiliproject.org/projects/chiliproject/issues/new
|
|
||||||
[cpo_contribute-code-branch]: https://www.chiliproject.org/projects/chiliproject/wiki/Contribute_Code#Branch
|
|
||||||
[cpo_contribute-code]: https://www.chiliproject.org/projects/chiliproject/wiki/Contribute_Code
|
|
||||||
[cpo_code-standards]: https://www.chiliproject.org/projects/chiliproject/wiki/Code_Standards
|
|
||||||
[cpo_code-review]: https://www.chiliproject.org/projects/chiliproject/wiki/Code_Review
|
|
||||||
[gh_chiliproject]: https://github.com/chiliproject/chiliproject
|
|
24
Gemfile
24
Gemfile
|
@ -1,32 +1,28 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
source "https://rubygems.org"
|
source :rubygems
|
||||||
|
|
||||||
gem "rails", "2.3.18"
|
gem "rails", "2.3.14"
|
||||||
|
|
||||||
gem "json", "~> 1.7.7"
|
|
||||||
gem "coderay", "~> 1.0.0"
|
gem "coderay", "~> 1.0.0"
|
||||||
gem "i18n", "~> 0.4.2"
|
gem "i18n", "~> 0.4.2"
|
||||||
gem "rubytree", "~> 0.5.2", :require => 'tree'
|
gem "rubytree", "~> 0.5.2", :require => 'tree'
|
||||||
gem "rdoc", ">= 2.4.2"
|
gem "rdoc", ">= 2.4.2"
|
||||||
gem "liquid", "~> 2.3.0"
|
gem "liquid", "~> 2.3.0"
|
||||||
gem "acts-as-taggable-on", "= 2.1.0"
|
gem "acts-as-taggable-on", "= 2.1.0"
|
||||||
gem 'gravatarify', '~> 3.0.0'
|
|
||||||
# Needed only on RUBY_VERSION = 1.8, ruby 1.9+ compatible interpreters should bring their csv
|
# Needed only on RUBY_VERSION = 1.8, ruby 1.9+ compatible interpreters should bring their csv
|
||||||
gem "fastercsv", "~> 1.5.0", :platforms => [:ruby_18, :jruby, :mingw_18]
|
gem "fastercsv", "~> 1.5.0", :platforms => [:ruby_18, :jruby, :mingw_18]
|
||||||
gem "tzinfo", "~> 0.3.31" # Fixes #903. Not required for Rails >= 3.2
|
# need for automatic encoding detection in diff,annotate and cat
|
||||||
|
gem "chardet", ">= 0.9.0"
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'shoulda', '~> 2.10.3'
|
gem 'shoulda', '~> 2.10.3'
|
||||||
# Shoulda doesn't work nice on 1.9.3 and seems to need test-unit explicitely…
|
|
||||||
gem 'test-unit', :platforms => [:mri_19]
|
|
||||||
gem 'edavis10-object_daddy', :require => 'object_daddy'
|
gem 'edavis10-object_daddy', :require => 'object_daddy'
|
||||||
gem 'mocha', '0.12.1'
|
gem 'mocha'
|
||||||
# capybara 2 drops ruby 1.8.7 compatibility
|
gem 'capybara'
|
||||||
gem 'capybara', '< 2.0.0'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :ldap do
|
group :ldap do
|
||||||
gem "net-ldap", '~> 0.3.1'
|
gem "net-ldap", '~> 0.2.2'
|
||||||
end
|
end
|
||||||
|
|
||||||
group :openid do
|
group :openid do
|
||||||
|
@ -57,13 +53,13 @@ end
|
||||||
# orders of magnitude compared to their native counterparts. You have been
|
# orders of magnitude compared to their native counterparts. You have been
|
||||||
# warned.
|
# warned.
|
||||||
|
|
||||||
platforms :mri, :mingw, :rbx do
|
platforms :mri, :mingw do
|
||||||
group :mysql2 do
|
group :mysql2 do
|
||||||
gem "mysql2", "~> 0.2.7"
|
gem "mysql2", "~> 0.2.7"
|
||||||
end
|
end
|
||||||
|
|
||||||
group :postgres do
|
group :postgres do
|
||||||
gem "pg"
|
gem "pg", "~> 0.9.0"
|
||||||
# gem "postgres-pr"
|
# gem "postgres-pr"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -79,7 +75,7 @@ platforms :mri_18, :mingw_18 do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
platforms :mri_19, :mingw_19, :rbx do
|
platforms :mri_19, :mingw_19 do
|
||||||
group :sqlite do
|
group :sqlite do
|
||||||
gem "sqlite3"
|
gem "sqlite3"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
= ChiliProject {<img src="https://travis-ci.org/chiliproject/chiliproject.png?branch=master" />}[http://travis-ci.org/chiliproject/chiliproject]
|
= ChiliProject
|
||||||
|
|
||||||
ChiliProject is a web based project management system. It supports your team throughout the complete project life cycle, from setting up and discussing a project plan, over tracking issues and reporting work progress to collaboratively sharing knowledge.
|
ChiliProject is a web based project management system. It supports your team throughout the complete project life cycle, from setting up and discussing a project plan, over tracking issues and reporting work progress to collaboratively sharing knowledge.
|
||||||
|
|
||||||
|
|
2
Rakefile
2
Rakefile
|
@ -8,5 +8,3 @@ require 'rake/testtask'
|
||||||
require 'rdoc/task'
|
require 'rdoc/task'
|
||||||
|
|
||||||
require 'tasks/rails'
|
require 'tasks/rails'
|
||||||
# Load rake tasks from plugins in chiliproject_plugins
|
|
||||||
Dir["#{RAILS_ROOT}/vendor/chiliproject_plugins/*/lib/tasks/**/*.rake"].sort.each { |ext| load ext }
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -37,7 +37,7 @@ class AccountController < ApplicationController
|
||||||
def lost_password
|
def lost_password
|
||||||
redirect_to(home_url) && return unless Setting.lost_password?
|
redirect_to(home_url) && return unless Setting.lost_password?
|
||||||
if params[:token]
|
if params[:token]
|
||||||
@token = Token.find_by_action_and_value("recovery", params[:token].to_s)
|
@token = Token.find_by_action_and_value("recovery", params[:token])
|
||||||
redirect_to(home_url) && return unless @token and !@token.expired?
|
redirect_to(home_url) && return unless @token and !@token.expired?
|
||||||
@user = @token.user
|
@user = @token.user
|
||||||
if request.post?
|
if request.post?
|
||||||
|
@ -53,7 +53,7 @@ class AccountController < ApplicationController
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
if request.post?
|
if request.post?
|
||||||
user = User.find_by_mail(params[:mail].to_s)
|
user = User.find_by_mail(params[:mail])
|
||||||
# user not found in db
|
# user not found in db
|
||||||
(flash.now[:error] = l(:notice_account_unknown_email); return) unless user
|
(flash.now[:error] = l(:notice_account_unknown_email); return) unless user
|
||||||
# user uses an external authentification
|
# user uses an external authentification
|
||||||
|
@ -109,7 +109,7 @@ class AccountController < ApplicationController
|
||||||
# Token based account activation
|
# Token based account activation
|
||||||
def activate
|
def activate
|
||||||
redirect_to(home_url) && return unless Setting.self_registration? && params[:token]
|
redirect_to(home_url) && return unless Setting.self_registration? && params[:token]
|
||||||
token = Token.find_by_action_and_value('register', params[:token].to_s)
|
token = Token.find_by_action_and_value('register', params[:token])
|
||||||
redirect_to(home_url) && return unless token and !token.expired?
|
redirect_to(home_url) && return unless token and !token.expired?
|
||||||
user = token.user
|
user = token.user
|
||||||
redirect_to(home_url) && return unless user.registered?
|
redirect_to(home_url) && return unless user.registered?
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -33,7 +33,7 @@ class ActivitiesController < ApplicationController
|
||||||
:with_subprojects => @with_subprojects,
|
:with_subprojects => @with_subprojects,
|
||||||
:author => @author)
|
:author => @author)
|
||||||
@activity.scope_select {|t| !params["show_#{t}"].nil?}
|
@activity.scope_select {|t| !params["show_#{t}"].nil?}
|
||||||
@activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty? unless params[:set_filter]
|
@activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
|
||||||
|
|
||||||
events = @activity.events(@date_from, @date_to)
|
events = @activity.events(@date_from, @date_to)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -77,7 +77,7 @@ class AdminController < ApplicationController
|
||||||
def info
|
def info
|
||||||
@db_adapter_name = ActiveRecord::Base.connection.adapter_name
|
@db_adapter_name = ActiveRecord::Base.connection.adapter_name
|
||||||
@checklist = [
|
@checklist = [
|
||||||
[:text_default_administrator_account_changed, !User.find_by_login("admin").try(:check_password?, "admin")],
|
[:text_default_administrator_account_changed, User.find(:first, :conditions => ["login=? and hashed_password=?", 'admin', User.hash_password('admin')]).nil?],
|
||||||
[:text_file_repository_writable, File.writable?(Attachment.storage_path)],
|
[:text_file_repository_writable, File.writable?(Attachment.storage_path)],
|
||||||
[:text_plugin_assets_writable, File.writable?(Engines.public_directory)],
|
[:text_plugin_assets_writable, File.writable?(Engines.public_directory)],
|
||||||
[:text_rmagick_available, Object.const_defined?(:Magick)]
|
[:text_rmagick_available, Object.const_defined?(:Magick)]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -31,6 +31,18 @@ class ApplicationController < ActionController::Base
|
||||||
cookies.delete(:autologin)
|
cookies.delete(:autologin)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Remove broken cookie after upgrade from 0.8.x (#4292)
|
||||||
|
# See https://rails.lighthouseapp.com/projects/8994/tickets/3360
|
||||||
|
# TODO: remove it when Rails is fixed
|
||||||
|
before_filter :delete_broken_cookies
|
||||||
|
def delete_broken_cookies
|
||||||
|
if cookies['_chiliproject_session'] && cookies['_chiliproject_session'] !~ /--/
|
||||||
|
cookies.delete '_chiliproject_session'
|
||||||
|
redirect_to home_path
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# FIXME: Remove this when all of Rack and Rails have learned how to
|
# FIXME: Remove this when all of Rack and Rails have learned how to
|
||||||
# properly use encodings
|
# properly use encodings
|
||||||
before_filter :params_filter
|
before_filter :params_filter
|
||||||
|
@ -52,16 +64,10 @@ class ApplicationController < ActionController::Base
|
||||||
before_filter :user_setup, :check_if_login_required, :set_localization
|
before_filter :user_setup, :check_if_login_required, :set_localization
|
||||||
filter_parameter_logging :password
|
filter_parameter_logging :password
|
||||||
|
|
||||||
|
rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token
|
||||||
# FIXME: This doesn't work with Rails >= 3.0 anymore
|
# FIXME: This doesn't work with Rails >= 3.0 anymore
|
||||||
# Possible workaround: https://github.com/rails/rails/issues/671#issuecomment-1780159
|
# Possible workaround: https://github.com/rails/rails/issues/671#issuecomment-1780159
|
||||||
rescue_from ActionController::RoutingError, :with => proc{
|
rescue_from ActionController::RoutingError, :with => proc{render_404}
|
||||||
# manually apply basic before_filters which aren't applied by default here
|
|
||||||
user_setup
|
|
||||||
check_if_login_required
|
|
||||||
set_localization
|
|
||||||
|
|
||||||
render_404
|
|
||||||
}
|
|
||||||
|
|
||||||
include Redmine::Search::Controller
|
include Redmine::Search::Controller
|
||||||
include Redmine::MenuManager::MenuController
|
include Redmine::MenuManager::MenuController
|
||||||
|
@ -89,11 +95,11 @@ class ApplicationController < ActionController::Base
|
||||||
user
|
user
|
||||||
elsif params[:format] == 'atom' && params[:key] && accept_key_auth_actions.include?(params[:action])
|
elsif params[:format] == 'atom' && params[:key] && accept_key_auth_actions.include?(params[:action])
|
||||||
# RSS key authentication does not start a session
|
# RSS key authentication does not start a session
|
||||||
User.find_by_rss_key(params[:key].to_s)
|
User.find_by_rss_key(params[:key])
|
||||||
elsif Setting.rest_api_enabled? && api_request?
|
elsif Setting.rest_api_enabled? && api_request?
|
||||||
if (key = api_key_from_request) && accept_key_auth_actions.include?(params[:action])
|
if (key = api_key_from_request) && accept_key_auth_actions.include?(params[:action])
|
||||||
# Use API key
|
# Use API key
|
||||||
User.find_by_api_key(key.to_s)
|
User.find_by_api_key(key)
|
||||||
else
|
else
|
||||||
# HTTP Basic, either username/password or API key/random
|
# HTTP Basic, either username/password or API key/random
|
||||||
authenticate_with_http_basic do |username, password|
|
authenticate_with_http_basic do |username, password|
|
||||||
|
@ -330,6 +336,13 @@ class ApplicationController < ActionController::Base
|
||||||
request.xhr? ? false : 'base'
|
request.xhr? ? false : 'base'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def invalid_authenticity_token
|
||||||
|
if api_request?
|
||||||
|
logger.error "Form authenticity token is missing or is invalid. API calls must include a proper Content-type header (text/xml or text/json)."
|
||||||
|
end
|
||||||
|
render_error "Invalid form authenticity token."
|
||||||
|
end
|
||||||
|
|
||||||
def render_feed(items, options={})
|
def render_feed(items, options={})
|
||||||
@items = items || []
|
@items = items || []
|
||||||
@items.sort! {|x,y| y.event_datetime <=> x.event_datetime }
|
@items.sort! {|x,y| y.event_datetime <=> x.event_datetime }
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -21,10 +21,7 @@ class CommentsController < ApplicationController
|
||||||
|
|
||||||
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
|
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
|
||||||
def create
|
def create
|
||||||
raise Unauthorized unless @news.commentable?
|
@comment = Comment.new(params[:comment])
|
||||||
|
|
||||||
@comment = Comment.new
|
|
||||||
@comment.safe_attributes = params[:comment]
|
|
||||||
@comment.author = User.current
|
@comment.author = User.current
|
||||||
if @news.comments << @comment
|
if @news.comments << @comment
|
||||||
flash[:notice] = l(:label_comment_added)
|
flash[:notice] = l(:label_comment_added)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -43,8 +43,7 @@ class DocumentsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@document = @project.documents.build
|
@document = @project.documents.build(params[:document])
|
||||||
@document.safe_attributes = params[:document]
|
|
||||||
if request.post?
|
if request.post?
|
||||||
if User.current.allowed_to?(:add_document_watchers, @project) && params[:document]['watcher_user_ids'].present?
|
if User.current.allowed_to?(:add_document_watchers, @project) && params[:document]['watcher_user_ids'].present?
|
||||||
@document.watcher_user_ids = params[:document]['watcher_user_ids']
|
@document.watcher_user_ids = params[:document]['watcher_user_ids']
|
||||||
|
@ -85,7 +84,7 @@ class DocumentsController < ApplicationController
|
||||||
|
|
||||||
if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added')
|
if attachments.present? && attachments[:files].present? && Setting.notified_events.include?('document_added')
|
||||||
# TODO: refactor
|
# TODO: refactor
|
||||||
@document.recipients.each do |recipient|
|
attachments.first.container.recipients.each do |recipient|
|
||||||
Mailer.deliver_attachments_added(attachments[:files], recipient)
|
Mailer.deliver_attachments_added(attachments[:files], recipient)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -23,8 +23,7 @@ class IssueCategoriesController < ApplicationController
|
||||||
verify :method => :post, :only => :destroy
|
verify :method => :post, :only => :destroy
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@category = @project.issue_categories.build
|
@category = @project.issue_categories.build(params[:category])
|
||||||
@category.safe_attributes = params[:category]
|
|
||||||
if request.post?
|
if request.post?
|
||||||
if @category.save
|
if @category.save
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -51,8 +50,7 @@ class IssueCategoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@category.safe_attributes = params[:category]
|
if request.post? and @category.update_attributes(params[:category])
|
||||||
if request.post? and @category.save
|
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
|
redirect_to :controller => 'projects', :action => 'settings', :tab => 'categories', :id => @project
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -21,19 +21,17 @@ class MembersController < ApplicationController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
members = []
|
members = []
|
||||||
if params[:member]
|
if params[:member] && request.post?
|
||||||
if params[:member][:user_ids]
|
attrs = params[:member].dup
|
||||||
attrs = params[:member].dup
|
if (user_ids = attrs.delete(:user_ids))
|
||||||
user_ids = attrs.delete(:user_ids)
|
|
||||||
user_ids.each do |user_id|
|
user_ids.each do |user_id|
|
||||||
members << Member.new(:role_ids => params[:member][:role_ids], :user_id => user_id)
|
members << Member.new(attrs.merge(:user_id => user_id))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
members << Member.new(:role_ids => params[:member][:role_ids], :user_id => params[:member][:user_id])
|
members << Member.new(attrs)
|
||||||
end
|
end
|
||||||
@project.members << members
|
@project.members << members
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if members.present? && members.all? {|m| m.valid? }
|
if members.present? && members.all? {|m| m.valid? }
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -48,26 +48,26 @@ class MessagesController < ApplicationController
|
||||||
|
|
||||||
# Create a new topic
|
# Create a new topic
|
||||||
def new
|
def new
|
||||||
@message = Message.new
|
@message = Message.new(params[:message])
|
||||||
@message.author = User.current
|
@message.author = User.current
|
||||||
@message.board = @board
|
@message.board = @board
|
||||||
@message.safe_attributes = params[:message]
|
if params[:message] && User.current.allowed_to?(:edit_messages, @project)
|
||||||
if request.post?
|
@message.locked = params[:message]['locked']
|
||||||
if @message.save
|
@message.sticky = params[:message]['sticky']
|
||||||
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
end
|
||||||
attachments = Attachment.attach_files(@message, params[:attachments])
|
if request.post? && @message.save
|
||||||
render_attachment_warning_if_needed(@message)
|
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
||||||
redirect_to :action => 'show', :id => @message
|
attachments = Attachment.attach_files(@message, params[:attachments])
|
||||||
end
|
render_attachment_warning_if_needed(@message)
|
||||||
|
redirect_to :action => 'show', :id => @message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Reply to a topic
|
# Reply to a topic
|
||||||
def reply
|
def reply
|
||||||
@reply = Message.new
|
@reply = Message.new(params[:reply])
|
||||||
@reply.author = User.current
|
@reply.author = User.current
|
||||||
@reply.board = @board
|
@reply.board = @board
|
||||||
@reply.safe_attributes = params[:reply]
|
|
||||||
@topic.children << @reply
|
@topic.children << @reply
|
||||||
if !@reply.new_record?
|
if !@reply.new_record?
|
||||||
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
|
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
|
||||||
|
@ -80,8 +80,11 @@ class MessagesController < ApplicationController
|
||||||
# Edit a message
|
# Edit a message
|
||||||
def edit
|
def edit
|
||||||
(render_403; return false) unless @message.editable_by?(User.current)
|
(render_403; return false) unless @message.editable_by?(User.current)
|
||||||
@message.safe_attributes = params[:message]
|
if params[:message]
|
||||||
if request.post? && @message.save
|
@message.locked = params[:message]['locked']
|
||||||
|
@message.sticky = params[:message]['sticky']
|
||||||
|
end
|
||||||
|
if request.post? && @message.update_attributes(params[:message])
|
||||||
attachments = Attachment.attach_files(@message, params[:attachments])
|
attachments = Attachment.attach_files(@message, params[:attachments])
|
||||||
render_attachment_warning_if_needed(@message)
|
render_attachment_warning_if_needed(@message)
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -59,12 +59,14 @@ class NewsController < ApplicationController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@news = News.new(:project => @project, :author => User.current)
|
@news = News.new(:project => @project, :author => User.current)
|
||||||
@news.safe_attributes = params[:news]
|
if request.post?
|
||||||
if @news.save
|
@news.attributes = params[:news]
|
||||||
flash[:notice] = l(:notice_successful_create)
|
if @news.save
|
||||||
redirect_to :controller => 'news', :action => 'index', :project_id => @project
|
flash[:notice] = l(:notice_successful_create)
|
||||||
else
|
redirect_to :controller => 'news', :action => 'index', :project_id => @project
|
||||||
render :action => 'new'
|
else
|
||||||
|
render :action => 'new'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -72,8 +74,7 @@ class NewsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@news.safe_attributes = params[:news]
|
if request.put? and @news.update_attributes(params[:news])
|
||||||
if @news.save
|
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to :action => 'show', :id => @news
|
redirect_to :action => 'show', :id => @news
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -59,8 +59,7 @@ class ProjectsController < ApplicationController
|
||||||
def new
|
def new
|
||||||
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
|
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
|
||||||
@trackers = Tracker.all
|
@trackers = Tracker.all
|
||||||
@project = Project.new
|
@project = Project.new(params[:project])
|
||||||
@project.safe_attributes = params[:project]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
|
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -43,7 +43,6 @@ class QueriesController < ApplicationController
|
||||||
@query.add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v]) if params[:fields] || params[:f]
|
@query.add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v]) if params[:fields] || params[:f]
|
||||||
@query.attributes = params[:query]
|
@query.attributes = params[:query]
|
||||||
@query.project = nil if params[:query_is_for_all]
|
@query.project = nil if params[:query_is_for_all]
|
||||||
@query.display_subprojects = params[:display_subprojects] if params[:display_subprojects].present?
|
|
||||||
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
|
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
|
||||||
@query.group_by ||= params[:group_by]
|
@query.group_by ||= params[:group_by]
|
||||||
@query.column_names = params[:c] if params[:c]
|
@query.column_names = params[:c] if params[:c]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -97,7 +97,7 @@ class TimelogController < ApplicationController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => User.current.today)
|
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => User.current.today)
|
||||||
@time_entry.safe_attributes = params[:time_entry]
|
@time_entry.attributes = params[:time_entry]
|
||||||
|
|
||||||
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
|
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
|
||||||
render :action => 'edit'
|
render :action => 'edit'
|
||||||
|
@ -106,7 +106,7 @@ class TimelogController < ApplicationController
|
||||||
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
|
verify :method => :post, :only => :create, :render => {:nothing => true, :status => :method_not_allowed }
|
||||||
def create
|
def create
|
||||||
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => User.current.today)
|
@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => User.current.today)
|
||||||
@time_entry.safe_attributes = params[:time_entry]
|
@time_entry.attributes = params[:time_entry]
|
||||||
|
|
||||||
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
|
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
|
||||||
|
|
||||||
|
@ -127,14 +127,14 @@ class TimelogController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
@time_entry.safe_attributes = params[:time_entry]
|
@time_entry.attributes = params[:time_entry]
|
||||||
|
|
||||||
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
|
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
|
||||||
end
|
end
|
||||||
|
|
||||||
verify :method => :put, :only => :update, :render => {:nothing => true, :status => :method_not_allowed }
|
verify :method => :put, :only => :update, :render => {:nothing => true, :status => :method_not_allowed }
|
||||||
def update
|
def update
|
||||||
@time_entry.safe_attributes = params[:time_entry]
|
@time_entry.attributes = params[:time_entry]
|
||||||
|
|
||||||
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
|
call_hook(:controller_timelog_edit_before_save, { :params => params, :time_entry => @time_entry })
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -56,7 +56,7 @@ class VersionsController < ApplicationController
|
||||||
if params[:version]
|
if params[:version]
|
||||||
attributes = params[:version].dup
|
attributes = params[:version].dup
|
||||||
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
|
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
|
||||||
@version.safe_attributes = attributes
|
@version.attributes = attributes
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class VersionsController < ApplicationController
|
||||||
if params[:version]
|
if params[:version]
|
||||||
attributes = params[:version].dup
|
attributes = params[:version].dup
|
||||||
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
|
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
|
||||||
@version.safe_attributes = attributes
|
@version.attributes = attributes
|
||||||
end
|
end
|
||||||
|
|
||||||
if request.post?
|
if request.post?
|
||||||
|
@ -101,8 +101,7 @@ class VersionsController < ApplicationController
|
||||||
if request.put? && params[:version]
|
if request.put? && params[:version]
|
||||||
attributes = params[:version].dup
|
attributes = params[:version].dup
|
||||||
attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing'])
|
attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing'])
|
||||||
@version.safe_attributes = attributes
|
if @version.update_attributes(attributes)
|
||||||
if @version.save
|
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
|
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -19,7 +19,7 @@ class WikisController < ApplicationController
|
||||||
# Create or update a project's wiki
|
# Create or update a project's wiki
|
||||||
def edit
|
def edit
|
||||||
@wiki = @project.wiki || Wiki.new(:project => @project)
|
@wiki = @project.wiki || Wiki.new(:project => @project)
|
||||||
@wiki.safe_attributes = params[:wiki]
|
@wiki.attributes = params[:wiki]
|
||||||
@wiki.save if request.post?
|
@wiki.save if request.post?
|
||||||
render(:update) {|page| page.replace_html "tab-content-wiki", :partial => 'projects/settings/wiki'}
|
render(:update) {|page| page.replace_html "tab-content-wiki", :partial => 'projects/settings/wiki'}
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -17,7 +17,7 @@ require 'cgi'
|
||||||
|
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
include Redmine::I18n
|
include Redmine::I18n
|
||||||
include Gravatarify::Helper
|
include GravatarHelper::PublicMethods
|
||||||
|
|
||||||
extend Forwardable
|
extend Forwardable
|
||||||
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
|
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
|
||||||
|
@ -436,7 +436,6 @@ module ApplicationHelper
|
||||||
css << 'theme-' + theme.name
|
css << 'theme-' + theme.name
|
||||||
end
|
end
|
||||||
|
|
||||||
css << 'project-' + @project.id.to_s if @project.present?
|
|
||||||
css << 'controller-' + params[:controller] if params[:controller]
|
css << 'controller-' + params[:controller] if params[:controller]
|
||||||
css << 'action-' + params[:action] if params[:action]
|
css << 'action-' + params[:action] if params[:action]
|
||||||
css.join(' ')
|
css.join(' ')
|
||||||
|
@ -503,7 +502,7 @@ module ApplicationHelper
|
||||||
|
|
||||||
@parsed_headings = []
|
@parsed_headings = []
|
||||||
text = parse_non_pre_blocks(text) do |text|
|
text = parse_non_pre_blocks(text) do |text|
|
||||||
[:parse_inline_attachments, :parse_wiki_links, :parse_redmine_links, :parse_headings, :parse_relative_urls].each do |method_name|
|
[:parse_inline_attachments, :parse_wiki_links, :parse_redmine_links, :parse_headings].each do |method_name|
|
||||||
send method_name, text, project, obj, attr, only_path, options
|
send method_name, text, project, obj, attr, only_path, options
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -544,41 +543,6 @@ module ApplicationHelper
|
||||||
parsed
|
parsed
|
||||||
end
|
end
|
||||||
|
|
||||||
RELATIVE_LINK_RE = %r{
|
|
||||||
<a
|
|
||||||
(?:
|
|
||||||
(\shref=
|
|
||||||
(?: # the href and link
|
|
||||||
(?:'(\/[^>]+?)')|
|
|
||||||
(?:"(\/[^>]+?)")
|
|
||||||
)
|
|
||||||
)|
|
|
||||||
[^>]
|
|
||||||
)*
|
|
||||||
>
|
|
||||||
[^<]*?<\/a> # content and closing link tag.
|
|
||||||
}x unless const_defined?(:RELATIVE_LINK_RE)
|
|
||||||
|
|
||||||
def parse_relative_urls(text, project, obj, attr, only_path, options)
|
|
||||||
return if only_path
|
|
||||||
text.gsub!(RELATIVE_LINK_RE) do |m|
|
|
||||||
href, relative_url = $1, $2 || $3
|
|
||||||
next m unless href.present?
|
|
||||||
if defined?(request) && request.present?
|
|
||||||
# we have a request!
|
|
||||||
protocol, host_with_port = request.protocol, request.host_with_port
|
|
||||||
elsif @controller
|
|
||||||
# use the same methods as url_for in the Mailer
|
|
||||||
url_opts = @controller.class.default_url_options
|
|
||||||
next m unless url_opts && url_opts[:protocol] && url_opts[:host]
|
|
||||||
protocol, host_with_port = "#{url_opts[:protocol]}://", url_opts[:host]
|
|
||||||
else
|
|
||||||
next m
|
|
||||||
end
|
|
||||||
m.sub href, " href=\"#{protocol}#{host_with_port}#{relative_url}\""
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def parse_inline_attachments(text, project, obj, attr, only_path, options)
|
def parse_inline_attachments(text, project, obj, attr, only_path, options)
|
||||||
# when using an image link, try to use an attachment, if possible
|
# when using an image link, try to use an attachment, if possible
|
||||||
if options[:attachments] || (obj && obj.respond_to?(:attachments))
|
if options[:attachments] || (obj && obj.respond_to?(:attachments))
|
||||||
|
@ -852,7 +816,7 @@ module ApplicationHelper
|
||||||
def back_url_hidden_field_tag
|
def back_url_hidden_field_tag
|
||||||
back_url = params[:back_url] || request.env['HTTP_REFERER']
|
back_url = params[:back_url] || request.env['HTTP_REFERER']
|
||||||
back_url = CGI.unescape(back_url.to_s)
|
back_url = CGI.unescape(back_url.to_s)
|
||||||
hidden_field_tag('back_url', CGI.escape(back_url), :id => nil) unless back_url.blank?
|
hidden_field_tag('back_url', CGI.escape(back_url)) unless back_url.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_all_links(form_name)
|
def check_all_links(form_name)
|
||||||
|
@ -868,10 +832,12 @@ module ApplicationHelper
|
||||||
pcts << (100 - pcts[1] - pcts[0])
|
pcts << (100 - pcts[1] - pcts[0])
|
||||||
width = options[:width] || '100px;'
|
width = options[:width] || '100px;'
|
||||||
legend = options[:legend] || ''
|
legend = options[:legend] || ''
|
||||||
content_tag('div',
|
content_tag('table',
|
||||||
content_tag('div', '', :style => "width: #{pcts[0]}%;", :class => 'closed ui-progressbar-value ui-widget-header ui-corner-left') +
|
content_tag('tr',
|
||||||
content_tag('div', '', :style => "width: #{pcts[1]}%;", :class => 'done ui-progressbar-value ui-widget-header'),
|
(pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : '') +
|
||||||
:class => 'progress ui-progressbar ui-widget ui-widget-content ui-corner-all', :style => "width: #{width};") +
|
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : '') +
|
||||||
|
(pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : '')
|
||||||
|
), :class => 'progress', :style => "width: #{width};") +
|
||||||
content_tag('p', legend, :class => 'pourcent')
|
content_tag('p', legend, :class => 'pourcent')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -884,7 +850,7 @@ module ApplicationHelper
|
||||||
def context_menu(url)
|
def context_menu(url)
|
||||||
unless @context_menu_included
|
unless @context_menu_included
|
||||||
content_for :header_tags do
|
content_for :header_tags do
|
||||||
javascript_include_tag('context_menu.jquery') +
|
javascript_include_tag('context_menu') +
|
||||||
stylesheet_link_tag('context_menu')
|
stylesheet_link_tag('context_menu')
|
||||||
end
|
end
|
||||||
if l(:direction) == 'rtl'
|
if l(:direction) == 'rtl'
|
||||||
|
@ -894,7 +860,7 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
@context_menu_included = true
|
@context_menu_included = true
|
||||||
end
|
end
|
||||||
javascript_tag "jQuery(document).ContextMenu('#{ url_for(url) }')"
|
javascript_tag "new ContextMenu('#{ url_for(url) }')"
|
||||||
end
|
end
|
||||||
|
|
||||||
def context_menu_link(name, url, options={})
|
def context_menu_link(name, url, options={})
|
||||||
|
@ -914,25 +880,33 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def calendar_for(field_id)
|
def calendar_for(field_id)
|
||||||
javascript_tag("jQuery('##{field_id}').datepicker(datepickerSettings)")
|
include_calendar_headers_tags
|
||||||
|
image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) +
|
||||||
|
javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });")
|
||||||
end
|
end
|
||||||
|
|
||||||
def jquery_datepicker_settings
|
def include_calendar_headers_tags
|
||||||
start_of_week = Setting.start_of_week.to_s
|
unless @calendar_headers_tags_included
|
||||||
start_of_week_string = start_of_week.present? ? "firstDay: '#{start_of_week}', " : ''
|
@calendar_headers_tags_included = true
|
||||||
script = javascript_tag("var datepickerSettings = {" +
|
content_for :header_tags do
|
||||||
start_of_week_string +
|
start_of_week = case Setting.start_of_week.to_i
|
||||||
"showOn: 'both', " +
|
when 1
|
||||||
"buttonImage: '" + path_to_image('/images/calendar.png') + "', " +
|
'Calendar._FD = 1;' # Monday
|
||||||
"buttonImageOnly: true, " +
|
when 7
|
||||||
"showButtonPanel: true, " +
|
'Calendar._FD = 0;' # Sunday
|
||||||
"dateFormat: 'yy-mm-dd' " +
|
when 6
|
||||||
"}")
|
'Calendar._FD = 6;' # Saturday
|
||||||
unless current_language == :en
|
else
|
||||||
jquery_locale = l("jquery.ui", :default => current_language.to_s)
|
'' # use language
|
||||||
script << javascript_include_tag("libs/ui/i18n/jquery.ui.datepicker-#{jquery_locale}.js")
|
end
|
||||||
|
|
||||||
|
javascript_include_tag('calendar/calendar') +
|
||||||
|
javascript_include_tag("calendar/lang/calendar-#{current_language.to_s.downcase}.js") +
|
||||||
|
javascript_tag(start_of_week) +
|
||||||
|
javascript_include_tag('calendar/calendar-setup') +
|
||||||
|
stylesheet_link_tag('calendar')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
script
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def content_for(name, content = nil, &block)
|
def content_for(name, content = nil, &block)
|
||||||
|
@ -945,19 +919,6 @@ module ApplicationHelper
|
||||||
(@has_content && @has_content[name]) || false
|
(@has_content && @has_content[name]) || false
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the gravatar image tag for the given email
|
|
||||||
# +email+ is a string with an email address
|
|
||||||
def gravatar(email, options={})
|
|
||||||
gravatarify_options = {}
|
|
||||||
gravatarify_options[:secure] = options.delete :ssl
|
|
||||||
[:default, :size, :rating, :filetype].each {|key| gravatarify_options[key] = options.delete key}
|
|
||||||
# Default size is 50x50 px
|
|
||||||
gravatarify_options[:size] ||= 50
|
|
||||||
options[:class] ||= 'gravatar'
|
|
||||||
gravatarify_options[:html] = options
|
|
||||||
gravatar_tag email, gravatarify_options
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the avatar image tag for the given +user+ if avatars are enabled
|
# Returns the avatar image tag for the given +user+ if avatars are enabled
|
||||||
# +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
|
# +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
|
||||||
def avatar(user, options = { })
|
def avatar(user, options = { })
|
||||||
|
@ -987,7 +948,6 @@ module ApplicationHelper
|
||||||
unless User.current.pref.warn_on_leaving_unsaved == '0'
|
unless User.current.pref.warn_on_leaving_unsaved == '0'
|
||||||
tags << "\n" + javascript_tag("Event.observe(window, 'load', function(){ new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}'); });")
|
tags << "\n" + javascript_tag("Event.observe(window, 'load', function(){ new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}'); });")
|
||||||
end
|
end
|
||||||
tags << jquery_datepicker_settings
|
|
||||||
tags
|
tags
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -12,6 +12,9 @@
|
||||||
# See doc/COPYRIGHT.rdoc for more details.
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
#++
|
#++
|
||||||
|
|
||||||
|
require 'rubygems'
|
||||||
|
require 'UniversalDetector'
|
||||||
|
|
||||||
module AttachmentsHelper
|
module AttachmentsHelper
|
||||||
# Displays view/delete links to the attachments of the given object
|
# Displays view/delete links to the attachments of the given object
|
||||||
# Options:
|
# Options:
|
||||||
|
@ -26,18 +29,16 @@ module AttachmentsHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_utf8_for_attachments(str)
|
def to_utf8_for_attachments(str)
|
||||||
if str.respond_to?(:force_encoding)
|
return nil if str.nil?
|
||||||
str.force_encoding('UTF-8')
|
iconv_str = str
|
||||||
return str if str.valid_encoding?
|
detected = UniversalDetector::chardet(str)
|
||||||
else
|
enc = detected['encoding']
|
||||||
return str if /\A[\r\n\t\x20-\x7e]*\Z/n.match(str) # for us-ascii
|
if !enc.nil?
|
||||||
end
|
begin
|
||||||
|
iconv_str = Iconv.conv('UTF-8', enc, str)
|
||||||
begin
|
rescue Iconv::Failure => err
|
||||||
Iconv.conv('UTF-8//IGNORE', 'UTF-8', str + ' ')[0..-3]
|
end
|
||||||
rescue Iconv::InvalidEncoding
|
end
|
||||||
# "UTF-8//IGNORE" is not supported on some OS
|
iconv_str
|
||||||
str
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -36,7 +36,8 @@ module CustomFieldsHelper
|
||||||
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
|
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
|
||||||
case field_format.try(:edit_as)
|
case field_format.try(:edit_as)
|
||||||
when "date"
|
when "date"
|
||||||
date_field_tag(field_name, custom_value.value, :id => field_id, :size => 10)
|
text_field_tag(field_name, custom_value.value, :id => field_id, :size => 10) +
|
||||||
|
calendar_for(field_id)
|
||||||
when "text"
|
when "text"
|
||||||
text_area_tag(field_name, custom_value.value, :id => field_id, :rows => 3, :style => 'width:90%')
|
text_area_tag(field_name, custom_value.value, :id => field_id, :rows => 3, :style => 'width:90%')
|
||||||
when "bool"
|
when "bool"
|
||||||
|
@ -70,7 +71,8 @@ module CustomFieldsHelper
|
||||||
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
|
field_format = Redmine::CustomFieldFormat.find_by_name(custom_field.field_format)
|
||||||
case field_format.try(:edit_as)
|
case field_format.try(:edit_as)
|
||||||
when "date"
|
when "date"
|
||||||
date_field_tag(field_name, '', :id => field_id, :size => 10)
|
text_field_tag(field_name, '', :id => field_id, :size => 10) +
|
||||||
|
calendar_for(field_id)
|
||||||
when "text"
|
when "text"
|
||||||
text_area_tag(field_name, '', :id => field_id, :rows => 3, :style => 'width:90%')
|
text_area_tag(field_name, '', :id => field_id, :rows => 3, :style => 'width:90%')
|
||||||
when "bool"
|
when "bool"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -79,22 +79,6 @@ module IssuesHelper
|
||||||
s
|
s
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_parents_and_subtree(issue)
|
|
||||||
return if issue.leaf? && !issue.parent
|
|
||||||
s = '<form><table id="issue_tree" class="list">'
|
|
||||||
issue_list(issue.self_and_ancestors.sort_by(&:lft) + issue.descendants.sort_by(&:lft)) do |el, level|
|
|
||||||
s << content_tag('tr',
|
|
||||||
content_tag('td', check_box_tag("ids[]", el.id, false, :id => nil), :class => 'checkbox') +
|
|
||||||
content_tag('td', link_to_issue(el, :truncate => 60), :class => 'subject') +
|
|
||||||
content_tag('td', h(el.status)) +
|
|
||||||
content_tag('td', link_to_user(el.assigned_to)) +
|
|
||||||
content_tag('td', progress_bar(el.done_ratio, :width => '80px')),
|
|
||||||
:class => "issue issue-#{el.id} #{"self" if el == issue} hascontextmenu #{level > 0 ? "idnt idnt-#{level}" : nil}")
|
|
||||||
end
|
|
||||||
s << '</table></form>'
|
|
||||||
s
|
|
||||||
end
|
|
||||||
|
|
||||||
def render_custom_fields_rows(issue)
|
def render_custom_fields_rows(issue)
|
||||||
return if issue.custom_field_values.empty?
|
return if issue.custom_field_values.empty?
|
||||||
ordered_values = []
|
ordered_values = []
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#-- copyright
|
#-- copyright
|
||||||
# ChiliProject is a project management system.
|
# ChiliProject is a project management system.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2010-2013 the ChiliProject Team
|
# Copyright (C) 2010-2012 the ChiliProject Team
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue