Merge branch 'release-v2.0.0' into stable
This commit is contained in:
commit
effcd726a3
5
.gitignore
vendored
5
.gitignore
vendored
@ -10,6 +10,8 @@
|
|||||||
/db/*.sqlite3
|
/db/*.sqlite3
|
||||||
/db/schema.rb
|
/db/schema.rb
|
||||||
/files/*
|
/files/*
|
||||||
|
/lib/redmine/scm/adapters/mercurial/redminehelper.pyc
|
||||||
|
/lib/redmine/scm/adapters/mercurial/redminehelper.pyo
|
||||||
/log/*.log*
|
/log/*.log*
|
||||||
/log/mongrel_debug
|
/log/mongrel_debug
|
||||||
/public/dispatch.*
|
/public/dispatch.*
|
||||||
@ -22,3 +24,6 @@
|
|||||||
/vendor/rails
|
/vendor/rails
|
||||||
*.rbc
|
*.rbc
|
||||||
doc/app
|
doc/app
|
||||||
|
/.bundle
|
||||||
|
/Gemfile.lock
|
||||||
|
/.rvmrc*
|
||||||
|
0
.gitmodules
vendored
Normal file
0
.gitmodules
vendored
Normal file
@ -12,6 +12,8 @@ db/*.db
|
|||||||
db/*.sqlite3
|
db/*.sqlite3
|
||||||
db/schema.rb
|
db/schema.rb
|
||||||
files/*
|
files/*
|
||||||
|
lib/redmine/scm/adapters/mercurial/redminehelper.pyc
|
||||||
|
lib/redmine/scm/adapters/mercurial/redminehelper.pyo
|
||||||
log/*.log*
|
log/*.log*
|
||||||
log/mongrel_debug
|
log/mongrel_debug
|
||||||
public/dispatch.*
|
public/dispatch.*
|
||||||
@ -23,3 +25,9 @@ tmp/sockets/*
|
|||||||
tmp/test/*
|
tmp/test/*
|
||||||
vendor/rails
|
vendor/rails
|
||||||
*.rbc
|
*.rbc
|
||||||
|
.svn/
|
||||||
|
.git/
|
||||||
|
doc/app
|
||||||
|
/.bundle
|
||||||
|
/Gemfile.lock
|
||||||
|
/.rvmrc*
|
||||||
|
71
Gemfile
Normal file
71
Gemfile
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
source :rubygems
|
||||||
|
|
||||||
|
gem "rails", "2.3.12"
|
||||||
|
|
||||||
|
gem "coderay", "~> 0.9.7"
|
||||||
|
gem "i18n", "~> 0.4.2"
|
||||||
|
gem "rubytree", "~> 0.5.2", :require => 'tree'
|
||||||
|
gem "rdoc", ">= 2.4.2"
|
||||||
|
|
||||||
|
group :test do
|
||||||
|
gem 'shoulda', '~> 2.10.3'
|
||||||
|
gem 'edavis10-object_daddy', :require => 'object_daddy'
|
||||||
|
gem 'mocha'
|
||||||
|
end
|
||||||
|
|
||||||
|
group :openid do
|
||||||
|
gem "ruby-openid", '~> 2.1.4', :require => 'openid'
|
||||||
|
end
|
||||||
|
|
||||||
|
group :rmagick do
|
||||||
|
gem "rmagick", "~> 1.15.17"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Use the commented pure ruby gems, if you have not the needed prerequisites on
|
||||||
|
# board to compile the native ones. Note, that their use is discouraged, since
|
||||||
|
# their integration is propbably not that well tested and their are slower in
|
||||||
|
# orders of magnitude compared to their native counterparts. You have been
|
||||||
|
# warned.
|
||||||
|
#
|
||||||
|
platforms :mri do
|
||||||
|
group :mysql do
|
||||||
|
gem "mysql"
|
||||||
|
# gem "ruby-mysql"
|
||||||
|
end
|
||||||
|
|
||||||
|
group :mysql2 do
|
||||||
|
gem "mysql2", "~> 0.2.7"
|
||||||
|
end
|
||||||
|
|
||||||
|
group :postgres do
|
||||||
|
gem "pg", "~> 0.9.0"
|
||||||
|
# gem "postgres-pr"
|
||||||
|
end
|
||||||
|
|
||||||
|
group :sqlite do
|
||||||
|
gem "sqlite3-ruby", "< 1.3", :require => "sqlite3"
|
||||||
|
# please tell me, if you are fond of a pure ruby sqlite3 binding
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
platforms :jruby do
|
||||||
|
gem "jruby-openssl"
|
||||||
|
|
||||||
|
group :mysql do
|
||||||
|
gem "activerecord-jdbcmysql-adapter"
|
||||||
|
end
|
||||||
|
|
||||||
|
group :postgres do
|
||||||
|
gem "activerecord-jdbcpostgresql-adapter"
|
||||||
|
end
|
||||||
|
|
||||||
|
group :sqlite do
|
||||||
|
gem "activerecord-jdbcsqlite3-adapter"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Load plugins' Gemfiles
|
||||||
|
Dir.glob File.expand_path("../vendor/plugins/*/Gemfile", __FILE__) do |file|
|
||||||
|
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
|
||||||
|
instance_eval File.read(file)
|
||||||
|
end
|
4
Rakefile
4
Rakefile
@ -1,10 +1,10 @@
|
|||||||
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||||||
# for example lib/tasks/switchtower.rake, and they will automatically be available to Rake.
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||||||
|
|
||||||
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
||||||
|
|
||||||
require 'rake'
|
require 'rake'
|
||||||
require 'rake/testtask'
|
require 'rake/testtask'
|
||||||
require 'rake/rdoctask'
|
require 'rdoc/task'
|
||||||
|
|
||||||
require 'tasks/rails'
|
require 'tasks/rails'
|
@ -1,22 +1,17 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class AccountController < ApplicationController
|
class AccountController < ApplicationController
|
||||||
helper :custom_fields
|
|
||||||
include CustomFieldsHelper
|
include CustomFieldsHelper
|
||||||
|
|
||||||
# prevents login action to be filtered by check_if_login_required application scope filter
|
# prevents login action to be filtered by check_if_login_required application scope filter
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class ActivitiesController < ApplicationController
|
class ActivitiesController < ApplicationController
|
||||||
menu_item :activity
|
menu_item :activity
|
||||||
before_filter :find_optional_project
|
before_filter :find_optional_project
|
||||||
|
@ -1,26 +1,21 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class AdminController < ApplicationController
|
class AdminController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
|
||||||
before_filter :require_admin
|
before_filter :require_admin
|
||||||
|
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -1,24 +1,21 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
require 'uri'
|
require 'uri'
|
||||||
require 'cgi'
|
require 'cgi'
|
||||||
|
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
|
helper :all
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class AttachmentsController < ApplicationController
|
class AttachmentsController < ApplicationController
|
||||||
before_filter :find_project
|
before_filter :find_project
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class AuthSourcesController < ApplicationController
|
class AuthSourcesController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class AutoCompletesController < ApplicationController
|
class AutoCompletesController < ApplicationController
|
||||||
before_filter :find_project
|
before_filter :find_project
|
||||||
|
|
||||||
|
@ -1,30 +1,23 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class BoardsController < ApplicationController
|
class BoardsController < ApplicationController
|
||||||
default_search_scope :messages
|
default_search_scope :messages
|
||||||
before_filter :find_project, :find_board_if_available, :authorize
|
before_filter :find_project, :find_board_if_available, :authorize
|
||||||
accept_key_auth :index, :show
|
accept_key_auth :index, :show
|
||||||
|
|
||||||
helper :messages
|
|
||||||
include MessagesHelper
|
include MessagesHelper
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
helper :watchers
|
|
||||||
include WatchersHelper
|
include WatchersHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -1,14 +1,23 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class CalendarsController < ApplicationController
|
class CalendarsController < ApplicationController
|
||||||
menu_item :calendar
|
menu_item :calendar
|
||||||
before_filter :find_optional_project
|
before_filter :find_optional_project
|
||||||
|
|
||||||
rescue_from Query::StatementInvalid, :with => :query_statement_invalid
|
rescue_from Query::StatementInvalid, :with => :query_statement_invalid
|
||||||
|
|
||||||
helper :issues
|
|
||||||
helper :projects
|
|
||||||
helper :queries
|
|
||||||
include QueriesHelper
|
include QueriesHelper
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class CommentsController < ApplicationController
|
class CommentsController < ApplicationController
|
||||||
default_search_scope :news
|
default_search_scope :news
|
||||||
model_object News
|
model_object News
|
||||||
|
@ -1,5 +1,17 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class ContextMenusController < ApplicationController
|
class ContextMenusController < ApplicationController
|
||||||
helper :watchers
|
|
||||||
|
|
||||||
def issues
|
def issues
|
||||||
@issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project)
|
@issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project)
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class CustomFieldsController < ApplicationController
|
class CustomFieldsController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class DocumentsController < ApplicationController
|
class DocumentsController < ApplicationController
|
||||||
default_search_scope :documents
|
default_search_scope :documents
|
||||||
@ -23,7 +19,6 @@ class DocumentsController < ApplicationController
|
|||||||
before_filter :find_project_from_association, :except => [:index, :new]
|
before_filter :find_project_from_association, :except => [:index, :new]
|
||||||
before_filter :authorize
|
before_filter :authorize
|
||||||
|
|
||||||
helper :attachments
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category'
|
@sort_by = %w(category date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category'
|
||||||
|
@ -1,26 +1,21 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class EnumerationsController < ApplicationController
|
class EnumerationsController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
|
||||||
before_filter :require_admin
|
before_filter :require_admin
|
||||||
|
|
||||||
helper :custom_fields
|
|
||||||
include CustomFieldsHelper
|
include CustomFieldsHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -1,10 +1,22 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class FilesController < ApplicationController
|
class FilesController < ApplicationController
|
||||||
menu_item :files
|
menu_item :files
|
||||||
|
|
||||||
before_filter :find_project_by_project_id
|
before_filter :find_project_by_project_id
|
||||||
before_filter :authorize
|
before_filter :authorize
|
||||||
|
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -1,15 +1,23 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class GanttsController < ApplicationController
|
class GanttsController < ApplicationController
|
||||||
menu_item :gantt
|
menu_item :gantt
|
||||||
before_filter :find_optional_project
|
before_filter :find_optional_project
|
||||||
|
|
||||||
rescue_from Query::StatementInvalid, :with => :query_statement_invalid
|
rescue_from Query::StatementInvalid, :with => :query_statement_invalid
|
||||||
|
|
||||||
helper :gantt
|
|
||||||
helper :issues
|
|
||||||
helper :projects
|
|
||||||
helper :queries
|
|
||||||
include QueriesHelper
|
include QueriesHelper
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
include Redmine::Export::PDF
|
include Redmine::Export::PDF
|
||||||
|
|
||||||
|
@ -1,26 +1,21 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class GroupsController < ApplicationController
|
class GroupsController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
|
||||||
before_filter :require_admin
|
before_filter :require_admin
|
||||||
|
|
||||||
helper :custom_fields
|
|
||||||
|
|
||||||
# GET /groups
|
# GET /groups
|
||||||
# GET /groups.xml
|
# GET /groups.xml
|
||||||
@ -132,7 +127,7 @@ class GroupsController < ApplicationController
|
|||||||
|
|
||||||
def autocomplete_for_user
|
def autocomplete_for_user
|
||||||
@group = Group.find(params[:id])
|
@group = Group.find(params[:id])
|
||||||
@users = User.active.like(params[:q]).find(:all, :limit => 100) - @group.users
|
@users = User.active.not_in_group(@group).like(params[:q]).all(:limit => 100)
|
||||||
render :layout => false
|
render :layout => false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class HelpController < ApplicationController
|
class HelpController < ApplicationController
|
||||||
def wiki_syntax
|
def wiki_syntax
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class IssueCategoriesController < ApplicationController
|
class IssueCategoriesController < ApplicationController
|
||||||
menu_item :settings
|
menu_item :settings
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class IssueMovesController < ApplicationController
|
class IssueMovesController < ApplicationController
|
||||||
default_search_scope :issues
|
default_search_scope :issues
|
||||||
before_filter :find_issues, :check_project_uniqueness
|
before_filter :find_issues, :check_project_uniqueness
|
||||||
@ -17,8 +30,7 @@ class IssueMovesController < ApplicationController
|
|||||||
moved_issues = []
|
moved_issues = []
|
||||||
@issues.each do |issue|
|
@issues.each do |issue|
|
||||||
issue.reload
|
issue.reload
|
||||||
issue.init_journal(User.current)
|
issue.init_journal(User.current, @notes || "")
|
||||||
issue.current_journal.notes = @notes if @notes.present?
|
|
||||||
call_hook(:controller_issues_move_before_save, { :params => params, :issue => issue, :target_project => @target_project, :copy => !!@copy })
|
call_hook(:controller_issues_move_before_save, { :params => params, :issue => issue, :target_project => @target_project, :copy => !!@copy })
|
||||||
if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes => extract_changed_attributes_for_move(params)})
|
if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes => extract_changed_attributes_for_move(params)})
|
||||||
moved_issues << r
|
moved_issues << r
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class IssueRelationsController < ApplicationController
|
class IssueRelationsController < ApplicationController
|
||||||
before_filter :find_issue, :find_project_from_association, :authorize
|
before_filter :find_issue, :find_project_from_association, :authorize
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class IssueStatusesController < ApplicationController
|
class IssueStatusesController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class IssuesController < ApplicationController
|
class IssuesController < ApplicationController
|
||||||
menu_item :new_issue, :only => [:new, :create]
|
menu_item :new_issue, :only => [:new, :create]
|
||||||
@ -31,26 +27,16 @@ class IssuesController < ApplicationController
|
|||||||
|
|
||||||
rescue_from Query::StatementInvalid, :with => :query_statement_invalid
|
rescue_from Query::StatementInvalid, :with => :query_statement_invalid
|
||||||
|
|
||||||
helper :journals
|
include JournalsHelper
|
||||||
helper :projects
|
|
||||||
include ProjectsHelper
|
include ProjectsHelper
|
||||||
helper :custom_fields
|
|
||||||
include CustomFieldsHelper
|
include CustomFieldsHelper
|
||||||
helper :issue_relations
|
|
||||||
include IssueRelationsHelper
|
include IssueRelationsHelper
|
||||||
helper :watchers
|
|
||||||
include WatchersHelper
|
include WatchersHelper
|
||||||
helper :attachments
|
|
||||||
include AttachmentsHelper
|
include AttachmentsHelper
|
||||||
helper :queries
|
|
||||||
include QueriesHelper
|
include QueriesHelper
|
||||||
helper :repositories
|
|
||||||
include RepositoriesHelper
|
include RepositoriesHelper
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
include IssuesHelper
|
include IssuesHelper
|
||||||
helper :timelog
|
|
||||||
helper :gantt
|
|
||||||
include Redmine::Export::PDF
|
include Redmine::Export::PDF
|
||||||
|
|
||||||
verify :method => [:post, :delete],
|
verify :method => [:post, :delete],
|
||||||
@ -103,8 +89,7 @@ class IssuesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@journals = @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC")
|
@journals = @issue.journals.find(:all, :include => [:user], :order => "#{Journal.table_name}.created_at ASC")
|
||||||
@journals.each_with_index {|j,i| j.indice = i+1}
|
|
||||||
@journals.reverse! if User.current.wants_comments_in_reverse_order?
|
@journals.reverse! if User.current.wants_comments_in_reverse_order?
|
||||||
@changesets = @issue.changesets.visible.all
|
@changesets = @issue.changesets.visible.all
|
||||||
@changesets.reverse! if User.current.wants_comments_in_reverse_order?
|
@changesets.reverse! if User.current.wants_comments_in_reverse_order?
|
||||||
@ -112,7 +97,7 @@ class IssuesController < ApplicationController
|
|||||||
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
||||||
@edit_allowed = User.current.allowed_to?(:edit_issues, @project)
|
@edit_allowed = User.current.allowed_to?(:edit_issues, @project)
|
||||||
@priorities = IssuePriority.all
|
@priorities = IssuePriority.all
|
||||||
@time_entry = TimeEntry.new
|
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { render :template => 'issues/show.rhtml' }
|
format.html { render :template => 'issues/show.rhtml' }
|
||||||
format.api
|
format.api
|
||||||
@ -132,6 +117,7 @@ class IssuesController < ApplicationController
|
|||||||
|
|
||||||
def create
|
def create
|
||||||
call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
|
call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
|
||||||
|
IssueObserver.instance.send_notification = params[:send_notification] == '0' ? false : true
|
||||||
if @issue.save
|
if @issue.save
|
||||||
attachments = Attachment.attach_files(@issue, params[:attachments])
|
attachments = Attachment.attach_files(@issue, params[:attachments])
|
||||||
render_attachment_warning_if_needed(@issue)
|
render_attachment_warning_if_needed(@issue)
|
||||||
@ -154,6 +140,7 @@ class IssuesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
return render_reply(@journal) if @journal
|
||||||
update_issue_from_params
|
update_issue_from_params
|
||||||
|
|
||||||
@journal = @issue.current_journal
|
@journal = @issue.current_journal
|
||||||
@ -166,10 +153,10 @@ class IssuesController < ApplicationController
|
|||||||
|
|
||||||
def update
|
def update
|
||||||
update_issue_from_params
|
update_issue_from_params
|
||||||
|
JournalObserver.instance.send_notification = params[:send_notification] == '0' ? false : true
|
||||||
if @issue.save_issue_with_child_records(params, @time_entry)
|
if @issue.save_issue_with_child_records(params, @time_entry)
|
||||||
render_attachment_warning_if_needed(@issue)
|
render_attachment_warning_if_needed(@issue)
|
||||||
flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record?
|
flash[:notice] = l(:notice_successful_update) unless @issue.current_journal == @journal
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_back_or_default({:action => 'show', :id => @issue}) }
|
format.html { redirect_back_or_default({:action => 'show', :id => @issue}) }
|
||||||
@ -177,7 +164,7 @@ class IssuesController < ApplicationController
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
render_attachment_warning_if_needed(@issue)
|
render_attachment_warning_if_needed(@issue)
|
||||||
flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record?
|
flash[:notice] = l(:notice_successful_update) unless @issue.current_journal == @journal
|
||||||
@journal = @issue.current_journal
|
@journal = @issue.current_journal
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@ -206,6 +193,7 @@ class IssuesController < ApplicationController
|
|||||||
journal = issue.init_journal(User.current, params[:notes])
|
journal = issue.init_journal(User.current, params[:notes])
|
||||||
issue.safe_attributes = attributes
|
issue.safe_attributes = attributes
|
||||||
call_hook(:controller_issues_bulk_edit_before_save, { :params => params, :issue => issue })
|
call_hook(:controller_issues_bulk_edit_before_save, { :params => params, :issue => issue })
|
||||||
|
JournalObserver.instance.send_notification = params[:send_notification] == '0' ? false : true
|
||||||
unless issue.save
|
unless issue.save
|
||||||
# Keep unsaved issue ids to display them in flash error
|
# Keep unsaved issue ids to display them in flash error
|
||||||
unsaved_issue_ids << issue.id
|
unsaved_issue_ids << issue.id
|
||||||
@ -236,7 +224,13 @@ class IssuesController < ApplicationController
|
|||||||
return unless api_request?
|
return unless api_request?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@issues.each(&:destroy)
|
@issues.each do |issue|
|
||||||
|
begin
|
||||||
|
issue.reload.destroy
|
||||||
|
rescue ::ActiveRecord::RecordNotFound # raised by #reload if issue no longer exists
|
||||||
|
# nothing to do, issue was already deleted (eg. by a parent)
|
||||||
|
end
|
||||||
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_back_or_default(:action => 'index', :project_id => @project) }
|
format.html { redirect_back_or_default(:action => 'index', :project_id => @project) }
|
||||||
format.api { head :ok }
|
format.api { head :ok }
|
||||||
@ -265,12 +259,13 @@ private
|
|||||||
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
||||||
@priorities = IssuePriority.all
|
@priorities = IssuePriority.all
|
||||||
@edit_allowed = User.current.allowed_to?(:edit_issues, @project)
|
@edit_allowed = User.current.allowed_to?(:edit_issues, @project)
|
||||||
@time_entry = TimeEntry.new
|
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
|
||||||
@time_entry.attributes = params[:time_entry]
|
@time_entry.attributes = params[:time_entry]
|
||||||
|
|
||||||
@notes = params[:notes] || (params[:issue].present? ? params[:issue][:notes] : nil)
|
@notes = params[:notes] || (params[:issue].present? ? params[:issue][:notes] : nil)
|
||||||
@issue.init_journal(User.current, @notes)
|
@issue.init_journal(User.current, @notes)
|
||||||
@issue.safe_attributes = params[:issue]
|
@issue.safe_attributes = params[:issue]
|
||||||
|
@journal = @issue.current_journal
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO: Refactor, lots of extra code in here
|
# TODO: Refactor, lots of extra code in here
|
||||||
|
@ -1,33 +1,26 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class JournalsController < ApplicationController
|
class JournalsController < ApplicationController
|
||||||
before_filter :find_journal, :only => [:edit]
|
before_filter :find_journal, :only => [:edit, :diff]
|
||||||
before_filter :find_issue, :only => [:new]
|
before_filter :find_issue, :only => [:new]
|
||||||
before_filter :find_optional_project, :only => [:index]
|
before_filter :find_optional_project, :only => [:index]
|
||||||
before_filter :authorize, :only => [:new, :edit]
|
before_filter :authorize, :only => [:new, :edit, :diff]
|
||||||
accept_key_auth :index
|
accept_key_auth :index
|
||||||
|
menu_item :issues
|
||||||
|
|
||||||
helper :issues
|
|
||||||
helper :queries
|
|
||||||
include QueriesHelper
|
include QueriesHelper
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
helper :custom_fields
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
retrieve_query
|
retrieve_query
|
||||||
@ -35,7 +28,7 @@ class JournalsController < ApplicationController
|
|||||||
sort_update(@query.sortable_columns)
|
sort_update(@query.sortable_columns)
|
||||||
|
|
||||||
if @query.valid?
|
if @query.valid?
|
||||||
@journals = @query.journals(:order => "#{Journal.table_name}.created_on DESC",
|
@journals = @query.issue_journals(:order => "#{Journal.table_name}.created_at DESC",
|
||||||
:limit => 25)
|
:limit => 25)
|
||||||
end
|
end
|
||||||
@title = (@project ? @project.name : Setting.app_title) + ": " + (@query.new_record? ? l(:label_changes_details) : @query.name)
|
@title = (@project ? @project.name : Setting.app_title) + ": " + (@query.new_record? ? l(:label_changes_details) : @query.name)
|
||||||
@ -44,6 +37,7 @@ class JournalsController < ApplicationController
|
|||||||
render_404
|
render_404
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Used when replying to an issue or journal
|
||||||
def new
|
def new
|
||||||
journal = Journal.find(params[:journal_id]) if params[:journal_id]
|
journal = Journal.find(params[:journal_id]) if params[:journal_id]
|
||||||
if journal
|
if journal
|
||||||
@ -68,21 +62,31 @@ class JournalsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
(render_403; return false) unless @journal.editable_by?(User.current)
|
||||||
if request.post?
|
if request.post?
|
||||||
@journal.update_attributes(:notes => params[:notes]) if params[:notes]
|
@journal.update_attribute(:notes, params[:notes]) if params[:notes]
|
||||||
@journal.destroy if @journal.details.empty? && @journal.notes.blank?
|
@journal.destroy if @journal.details.empty? && @journal.notes.blank?
|
||||||
call_hook(:controller_journals_edit_post, { :journal => @journal, :params => params})
|
call_hook(:controller_journals_edit_post, { :journal => @journal, :params => params})
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to :controller => 'issues', :action => 'show', :id => @journal.journalized_id }
|
format.html { redirect_to :controller => @journal.journaled.class.name.pluralize.downcase,
|
||||||
|
:action => 'show', :id => @journal.journaled_id }
|
||||||
format.js { render :action => 'update' }
|
format.js { render :action => 'update' }
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {
|
||||||
|
# TODO: implement non-JS journal update
|
||||||
|
render :nothing => true
|
||||||
|
}
|
||||||
|
format.js
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def find_journal
|
def find_journal
|
||||||
@journal = Journal.find(params[:id])
|
@journal = Journal.find(params[:id])
|
||||||
(render_403; return false) unless @journal.editable_by?(User.current)
|
|
||||||
@project = @journal.journalized.project
|
@project = @journal.journalized.project
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
render_404
|
render_404
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class LdapAuthSourcesController < AuthSourcesController
|
class LdapAuthSourcesController < AuthSourcesController
|
||||||
|
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class MailHandlerController < ActionController::Base
|
class MailHandlerController < ActionController::Base
|
||||||
before_filter :check_credential
|
before_filter :check_credential
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class MembersController < ApplicationController
|
class MembersController < ApplicationController
|
||||||
model_object Member
|
model_object Member
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class MessagesController < ApplicationController
|
class MessagesController < ApplicationController
|
||||||
menu_item :boards
|
menu_item :boards
|
||||||
@ -25,8 +21,6 @@ class MessagesController < ApplicationController
|
|||||||
verify :method => :post, :only => [ :reply, :destroy ], :redirect_to => { :action => :show }
|
verify :method => :post, :only => [ :reply, :destroy ], :redirect_to => { :action => :show }
|
||||||
verify :xhr => true, :only => :quote
|
verify :xhr => true, :only => :quote
|
||||||
|
|
||||||
helper :watchers
|
|
||||||
helper :attachments
|
|
||||||
include AttachmentsHelper
|
include AttachmentsHelper
|
||||||
|
|
||||||
REPLIES_PER_PAGE = 25 unless const_defined?(:REPLIES_PER_PAGE)
|
REPLIES_PER_PAGE = 25 unless const_defined?(:REPLIES_PER_PAGE)
|
||||||
|
@ -1,26 +1,19 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class MyController < ApplicationController
|
class MyController < ApplicationController
|
||||||
before_filter :require_login
|
before_filter :require_login
|
||||||
|
|
||||||
helper :issues
|
|
||||||
helper :users
|
|
||||||
helper :custom_fields
|
|
||||||
|
|
||||||
BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
|
BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
|
||||||
'issuesreportedbyme' => :label_reported_issues,
|
'issuesreportedbyme' => :label_reported_issues,
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class NewsController < ApplicationController
|
class NewsController < ApplicationController
|
||||||
default_search_scope :news
|
default_search_scope :news
|
||||||
@ -25,6 +21,7 @@ class NewsController < ApplicationController
|
|||||||
before_filter :find_optional_project, :only => :index
|
before_filter :find_optional_project, :only => :index
|
||||||
accept_key_auth :index
|
accept_key_auth :index
|
||||||
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
case params[:format]
|
case params[:format]
|
||||||
when 'xml', 'json'
|
when 'xml', 'json'
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class PreviewsController < ApplicationController
|
class PreviewsController < ApplicationController
|
||||||
before_filter :find_project
|
before_filter :find_project
|
||||||
|
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class ProjectEnumerationsController < ApplicationController
|
class ProjectEnumerationsController < ApplicationController
|
||||||
before_filter :find_project_by_project_id
|
before_filter :find_project_by_project_id
|
||||||
before_filter :authorize
|
before_filter :authorize
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class ProjectsController < ApplicationController
|
class ProjectsController < ApplicationController
|
||||||
menu_item :overview
|
menu_item :overview
|
||||||
@ -32,14 +28,9 @@ class ProjectsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
helper :custom_fields
|
|
||||||
include CustomFieldsHelper
|
include CustomFieldsHelper
|
||||||
helper :issues
|
|
||||||
helper :queries
|
|
||||||
include QueriesHelper
|
include QueriesHelper
|
||||||
helper :repositories
|
|
||||||
include RepositoriesHelper
|
include RepositoriesHelper
|
||||||
include ProjectsHelper
|
include ProjectsHelper
|
||||||
|
|
||||||
@ -143,7 +134,7 @@ class ProjectsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
@users_by_role = @project.users_by_role
|
@users_by_role = @project.users_by_role
|
||||||
@subprojects = @project.children.visible
|
@subprojects = @project.children.visible.all
|
||||||
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
|
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
|
||||||
@trackers = @project.rolled_up_trackers
|
@trackers = @project.rolled_up_trackers
|
||||||
|
|
||||||
@ -156,11 +147,10 @@ class ProjectsController < ApplicationController
|
|||||||
:include => [:project, :status, :tracker],
|
:include => [:project, :status, :tracker],
|
||||||
:conditions => cond)
|
:conditions => cond)
|
||||||
|
|
||||||
TimeEntry.visible_by(User.current) do
|
if User.current.allowed_to?(:view_time_entries, @project)
|
||||||
@total_hours = TimeEntry.sum(:hours,
|
@total_hours = TimeEntry.visible.sum(:hours, :include => :project, :conditions => cond).to_f
|
||||||
:include => :project,
|
|
||||||
:conditions => cond).to_f
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@key = User.current.rss_key
|
@key = User.current.rss_key
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class QueriesController < ApplicationController
|
class QueriesController < ApplicationController
|
||||||
menu_item :issues
|
menu_item :issues
|
||||||
@ -25,10 +21,11 @@ class QueriesController < ApplicationController
|
|||||||
@query.project = params[:query_is_for_all] ? nil : @project
|
@query.project = params[:query_is_for_all] ? nil : @project
|
||||||
@query.user = User.current
|
@query.user = User.current
|
||||||
@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.column_names = nil if params[:default_columns]
|
|
||||||
|
|
||||||
@query.add_filters(params[:fields], params[:operators], params[:values]) if params[:fields]
|
@query.add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v]) if params[:fields] || params[:f]
|
||||||
@query.group_by ||= params[:group_by]
|
@query.group_by ||= params[:group_by]
|
||||||
|
@query.column_names = params[:c] if params[:c]
|
||||||
|
@query.column_names = nil if params[:default_columns]
|
||||||
|
|
||||||
if request.post? && params[:confirm] && @query.save
|
if request.post? && params[:confirm] && @query.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
@ -41,10 +38,12 @@ class QueriesController < ApplicationController
|
|||||||
def edit
|
def edit
|
||||||
if request.post?
|
if request.post?
|
||||||
@query.filters = {}
|
@query.filters = {}
|
||||||
@query.add_filters(params[:fields], params[:operators], params[:values]) if params[:fields]
|
@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.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.column_names = params[:c] if params[:c]
|
||||||
@query.column_names = nil if params[:default_columns]
|
@query.column_names = nil if params[:default_columns]
|
||||||
|
|
||||||
if @query.save
|
if @query.save
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class ReportsController < ApplicationController
|
class ReportsController < ApplicationController
|
||||||
menu_item :issues
|
menu_item :issues
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
require 'SVG/Graph/Bar'
|
require 'SVG/Graph/Bar'
|
||||||
require 'SVG/Graph/BarHorizontal'
|
require 'SVG/Graph/BarHorizontal'
|
||||||
@ -77,6 +73,7 @@ class RepositoriesController < ApplicationController
|
|||||||
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
|
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
|
||||||
|
|
||||||
@entries = @repository.entries(@path, @rev)
|
@entries = @repository.entries(@path, @rev)
|
||||||
|
@changeset = @repository.find_changeset_by_name(@rev)
|
||||||
if request.xhr?
|
if request.xhr?
|
||||||
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
|
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
|
||||||
else
|
else
|
||||||
@ -122,17 +119,35 @@ class RepositoriesController < ApplicationController
|
|||||||
|
|
||||||
@content = @repository.cat(@path, @rev)
|
@content = @repository.cat(@path, @rev)
|
||||||
(show_error_not_found; return) unless @content
|
(show_error_not_found; return) unless @content
|
||||||
if 'raw' == params[:format] || @content.is_binary_data? ||
|
if 'raw' == params[:format] ||
|
||||||
(@entry.size && @entry.size > Setting.file_max_size_displayed.to_i.kilobyte)
|
(@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) ||
|
||||||
|
! is_entry_text_data?(@content, @path)
|
||||||
# Force the download
|
# Force the download
|
||||||
send_data @content, :filename => filename_for_content_disposition(@path.split('/').last)
|
send_opt = { :filename => filename_for_content_disposition(@path.split('/').last) }
|
||||||
|
send_type = Redmine::MimeType.of(@path)
|
||||||
|
send_opt[:type] = send_type.to_s if send_type
|
||||||
|
send_data @content, send_opt
|
||||||
else
|
else
|
||||||
# Prevent empty lines when displaying a file with Windows style eol
|
# Prevent empty lines when displaying a file with Windows style eol
|
||||||
|
# TODO: UTF-16
|
||||||
|
# Is this needs? AttachmentsController reads file simply.
|
||||||
@content.gsub!("\r\n", "\n")
|
@content.gsub!("\r\n", "\n")
|
||||||
@changeset = @repository.find_changeset_by_name(@rev)
|
@changeset = @repository.find_changeset_by_name(@rev)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_entry_text_data?(ent, path)
|
||||||
|
# UTF-16 contains "\x00".
|
||||||
|
# It is very strict that file contains less than 30% of ascii symbols
|
||||||
|
# in non Western Europe.
|
||||||
|
return true if Redmine::MimeType.is_type?('text', path)
|
||||||
|
# Ruby 1.8.6 has a bug of integer divisions.
|
||||||
|
# http://apidock.com/ruby/v1_8_6_287/String/is_binary_data%3F
|
||||||
|
return false if ent.is_binary_data?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
private :is_entry_text_data?
|
||||||
|
|
||||||
def annotate
|
def annotate
|
||||||
@entry = @repository.entry(@path, @rev)
|
@entry = @repository.entry(@path, @rev)
|
||||||
(show_error_not_found; return) unless @entry
|
(show_error_not_found; return) unless @entry
|
||||||
@ -218,7 +233,7 @@ class RepositoriesController < ApplicationController
|
|||||||
@rev = params[:rev].blank? ? @repository.default_branch : params[:rev].strip
|
@rev = params[:rev].blank? ? @repository.default_branch : params[:rev].strip
|
||||||
@rev_to = params[:rev_to]
|
@rev_to = params[:rev_to]
|
||||||
|
|
||||||
unless @rev.to_s.match(REV_PARAM_RE) && @rev.to_s.match(REV_PARAM_RE)
|
unless @rev.to_s.match(REV_PARAM_RE) && @rev_to.to_s.match(REV_PARAM_RE)
|
||||||
if @repository.branches.blank?
|
if @repository.branches.blank?
|
||||||
raise InvalidRevisionParam
|
raise InvalidRevisionParam
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class RolesController < ApplicationController
|
class RolesController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
@ -1,24 +1,19 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class SearchController < ApplicationController
|
class SearchController < ApplicationController
|
||||||
before_filter :find_optional_project
|
before_filter :find_optional_project
|
||||||
|
|
||||||
helper :messages
|
|
||||||
include MessagesHelper
|
include MessagesHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class SettingsController < ApplicationController
|
class SettingsController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class SysController < ActionController::Base
|
class SysController < ActionController::Base
|
||||||
before_filter :check_enabled
|
before_filter :check_enabled
|
||||||
|
@ -1,14 +1,23 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
class TimeEntryReportsController < ApplicationController
|
class TimeEntryReportsController < ApplicationController
|
||||||
menu_item :issues
|
menu_item :issues
|
||||||
before_filter :find_optional_project
|
before_filter :find_optional_project
|
||||||
before_filter :load_available_criterias
|
before_filter :load_available_criterias
|
||||||
|
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
helper :issues
|
|
||||||
helper :timelog
|
|
||||||
include TimelogHelper
|
include TimelogHelper
|
||||||
helper :custom_fields
|
|
||||||
include CustomFieldsHelper
|
include CustomFieldsHelper
|
||||||
|
|
||||||
def report
|
def report
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2010 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class TimelogController < ApplicationController
|
class TimelogController < ApplicationController
|
||||||
menu_item :issues
|
menu_item :issues
|
||||||
@ -23,11 +19,8 @@ class TimelogController < ApplicationController
|
|||||||
before_filter :find_optional_project, :only => [:index]
|
before_filter :find_optional_project, :only => [:index]
|
||||||
accept_key_auth :index, :show, :create, :update, :destroy
|
accept_key_auth :index, :show, :create, :update, :destroy
|
||||||
|
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
helper :issues
|
|
||||||
include TimelogHelper
|
include TimelogHelper
|
||||||
helper :custom_fields
|
|
||||||
include CustomFieldsHelper
|
include CustomFieldsHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@ -40,37 +33,34 @@ class TimelogController < ApplicationController
|
|||||||
'hours' => 'hours'
|
'hours' => 'hours'
|
||||||
|
|
||||||
cond = ARCondition.new
|
cond = ARCondition.new
|
||||||
if @project.nil?
|
if @issue
|
||||||
cond << Project.allowed_to_condition(User.current, :view_time_entries)
|
|
||||||
elsif @issue.nil?
|
|
||||||
cond << @project.project_condition(Setting.display_subprojects_issues?)
|
|
||||||
else
|
|
||||||
cond << "#{Issue.table_name}.root_id = #{@issue.root_id} AND #{Issue.table_name}.lft >= #{@issue.lft} AND #{Issue.table_name}.rgt <= #{@issue.rgt}"
|
cond << "#{Issue.table_name}.root_id = #{@issue.root_id} AND #{Issue.table_name}.lft >= #{@issue.lft} AND #{Issue.table_name}.rgt <= #{@issue.rgt}"
|
||||||
|
elsif @project
|
||||||
|
cond << @project.project_condition(Setting.display_subprojects_issues?)
|
||||||
end
|
end
|
||||||
|
|
||||||
retrieve_date_range
|
retrieve_date_range
|
||||||
cond << ['spent_on BETWEEN ? AND ?', @from, @to]
|
cond << ['spent_on BETWEEN ? AND ?', @from, @to]
|
||||||
|
|
||||||
TimeEntry.visible_by(User.current) do
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
# Paginate results
|
# Paginate results
|
||||||
@entry_count = TimeEntry.count(:include => [:project, :issue], :conditions => cond.conditions)
|
@entry_count = TimeEntry.visible.count(:include => [:project, :issue], :conditions => cond.conditions)
|
||||||
@entry_pages = Paginator.new self, @entry_count, per_page_option, params['page']
|
@entry_pages = Paginator.new self, @entry_count, per_page_option, params['page']
|
||||||
@entries = TimeEntry.find(:all,
|
@entries = TimeEntry.visible.find(:all,
|
||||||
:include => [:project, :activity, :user, {:issue => :tracker}],
|
:include => [:project, :activity, :user, {:issue => :tracker}],
|
||||||
:conditions => cond.conditions,
|
:conditions => cond.conditions,
|
||||||
:order => sort_clause,
|
:order => sort_clause,
|
||||||
:limit => @entry_pages.items_per_page,
|
:limit => @entry_pages.items_per_page,
|
||||||
:offset => @entry_pages.current.offset)
|
:offset => @entry_pages.current.offset)
|
||||||
@total_hours = TimeEntry.sum(:hours, :include => [:project, :issue], :conditions => cond.conditions).to_f
|
@total_hours = TimeEntry.visible.sum(:hours, :include => [:project, :issue], :conditions => cond.conditions).to_f
|
||||||
|
|
||||||
render :layout => !request.xhr?
|
render :layout => !request.xhr?
|
||||||
}
|
}
|
||||||
format.api {
|
format.api {
|
||||||
@entry_count = TimeEntry.count(:include => [:project, :issue], :conditions => cond.conditions)
|
@entry_count = TimeEntry.visible.count(:include => [:project, :issue], :conditions => cond.conditions)
|
||||||
@entry_pages = Paginator.new self, @entry_count, per_page_option, params['page']
|
@entry_pages = Paginator.new self, @entry_count, per_page_option, params['page']
|
||||||
@entries = TimeEntry.find(:all,
|
@entries = TimeEntry.visible.find(:all,
|
||||||
:include => [:project, :activity, :user, {:issue => :tracker}],
|
:include => [:project, :activity, :user, {:issue => :tracker}],
|
||||||
:conditions => cond.conditions,
|
:conditions => cond.conditions,
|
||||||
:order => sort_clause,
|
:order => sort_clause,
|
||||||
@ -78,7 +68,7 @@ class TimelogController < ApplicationController
|
|||||||
:offset => @entry_pages.current.offset)
|
:offset => @entry_pages.current.offset)
|
||||||
}
|
}
|
||||||
format.atom {
|
format.atom {
|
||||||
entries = TimeEntry.find(:all,
|
entries = TimeEntry.visible.find(:all,
|
||||||
:include => [:project, :activity, :user, {:issue => :tracker}],
|
:include => [:project, :activity, :user, {:issue => :tracker}],
|
||||||
:conditions => cond.conditions,
|
:conditions => cond.conditions,
|
||||||
:order => "#{TimeEntry.table_name}.created_on DESC",
|
:order => "#{TimeEntry.table_name}.created_on DESC",
|
||||||
@ -87,7 +77,7 @@ class TimelogController < ApplicationController
|
|||||||
}
|
}
|
||||||
format.csv {
|
format.csv {
|
||||||
# Export all entries
|
# Export all entries
|
||||||
@entries = TimeEntry.find(:all,
|
@entries = TimeEntry.visible.find(:all,
|
||||||
:include => [:project, :activity, :user, {:issue => [:tracker, :assigned_to, :priority]}],
|
:include => [:project, :activity, :user, {:issue => [:tracker, :assigned_to, :priority]}],
|
||||||
:conditions => cond.conditions,
|
:conditions => cond.conditions,
|
||||||
:order => sort_clause)
|
:order => sort_clause)
|
||||||
@ -95,7 +85,6 @@ class TimelogController < ApplicationController
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def show
|
def show
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class TrackersController < ApplicationController
|
class TrackersController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2010 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class UsersController < ApplicationController
|
class UsersController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
@ -22,9 +18,7 @@ class UsersController < ApplicationController
|
|||||||
before_filter :find_user, :only => [:show, :edit, :update, :edit_membership, :destroy_membership]
|
before_filter :find_user, :only => [:show, :edit, :update, :edit_membership, :destroy_membership]
|
||||||
accept_key_auth :index, :show, :create, :update
|
accept_key_auth :index, :show, :create, :update
|
||||||
|
|
||||||
helper :sort
|
|
||||||
include SortHelper
|
include SortHelper
|
||||||
helper :custom_fields
|
|
||||||
include CustomFieldsHelper
|
include CustomFieldsHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@ -38,6 +32,9 @@ class UsersController < ApplicationController
|
|||||||
@limit = per_page_option
|
@limit = per_page_option
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scope = User
|
||||||
|
scope = scope.in_group(params[:group_id].to_i) if params[:group_id].present?
|
||||||
|
|
||||||
@status = params[:status] ? params[:status].to_i : 1
|
@status = params[:status] ? params[:status].to_i : 1
|
||||||
c = ARCondition.new(@status == 0 ? "status <> 0" : ["status = ?", @status])
|
c = ARCondition.new(@status == 0 ? "status <> 0" : ["status = ?", @status])
|
||||||
|
|
||||||
@ -46,17 +43,20 @@ class UsersController < ApplicationController
|
|||||||
c << ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ? OR LOWER(mail) LIKE ?", name, name, name, name]
|
c << ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ? OR LOWER(mail) LIKE ?", name, name, name, name]
|
||||||
end
|
end
|
||||||
|
|
||||||
@user_count = User.count(:conditions => c.conditions)
|
@user_count = scope.count(:conditions => c.conditions)
|
||||||
@user_pages = Paginator.new self, @user_count, @limit, params['page']
|
@user_pages = Paginator.new self, @user_count, @limit, params['page']
|
||||||
@offset ||= @user_pages.current.offset
|
@offset ||= @user_pages.current.offset
|
||||||
@users = User.find :all,
|
@users = scope.find :all,
|
||||||
:order => sort_clause,
|
:order => sort_clause,
|
||||||
:conditions => c.conditions,
|
:conditions => c.conditions,
|
||||||
:limit => @limit,
|
:limit => @limit,
|
||||||
:offset => @offset
|
:offset => @offset
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { render :layout => !request.xhr? }
|
format.html {
|
||||||
|
@groups = Group.all.sort
|
||||||
|
render :layout => !request.xhr?
|
||||||
|
}
|
||||||
format.api
|
format.api
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class VersionsController < ApplicationController
|
class VersionsController < ApplicationController
|
||||||
menu_item :roadmap
|
menu_item :roadmap
|
||||||
@ -23,8 +19,6 @@ class VersionsController < ApplicationController
|
|||||||
before_filter :find_project, :only => [:index, :new, :create, :close_completed]
|
before_filter :find_project, :only => [:index, :new, :create, :close_completed]
|
||||||
before_filter :authorize
|
before_filter :authorize
|
||||||
|
|
||||||
helper :custom_fields
|
|
||||||
helper :projects
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@trackers = @project.trackers.find(:all, :order => 'position')
|
@trackers = @project.trackers.find(:all, :order => 'position')
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class WatchersController < ApplicationController
|
class WatchersController < ApplicationController
|
||||||
before_filter :find_project
|
before_filter :find_project
|
||||||
@ -76,28 +72,22 @@ private
|
|||||||
|
|
||||||
def set_watcher(user, watching)
|
def set_watcher(user, watching)
|
||||||
@watched.set_watcher(user, watching)
|
@watched.set_watcher(user, watching)
|
||||||
if params[:replace].present?
|
|
||||||
if params[:replace].is_a? Array
|
|
||||||
replace_ids = params[:replace]
|
|
||||||
else
|
|
||||||
replace_ids = [params[:replace]]
|
|
||||||
end
|
|
||||||
else
|
|
||||||
replace_ids = ['watcher']
|
|
||||||
end
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to :back }
|
format.html { redirect_to :back }
|
||||||
format.js do
|
format.js do
|
||||||
render(:update) do |page|
|
if params[:replace].present?
|
||||||
replace_ids.each do |replace_id|
|
if params[:replace].is_a? Array
|
||||||
case replace_id
|
@replace_selectors = params[:replace]
|
||||||
when 'watchers'
|
|
||||||
page.replace_html 'watchers', :partial => 'watchers/watchers', :locals => {:watched => @watched}
|
|
||||||
else
|
else
|
||||||
page.replace_html replace_id, watcher_link(@watched, user, :replace => replace_ids)
|
@replace_selectors = params[:replace].split(',').map(&:strip)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
@replace_selectors = ['#watcher']
|
||||||
end
|
end
|
||||||
|
@user = user
|
||||||
|
|
||||||
|
render :action => 'replace_selectors'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue ::ActionController::RedirectBackError
|
rescue ::ActionController::RedirectBackError
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class WelcomeController < ApplicationController
|
class WelcomeController < ApplicationController
|
||||||
caches_action :robots
|
caches_action :robots
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
require 'diff'
|
require 'diff'
|
||||||
|
|
||||||
@ -38,13 +34,18 @@ class WikiController < ApplicationController
|
|||||||
|
|
||||||
verify :method => :post, :only => [:protect], :redirect_to => { :action => :show }
|
verify :method => :post, :only => [:protect], :redirect_to => { :action => :show }
|
||||||
|
|
||||||
helper :attachments
|
|
||||||
include AttachmentsHelper
|
include AttachmentsHelper
|
||||||
helper :watchers
|
|
||||||
|
|
||||||
# List of pages, sorted alphabetically and by parent (hierarchy)
|
# List of pages, sorted alphabetically and by parent (hierarchy)
|
||||||
def index
|
def index
|
||||||
load_pages_grouped_by_date_without_content
|
load_pages_for_index
|
||||||
|
@pages_by_parent_id = @pages.group_by(&:parent_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
# List of page, by last update
|
||||||
|
def date_index
|
||||||
|
load_pages_for_index
|
||||||
|
@pages_by_date = @pages.group_by {|p| p.updated_on.to_date}
|
||||||
end
|
end
|
||||||
|
|
||||||
# display a page (in editing mode if it doesn't exist)
|
# display a page (in editing mode if it doesn't exist)
|
||||||
@ -77,7 +78,6 @@ class WikiController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
@editable = editable?
|
@editable = editable?
|
||||||
render :action => 'show'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# edit an existing page or a new one
|
# edit an existing page or a new one
|
||||||
@ -92,10 +92,7 @@ class WikiController < ApplicationController
|
|||||||
@content.comments = nil
|
@content.comments = nil
|
||||||
|
|
||||||
# To prevent StaleObjectError exception when reverting to a previous version
|
# To prevent StaleObjectError exception when reverting to a previous version
|
||||||
@content.version = @page.content.version
|
@content.lock_version = @page.content.lock_version
|
||||||
rescue ActiveRecord::StaleObjectError
|
|
||||||
# Optimistic locking exception
|
|
||||||
flash[:error] = l(:notice_locking_conflict)
|
|
||||||
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 }
|
||||||
@ -117,6 +114,7 @@ class WikiController < ApplicationController
|
|||||||
redirect_to :action => 'show', :project_id => @project, :id => @page.title
|
redirect_to :action => 'show', :project_id => @project, :id => @page.title
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
params[:content].delete(:version) # The version count is automatically increased
|
||||||
@content.attributes = params[:content]
|
@content.attributes = params[:content]
|
||||||
@content.author = User.current
|
@content.author = User.current
|
||||||
# if page is new @page.save will also save content, but not if page isn't a new record
|
# if page is new @page.save will also save content, but not if page isn't a new record
|
||||||
@ -131,7 +129,8 @@ class WikiController < ApplicationController
|
|||||||
|
|
||||||
rescue ActiveRecord::StaleObjectError
|
rescue ActiveRecord::StaleObjectError
|
||||||
# Optimistic locking exception
|
# Optimistic locking exception
|
||||||
flash[:error] = l(:notice_locking_conflict)
|
flash.now[:error] = l(:notice_locking_conflict)
|
||||||
|
render :action => 'edit'
|
||||||
end
|
end
|
||||||
|
|
||||||
# rename a page
|
# rename a page
|
||||||
@ -157,7 +156,7 @@ class WikiController < ApplicationController
|
|||||||
@version_pages = Paginator.new self, @version_count, per_page_option, params['p']
|
@version_pages = Paginator.new self, @version_count, per_page_option, params['p']
|
||||||
# don't load text
|
# don't load text
|
||||||
@versions = @page.content.versions.find :all,
|
@versions = @page.content.versions.find :all,
|
||||||
:select => "id, author_id, comments, updated_on, version",
|
:select => "id, user_id, notes, created_at, version",
|
||||||
:order => 'version DESC',
|
:order => 'version DESC',
|
||||||
:limit => @version_pages.items_per_page + 1,
|
:limit => @version_pages.items_per_page + 1,
|
||||||
:offset => @version_pages.current.offset
|
:offset => @version_pages.current.offset
|
||||||
@ -216,10 +215,6 @@ class WikiController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def date_index
|
|
||||||
load_pages_grouped_by_date_without_content
|
|
||||||
end
|
|
||||||
|
|
||||||
def preview
|
def preview
|
||||||
page = @wiki.find_page(params[:id])
|
page = @wiki.find_page(params[:id])
|
||||||
# page is nil when previewing a new page
|
# page is nil when previewing a new page
|
||||||
@ -267,13 +262,7 @@ private
|
|||||||
helper.instance_method(:initial_page_content).bind(self).call(page)
|
helper.instance_method(:initial_page_content).bind(self).call(page)
|
||||||
end
|
end
|
||||||
|
|
||||||
# eager load information about last updates, without loading text
|
def load_pages_for_index
|
||||||
def load_pages_grouped_by_date_without_content
|
@pages = @wiki.pages.with_updated_on.all(:order => 'title', :include => {:wiki => :project})
|
||||||
@pages = @wiki.pages.find :all, :select => "#{WikiPage.table_name}.*, #{WikiContent.table_name}.updated_on",
|
|
||||||
:joins => "LEFT JOIN #{WikiContent.table_name} ON #{WikiContent.table_name}.page_id = #{WikiPage.table_name}.id",
|
|
||||||
:order => 'title'
|
|
||||||
@pages_by_date = @pages.group_by {|p| p.updated_on.to_date}
|
|
||||||
@pages_by_parent_id = @pages.group_by(&:parent_id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class WikisController < ApplicationController
|
class WikisController < ApplicationController
|
||||||
menu_item :settings
|
menu_item :settings
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class WorkflowsController < ApplicationController
|
class WorkflowsController < ApplicationController
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
@ -32,14 +28,17 @@ class WorkflowsController < ApplicationController
|
|||||||
|
|
||||||
if request.post?
|
if request.post?
|
||||||
Workflow.destroy_all( ["role_id=? and tracker_id=?", @role.id, @tracker.id])
|
Workflow.destroy_all( ["role_id=? and tracker_id=?", @role.id, @tracker.id])
|
||||||
(params[:issue_status] || []).each { |old, news|
|
(params[:issue_status] || []).each { |status_id, transitions|
|
||||||
news.each { |new|
|
transitions.each { |new_status_id, options|
|
||||||
@role.workflows.build(:tracker_id => @tracker.id, :old_status_id => old, :new_status_id => new)
|
author = options.is_a?(Array) && options.include?('author') && !options.include?('always')
|
||||||
|
assignee = options.is_a?(Array) && options.include?('assignee') && !options.include?('always')
|
||||||
|
@role.workflows.build(:tracker_id => @tracker.id, :old_status_id => status_id, :new_status_id => new_status_id, :author => author, :assignee => assignee)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if @role.save
|
if @role.save
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to :action => 'edit', :role_id => @role, :tracker_id => @tracker
|
redirect_to :action => 'edit', :role_id => @role, :tracker_id => @tracker
|
||||||
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -48,6 +47,14 @@ class WorkflowsController < ApplicationController
|
|||||||
@statuses = @tracker.issue_statuses
|
@statuses = @tracker.issue_statuses
|
||||||
end
|
end
|
||||||
@statuses ||= IssueStatus.find(:all, :order => 'position')
|
@statuses ||= IssueStatus.find(:all, :order => 'position')
|
||||||
|
|
||||||
|
if @tracker && @role && @statuses.any?
|
||||||
|
workflows = Workflow.all(:conditions => {:role_id => @role.id, :tracker_id => @tracker.id})
|
||||||
|
@workflows = {}
|
||||||
|
@workflows['always'] = workflows.select {|w| !w.author && !w.assignee}
|
||||||
|
@workflows['author'] = workflows.select {|w| w.author}
|
||||||
|
@workflows['assignee'] = workflows.select {|w| w.assignee}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def copy
|
def copy
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module AccountHelper
|
module AccountHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module AdminHelper
|
module AdminHelper
|
||||||
def project_status_options_for_select(selected)
|
def project_status_options_for_select(selected)
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2010 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
require 'forwardable'
|
require 'forwardable'
|
||||||
require 'cgi'
|
require 'cgi'
|
||||||
@ -192,15 +188,15 @@ module ApplicationHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_page_hierarchy(pages, node=nil)
|
def render_page_hierarchy(pages, node=nil, options={})
|
||||||
content = ''
|
content = ''
|
||||||
if pages[node]
|
if pages[node]
|
||||||
content << "<ul class=\"pages-hierarchy\">\n"
|
content << "<ul class=\"pages-hierarchy\">\n"
|
||||||
pages[node].each do |page|
|
pages[node].each do |page|
|
||||||
content << "<li>"
|
content << "<li>"
|
||||||
content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'show', :project_id => page.project, :id => page.title},
|
content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'show', :project_id => page.project, :id => page.title},
|
||||||
:title => (page.respond_to?(:updated_on) ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil))
|
:title => (options[:timestamp] && page.updated_on ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil))
|
||||||
content << "\n" + render_page_hierarchy(pages, page.id) if pages[page.id]
|
content << "\n" + render_page_hierarchy(pages, page.id, options) if pages[page.id]
|
||||||
content << "</li>\n"
|
content << "</li>\n"
|
||||||
end
|
end
|
||||||
content << "</ul>\n"
|
content << "</ul>\n"
|
||||||
@ -228,8 +224,7 @@ module ApplicationHelper
|
|||||||
|
|
||||||
# Renders the project quick-jump box
|
# Renders the project quick-jump box
|
||||||
def render_project_jump_box
|
def render_project_jump_box
|
||||||
# Retrieve them now to avoid a COUNT query
|
projects = User.current.memberships.collect(&:project).compact.uniq
|
||||||
projects = User.current.projects.all
|
|
||||||
if projects.any?
|
if projects.any?
|
||||||
s = '<select onchange="if (this.value != \'\') { window.location = this.value; }">' +
|
s = '<select onchange="if (this.value != \'\') { window.location = this.value; }">' +
|
||||||
"<option value=''>#{ l(:label_jump_to_a_project) }</option>" +
|
"<option value=''>#{ l(:label_jump_to_a_project) }</option>" +
|
||||||
@ -346,15 +341,15 @@ module ApplicationHelper
|
|||||||
|
|
||||||
html = ''
|
html = ''
|
||||||
if paginator.current.previous
|
if paginator.current.previous
|
||||||
html << link_to_remote_content_update('« ' + l(:label_previous), url_param.merge(page_param => paginator.current.previous)) + ' '
|
html << link_to_content_update('« ' + l(:label_previous), url_param.merge(page_param => paginator.current.previous)) + ' '
|
||||||
end
|
end
|
||||||
|
|
||||||
html << (pagination_links_each(paginator, options) do |n|
|
html << (pagination_links_each(paginator, options) do |n|
|
||||||
link_to_remote_content_update(n.to_s, url_param.merge(page_param => n))
|
link_to_content_update(n.to_s, url_param.merge(page_param => n))
|
||||||
end || '')
|
end || '')
|
||||||
|
|
||||||
if paginator.current.next
|
if paginator.current.next
|
||||||
html << ' ' + link_to_remote_content_update((l(:label_next) + ' »'), url_param.merge(page_param => paginator.current.next))
|
html << ' ' + link_to_content_update((l(:label_next) + ' »'), url_param.merge(page_param => paginator.current.next))
|
||||||
end
|
end
|
||||||
|
|
||||||
unless count.nil?
|
unless count.nil?
|
||||||
@ -368,14 +363,8 @@ module ApplicationHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def per_page_links(selected=nil)
|
def per_page_links(selected=nil)
|
||||||
url_param = params.dup
|
|
||||||
url_param.clear if url_param.has_key?(:set_filter)
|
|
||||||
|
|
||||||
links = Setting.per_page_options_array.collect do |n|
|
links = Setting.per_page_options_array.collect do |n|
|
||||||
n == selected ? n : link_to_remote(n, {:update => "content",
|
n == selected ? n : link_to_content_update(n, params.merge(:per_page => n))
|
||||||
:url => params.dup.merge(:per_page => n),
|
|
||||||
:method => :get},
|
|
||||||
{:href => url_for(url_param.merge(:per_page => n))})
|
|
||||||
end
|
end
|
||||||
links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil
|
links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil
|
||||||
end
|
end
|
||||||
@ -718,7 +707,7 @@ module ApplicationHelper
|
|||||||
item = strip_tags(content).strip
|
item = strip_tags(content).strip
|
||||||
anchor = item.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
|
anchor = item.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
|
||||||
@parsed_headings << [level, anchor, item]
|
@parsed_headings << [level, anchor, item]
|
||||||
"<h#{level} #{attrs} id=\"#{anchor}\">#{content}<a href=\"##{anchor}\" class=\"wiki-anchor\">¶</a></h#{level}>"
|
"<a name=\"#{anchor}\"></a>\n<h#{level} #{attrs}>#{content}<a href=\"##{anchor}\" class=\"wiki-anchor\">¶</a></h#{level}>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -860,6 +849,8 @@ module ApplicationHelper
|
|||||||
'Calendar._FD = 1;' # Monday
|
'Calendar._FD = 1;' # Monday
|
||||||
when 7
|
when 7
|
||||||
'Calendar._FD = 0;' # Sunday
|
'Calendar._FD = 0;' # Sunday
|
||||||
|
when 6
|
||||||
|
'Calendar._FD = 6;' # Saturday
|
||||||
else
|
else
|
||||||
'' # use language
|
'' # use language
|
||||||
end
|
end
|
||||||
@ -900,6 +891,15 @@ module ApplicationHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the javascript tags that are included in the html layout head
|
||||||
|
def javascript_heads
|
||||||
|
tags = javascript_include_tag(:defaults)
|
||||||
|
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) )}'); });")
|
||||||
|
end
|
||||||
|
tags
|
||||||
|
end
|
||||||
|
|
||||||
def favicon
|
def favicon
|
||||||
"<link rel='shortcut icon' href='#{image_path('/favicon.ico')}' />"
|
"<link rel='shortcut icon' href='#{image_path('/favicon.ico')}' />"
|
||||||
end
|
end
|
||||||
@ -942,11 +942,7 @@ module ApplicationHelper
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
def link_to_remote_content_update(text, url_params)
|
def link_to_content_update(text, url_params = {}, html_options = {})
|
||||||
link_to_remote(text,
|
link_to(text, url_params, html_options)
|
||||||
{:url => url_params, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'},
|
|
||||||
{:href => url_for(:params => url_params)}
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
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
|
||||||
@ -28,7 +24,7 @@ module AttachmentsHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_utf8(str)
|
def to_utf8_for_attachments(str)
|
||||||
if str.respond_to?(:force_encoding)
|
if str.respond_to?(:force_encoding)
|
||||||
str.force_encoding('UTF-8')
|
str.force_encoding('UTF-8')
|
||||||
return str if str.valid_encoding?
|
return str if str.valid_encoding?
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module AuthSourcesHelper
|
module AuthSourcesHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module BoardsHelper
|
module BoardsHelper
|
||||||
end
|
end
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
module CalendarsHelper
|
module CalendarsHelper
|
||||||
def link_to_previous_month(year, month, options={})
|
def link_to_previous_month(year, month, options={})
|
||||||
target_year, target_month = if month == 1
|
target_year, target_month = if month == 1
|
||||||
@ -32,14 +45,6 @@ module CalendarsHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def link_to_month(link_name, year, month, options={})
|
def link_to_month(link_name, year, month, options={})
|
||||||
project_id = options[:project].present? ? options[:project].to_param : nil
|
link_to_content_update(link_name, params.merge(:year => year, :month => month))
|
||||||
|
|
||||||
link_target = calendar_path(:year => year, :month => month, :project_id => project_id)
|
|
||||||
|
|
||||||
link_to_remote(link_name,
|
|
||||||
{:update => "content", :url => link_target, :method => :put},
|
|
||||||
{:href => link_target})
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module CustomFieldsHelper
|
module CustomFieldsHelper
|
||||||
|
|
||||||
@ -37,7 +33,7 @@ module CustomFieldsHelper
|
|||||||
field_id = "#{name}_custom_field_values_#{custom_field.id}"
|
field_id = "#{name}_custom_field_values_#{custom_field.id}"
|
||||||
|
|
||||||
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.edit_as
|
case field_format.try(:edit_as)
|
||||||
when "date"
|
when "date"
|
||||||
text_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)
|
calendar_for(field_id)
|
||||||
@ -49,7 +45,7 @@ module CustomFieldsHelper
|
|||||||
blank_option = custom_field.is_required? ?
|
blank_option = custom_field.is_required? ?
|
||||||
(custom_field.default_value.blank? ? "<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" : '') :
|
(custom_field.default_value.blank? ? "<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>" : '') :
|
||||||
'<option></option>'
|
'<option></option>'
|
||||||
select_tag(field_name, blank_option + options_for_select(custom_field.possible_values, custom_value.value), :id => field_id)
|
select_tag(field_name, blank_option + options_for_select(custom_field.possible_values_options(custom_value.customized), custom_value.value), :id => field_id)
|
||||||
else
|
else
|
||||||
text_field_tag(field_name, custom_value.value, :id => field_id)
|
text_field_tag(field_name, custom_value.value, :id => field_id)
|
||||||
end
|
end
|
||||||
@ -72,7 +68,7 @@ module CustomFieldsHelper
|
|||||||
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
|
field_name = "#{name}[custom_field_values][#{custom_field.id}]"
|
||||||
field_id = "#{name}_custom_field_values_#{custom_field.id}"
|
field_id = "#{name}_custom_field_values_#{custom_field.id}"
|
||||||
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.edit_as
|
case field_format.try(:edit_as)
|
||||||
when "date"
|
when "date"
|
||||||
text_field_tag(field_name, '', :id => field_id, :size => 10) +
|
text_field_tag(field_name, '', :id => field_id, :size => 10) +
|
||||||
calendar_for(field_id)
|
calendar_for(field_id)
|
||||||
@ -83,7 +79,7 @@ module CustomFieldsHelper
|
|||||||
[l(:general_text_yes), '1'],
|
[l(:general_text_yes), '1'],
|
||||||
[l(:general_text_no), '0']]), :id => field_id)
|
[l(:general_text_no), '0']]), :id => field_id)
|
||||||
when "list"
|
when "list"
|
||||||
select_tag(field_name, options_for_select([[l(:label_no_change_option), '']] + custom_field.possible_values), :id => field_id)
|
select_tag(field_name, options_for_select([[l(:label_no_change_option), '']] + custom_field.possible_values_options), :id => field_id)
|
||||||
else
|
else
|
||||||
text_field_tag(field_name, '', :id => field_id)
|
text_field_tag(field_name, '', :id => field_id)
|
||||||
end
|
end
|
||||||
@ -101,8 +97,8 @@ module CustomFieldsHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Return an array of custom field formats which can be used in select_tag
|
# Return an array of custom field formats which can be used in select_tag
|
||||||
def custom_field_formats_for_select
|
def custom_field_formats_for_select(custom_field)
|
||||||
Redmine::CustomFieldFormat.as_select
|
Redmine::CustomFieldFormat.as_select(custom_field.class.customized_class.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Renders the custom_values in api views
|
# Renders the custom_values in api views
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module DocumentsHelper
|
module DocumentsHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module EnumerationsHelper
|
module EnumerationsHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module GanttHelper
|
module GanttHelper
|
||||||
|
|
||||||
@ -21,29 +17,21 @@ module GanttHelper
|
|||||||
case in_or_out
|
case in_or_out
|
||||||
when :in
|
when :in
|
||||||
if gantt.zoom < 4
|
if gantt.zoom < 4
|
||||||
link_to_remote(l(:text_zoom_in),
|
link_to_content_update l(:text_zoom_in),
|
||||||
{:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :method => :get, :update => 'content'},
|
params.merge(gantt.params.merge(:zoom => (gantt.zoom+1))),
|
||||||
{:href => url_for(gantt.params.merge(:zoom => (gantt.zoom+1))),
|
:class => 'icon icon-zoom-in'
|
||||||
:class => 'icon icon-zoom-in'})
|
|
||||||
else
|
else
|
||||||
content_tag('span', l(:text_zoom_in), :class => 'icon icon-zoom-in')
|
content_tag('span', l(:text_zoom_in), :class => 'icon icon-zoom-in')
|
||||||
end
|
end
|
||||||
|
|
||||||
when :out
|
when :out
|
||||||
if gantt.zoom > 1
|
if gantt.zoom > 1
|
||||||
link_to_remote(l(:text_zoom_out),
|
link_to_content_update l(:text_zoom_out),
|
||||||
{:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :method => :get, :update => 'content'},
|
params.merge(gantt.params.merge(:zoom => (gantt.zoom-1))),
|
||||||
{:href => url_for(gantt.params.merge(:zoom => (gantt.zoom-1))),
|
:class => 'icon icon-zoom-out'
|
||||||
:class => 'icon icon-zoom-out'})
|
|
||||||
else
|
else
|
||||||
content_tag('span', l(:text_zoom_out), :class => 'icon icon-zoom-out')
|
content_tag('span', l(:text_zoom_out), :class => 'icon icon-zoom-out')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def number_of_issues_on_versions(gantt)
|
|
||||||
versions = gantt.events.collect {|event| (event.is_a? Version) ? event : nil}.compact
|
|
||||||
|
|
||||||
versions.sum {|v| v.fixed_issues.for_gantt.with_query(@query).count}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module GroupsHelper
|
module GroupsHelper
|
||||||
# Options for the new membership projects combo-box
|
# Options for the new membership projects combo-box
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module IssueCategoriesHelper
|
module IssueCategoriesHelper
|
||||||
end
|
end
|
||||||
|
@ -1,2 +1,15 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
module IssueMovesHelper
|
module IssueMovesHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module IssueRelationsHelper
|
module IssueRelationsHelper
|
||||||
def collection_for_relation_type_select
|
def collection_for_relation_type_select
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module IssueStatusesHelper
|
module IssueStatusesHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module IssuesHelper
|
module IssuesHelper
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
@ -57,11 +53,12 @@ module IssuesHelper
|
|||||||
|
|
||||||
def render_issue_subject_with_tree(issue)
|
def render_issue_subject_with_tree(issue)
|
||||||
s = ''
|
s = ''
|
||||||
issue.ancestors.each do |ancestor|
|
ancestors = issue.root? ? [] : issue.ancestors.all
|
||||||
|
ancestors.each do |ancestor|
|
||||||
s << '<div>' + content_tag('p', link_to_issue(ancestor))
|
s << '<div>' + content_tag('p', link_to_issue(ancestor))
|
||||||
end
|
end
|
||||||
s << '<div>' + content_tag('h3', h(issue.subject))
|
s << '<div>' + content_tag('h3', h(issue.subject))
|
||||||
s << '</div>' * (issue.ancestors.size + 1)
|
s << '</div>' * (ancestors.size + 1)
|
||||||
s
|
s
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -106,13 +103,32 @@ module IssuesHelper
|
|||||||
# Project specific queries and global queries
|
# Project specific queries and global queries
|
||||||
visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
|
visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
|
||||||
@sidebar_queries = Query.find(:all,
|
@sidebar_queries = Query.find(:all,
|
||||||
:select => 'id, name',
|
:select => 'id, name, is_public',
|
||||||
:order => "name ASC",
|
:order => "name ASC",
|
||||||
:conditions => visible.conditions)
|
:conditions => visible.conditions)
|
||||||
end
|
end
|
||||||
@sidebar_queries
|
@sidebar_queries
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def query_links(title, queries)
|
||||||
|
# links to #index on issues/show
|
||||||
|
url_params = controller_name == 'issues' ? {:controller => 'issues', :action => 'index', :project_id => @project} : params
|
||||||
|
|
||||||
|
content_tag('h3', title) +
|
||||||
|
queries.collect {|query|
|
||||||
|
link_to(h(query.name), url_params.merge(:query_id => query))
|
||||||
|
}.join('<br />')
|
||||||
|
end
|
||||||
|
|
||||||
|
def render_sidebar_queries
|
||||||
|
out = ''
|
||||||
|
queries = sidebar_queries.select {|q| !q.is_public?}
|
||||||
|
out << query_links(l(:label_my_queries), queries) if queries.any?
|
||||||
|
queries = sidebar_queries.select {|q| q.is_public?}
|
||||||
|
out << query_links(l(:label_query_plural), queries) if queries.any?
|
||||||
|
out
|
||||||
|
end
|
||||||
|
|
||||||
def show_detail(detail, no_html=false)
|
def show_detail(detail, no_html=false)
|
||||||
case detail.property
|
case detail.property
|
||||||
when 'attr'
|
when 'attr'
|
||||||
@ -164,7 +180,16 @@ module IssuesHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if !detail.value.blank?
|
if detail.property == 'attr' && detail.prop_key == 'description'
|
||||||
|
s = l(:text_journal_changed_no_detail, :label => label)
|
||||||
|
unless no_html
|
||||||
|
diff_link = link_to 'diff',
|
||||||
|
{:controller => 'journals', :action => 'diff', :id => detail.journal_id, :detail_id => detail.id},
|
||||||
|
:title => l(:label_view_diff)
|
||||||
|
s << " (#{ diff_link })"
|
||||||
|
end
|
||||||
|
s
|
||||||
|
elsif !detail.value.blank?
|
||||||
case detail.property
|
case detail.property
|
||||||
when 'attr', 'cf'
|
when 'attr', 'cf'
|
||||||
if !detail.old_value.blank?
|
if !detail.old_value.blank?
|
||||||
@ -260,4 +285,14 @@ module IssuesHelper
|
|||||||
end
|
end
|
||||||
export
|
export
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def send_notification_option
|
||||||
|
content_tag(:p,
|
||||||
|
content_tag(:label,
|
||||||
|
l(:label_notify_member_plural)) +
|
||||||
|
hidden_field_tag('send_notification', '0') +
|
||||||
|
check_box_tag('send_notification', '1', true))
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,37 +1,93 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module JournalsHelper
|
module JournalsHelper
|
||||||
def render_notes(issue, journal, options={})
|
unloadable
|
||||||
content = ''
|
include ApplicationHelper
|
||||||
editable = User.current.logged? && (User.current.allowed_to?(:edit_issue_notes, issue.project) || (journal.user == User.current && User.current.allowed_to?(:edit_own_issue_notes, issue.project)))
|
include ActionView::Helpers::TagHelper
|
||||||
links = []
|
|
||||||
if !journal.notes.blank?
|
def self.included(base)
|
||||||
links << link_to_remote(image_tag('comment.png'),
|
base.class_eval do
|
||||||
{ :url => {:controller => 'journals', :action => 'new', :id => issue, :journal_id => journal} },
|
if respond_to? :before_filter
|
||||||
:title => l(:button_quote)) if options[:reply_links]
|
before_filter :find_optional_journal, :only => [:edit]
|
||||||
links << link_to_in_place_notes_editor(image_tag('edit.png'), "journal-#{journal.id}-notes",
|
|
||||||
{ :controller => 'journals', :action => 'edit', :id => journal },
|
|
||||||
:title => l(:button_edit)) if editable
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def render_journal(model, journal, options = {})
|
||||||
|
return "" if journal.initial?
|
||||||
|
journal_content = render_journal_details(journal, :label_updated_time_by)
|
||||||
|
journal_content += render_notes(model, journal, options) unless journal.notes.blank?
|
||||||
|
content_tag "div", journal_content, { :id => "change-#{journal.id}", :class => journal.css_classes }
|
||||||
|
end
|
||||||
|
|
||||||
|
# This renders a journal entry wiht a header and details
|
||||||
|
def render_journal_details(journal, header_label = :label_updated_time_by)
|
||||||
|
header = <<-HTML
|
||||||
|
<h4>
|
||||||
|
<div style="float:right;">#{link_to "##{journal.anchor}", :anchor => "note-#{journal.anchor}"}</div>
|
||||||
|
#{avatar(journal.user, :size => "24")}
|
||||||
|
#{content_tag('a', '', :name => "note-#{journal.anchor}")}
|
||||||
|
#{authoring journal.created_at, journal.user, :label => header_label}
|
||||||
|
</h4>
|
||||||
|
HTML
|
||||||
|
|
||||||
|
if journal.details.any?
|
||||||
|
details = content_tag "ul", :class => "details" do
|
||||||
|
journal.details.collect do |detail|
|
||||||
|
if d = journal.render_detail(detail)
|
||||||
|
content_tag("li", d)
|
||||||
|
end
|
||||||
|
end.compact
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
content_tag("div", "#{header}#{details}", :id => "change-#{journal.id}", :class => "journal")
|
||||||
|
end
|
||||||
|
|
||||||
|
def render_notes(model, journal, options={})
|
||||||
|
controller = model.class.name.downcase.pluralize
|
||||||
|
action = 'edit'
|
||||||
|
reply_links = authorize_for(controller, action)
|
||||||
|
|
||||||
|
if User.current.logged?
|
||||||
|
editable = User.current.allowed_to?(options[:edit_permission], journal.project) if options[:edit_permission]
|
||||||
|
if journal.user == User.current && options[:edit_own_permission]
|
||||||
|
editable ||= User.current.allowed_to?(options[:edit_own_permission], journal.project)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
unless journal.notes.blank?
|
||||||
|
links = [].tap do |l|
|
||||||
|
if reply_links
|
||||||
|
l << link_to_remote(image_tag('comment.png'), :title => l(:button_quote),
|
||||||
|
:url => {:controller => controller, :action => action, :id => model, :journal_id => journal})
|
||||||
|
end
|
||||||
|
if editable
|
||||||
|
l << link_to_in_place_notes_editor(image_tag('edit.png'), "journal-#{journal.id}-notes",
|
||||||
|
{ :controller => 'journals', :action => 'edit', :id => journal },
|
||||||
|
:title => l(:button_edit))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
content = ''
|
||||||
content << content_tag('div', links.join(' '), :class => 'contextual') unless links.empty?
|
content << content_tag('div', links.join(' '), :class => 'contextual') unless links.empty?
|
||||||
content << textilizable(journal, :notes)
|
content << textilizable(journal, :notes)
|
||||||
|
|
||||||
css_classes = "wiki"
|
css_classes = "wiki"
|
||||||
css_classes << " editable" if editable
|
css_classes << " editable" if editable
|
||||||
|
|
||||||
content_tag('div', content, :id => "journal-#{journal.id}-notes", :class => css_classes)
|
content_tag('div', content, :id => "journal-#{journal.id}-notes", :class => css_classes)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -39,4 +95,27 @@ module JournalsHelper
|
|||||||
onclick = "new Ajax.Request('#{url_for(url)}', {asynchronous:true, evalScripts:true, method:'get'}); return false;"
|
onclick = "new Ajax.Request('#{url_for(url)}', {asynchronous:true, evalScripts:true, method:'get'}); return false;"
|
||||||
link_to text, '#', options.merge(:onclick => onclick)
|
link_to text, '#', options.merge(:onclick => onclick)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# This may conveniently be used by controllers to find journals referred to in the current request
|
||||||
|
def find_optional_journal
|
||||||
|
@journal = Journal.find_by_id(params[:journal_id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def render_reply(journal)
|
||||||
|
user = journal.user
|
||||||
|
text = journal.notes
|
||||||
|
|
||||||
|
# Replaces pre blocks with [...]
|
||||||
|
text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
|
||||||
|
content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
|
||||||
|
content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
|
||||||
|
|
||||||
|
render(:update) do |page|
|
||||||
|
page << "$('notes').value = \"#{escape_javascript content}\";"
|
||||||
|
page.show 'update'
|
||||||
|
page << "Form.Element.focus('notes');"
|
||||||
|
page << "Element.scrollTo('update');"
|
||||||
|
page << "$('notes').scrollTop = $('notes').scrollHeight - $('notes').clientHeight;"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module MailHandlerHelper
|
module MailHandlerHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module MembersHelper
|
module MembersHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module MessagesHelper
|
module MessagesHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module MyHelper
|
module MyHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module NewsHelper
|
module NewsHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module ProjectsHelper
|
module ProjectsHelper
|
||||||
def link_to_version(version, options = {})
|
def link_to_version(version, options = {})
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module QueriesHelper
|
module QueriesHelper
|
||||||
|
|
||||||
@ -78,16 +74,16 @@ module QueriesHelper
|
|||||||
# Give it a name, required to be valid
|
# Give it a name, required to be valid
|
||||||
@query = Query.new(:name => "_")
|
@query = Query.new(:name => "_")
|
||||||
@query.project = @project
|
@query.project = @project
|
||||||
if params[:fields]
|
if params[:fields] || params[:f]
|
||||||
@query.filters = {}
|
@query.filters = {}
|
||||||
@query.add_filters(params[:fields], params[:operators], params[:values])
|
@query.add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v])
|
||||||
else
|
else
|
||||||
@query.available_filters.keys.each do |field|
|
@query.available_filters.keys.each do |field|
|
||||||
@query.add_short_filter(field, params[field]) if params[field]
|
@query.add_short_filter(field, params[field]) if params[field]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@query.group_by = params[:group_by]
|
@query.group_by = params[:group_by]
|
||||||
@query.column_names = params[:query] && params[:query][:column_names]
|
@query.column_names = params[:c] || (params[:query] && params[:query][:column_names])
|
||||||
session[:query] = {:project_id => @query.project_id, :filters => @query.filters, :group_by => @query.group_by, :column_names => @query.column_names}
|
session[:query] = {:project_id => @query.project_id, :filters => @query.filters, :group_by => @query.group_by, :column_names => @query.column_names}
|
||||||
else
|
else
|
||||||
@query = Query.find_by_id(session[:query][:id]) if session[:query][:id]
|
@query = Query.find_by_id(session[:query][:id]) if session[:query][:id]
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module ReportsHelper
|
module ReportsHelper
|
||||||
|
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
require 'iconv'
|
require 'iconv'
|
||||||
|
|
||||||
@ -116,14 +112,25 @@ module RepositoriesHelper
|
|||||||
output
|
output
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_utf8(str)
|
def to_utf8_for_repositories(str)
|
||||||
|
return str if str.nil?
|
||||||
|
str = to_utf8_internal(str)
|
||||||
if str.respond_to?(:force_encoding)
|
if str.respond_to?(:force_encoding)
|
||||||
str.force_encoding('UTF-8')
|
str.force_encoding('UTF-8')
|
||||||
return str if str.valid_encoding?
|
end
|
||||||
else
|
str
|
||||||
return str if /\A[\r\n\t\x20-\x7e]*\Z/n.match(str) # for us-ascii
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def to_utf8_internal(str)
|
||||||
|
return str if str.nil?
|
||||||
|
if str.respond_to?(:force_encoding)
|
||||||
|
str.force_encoding('ASCII-8BIT')
|
||||||
|
end
|
||||||
|
return str if str.empty?
|
||||||
|
return str if /\A[\r\n\t\x20-\x7e]*\Z/n.match(str) # for us-ascii
|
||||||
|
if str.respond_to?(:force_encoding)
|
||||||
|
str.force_encoding('UTF-8')
|
||||||
|
end
|
||||||
@encodings ||= Setting.repositories_encodings.split(',').collect(&:strip)
|
@encodings ||= Setting.repositories_encodings.split(',').collect(&:strip)
|
||||||
@encodings.each do |encoding|
|
@encodings.each do |encoding|
|
||||||
begin
|
begin
|
||||||
@ -132,24 +139,56 @@ module RepositoriesHelper
|
|||||||
# do nothing here and try the next encoding
|
# do nothing here and try the next encoding
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
str = replace_invalid_utf8(str)
|
||||||
|
end
|
||||||
|
private :to_utf8_internal
|
||||||
|
|
||||||
|
def replace_invalid_utf8(str)
|
||||||
|
return str if str.nil?
|
||||||
|
if str.respond_to?(:force_encoding)
|
||||||
|
str.force_encoding('UTF-8')
|
||||||
|
if ! str.valid_encoding?
|
||||||
|
str = str.encode("US-ASCII", :invalid => :replace,
|
||||||
|
:undef => :replace, :replace => '?').encode("UTF-8")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
# removes invalid UTF8 sequences
|
||||||
|
begin
|
||||||
|
str = Iconv.conv('UTF-8//IGNORE', 'UTF-8', str + ' ')[0..-3]
|
||||||
|
rescue Iconv::InvalidEncoding
|
||||||
|
# "UTF-8//IGNORE" is not supported on some OS
|
||||||
|
end
|
||||||
|
end
|
||||||
str
|
str
|
||||||
end
|
end
|
||||||
|
|
||||||
def repository_field_tags(form, repository)
|
def repository_field_tags(form, repository)
|
||||||
method = repository.class.name.demodulize.underscore + "_field_tags"
|
method = repository.class.name.demodulize.underscore + "_field_tags"
|
||||||
send(method, form, repository) if repository.is_a?(Repository) && respond_to?(method) && method != 'repository_field_tags'
|
if repository.is_a?(Repository) &&
|
||||||
|
respond_to?(method) && method != 'repository_field_tags'
|
||||||
|
send(method, form, repository)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def scm_select_tag(repository)
|
def scm_select_tag(repository)
|
||||||
scm_options = [["--- #{l(:actionview_instancetag_blank_option)} ---", '']]
|
scm_options = [["--- #{l(:actionview_instancetag_blank_option)} ---", '']]
|
||||||
Redmine::Scm::Base.all.each do |scm|
|
Redmine::Scm::Base.all.each do |scm|
|
||||||
scm_options << ["Repository::#{scm}".constantize.scm_name, scm] if Setting.enabled_scm.include?(scm) || (repository && repository.class.name.demodulize == scm)
|
if Setting.enabled_scm.include?(scm) ||
|
||||||
|
(repository && repository.class.name.demodulize == scm)
|
||||||
|
scm_options << ["Repository::#{scm}".constantize.scm_name, scm]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
select_tag('repository_scm',
|
select_tag('repository_scm',
|
||||||
options_for_select(scm_options, repository.class.name.demodulize),
|
options_for_select(scm_options, repository.class.name.demodulize),
|
||||||
:disabled => (repository && !repository.new_record?),
|
:disabled => (repository && !repository.new_record?),
|
||||||
:onchange => remote_function(:url => { :controller => 'repositories', :action => 'edit', :id => @project }, :method => :get, :with => "Form.serialize(this.form)")
|
:onchange => remote_function(
|
||||||
|
:url => {
|
||||||
|
:controller => 'repositories',
|
||||||
|
:action => 'edit',
|
||||||
|
:id => @project
|
||||||
|
},
|
||||||
|
:method => :get,
|
||||||
|
:with => "Form.serialize(this.form)")
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -172,27 +211,46 @@ module RepositoriesHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def darcs_field_tags(form, repository)
|
def darcs_field_tags(form, repository)
|
||||||
content_tag('p', form.text_field(:url, :label => :label_darcs_path, :size => 60, :required => true, :disabled => (repository && !repository.new_record?)))
|
content_tag('p', form.text_field(:url, :label => :label_darcs_path, :size => 60, :required => true, :disabled => (repository && !repository.new_record?))) +
|
||||||
|
content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
|
||||||
|
:label => l(:setting_commit_logs_encoding), :required => true))
|
||||||
end
|
end
|
||||||
|
|
||||||
def mercurial_field_tags(form, repository)
|
def mercurial_field_tags(form, repository)
|
||||||
content_tag('p', form.text_field(:url, :label => :label_mercurial_path, :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
|
content_tag('p', form.text_field(:url, :label => :label_mercurial_path, :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)) +
|
||||||
|
'<br />' + l(:text_mercurial_repo_example)) +
|
||||||
|
content_tag('p', form.select(:path_encoding, [nil] + Setting::ENCODINGS,
|
||||||
|
:label => l(:label_path_encoding)) +
|
||||||
|
'<br />' + l(:text_default_encoding))
|
||||||
end
|
end
|
||||||
|
|
||||||
def git_field_tags(form, repository)
|
def git_field_tags(form, repository)
|
||||||
content_tag('p', form.text_field(:url, :label => :label_git_path, :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
|
content_tag('p', form.text_field(:url, :label => :label_git_path, :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)) +
|
||||||
|
'<br />' + l(:text_git_repo_example)) +
|
||||||
|
content_tag('p', form.select(
|
||||||
|
:path_encoding, [nil] + Setting::ENCODINGS,
|
||||||
|
:label => l(:label_path_encoding)) +
|
||||||
|
'<br />' + l(:text_default_encoding))
|
||||||
end
|
end
|
||||||
|
|
||||||
def cvs_field_tags(form, repository)
|
def cvs_field_tags(form, repository)
|
||||||
content_tag('p', form.text_field(:root_url, :label => :label_cvs_path, :size => 60, :required => true, :disabled => !repository.new_record?)) +
|
content_tag('p', form.text_field(:root_url, :label => :label_cvs_path, :size => 60, :required => true, :disabled => !repository.new_record?)) +
|
||||||
content_tag('p', form.text_field(:url, :label => :label_cvs_module, :size => 30, :required => true, :disabled => !repository.new_record?))
|
content_tag('p', form.text_field(:url, :label => :label_cvs_module, :size => 30, :required => true, :disabled => !repository.new_record?)) +
|
||||||
|
content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
|
||||||
|
:label => l(:setting_commit_logs_encoding), :required => true))
|
||||||
end
|
end
|
||||||
|
|
||||||
def bazaar_field_tags(form, repository)
|
def bazaar_field_tags(form, repository)
|
||||||
content_tag('p', form.text_field(:url, :label => :label_bazaar_path, :size => 60, :required => true, :disabled => (repository && !repository.new_record?)))
|
content_tag('p', form.text_field(:url, :label => :label_bazaar_path, :size => 60, :required => true, :disabled => (repository && !repository.new_record?))) +
|
||||||
|
content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
|
||||||
|
:label => l(:setting_commit_logs_encoding), :required => true))
|
||||||
end
|
end
|
||||||
|
|
||||||
def filesystem_field_tags(form, repository)
|
def filesystem_field_tags(form, repository)
|
||||||
content_tag('p', form.text_field(:url, :label => :label_filesystem_path, :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)))
|
content_tag('p', form.text_field(:url, :label => :label_filesystem_path, :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?))) +
|
||||||
|
content_tag('p', form.select(:path_encoding, [nil] + Setting::ENCODINGS,
|
||||||
|
:label => l(:label_path_encoding)) +
|
||||||
|
'<br />' + l(:text_default_encoding))
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module RolesHelper
|
module RolesHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module SearchHelper
|
module SearchHelper
|
||||||
def highlight_tokens(text, tokens)
|
def highlight_tokens(text, tokens)
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module SettingsHelper
|
module SettingsHelper
|
||||||
def administration_settings_tabs
|
def administration_settings_tabs
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
#-- copyright
|
||||||
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
|
#++
|
||||||
|
|
||||||
# Helpers to sort tables using clickable column headers.
|
# Helpers to sort tables using clickable column headers.
|
||||||
#
|
#
|
||||||
# Author: Stuart Rackham <srackham@methods.co.nz>, March 2005.
|
# Author: Stuart Rackham <srackham@methods.co.nz>, March 2005.
|
||||||
@ -200,16 +213,12 @@ module SortHelper
|
|||||||
caption = column.to_s.humanize unless caption
|
caption = column.to_s.humanize unless caption
|
||||||
|
|
||||||
sort_options = { :sort => @sort_criteria.add(column.to_s, order).to_param }
|
sort_options = { :sort => @sort_criteria.add(column.to_s, order).to_param }
|
||||||
# don't reuse params if filters are present
|
url_options = params.merge(sort_options)
|
||||||
url_options = params.has_key?(:set_filter) ? sort_options : params.merge(sort_options)
|
|
||||||
|
|
||||||
# Add project_id to url_options
|
# Add project_id to url_options
|
||||||
url_options = url_options.merge(:project_id => params[:project_id]) if params.has_key?(:project_id)
|
url_options = url_options.merge(:project_id => params[:project_id]) if params.has_key?(:project_id)
|
||||||
|
|
||||||
link_to_remote(caption,
|
link_to_content_update(caption, url_options, :class => css)
|
||||||
{:update => "content", :url => url_options, :method => :get},
|
|
||||||
{:href => url_for(url_options),
|
|
||||||
:class => css})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a table header <th> tag with a sort link for the named column
|
# Returns a table header <th> tag with a sort link for the named column
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module TimelogHelper
|
module TimelogHelper
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
@ -144,7 +140,7 @@ module TimelogHelper
|
|||||||
headers = criterias.collect {|criteria| l(@available_criterias[criteria][:label]) }
|
headers = criterias.collect {|criteria| l(@available_criterias[criteria][:label]) }
|
||||||
headers += periods
|
headers += periods
|
||||||
headers << l(:label_total)
|
headers << l(:label_total)
|
||||||
csv << headers.collect {|c| to_utf8(c) }
|
csv << headers.collect {|c| to_utf8_for_timelogs(c) }
|
||||||
# Content
|
# Content
|
||||||
report_criteria_to_csv(csv, criterias, periods, hours)
|
report_criteria_to_csv(csv, criterias, periods, hours)
|
||||||
# Total row
|
# Total row
|
||||||
@ -166,7 +162,7 @@ module TimelogHelper
|
|||||||
hours_for_value = select_hours(hours, criterias[level], value)
|
hours_for_value = select_hours(hours, criterias[level], value)
|
||||||
next if hours_for_value.empty?
|
next if hours_for_value.empty?
|
||||||
row = [''] * level
|
row = [''] * level
|
||||||
row << to_utf8(format_criteria_value(criterias[level], value))
|
row << to_utf8_for_timelogs(format_criteria_value(criterias[level], value))
|
||||||
row += [''] * (criterias.length - level - 1)
|
row += [''] * (criterias.length - level - 1)
|
||||||
total = 0
|
total = 0
|
||||||
periods.each do |period|
|
periods.each do |period|
|
||||||
@ -183,7 +179,7 @@ module TimelogHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_utf8(s)
|
def to_utf8_for_timelogs(s)
|
||||||
@ic ||= Iconv.new(l(:general_csv_encoding), 'UTF-8')
|
@ic ||= Iconv.new(l(:general_csv_encoding), 'UTF-8')
|
||||||
begin; @ic.iconv(s.to_s); rescue; s.to_s; end
|
begin; @ic.iconv(s.to_s); rescue; s.to_s; end
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module TrackersHelper
|
module TrackersHelper
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module UsersHelper
|
module UsersHelper
|
||||||
def users_status_options_for_select(selected)
|
def users_status_options_for_select(selected)
|
||||||
|
@ -1,27 +1,22 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module VersionsHelper
|
module VersionsHelper
|
||||||
|
|
||||||
STATUS_BY_CRITERIAS = %w(category tracker priority author assigned_to)
|
STATUS_BY_CRITERIAS = %w(category tracker status priority author assigned_to)
|
||||||
|
|
||||||
def render_issue_status_by(version, criteria)
|
def render_issue_status_by(version, criteria)
|
||||||
criteria ||= 'category'
|
criteria = 'category' unless STATUS_BY_CRITERIAS.include?(criteria)
|
||||||
raise 'Unknown criteria' unless STATUS_BY_CRITERIAS.include?(criteria)
|
|
||||||
|
|
||||||
h = Hash.new {|k,v| k[v] = [0, 0]}
|
h = Hash.new {|k,v| k[v] = [0, 0]}
|
||||||
begin
|
begin
|
||||||
|
@ -1,48 +1,53 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module WatchersHelper
|
module WatchersHelper
|
||||||
|
|
||||||
# Valid options
|
# Deprecated method. Use watcher_link instead
|
||||||
# * :id - the element id
|
#
|
||||||
# * :replace - a string or array of element ids that will be
|
# This method will be removed in ChiliProject 3.0 or later
|
||||||
# replaced
|
|
||||||
def watcher_tag(object, user, options={:replace => 'watcher'})
|
def watcher_tag(object, user, options={:replace => 'watcher'})
|
||||||
id = options[:id]
|
ActiveSupport::Deprecation.warn "The WatchersHelper#watcher_tag is deprecated and will be removed in ChiliProject 3.0. Please use WatchersHelper#watcher_link instead. Please also note the differences between the APIs.", caller
|
||||||
id ||= options[:replace] if options[:replace].is_a? String
|
|
||||||
content_tag("span", watcher_link(object, user, options), :id => id)
|
options[:id] ||= options[:replace] if options[:replace].is_a? String
|
||||||
|
|
||||||
|
options[:replace] = Array(options[:replace]).map { |id| "##{id}" }
|
||||||
|
|
||||||
|
watcher_link(object, user, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Valid options
|
# Create a link to watch/unwatch object
|
||||||
# * :replace - a string or array of element ids that will be
|
#
|
||||||
# replaced
|
# * :replace - a string or array of strings with css selectors that will be updated, whenever the watcher status is changed
|
||||||
def watcher_link(object, user, options={:replace => 'watcher'})
|
def watcher_link(object, user, options = {:replace => '.watcher_link', :class => 'watcher_link'})
|
||||||
|
options = options.with_indifferent_access
|
||||||
|
raise ArgumentError, 'Missing :replace option in options hash' if options['replace'].blank?
|
||||||
|
|
||||||
return '' unless user && user.logged? && object.respond_to?('watched_by?')
|
return '' unless user && user.logged? && object.respond_to?('watched_by?')
|
||||||
|
|
||||||
watched = object.watched_by?(user)
|
watched = object.watched_by?(user)
|
||||||
url = {:controller => 'watchers',
|
url = {:controller => 'watchers',
|
||||||
:action => (watched ? 'unwatch' : 'watch'),
|
:action => (watched ? 'unwatch' : 'watch'),
|
||||||
:object_type => object.class.to_s.underscore,
|
:object_type => object.class.to_s.underscore,
|
||||||
:object_id => object.id,
|
:object_id => object.id,
|
||||||
:replace => options[:replace]}
|
:replace => options.delete('replace')}
|
||||||
link_to_remote((watched ? l(:button_unwatch) : l(:button_watch)),
|
|
||||||
{:url => url},
|
|
||||||
:href => url_for(url),
|
|
||||||
:class => (watched ? 'icon icon-fav' : 'icon icon-fav-off'))
|
|
||||||
|
|
||||||
|
url_options = {:url => url}
|
||||||
|
|
||||||
|
html_options = options.merge(:href => url_for(url))
|
||||||
|
html_options[:class] = html_options[:class].to_s + (watched ? ' icon icon-fav' : ' icon icon-fav-off')
|
||||||
|
|
||||||
|
link_to_remote((watched ? l(:button_unwatch) : l(:button_watch)), url_options, html_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a comma separated list of users watching the given object
|
# Returns a comma separated list of users watching the given object
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module WelcomeHelper
|
module WelcomeHelper
|
||||||
end
|
end
|
||||||
|
@ -1,25 +1,23 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module WikiHelper
|
module WikiHelper
|
||||||
|
|
||||||
def wiki_page_options_for_select(pages, selected = nil, parent = nil, level = 0)
|
def wiki_page_options_for_select(pages, selected = nil, parent = nil, level = 0)
|
||||||
|
pages = pages.group_by(&:parent) unless pages.is_a?(Hash)
|
||||||
s = ''
|
s = ''
|
||||||
pages.select {|p| p.parent == parent}.each do |page|
|
if pages.has_key?(parent)
|
||||||
|
pages[parent].each do |page|
|
||||||
attrs = "value='#{page.id}'"
|
attrs = "value='#{page.id}'"
|
||||||
attrs << " selected='selected'" if selected == page
|
attrs << " selected='selected'" if selected == page
|
||||||
indent = (level > 0) ? (' ' * level * 2 + '» ') : nil
|
indent = (level > 0) ? (' ' * level * 2 + '» ') : nil
|
||||||
@ -27,43 +25,7 @@ module WikiHelper
|
|||||||
s << "<option #{attrs}>#{indent}#{h page.pretty_title}</option>\n" +
|
s << "<option #{attrs}>#{indent}#{h page.pretty_title}</option>\n" +
|
||||||
wiki_page_options_for_select(pages, selected, page, level + 1)
|
wiki_page_options_for_select(pages, selected, page, level + 1)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
s
|
s
|
||||||
end
|
end
|
||||||
|
|
||||||
def html_diff(wdiff)
|
|
||||||
words = wdiff.words.collect{|word| h(word)}
|
|
||||||
words_add = 0
|
|
||||||
words_del = 0
|
|
||||||
dels = 0
|
|
||||||
del_off = 0
|
|
||||||
wdiff.diff.diffs.each do |diff|
|
|
||||||
add_at = nil
|
|
||||||
add_to = nil
|
|
||||||
del_at = nil
|
|
||||||
deleted = ""
|
|
||||||
diff.each do |change|
|
|
||||||
pos = change[1]
|
|
||||||
if change[0] == "+"
|
|
||||||
add_at = pos + dels unless add_at
|
|
||||||
add_to = pos + dels
|
|
||||||
words_add += 1
|
|
||||||
else
|
|
||||||
del_at = pos unless del_at
|
|
||||||
deleted << ' ' + h(change[2])
|
|
||||||
words_del += 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if add_at
|
|
||||||
words[add_at] = '<span class="diff_in">' + words[add_at]
|
|
||||||
words[add_to] = words[add_to] + '</span>'
|
|
||||||
end
|
|
||||||
if del_at
|
|
||||||
words.insert del_at - del_off + dels + words_add, '<span class="diff_out">' + deleted + '</span>'
|
|
||||||
dels += 1
|
|
||||||
del_off += words_del
|
|
||||||
words_del = 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
simple_format_without_paragraph(words.join(' '))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
module WorkflowsHelper
|
module WorkflowsHelper
|
||||||
end
|
end
|
||||||
|
@ -1,46 +1,57 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
require "digest/md5"
|
require "digest/md5"
|
||||||
|
|
||||||
class Attachment < ActiveRecord::Base
|
class Attachment < ActiveRecord::Base
|
||||||
belongs_to :container, :polymorphic => true
|
belongs_to :container, :polymorphic => true
|
||||||
|
|
||||||
|
# FIXME: Remove these once the Versions, Documents and Projects themselves can provide file events
|
||||||
|
belongs_to :version, :foreign_key => "container_id"
|
||||||
|
belongs_to :document, :foreign_key => "container_id"
|
||||||
|
|
||||||
belongs_to :author, :class_name => "User", :foreign_key => "author_id"
|
belongs_to :author, :class_name => "User", :foreign_key => "author_id"
|
||||||
|
|
||||||
validates_presence_of :container, :filename, :author
|
validates_presence_of :container, :filename, :author
|
||||||
validates_length_of :filename, :maximum => 255
|
validates_length_of :filename, :maximum => 255
|
||||||
validates_length_of :disk_filename, :maximum => 255
|
validates_length_of :disk_filename, :maximum => 255
|
||||||
|
|
||||||
acts_as_event :title => :filename,
|
acts_as_journalized :event_title => :filename,
|
||||||
:url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id, :filename => o.filename}}
|
:event_url => (Proc.new do |o|
|
||||||
|
{ :controller => 'attachments', :action => 'download',
|
||||||
|
:id => o.journaled_id, :filename => o.filename }
|
||||||
|
end),
|
||||||
|
:activity_type => 'files',
|
||||||
|
:activity_permission => :view_files,
|
||||||
|
:activity_find_options => { :include => { :version => :project } }
|
||||||
|
|
||||||
acts_as_activity_provider :type => 'files',
|
acts_as_activity :type => 'documents', :permission => :view_documents,
|
||||||
:permission => :view_files,
|
:find_options => { :include => { :document => :project } }
|
||||||
:author_key => :author_id,
|
|
||||||
:find_options => {:select => "#{Attachment.table_name}.*",
|
|
||||||
:joins => "LEFT JOIN #{Version.table_name} ON #{Attachment.table_name}.container_type='Version' AND #{Version.table_name}.id = #{Attachment.table_name}.container_id " +
|
|
||||||
"LEFT JOIN #{Project.table_name} ON #{Version.table_name}.project_id = #{Project.table_name}.id OR ( #{Attachment.table_name}.container_type='Project' AND #{Attachment.table_name}.container_id = #{Project.table_name}.id )"}
|
|
||||||
|
|
||||||
acts_as_activity_provider :type => 'documents',
|
# This method is called on save by the AttachmentJournal in order to
|
||||||
:permission => :view_documents,
|
# decide which kind of activity we are dealing with. When that activity
|
||||||
:author_key => :author_id,
|
# is retrieved later, we don't need to check the container_type in
|
||||||
:find_options => {:select => "#{Attachment.table_name}.*",
|
# SQL anymore as that will be just the one we have specified here.
|
||||||
:joins => "LEFT JOIN #{Document.table_name} ON #{Attachment.table_name}.container_type='Document' AND #{Document.table_name}.id = #{Attachment.table_name}.container_id " +
|
def activity_type
|
||||||
"LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
|
case container_type
|
||||||
|
when "Document"
|
||||||
|
"documents"
|
||||||
|
when "Version"
|
||||||
|
"files"
|
||||||
|
else
|
||||||
|
super
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
cattr_accessor :storage_path
|
cattr_accessor :storage_path
|
||||||
@@storage_path = Redmine::Configuration['attachments_storage_path'] || "#{RAILS_ROOT}/files"
|
@@storage_path = Redmine::Configuration['attachments_storage_path'] || "#{RAILS_ROOT}/files"
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class AuthSource < ActiveRecord::Base
|
class AuthSource < ActiveRecord::Base
|
||||||
|
include Redmine::Ciphering
|
||||||
|
|
||||||
has_many :users
|
has_many :users
|
||||||
|
|
||||||
validates_presence_of :name
|
validates_presence_of :name
|
||||||
@ -32,6 +30,14 @@ class AuthSource < ActiveRecord::Base
|
|||||||
"Abstract"
|
"Abstract"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def account_password
|
||||||
|
read_ciphered_attribute(:account_password)
|
||||||
|
end
|
||||||
|
|
||||||
|
def account_password=(arg)
|
||||||
|
write_ciphered_attribute(:account_password, arg)
|
||||||
|
end
|
||||||
|
|
||||||
def allow_password_changes?
|
def allow_password_changes?
|
||||||
self.class.allow_password_changes?
|
self.class.allow_password_changes?
|
||||||
end
|
end
|
||||||
|
@ -1,27 +1,23 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
require 'net/ldap'
|
require 'net/ldap'
|
||||||
require 'iconv'
|
require 'iconv'
|
||||||
|
|
||||||
class AuthSourceLdap < AuthSource
|
class AuthSourceLdap < AuthSource
|
||||||
validates_presence_of :host, :port, :attr_login
|
validates_presence_of :host, :port, :attr_login
|
||||||
validates_length_of :name, :host, :account_password, :maximum => 60, :allow_nil => true
|
validates_length_of :name, :host, :maximum => 60, :allow_nil => true
|
||||||
validates_length_of :account, :base_dn, :maximum => 255, :allow_nil => true
|
validates_length_of :account, :account_password, :base_dn, :maximum => 255, :allow_nil => true
|
||||||
validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30, :allow_nil => true
|
validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30, :allow_nil => true
|
||||||
validates_numericality_of :port, :only_integer => true
|
validates_numericality_of :port, :only_integer => true
|
||||||
|
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class Board < ActiveRecord::Base
|
class Board < ActiveRecord::Base
|
||||||
belongs_to :project
|
belongs_to :project
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# redMine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
class Change < ActiveRecord::Base
|
class Change < ActiveRecord::Base
|
||||||
belongs_to :changeset
|
belongs_to :changeset
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
# Redmine - project management software
|
#-- copyright
|
||||||
# Copyright (C) 2006-2010 Jean-Philippe Lang
|
# ChiliProject is a project management system.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010-2011 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
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# See doc/COPYRIGHT.rdoc for more details.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
#++
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
require 'iconv'
|
require 'iconv'
|
||||||
|
|
||||||
@ -23,19 +19,18 @@ class Changeset < ActiveRecord::Base
|
|||||||
has_many :changes, :dependent => :delete_all
|
has_many :changes, :dependent => :delete_all
|
||||||
has_and_belongs_to_many :issues
|
has_and_belongs_to_many :issues
|
||||||
|
|
||||||
acts_as_event :title => Proc.new {|o| "#{l(:label_revision)} #{o.format_identifier}" + (o.short_comments.blank? ? '' : (': ' + o.short_comments))},
|
acts_as_journalized :event_title => Proc.new {|o| "#{l(:label_revision)} #{o.format_identifier}" + (o.short_comments.blank? ? '' : (': ' + o.short_comments))},
|
||||||
:description => :long_comments,
|
:event_description => :long_comments,
|
||||||
:datetime => :committed_on,
|
:event_datetime => :committed_on,
|
||||||
:url => Proc.new {|o| {:controller => 'repositories', :action => 'revision', :id => o.repository.project, :rev => o.identifier}}
|
:event_url => Proc.new {|o| {:controller => 'repositories', :action => 'revision', :id => o.repository.project, :rev => o.identifier}},
|
||||||
|
:event_author => Proc.new {|o| o.author},
|
||||||
|
:activity_timestamp => "#{table_name}.committed_on",
|
||||||
|
:activity_find_options => {:include => [:user, {:repository => :project}]}
|
||||||
acts_as_searchable :columns => 'comments',
|
acts_as_searchable :columns => 'comments',
|
||||||
:include => {:repository => :project},
|
:include => {:repository => :project},
|
||||||
:project_key => "#{Repository.table_name}.project_id",
|
:project_key => "#{Repository.table_name}.project_id",
|
||||||
:date_column => 'committed_on'
|
:date_column => 'committed_on'
|
||||||
|
|
||||||
acts_as_activity_provider :timestamp => "#{table_name}.committed_on",
|
|
||||||
:author_key => :user_id,
|
|
||||||
:find_options => {:include => [:user, {:repository => :project}]}
|
|
||||||
|
|
||||||
validates_presence_of :repository_id, :revision, :committed_on, :commit_date
|
validates_presence_of :repository_id, :revision, :committed_on, :commit_date
|
||||||
validates_uniqueness_of :revision, :scope => :repository_id
|
validates_uniqueness_of :revision, :scope => :repository_id
|
||||||
@ -57,10 +52,6 @@ class Changeset < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def comments=(comment)
|
|
||||||
write_attribute(:comments, Changeset.normalize_comments(comment))
|
|
||||||
end
|
|
||||||
|
|
||||||
def committed_on=(date)
|
def committed_on=(date)
|
||||||
self.commit_date = date
|
self.commit_date = date
|
||||||
super
|
super
|
||||||
@ -75,10 +66,6 @@ class Changeset < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def committer=(arg)
|
|
||||||
write_attribute(:committer, self.class.to_utf8(arg.to_s))
|
|
||||||
end
|
|
||||||
|
|
||||||
def project
|
def project
|
||||||
repository.project
|
repository.project
|
||||||
end
|
end
|
||||||
@ -88,7 +75,9 @@ class Changeset < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def before_create
|
def before_create
|
||||||
self.user = repository.find_committer_user(committer)
|
self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding)
|
||||||
|
self.comments = self.class.normalize_comments(self.comments, repository.repo_log_encoding)
|
||||||
|
self.user = repository.find_committer_user(self.committer)
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_create
|
def after_create
|
||||||
@ -97,11 +86,13 @@ class Changeset < ActiveRecord::Base
|
|||||||
|
|
||||||
TIMELOG_RE = /
|
TIMELOG_RE = /
|
||||||
(
|
(
|
||||||
(\d+([.,]\d+)?)h?
|
((\d+)(h|hours?))((\d+)(m|min)?)?
|
||||||
|
|
|
||||||
|
((\d+)(h|hours?|m|min))
|
||||||
|
|
|
|
||||||
(\d+):(\d+)
|
(\d+):(\d+)
|
||||||
|
|
|
|
||||||
((\d+)(h|hours?))?((\d+)(m|min)?)?
|
(\d+([\.,]\d+)?)h?
|
||||||
)
|
)
|
||||||
/x
|
/x
|
||||||
|
|
||||||
@ -161,11 +152,6 @@ class Changeset < ActiveRecord::Base
|
|||||||
@next ||= Changeset.find(:first, :conditions => ['id > ? AND repository_id = ?', self.id, self.repository_id], :order => 'id ASC')
|
@next ||= Changeset.find(:first, :conditions => ['id > ? AND repository_id = ?', self.id, self.repository_id], :order => 'id ASC')
|
||||||
end
|
end
|
||||||
|
|
||||||
# Strips and reencodes a commit log before insertion into the database
|
|
||||||
def self.normalize_comments(str)
|
|
||||||
to_utf8(str.to_s.strip)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Creates a new Change from it's common parameters
|
# Creates a new Change from it's common parameters
|
||||||
def create_change(change)
|
def create_change(change)
|
||||||
Change.create(:changeset => self,
|
Change.create(:changeset => self,
|
||||||
@ -183,7 +169,7 @@ class Changeset < ActiveRecord::Base
|
|||||||
return nil if id.blank?
|
return nil if id.blank?
|
||||||
issue = Issue.find_by_id(id.to_i, :include => :project)
|
issue = Issue.find_by_id(id.to_i, :include => :project)
|
||||||
if issue
|
if issue
|
||||||
unless project == issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project)
|
unless issue.project && (project == issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project))
|
||||||
issue = nil
|
issue = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -202,7 +188,7 @@ class Changeset < ActiveRecord::Base
|
|||||||
# don't change the status is the issue is closed
|
# don't change the status is the issue is closed
|
||||||
return if issue.status && issue.status.is_closed?
|
return if issue.status && issue.status.is_closed?
|
||||||
|
|
||||||
journal = issue.init_journal(user || User.anonymous, ll(Setting.default_language, :text_status_changed_by_changeset, text_tag))
|
issue.init_journal(user || User.anonymous, ll(Setting.default_language, :text_status_changed_by_changeset, text_tag))
|
||||||
issue.status = status
|
issue.status = status
|
||||||
unless Setting.commit_fix_done_ratio.blank?
|
unless Setting.commit_fix_done_ratio.blank?
|
||||||
issue.done_ratio = Setting.commit_fix_done_ratio.to_i
|
issue.done_ratio = Setting.commit_fix_done_ratio.to_i
|
||||||
@ -244,21 +230,48 @@ class Changeset < ActiveRecord::Base
|
|||||||
return @short_comments, @long_comments
|
return @short_comments, @long_comments
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.to_utf8(str)
|
public
|
||||||
if str.respond_to?(:force_encoding)
|
|
||||||
str.force_encoding('UTF-8')
|
# Strips and reencodes a commit log before insertion into the database
|
||||||
return str if str.valid_encoding?
|
def self.normalize_comments(str, encoding)
|
||||||
else
|
Changeset.to_utf8(str.to_s.strip, encoding)
|
||||||
return str if /\A[\r\n\t\x20-\x7e]*\Z/n.match(str) # for us-ascii
|
|
||||||
end
|
end
|
||||||
|
|
||||||
encoding = Setting.commit_logs_encoding.to_s.strip
|
private
|
||||||
unless encoding.blank? || encoding == 'UTF-8'
|
|
||||||
begin
|
def self.to_utf8(str, encoding)
|
||||||
str = Iconv.conv('UTF-8', encoding, str)
|
return str if str.nil?
|
||||||
rescue Iconv::Failure
|
str.force_encoding("ASCII-8BIT") if str.respond_to?(:force_encoding)
|
||||||
# do nothing here
|
if str.empty?
|
||||||
|
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
|
||||||
|
return str
|
||||||
end
|
end
|
||||||
|
normalized_encoding = encoding.blank? ? "UTF-8" : encoding
|
||||||
|
if str.respond_to?(:force_encoding)
|
||||||
|
if normalized_encoding.upcase != "UTF-8"
|
||||||
|
str.force_encoding(normalized_encoding)
|
||||||
|
str = str.encode("UTF-8", :invalid => :replace,
|
||||||
|
:undef => :replace, :replace => '?')
|
||||||
|
else
|
||||||
|
str.force_encoding("UTF-8")
|
||||||
|
unless str.valid_encoding?
|
||||||
|
str = str.encode("US-ASCII", :invalid => :replace,
|
||||||
|
:undef => :replace, :replace => '?').encode("UTF-8")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
|
||||||
|
txtar = ""
|
||||||
|
begin
|
||||||
|
txtar += Iconv.new('UTF-8', normalized_encoding).iconv(str)
|
||||||
|
rescue Iconv::IllegalSequence
|
||||||
|
txtar += $!.success
|
||||||
|
str = '?' + $!.failed[1,$!.failed.length]
|
||||||
|
retry
|
||||||
|
rescue
|
||||||
|
txtar += $!.success
|
||||||
|
end
|
||||||
|
str = txtar
|
||||||
end
|
end
|
||||||
# removes invalid UTF8 sequences
|
# removes invalid UTF8 sequences
|
||||||
begin
|
begin
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user