##// END OF EJS Templates
notice messages translation...
Jean-Philippe Lang -
r15:18ee1fef4172
parent child
Show More
@@ -1,160 +1,165
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class AccountController < ApplicationController
18 class AccountController < ApplicationController
19 layout 'base'
19 layout 'base'
20 helper :custom_fields
20 helper :custom_fields
21 include CustomFieldsHelper
21 include CustomFieldsHelper
22
22
23 # prevents login action to be filtered by check_if_login_required application scope filter
23 # prevents login action to be filtered by check_if_login_required application scope filter
24 skip_before_filter :check_if_login_required, :only => [:login, :lost_password, :register]
24 skip_before_filter :check_if_login_required, :only => [:login, :lost_password, :register]
25 before_filter :require_login, :except => [:show, :login, :lost_password, :register]
25 before_filter :require_login, :except => [:show, :login, :lost_password, :register]
26
26
27 # Show user's account
27 # Show user's account
28 def show
28 def show
29 @user = User.find(params[:id])
29 @user = User.find(params[:id])
30 end
30 end
31
31
32 # Login request and validation
32 # Login request and validation
33 def login
33 def login
34 if request.get?
34 if request.get?
35 # Logout user
35 # Logout user
36 self.logged_in_user = nil
36 self.logged_in_user = nil
37 else
37 else
38 # Authenticate user
38 # Authenticate user
39 user = User.try_to_login(params[:login], params[:password])
39 user = User.try_to_login(params[:login], params[:password])
40 if user
40 if user
41 self.logged_in_user = user
41 self.logged_in_user = user
42 redirect_back_or_default :controller => 'account', :action => 'my_page'
42 redirect_back_or_default :controller => 'account', :action => 'my_page'
43 else
43 else
44 flash.now[:notice] = l(:notice_account_invalid_creditentials)
44 flash.now[:notice] = l(:notice_account_invalid_creditentials)
45 end
45 end
46 end
46 end
47 end
47 end
48
48
49 # Log out current user and redirect to welcome page
49 # Log out current user and redirect to welcome page
50 def logout
50 def logout
51 self.logged_in_user = nil
51 self.logged_in_user = nil
52 redirect_to :controller => ''
52 redirect_to :controller => ''
53 end
53 end
54
54
55 # Show logged in user's page
55 # Show logged in user's page
56 def my_page
56 def my_page
57 @user = self.logged_in_user
57 @user = self.logged_in_user
58 @reported_issues = Issue.find(:all, :conditions => ["author_id=?", @user.id], :limit => 10, :include => [ :status, :project, :tracker ], :order => 'issues.updated_on DESC')
58 @reported_issues = Issue.find(:all, :conditions => ["author_id=?", @user.id], :limit => 10, :include => [ :status, :project, :tracker ], :order => 'issues.updated_on DESC')
59 @assigned_issues = Issue.find(:all, :conditions => ["assigned_to_id=?", @user.id], :limit => 10, :include => [ :status, :project, :tracker ], :order => 'issues.updated_on DESC')
59 @assigned_issues = Issue.find(:all, :conditions => ["assigned_to_id=?", @user.id], :limit => 10, :include => [ :status, :project, :tracker ], :order => 'issues.updated_on DESC')
60 end
60 end
61
61
62 # Edit logged in user's account
62 # Edit logged in user's account
63 def my_account
63 def my_account
64 @user = self.logged_in_user
64 @user = self.logged_in_user
65 if request.post? and @user.update_attributes(@params[:user])
65 if request.post? and @user.update_attributes(@params[:user])
66 set_localization
66 set_localization
67 flash.now[:notice] = l(:notice_account_updated)
67 flash.now[:notice] = l(:notice_account_updated)
68 self.logged_in_user.reload
68 self.logged_in_user.reload
69 end
69 end
70 end
70 end
71
71
72 # Change logged in user's password
72 # Change logged in user's password
73 def change_password
73 def change_password
74 @user = self.logged_in_user
74 @user = self.logged_in_user
75 flash.now[:notice] = l(:notice_can_t_change_password) and render :action => 'my_account' and return if @user.auth_source_id
75 flash[:notice] = l(:notice_can_t_change_password) and redirect_to :action => 'my_account' and return if @user.auth_source_id
76 if @user.check_password?(@params[:password])
76 if @user.check_password?(@params[:password])
77 @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
77 @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
78 flash.now[:notice] = l(:notice_account_password_updated) if @user.save
78 if @user.save
79 flash[:notice] = l(:notice_account_password_updated)
80 else
81 render :action => 'my_account'
82 return
83 end
79 else
84 else
80 flash.now[:notice] = l(:notice_account_wrong_password)
85 flash[:notice] = l(:notice_account_wrong_password)
81 end
86 end
82 render :action => 'my_account'
87 redirect_to :action => 'my_account'
83 end
88 end
84
89
85 # Enable user to choose a new password
90 # Enable user to choose a new password
86 def lost_password
91 def lost_password
87 if params[:token]
92 if params[:token]
88 @token = Token.find_by_action_and_value("recovery", params[:token])
93 @token = Token.find_by_action_and_value("recovery", params[:token])
89 redirect_to :controller => '' and return unless @token and !@token.expired?
94 redirect_to :controller => '' and return unless @token and !@token.expired?
90 @user = @token.user
95 @user = @token.user
91 if request.post?
96 if request.post?
92 @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
97 @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
93 if @user.save
98 if @user.save
94 @token.destroy
99 @token.destroy
95 flash[:notice] = l(:notice_account_password_updated)
100 flash[:notice] = l(:notice_account_password_updated)
96 redirect_to :action => 'login'
101 redirect_to :action => 'login'
97 return
102 return
98 end
103 end
99 end
104 end
100 render :template => "account/password_recovery"
105 render :template => "account/password_recovery"
101 return
106 return
102 else
107 else
103 if request.post?
108 if request.post?
104 user = User.find_by_mail(params[:mail])
109 user = User.find_by_mail(params[:mail])
105 # user not found in db
110 # user not found in db
106 flash.now[:notice] = l(:notice_account_unknown_email) and return unless user
111 flash.now[:notice] = l(:notice_account_unknown_email) and return unless user
107 # user uses an external authentification
112 # user uses an external authentification
108 flash.now[:notice] = l(:notice_can_t_change_password) and return if user.auth_source_id
113 flash.now[:notice] = l(:notice_can_t_change_password) and return if user.auth_source_id
109 # create a new token for password recovery
114 # create a new token for password recovery
110 token = Token.new(:user => user, :action => "recovery")
115 token = Token.new(:user => user, :action => "recovery")
111 if token.save
116 if token.save
112 # send token to user via email
117 # send token to user via email
113 Mailer.set_language_if_valid(user.language)
118 Mailer.set_language_if_valid(user.language)
114 Mailer.deliver_lost_password(token)
119 Mailer.deliver_lost_password(token)
115 flash[:notice] = l(:notice_account_lost_email_sent)
120 flash[:notice] = l(:notice_account_lost_email_sent)
116 redirect_to :action => 'login'
121 redirect_to :action => 'login'
117 return
122 return
118 end
123 end
119 end
124 end
120 end
125 end
121 end
126 end
122
127
123 # User self-registration
128 # User self-registration
124 def register
129 def register
125 redirect_to :controller => '' and return if $RDM_SELF_REGISTRATION == false
130 redirect_to :controller => '' and return if $RDM_SELF_REGISTRATION == false
126 if params[:token]
131 if params[:token]
127 token = Token.find_by_action_and_value("register", params[:token])
132 token = Token.find_by_action_and_value("register", params[:token])
128 redirect_to :controller => '' and return unless token and !token.expired?
133 redirect_to :controller => '' and return unless token and !token.expired?
129 user = token.user
134 user = token.user
130 redirect_to :controller => '' and return unless user.status == User::STATUS_REGISTERED
135 redirect_to :controller => '' and return unless user.status == User::STATUS_REGISTERED
131 user.status = User::STATUS_ACTIVE
136 user.status = User::STATUS_ACTIVE
132 if user.save
137 if user.save
133 token.destroy
138 token.destroy
134 flash[:notice] = l(:notice_account_activated)
139 flash[:notice] = l(:notice_account_activated)
135 redirect_to :action => 'login'
140 redirect_to :action => 'login'
136 return
141 return
137 end
142 end
138 else
143 else
139 if request.get?
144 if request.get?
140 @user = User.new(:language => $RDM_DEFAULT_LANG)
145 @user = User.new(:language => $RDM_DEFAULT_LANG)
141 @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user) }
146 @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user) }
142 else
147 else
143 @user = User.new(params[:user])
148 @user = User.new(params[:user])
144 @user.admin = false
149 @user.admin = false
145 @user.login = params[:user][:login]
150 @user.login = params[:user][:login]
146 @user.status = User::STATUS_REGISTERED
151 @user.status = User::STATUS_REGISTERED
147 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation]
152 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation]
148 @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }
153 @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }
149 @user.custom_values = @custom_values
154 @user.custom_values = @custom_values
150 token = Token.new(:user => @user, :action => "register")
155 token = Token.new(:user => @user, :action => "register")
151 if @user.save and token.save
156 if @user.save and token.save
152 Mailer.set_language_if_valid(@user.language)
157 Mailer.set_language_if_valid(@user.language)
153 Mailer.deliver_register(token)
158 Mailer.deliver_register(token)
154 flash[:notice] = l(:notice_account_register_done)
159 flash[:notice] = l(:notice_account_register_done)
155 redirect_to :controller => ''
160 redirect_to :controller => ''
156 end
161 end
157 end
162 end
158 end
163 end
159 end
164 end
160 end
165 end
@@ -1,54 +1,54
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class AdminController < ApplicationController
18 class AdminController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :require_admin
20 before_filter :require_admin
21
21
22 helper :sort
22 helper :sort
23 include SortHelper
23 include SortHelper
24
24
25 def index
25 def index
26 end
26 end
27
27
28 def projects
28 def projects
29 sort_init 'name', 'asc'
29 sort_init 'name', 'asc'
30 sort_update
30 sort_update
31 @project_count = Project.count
31 @project_count = Project.count
32 @project_pages = Paginator.new self, @project_count,
32 @project_pages = Paginator.new self, @project_count,
33 15,
33 15,
34 @params['page']
34 @params['page']
35 @projects = Project.find :all, :order => sort_clause,
35 @projects = Project.find :all, :order => sort_clause,
36 :limit => @project_pages.items_per_page,
36 :limit => @project_pages.items_per_page,
37 :offset => @project_pages.current.offset
37 :offset => @project_pages.current.offset
38 end
38 end
39
39
40 def mail_options
40 def mail_options
41 @actions = Permission.find(:all, :conditions => ["mail_option=?", true]) || []
41 @actions = Permission.find(:all, :conditions => ["mail_option=?", true]) || []
42 if request.post?
42 if request.post?
43 @actions.each { |a|
43 @actions.each { |a|
44 a.mail_enabled = (params[:action_ids] || []).include? a.id.to_s
44 a.mail_enabled = (params[:action_ids] || []).include? a.id.to_s
45 a.save
45 a.save
46 }
46 }
47 flash[:notice] = "Mail options were successfully updated."
47 flash.now[:notice] = l(:notice_successful_update)
48 end
48 end
49 end
49 end
50
50
51 def info
51 def info
52 @adapter_name = ActiveRecord::Base.connection.adapter_name
52 @adapter_name = ActiveRecord::Base.connection.adapter_name
53 end
53 end
54 end
54 end
@@ -1,109 +1,107
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class ApplicationController < ActionController::Base
18 class ApplicationController < ActionController::Base
19 before_filter :check_if_login_required, :set_localization
19 before_filter :check_if_login_required, :set_localization
20
20
21 def logged_in_user=(user)
21 def logged_in_user=(user)
22 @logged_in_user = user
22 @logged_in_user = user
23 session[:user_id] = (user ? user.id : nil)
23 session[:user_id] = (user ? user.id : nil)
24 end
24 end
25
25
26 def logged_in_user
26 def logged_in_user
27 if session[:user_id]
27 if session[:user_id]
28 @logged_in_user ||= User.find(session[:user_id], :include => :memberships)
28 @logged_in_user ||= User.find(session[:user_id], :include => :memberships)
29 else
29 else
30 nil
30 nil
31 end
31 end
32 end
32 end
33
33
34 # check if login is globally required to access the application
34 # check if login is globally required to access the application
35 def check_if_login_required
35 def check_if_login_required
36 require_login if $RDM_LOGIN_REQUIRED
36 require_login if $RDM_LOGIN_REQUIRED
37 end
37 end
38
38
39 def set_localization
39 def set_localization
40 lang = begin
40 lang = begin
41 if self.logged_in_user and self.logged_in_user.language and !self.logged_in_user.language.empty? and GLoc.valid_languages.include? self.logged_in_user.language.to_sym
41 if self.logged_in_user and self.logged_in_user.language and !self.logged_in_user.language.empty? and GLoc.valid_languages.include? self.logged_in_user.language.to_sym
42 self.logged_in_user.language
42 self.logged_in_user.language
43 elsif request.env['HTTP_ACCEPT_LANGUAGE']
43 elsif request.env['HTTP_ACCEPT_LANGUAGE']
44 accept_lang = HTTPUtils.parse_qvalues(request.env['HTTP_ACCEPT_LANGUAGE']).first.split('-').first
44 accept_lang = HTTPUtils.parse_qvalues(request.env['HTTP_ACCEPT_LANGUAGE']).first.split('-').first
45 if accept_lang and !accept_lang.empty? and GLoc.valid_languages.include? accept_lang.to_sym
45 if accept_lang and !accept_lang.empty? and GLoc.valid_languages.include? accept_lang.to_sym
46 accept_lang
46 accept_lang
47 end
47 end
48 end
48 end
49 rescue
49 rescue
50 nil
50 nil
51 end || $RDM_DEFAULT_LANG
51 end || $RDM_DEFAULT_LANG
52 set_language_if_valid(lang)
52 set_language_if_valid(lang)
53 end
53 end
54
54
55 def require_login
55 def require_login
56 unless self.logged_in_user
56 unless self.logged_in_user
57 store_location
57 store_location
58 redirect_to(:controller => "account", :action => "login")
58 redirect_to :controller => "account", :action => "login"
59 return false
59 return false
60 end
60 end
61 true
61 true
62 end
62 end
63
63
64 def require_admin
64 def require_admin
65 return unless require_login
65 return unless require_login
66 unless self.logged_in_user.admin?
66 unless self.logged_in_user.admin?
67 flash[:notice] = "Acces denied"
67 render :nothing => true, :status => 403
68 redirect_to:controller => ''
69 return false
68 return false
70 end
69 end
71 true
70 true
72 end
71 end
73
72
74 # authorizes the user for the requested action.
73 # authorizes the user for the requested action.
75 def authorize
74 def authorize
76 # check if action is allowed on public projects
75 # check if action is allowed on public projects
77 if @project.is_public? and Permission.allowed_to_public "%s/%s" % [ @params[:controller], @params[:action] ]
76 if @project.is_public? and Permission.allowed_to_public "%s/%s" % [ @params[:controller], @params[:action] ]
78 return true
77 return true
79 end
78 end
80 # if action is not public, force login
79 # if action is not public, force login
81 return unless require_login
80 return unless require_login
82 # admin is always authorized
81 # admin is always authorized
83 return true if self.logged_in_user.admin?
82 return true if self.logged_in_user.admin?
84 # if not admin, check membership permission
83 # if not admin, check membership permission
85 @user_membership ||= Member.find(:first, :conditions => ["user_id=? and project_id=?", self.logged_in_user.id, @project.id])
84 @user_membership ||= Member.find(:first, :conditions => ["user_id=? and project_id=?", self.logged_in_user.id, @project.id])
86 if @user_membership and Permission.allowed_to_role( "%s/%s" % [ @params[:controller], @params[:action] ], @user_membership.role_id )
85 if @user_membership and Permission.allowed_to_role( "%s/%s" % [ @params[:controller], @params[:action] ], @user_membership.role_id )
87 return true
86 return true
88 end
87 end
89 flash[:notice] = "Acces denied"
88 render :nothing => true, :status => 403
90 redirect_to :controller => ''
91 false
89 false
92 end
90 end
93
91
94 # store current uri in session.
92 # store current uri in session.
95 # return to this location by calling redirect_back_or_default
93 # return to this location by calling redirect_back_or_default
96 def store_location
94 def store_location
97 session[:return_to] = @request.request_uri
95 session[:return_to] = @request.request_uri
98 end
96 end
99
97
100 # move to the last store_location call or to the passed default one
98 # move to the last store_location call or to the passed default one
101 def redirect_back_or_default(default)
99 def redirect_back_or_default(default)
102 if session[:return_to].nil?
100 if session[:return_to].nil?
103 redirect_to default
101 redirect_to default
104 else
102 else
105 redirect_to_url session[:return_to]
103 redirect_to_url session[:return_to]
106 session[:return_to] = nil
104 session[:return_to] = nil
107 end
105 end
108 end
106 end
109 end No newline at end of file
107 end
@@ -1,69 +1,70
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class CustomFieldsController < ApplicationController
18 class CustomFieldsController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :require_admin
20 before_filter :require_admin
21
21
22 def index
22 def index
23 list
23 list
24 render :action => 'list'
24 render :action => 'list'
25 end
25 end
26
26
27 def list
27 def list
28 @custom_field_pages, @custom_fields = paginate :custom_fields, :per_page => 15
28 @custom_field_pages, @custom_fields = paginate :custom_fields, :per_page => 15
29 end
29 end
30
30
31 def new
31 def new
32 case params[:type]
32 case params[:type]
33 when "IssueCustomField"
33 when "IssueCustomField"
34 @custom_field = IssueCustomField.new(params[:custom_field])
34 @custom_field = IssueCustomField.new(params[:custom_field])
35 @custom_field.trackers = Tracker.find(params[:tracker_ids]) if params[:tracker_ids]
35 @custom_field.trackers = Tracker.find(params[:tracker_ids]) if params[:tracker_ids]
36 when "UserCustomField"
36 when "UserCustomField"
37 @custom_field = UserCustomField.new(params[:custom_field])
37 @custom_field = UserCustomField.new(params[:custom_field])
38 when "ProjectCustomField"
38 when "ProjectCustomField"
39 @custom_field = ProjectCustomField.new(params[:custom_field])
39 @custom_field = ProjectCustomField.new(params[:custom_field])
40 else
40 else
41 redirect_to :action => 'list'
41 redirect_to :action => 'list'
42 return
42 return
43 end
43 end
44 if request.post? and @custom_field.save
44 if request.post? and @custom_field.save
45 flash[:notice] = l(:notice_successful_create)
45 redirect_to :action => 'list'
46 redirect_to :action => 'list'
46 end
47 end
47 @trackers = Tracker.find(:all)
48 @trackers = Tracker.find(:all)
48 end
49 end
49
50
50 def edit
51 def edit
51 @custom_field = CustomField.find(params[:id])
52 @custom_field = CustomField.find(params[:id])
52 if request.post? and @custom_field.update_attributes(params[:custom_field])
53 if request.post? and @custom_field.update_attributes(params[:custom_field])
53 if @custom_field.is_a? IssueCustomField
54 if @custom_field.is_a? IssueCustomField
54 @custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : []
55 @custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : []
55 end
56 end
56 flash[:notice] = 'Custom field was successfully updated.'
57 flash[:notice] = l(:notice_successful_update)
57 redirect_to :action => 'list'
58 redirect_to :action => 'list'
58 end
59 end
59 @trackers = Tracker.find(:all)
60 @trackers = Tracker.find(:all)
60 end
61 end
61
62
62 def destroy
63 def destroy
63 CustomField.find(params[:id]).destroy
64 CustomField.find(params[:id]).destroy
64 redirect_to :action => 'list'
65 redirect_to :action => 'list'
65 rescue
66 rescue
66 flash[:notice] = "Unable to delete custom field"
67 flash[:notice] = "Unable to delete custom field"
67 redirect_to :action => 'list'
68 redirect_to :action => 'list'
68 end
69 end
69 end
70 end
@@ -1,65 +1,65
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class DocumentsController < ApplicationController
18 class DocumentsController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :find_project, :authorize
20 before_filter :find_project, :authorize
21
21
22 def show
22 def show
23 end
23 end
24
24
25 def edit
25 def edit
26 @categories = Enumeration::get_values('DCAT')
26 @categories = Enumeration::get_values('DCAT')
27 if request.post? and @document.update_attributes(params[:document])
27 if request.post? and @document.update_attributes(params[:document])
28 flash[:notice] = 'Document was successfully updated.'
28 flash[:notice] = l(:notice_successful_update)
29 redirect_to :action => 'show', :id => @document
29 redirect_to :action => 'show', :id => @document
30 end
30 end
31 end
31 end
32
32
33 def destroy
33 def destroy
34 @document.destroy
34 @document.destroy
35 redirect_to :controller => 'projects', :action => 'list_documents', :id => @project
35 redirect_to :controller => 'projects', :action => 'list_documents', :id => @project
36 end
36 end
37
37
38 def download
38 def download
39 @attachment = @document.attachments.find(params[:attachment_id])
39 @attachment = @document.attachments.find(params[:attachment_id])
40 @attachment.increment_download
40 @attachment.increment_download
41 send_file @attachment.diskfile, :filename => @attachment.filename
41 send_file @attachment.diskfile, :filename => @attachment.filename
42 end
42 end
43
43
44 def add_attachment
44 def add_attachment
45 # Save the attachment
45 # Save the attachment
46 if params[:attachment][:file].size > 0
46 if params[:attachment][:file].size > 0
47 @attachment = @document.attachments.build(params[:attachment])
47 @attachment = @document.attachments.build(params[:attachment])
48 @attachment.author_id = self.logged_in_user.id if self.logged_in_user
48 @attachment.author_id = self.logged_in_user.id if self.logged_in_user
49 @attachment.save
49 @attachment.save
50 end
50 end
51 render :action => 'show'
51 render :action => 'show'
52 end
52 end
53
53
54 def destroy_attachment
54 def destroy_attachment
55 @document.attachments.find(params[:attachment_id]).destroy
55 @document.attachments.find(params[:attachment_id]).destroy
56 render :action => 'show'
56 render :action => 'show'
57 end
57 end
58
58
59 private
59 private
60 def find_project
60 def find_project
61 @document = Document.find(params[:id])
61 @document = Document.find(params[:id])
62 @project = @document.project
62 @project = @document.project
63 end
63 end
64
64
65 end
65 end
@@ -1,42 +1,42
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class IssueCategoriesController < ApplicationController
18 class IssueCategoriesController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :find_project, :authorize
20 before_filter :find_project, :authorize
21
21
22 def edit
22 def edit
23 if request.post? and @category.update_attributes(params[:category])
23 if request.post? and @category.update_attributes(params[:category])
24 flash[:notice] = 'Issue category was successfully updated.'
24 flash[:notice] = l(:notice_successful_update)
25 redirect_to :controller => 'projects', :action => 'settings', :id => @project
25 redirect_to :controller => 'projects', :action => 'settings', :id => @project
26 end
26 end
27 end
27 end
28
28
29 def destroy
29 def destroy
30 @category.destroy
30 @category.destroy
31 redirect_to :controller => 'projects', :action => 'settings', :id => @project
31 redirect_to :controller => 'projects', :action => 'settings', :id => @project
32 rescue
32 rescue
33 flash[:notice] = "Categorie can't be deleted"
33 flash[:notice] = "Categorie can't be deleted"
34 redirect_to :controller => 'projects', :action => 'settings', :id => @project
34 redirect_to :controller => 'projects', :action => 'settings', :id => @project
35 end
35 end
36
36
37 private
37 private
38 def find_project
38 def find_project
39 @category = IssueCategory.find(params[:id])
39 @category = IssueCategory.find(params[:id])
40 @project = @category.project
40 @project = @category.project
41 end
41 end
42 end
42 end
@@ -1,68 +1,68
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class IssueStatusesController < ApplicationController
18 class IssueStatusesController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :require_admin
20 before_filter :require_admin
21
21
22 def index
22 def index
23 list
23 list
24 render :action => 'list'
24 render :action => 'list'
25 end
25 end
26
26
27 def list
27 def list
28 @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 10
28 @issue_status_pages, @issue_statuses = paginate :issue_statuses, :per_page => 10
29 end
29 end
30
30
31 def new
31 def new
32 @issue_status = IssueStatus.new
32 @issue_status = IssueStatus.new
33 end
33 end
34
34
35 def create
35 def create
36 @issue_status = IssueStatus.new(params[:issue_status])
36 @issue_status = IssueStatus.new(params[:issue_status])
37 if @issue_status.save
37 if @issue_status.save
38 flash[:notice] = 'IssueStatus was successfully created.'
38 flash[:notice] = l(:notice_successful_create)
39 redirect_to :action => 'list'
39 redirect_to :action => 'list'
40 else
40 else
41 render :action => 'new'
41 render :action => 'new'
42 end
42 end
43 end
43 end
44
44
45 def edit
45 def edit
46 @issue_status = IssueStatus.find(params[:id])
46 @issue_status = IssueStatus.find(params[:id])
47 end
47 end
48
48
49 def update
49 def update
50 @issue_status = IssueStatus.find(params[:id])
50 @issue_status = IssueStatus.find(params[:id])
51 if @issue_status.update_attributes(params[:issue_status])
51 if @issue_status.update_attributes(params[:issue_status])
52 flash[:notice] = 'IssueStatus was successfully updated.'
52 flash[:notice] = l(:notice_successful_update)
53 redirect_to :action => 'list'
53 redirect_to :action => 'list'
54 else
54 else
55 render :action => 'edit'
55 render :action => 'edit'
56 end
56 end
57 end
57 end
58
58
59 def destroy
59 def destroy
60 IssueStatus.find(params[:id]).destroy
60 IssueStatus.find(params[:id]).destroy
61 redirect_to :action => 'list'
61 redirect_to :action => 'list'
62 rescue
62 rescue
63 flash[:notice] = "Unable to delete issue status"
63 flash[:notice] = "Unable to delete issue status"
64 redirect_to :action => 'list'
64 redirect_to :action => 'list'
65 end
65 end
66
66
67
67
68 end
68 end
@@ -1,100 +1,100
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class IssuesController < ApplicationController
18 class IssuesController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :find_project, :authorize
20 before_filter :find_project, :authorize
21
21
22 helper :custom_fields
22 helper :custom_fields
23 include CustomFieldsHelper
23 include CustomFieldsHelper
24
24
25 def show
25 def show
26 @status_options = @issue.status.workflows.find(:all, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user
26 @status_options = @issue.status.workflows.find(:all, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user
27 @custom_values = @issue.custom_values.find(:all, :include => :custom_field)
27 @custom_values = @issue.custom_values.find(:all, :include => :custom_field)
28 end
28 end
29
29
30 def edit
30 def edit
31 @priorities = Enumeration::get_values('IPRI')
31 @priorities = Enumeration::get_values('IPRI')
32
32
33 if request.get?
33 if request.get?
34 @custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| @issue.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x, :customized => @issue) }
34 @custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| @issue.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x, :customized => @issue) }
35 else
35 else
36 # Retrieve custom fields and values
36 # Retrieve custom fields and values
37 @custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
37 @custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
38 @issue.custom_values = @custom_values
38 @issue.custom_values = @custom_values
39 @issue.attributes = params[:issue]
39 @issue.attributes = params[:issue]
40 if @issue.save
40 if @issue.save
41 flash[:notice] = 'Issue was successfully updated.'
41 flash[:notice] = l(:notice_successful_update)
42 redirect_to :action => 'show', :id => @issue
42 redirect_to :action => 'show', :id => @issue
43 end
43 end
44 end
44 end
45 end
45 end
46
46
47 def change_status
47 def change_status
48 @history = @issue.histories.build(params[:history])
48 @history = @issue.histories.build(params[:history])
49 @status_options = @issue.status.workflows.find(:all, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user
49 @status_options = @issue.status.workflows.find(:all, :conditions => ["role_id=? and tracker_id=?", self.logged_in_user.role_for_project(@project.id), @issue.tracker.id]).collect{ |w| w.new_status } if self.logged_in_user
50
50
51 if params[:confirm]
51 if params[:confirm]
52 @history.author_id = self.logged_in_user.id if self.logged_in_user
52 @history.author_id = self.logged_in_user.id if self.logged_in_user
53
53
54 if @history.save
54 if @history.save
55 @issue.status = @history.status
55 @issue.status = @history.status
56 @issue.fixed_version_id = (params[:issue][:fixed_version_id])
56 @issue.fixed_version_id = (params[:issue][:fixed_version_id])
57 @issue.assigned_to_id = (params[:issue][:assigned_to_id])
57 @issue.assigned_to_id = (params[:issue][:assigned_to_id])
58 if @issue.save
58 if @issue.save
59 flash[:notice] = 'Issue was successfully updated.'
59 flash[:notice] = l(:notice_successful_update)
60 Mailer.deliver_issue_change_status(@issue) if Permission.find_by_controller_and_action(@params[:controller], @params[:action]).mail_enabled?
60 Mailer.deliver_issue_change_status(@issue) if Permission.find_by_controller_and_action(@params[:controller], @params[:action]).mail_enabled?
61 redirect_to :action => 'show', :id => @issue
61 redirect_to :action => 'show', :id => @issue
62 end
62 end
63 end
63 end
64 end
64 end
65 @assignable_to = @project.members.find(:all, :include => :user).collect{ |m| m.user }
65 @assignable_to = @project.members.find(:all, :include => :user).collect{ |m| m.user }
66
66
67 end
67 end
68
68
69 def destroy
69 def destroy
70 @issue.destroy
70 @issue.destroy
71 redirect_to :controller => 'projects', :action => 'list_issues', :id => @project
71 redirect_to :controller => 'projects', :action => 'list_issues', :id => @project
72 end
72 end
73
73
74 def add_attachment
74 def add_attachment
75 # Save the attachment
75 # Save the attachment
76 if params[:attachment][:file].size > 0
76 if params[:attachment][:file].size > 0
77 @attachment = @issue.attachments.build(params[:attachment])
77 @attachment = @issue.attachments.build(params[:attachment])
78 @attachment.author_id = self.logged_in_user.id if self.logged_in_user
78 @attachment.author_id = self.logged_in_user.id if self.logged_in_user
79 @attachment.save
79 @attachment.save
80 end
80 end
81 redirect_to :action => 'show', :id => @issue
81 redirect_to :action => 'show', :id => @issue
82 end
82 end
83
83
84 def destroy_attachment
84 def destroy_attachment
85 @issue.attachments.find(params[:attachment_id]).destroy
85 @issue.attachments.find(params[:attachment_id]).destroy
86 redirect_to :action => 'show', :id => @issue
86 redirect_to :action => 'show', :id => @issue
87 end
87 end
88
88
89 # Send the file in stream mode
89 # Send the file in stream mode
90 def download
90 def download
91 @attachment = @issue.attachments.find(params[:attachment_id])
91 @attachment = @issue.attachments.find(params[:attachment_id])
92 send_file @attachment.diskfile, :filename => @attachment.filename
92 send_file @attachment.diskfile, :filename => @attachment.filename
93 end
93 end
94
94
95 private
95 private
96 def find_project
96 def find_project
97 @issue = Issue.find(params[:id])
97 @issue = Issue.find(params[:id])
98 @project = @issue.project
98 @project = @issue.project
99 end
99 end
100 end
100 end
@@ -1,41 +1,41
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class MembersController < ApplicationController
18 class MembersController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :find_project, :authorize
20 before_filter :find_project, :authorize
21
21
22 def edit
22 def edit
23 if request.post? and @member.update_attributes(params[:member])
23 if request.post? and @member.update_attributes(params[:member])
24 flash[:notice] = 'Member was successfully updated.'
24 flash[:notice] = l(:notice_successful_update)
25 redirect_to :controller => 'projects', :action => 'settings', :id => @project
25 redirect_to :controller => 'projects', :action => 'settings', :id => @project
26 end
26 end
27 end
27 end
28
28
29 def destroy
29 def destroy
30 @member.destroy
30 @member.destroy
31 flash[:notice] = 'Member was successfully removed.'
31 flash[:notice] = l(:notice_successful_delete)
32 redirect_to :controller => 'projects', :action => 'settings', :id => @project
32 redirect_to :controller => 'projects', :action => 'settings', :id => @project
33 end
33 end
34
34
35 private
35 private
36 def find_project
36 def find_project
37 @member = Member.find(params[:id])
37 @member = Member.find(params[:id])
38 @project = @member.project
38 @project = @member.project
39 end
39 end
40
40
41 end
41 end
@@ -1,42 +1,42
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class NewsController < ApplicationController
18 class NewsController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :find_project, :authorize
20 before_filter :find_project, :authorize
21
21
22 def show
22 def show
23 end
23 end
24
24
25 def edit
25 def edit
26 if request.post? and @news.update_attributes(params[:news])
26 if request.post? and @news.update_attributes(params[:news])
27 flash[:notice] = 'News was successfully updated.'
27 flash[:notice] = l(:notice_successful_update)
28 redirect_to :action => 'show', :id => @news
28 redirect_to :action => 'show', :id => @news
29 end
29 end
30 end
30 end
31
31
32 def destroy
32 def destroy
33 @news.destroy
33 @news.destroy
34 redirect_to :controller => 'projects', :action => 'list_news', :id => @project
34 redirect_to :controller => 'projects', :action => 'list_news', :id => @project
35 end
35 end
36
36
37 private
37 private
38 def find_project
38 def find_project
39 @news = News.find(params[:id])
39 @news = News.find(params[:id])
40 @project = @news.project
40 @project = @news.project
41 end
41 end
42 end
42 end
@@ -1,292 +1,296
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class ProjectsController < ApplicationController
18 class ProjectsController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :find_project, :authorize, :except => [ :index, :list, :add ]
20 before_filter :find_project, :authorize, :except => [ :index, :list, :add ]
21 before_filter :require_admin, :only => [ :add, :destroy ]
21 before_filter :require_admin, :only => [ :add, :destroy ]
22
22
23 helper :sort
23 helper :sort
24 include SortHelper
24 include SortHelper
25 helper :search_filter
25 helper :search_filter
26 include SearchFilterHelper
26 include SearchFilterHelper
27 helper :custom_fields
27 helper :custom_fields
28 include CustomFieldsHelper
28 include CustomFieldsHelper
29
29
30 def index
30 def index
31 list
31 list
32 render :action => 'list'
32 render :action => 'list'
33 end
33 end
34
34
35 # Lists public projects
35 # Lists public projects
36 def list
36 def list
37 sort_init 'name', 'asc'
37 sort_init 'name', 'asc'
38 sort_update
38 sort_update
39 @project_count = Project.count(["is_public=?", true])
39 @project_count = Project.count(["is_public=?", true])
40 @project_pages = Paginator.new self, @project_count,
40 @project_pages = Paginator.new self, @project_count,
41 15,
41 15,
42 @params['page']
42 @params['page']
43 @projects = Project.find :all, :order => sort_clause,
43 @projects = Project.find :all, :order => sort_clause,
44 :conditions => ["is_public=?", true],
44 :conditions => ["is_public=?", true],
45 :limit => @project_pages.items_per_page,
45 :limit => @project_pages.items_per_page,
46 :offset => @project_pages.current.offset
46 :offset => @project_pages.current.offset
47 end
47 end
48
48
49 # Add a new project
49 # Add a new project
50 def add
50 def add
51 @custom_fields = IssueCustomField.find(:all)
51 @custom_fields = IssueCustomField.find(:all)
52 @root_projects = Project.find(:all, :conditions => "parent_id is null")
52 @root_projects = Project.find(:all, :conditions => "parent_id is null")
53 @project = Project.new(params[:project])
53 @project = Project.new(params[:project])
54 if request.get?
54 if request.get?
55 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
55 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
56 else
56 else
57 @project.custom_fields = CustomField.find(@params[:custom_field_ids]) if @params[:custom_field_ids]
57 @project.custom_fields = CustomField.find(@params[:custom_field_ids]) if @params[:custom_field_ids]
58 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
58 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
59 @project.custom_values = @custom_values
59 @project.custom_values = @custom_values
60 if @project.save
60 if @project.save
61 flash[:notice] = 'Project was successfully created.'
61 flash[:notice] = l(:notice_successful_create)
62 redirect_to :controller => 'admin', :action => 'projects'
62 redirect_to :controller => 'admin', :action => 'projects'
63 end
63 end
64 end
64 end
65 end
65 end
66
66
67 # Show @project
67 # Show @project
68 def show
68 def show
69 @custom_values = @project.custom_values.find(:all, :include => :custom_field)
69 @custom_values = @project.custom_values.find(:all, :include => :custom_field)
70 @members = @project.members.find(:all, :include => [:user, :role])
70 @members = @project.members.find(:all, :include => [:user, :role])
71 @subprojects = @project.children if @project.children_count > 0
71 @subprojects = @project.children if @project.children_count > 0
72 @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
72 @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
73 @trackers = Tracker.find(:all)
73 @trackers = Tracker.find(:all)
74 end
74 end
75
75
76 def settings
76 def settings
77 @root_projects = Project::find(:all, :conditions => ["parent_id is null and id <> ?", @project.id])
77 @root_projects = Project::find(:all, :conditions => ["parent_id is null and id <> ?", @project.id])
78 @custom_fields = IssueCustomField::find_all
78 @custom_fields = IssueCustomField::find_all
79 @issue_category ||= IssueCategory.new
79 @issue_category ||= IssueCategory.new
80 @member ||= @project.members.new
80 @member ||= @project.members.new
81 @roles = Role.find_all
81 @roles = Role.find_all
82 @users = User.find_all - @project.members.find(:all, :include => :user).collect{|m| m.user }
82 @users = User.find_all - @project.members.find(:all, :include => :user).collect{|m| m.user }
83 @custom_values = ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
83 @custom_values = ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
84 end
84 end
85
85
86 # Edit @project
86 # Edit @project
87 def edit
87 def edit
88 if request.post?
88 if request.post?
89 @project.custom_fields = IssueCustomField.find(@params[:custom_field_ids]) if @params[:custom_field_ids]
89 @project.custom_fields = IssueCustomField.find(@params[:custom_field_ids]) if @params[:custom_field_ids]
90 if params[:custom_fields]
90 if params[:custom_fields]
91 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
91 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
92 @project.custom_values = @custom_values
92 @project.custom_values = @custom_values
93 end
93 end
94 if @project.update_attributes(params[:project])
94 if @project.update_attributes(params[:project])
95 flash[:notice] = 'Project was successfully updated.'
95 flash[:notice] = l(:notice_successful_update)
96 redirect_to :action => 'settings', :id => @project
96 redirect_to :action => 'settings', :id => @project
97 else
97 else
98 settings
98 settings
99 render :action => 'settings'
99 render :action => 'settings'
100 end
100 end
101 end
101 end
102 end
102 end
103
103
104 # Delete @project
104 # Delete @project
105 def destroy
105 def destroy
106 if request.post? and params[:confirm]
106 if request.post? and params[:confirm]
107 @project.destroy
107 @project.destroy
108 redirect_to :controller => 'admin', :action => 'projects'
108 redirect_to :controller => 'admin', :action => 'projects'
109 end
109 end
110 end
110 end
111
111
112 # Add a new issue category to @project
112 # Add a new issue category to @project
113 def add_issue_category
113 def add_issue_category
114 if request.post?
114 if request.post?
115 @issue_category = @project.issue_categories.build(params[:issue_category])
115 @issue_category = @project.issue_categories.build(params[:issue_category])
116 if @issue_category.save
116 if @issue_category.save
117 flash[:notice] = l(:notice_successful_create)
117 redirect_to :action => 'settings', :id => @project
118 redirect_to :action => 'settings', :id => @project
118 else
119 else
119 settings
120 settings
120 render :action => 'settings'
121 render :action => 'settings'
121 end
122 end
122 end
123 end
123 end
124 end
124
125
125 # Add a new version to @project
126 # Add a new version to @project
126 def add_version
127 def add_version
127 @version = @project.versions.build(params[:version])
128 @version = @project.versions.build(params[:version])
128 if request.post? and @version.save
129 if request.post? and @version.save
130 flash[:notice] = l(:notice_successful_create)
129 redirect_to :action => 'settings', :id => @project
131 redirect_to :action => 'settings', :id => @project
130 end
132 end
131 end
133 end
132
134
133 # Add a new member to @project
135 # Add a new member to @project
134 def add_member
136 def add_member
135 @member = @project.members.build(params[:member])
137 @member = @project.members.build(params[:member])
136 if request.post?
138 if request.post?
137 if @member.save
139 if @member.save
138 flash[:notice] = 'Member was successfully added.'
140 flash[:notice] = l(:notice_successful_create)
139 redirect_to :action => 'settings', :id => @project
141 redirect_to :action => 'settings', :id => @project
140 else
142 else
141 settings
143 settings
142 render :action => 'settings'
144 render :action => 'settings'
143 end
145 end
144 end
146 end
145 end
147 end
146
148
147 # Show members list of @project
149 # Show members list of @project
148 def list_members
150 def list_members
149 @members = @project.members
151 @members = @project.members
150 end
152 end
151
153
152 # Add a new document to @project
154 # Add a new document to @project
153 def add_document
155 def add_document
154 @categories = Enumeration::get_values('DCAT')
156 @categories = Enumeration::get_values('DCAT')
155 @document = @project.documents.build(params[:document])
157 @document = @project.documents.build(params[:document])
156 if request.post?
158 if request.post?
157 # Save the attachment
159 # Save the attachment
158 if params[:attachment][:file].size > 0
160 if params[:attachment][:file].size > 0
159 @attachment = @document.attachments.build(params[:attachment])
161 @attachment = @document.attachments.build(params[:attachment])
160 @attachment.author_id = self.logged_in_user.id if self.logged_in_user
162 @attachment.author_id = self.logged_in_user.id if self.logged_in_user
161 end
163 end
162 if @document.save
164 if @document.save
165 flash[:notice] = l(:notice_successful_create)
163 redirect_to :action => 'list_documents', :id => @project
166 redirect_to :action => 'list_documents', :id => @project
164 end
167 end
165 end
168 end
166 end
169 end
167
170
168 # Show documents list of @project
171 # Show documents list of @project
169 def list_documents
172 def list_documents
170 @documents = @project.documents
173 @documents = @project.documents
171 end
174 end
172
175
173 # Add a new issue to @project
176 # Add a new issue to @project
174 def add_issue
177 def add_issue
175 @tracker = Tracker.find(params[:tracker_id])
178 @tracker = Tracker.find(params[:tracker_id])
176 @priorities = Enumeration::get_values('IPRI')
179 @priorities = Enumeration::get_values('IPRI')
177 @issue = Issue.new(:project => @project, :tracker => @tracker)
180 @issue = Issue.new(:project => @project, :tracker => @tracker)
178 if request.get?
181 if request.get?
179 @custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue) }
182 @custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue) }
180 else
183 else
181 @issue.attributes = params[:issue]
184 @issue.attributes = params[:issue]
182 @issue.author_id = self.logged_in_user.id if self.logged_in_user
185 @issue.author_id = self.logged_in_user.id if self.logged_in_user
183 # Create the document if a file was sent
186 # Create the document if a file was sent
184 if params[:attachment][:file].size > 0
187 if params[:attachment][:file].size > 0
185 @attachment = @issue.attachments.build(params[:attachment])
188 @attachment = @issue.attachments.build(params[:attachment])
186 @attachment.author_id = self.logged_in_user.id if self.logged_in_user
189 @attachment.author_id = self.logged_in_user.id if self.logged_in_user
187 end
190 end
188 @custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
191 @custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
189 @issue.custom_values = @custom_values
192 @issue.custom_values = @custom_values
190 if @issue.save
193 if @issue.save
191 flash[:notice] = "Issue was successfully added."
194 flash[:notice] = l(:notice_successful_create)
192 Mailer.deliver_issue_add(@issue) if Permission.find_by_controller_and_action(@params[:controller], @params[:action]).mail_enabled?
195 Mailer.deliver_issue_add(@issue) if Permission.find_by_controller_and_action(@params[:controller], @params[:action]).mail_enabled?
193 redirect_to :action => 'list_issues', :id => @project
196 redirect_to :action => 'list_issues', :id => @project
194 end
197 end
195 end
198 end
196 end
199 end
197
200
198 # Show filtered/sorted issues list of @project
201 # Show filtered/sorted issues list of @project
199 def list_issues
202 def list_issues
200 sort_init 'issues.id', 'desc'
203 sort_init 'issues.id', 'desc'
201 sort_update
204 sort_update
202
205
203 search_filter_init_list_issues
206 search_filter_init_list_issues
204 search_filter_update if params[:set_filter] or request.post?
207 search_filter_update if params[:set_filter] or request.post?
205
208
206 @issue_count = Issue.count(:include => [:status, :project], :conditions => search_filter_clause)
209 @issue_count = Issue.count(:include => [:status, :project], :conditions => search_filter_clause)
207 @issue_pages = Paginator.new self, @issue_count, 15, @params['page']
210 @issue_pages = Paginator.new self, @issue_count, 15, @params['page']
208 @issues = Issue.find :all, :order => sort_clause,
211 @issues = Issue.find :all, :order => sort_clause,
209 :include => [ :author, :status, :tracker, :project ],
212 :include => [ :author, :status, :tracker, :project ],
210 :conditions => search_filter_clause,
213 :conditions => search_filter_clause,
211 :limit => @issue_pages.items_per_page,
214 :limit => @issue_pages.items_per_page,
212 :offset => @issue_pages.current.offset
215 :offset => @issue_pages.current.offset
213 end
216 end
214
217
215 # Export filtered/sorted issues list to CSV
218 # Export filtered/sorted issues list to CSV
216 def export_issues_csv
219 def export_issues_csv
217 sort_init 'issues.id', 'desc'
220 sort_init 'issues.id', 'desc'
218 sort_update
221 sort_update
219
222
220 search_filter_init_list_issues
223 search_filter_init_list_issues
221
224
222 @issues = Issue.find :all, :order => sort_clause,
225 @issues = Issue.find :all, :order => sort_clause,
223 :include => [ :author, :status, :tracker, :project ],
226 :include => [ :author, :status, :tracker, :project ],
224 :conditions => search_filter_clause
227 :conditions => search_filter_clause
225
228
226 export = StringIO.new
229 export = StringIO.new
227 CSV::Writer.generate(export, ',') do |csv|
230 CSV::Writer.generate(export, ',') do |csv|
228 csv << %w(Id Status Tracker Subject Author Created Updated)
231 csv << %w(Id Status Tracker Subject Author Created Updated)
229 @issues.each do |issue|
232 @issues.each do |issue|
230 csv << [issue.id, issue.status.name, issue.tracker.name, issue.subject, issue.author.display_name, l_datetime(issue.created_on), l_datetime(issue.updated_on)]
233 csv << [issue.id, issue.status.name, issue.tracker.name, issue.subject, issue.author.display_name, l_datetime(issue.created_on), l_datetime(issue.updated_on)]
231 end
234 end
232 end
235 end
233 export.rewind
236 export.rewind
234 send_data(export.read,
237 send_data(export.read,
235 :type => 'text/csv; charset=utf-8; header=present',
238 :type => 'text/csv; charset=utf-8; header=present',
236 :filename => 'export.csv')
239 :filename => 'export.csv')
237 end
240 end
238
241
239 # Add a news to @project
242 # Add a news to @project
240 def add_news
243 def add_news
241 @news = News.new(:project => @project)
244 @news = News.new(:project => @project)
242 if request.post?
245 if request.post?
243 @news.attributes = params[:news]
246 @news.attributes = params[:news]
244 @news.author_id = self.logged_in_user.id if self.logged_in_user
247 @news.author_id = self.logged_in_user.id if self.logged_in_user
245 if @news.save
248 if @news.save
249 flash[:notice] = l(:notice_successful_create)
246 redirect_to :action => 'list_news', :id => @project
250 redirect_to :action => 'list_news', :id => @project
247 end
251 end
248 end
252 end
249 end
253 end
250
254
251 # Show news list of @project
255 # Show news list of @project
252 def list_news
256 def list_news
253 @news_pages, @news = paginate :news, :per_page => 10, :conditions => ["project_id=?", @project.id], :include => :author, :order => "news.created_on DESC"
257 @news_pages, @news = paginate :news, :per_page => 10, :conditions => ["project_id=?", @project.id], :include => :author, :order => "news.created_on DESC"
254 end
258 end
255
259
256 def add_file
260 def add_file
257 if request.post?
261 if request.post?
258 # Save the attachment
262 # Save the attachment
259 if params[:attachment][:file].size > 0
263 if params[:attachment][:file].size > 0
260 @attachment = @project.versions.find(params[:version_id]).attachments.build(params[:attachment])
264 @attachment = @project.versions.find(params[:version_id]).attachments.build(params[:attachment])
261 @attachment.author_id = self.logged_in_user.id if self.logged_in_user
265 @attachment.author_id = self.logged_in_user.id if self.logged_in_user
262 if @attachment.save
266 if @attachment.save
267 flash[:notice] = l(:notice_successful_create)
263 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
268 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
264 end
269 end
265 end
270 end
266 end
271 end
267 @versions = @project.versions
272 @versions = @project.versions
268 end
273 end
269
274
270 def list_files
275 def list_files
271 @versions = @project.versions
276 @versions = @project.versions
272 end
277 end
273
278
274 # Show changelog of @project
279 # Show changelog of @project
275 def changelog
280 def changelog
276 @fixed_issues = @project.issues.find(:all,
281 @fixed_issues = @project.issues.find(:all,
277 :include => [ :fixed_version, :status, :tracker ],
282 :include => [ :fixed_version, :status, :tracker ],
278 :conditions => [ "issue_statuses.is_closed=? and trackers.is_in_chlog=? and issues.fixed_version_id is not null", true, true]
283 :conditions => [ "issue_statuses.is_closed=? and trackers.is_in_chlog=? and issues.fixed_version_id is not null", true, true]
279 )
284 )
280 end
285 end
281
286
282 private
287 private
283 # Find project of id params[:id]
288 # Find project of id params[:id]
284 # if not found, redirect to project list
289 # if not found, redirect to project list
285 # used as a before_filter
290 # used as a before_filter
286 def find_project
291 def find_project
287 @project = Project.find(params[:id])
292 @project = Project.find(params[:id])
288 rescue
293 rescue
289 flash[:notice] = 'Project not found.'
290 redirect_to :action => 'list'
294 redirect_to :action => 'list'
291 end
295 end
292 end
296 end
@@ -1,83 +1,83
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class RolesController < ApplicationController
18 class RolesController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :require_admin
20 before_filter :require_admin
21
21
22 def index
22 def index
23 list
23 list
24 render :action => 'list'
24 render :action => 'list'
25 end
25 end
26
26
27 def list
27 def list
28 @role_pages, @roles = paginate :roles, :per_page => 10
28 @role_pages, @roles = paginate :roles, :per_page => 10
29 end
29 end
30
30
31 def new
31 def new
32 @role = Role.new(params[:role])
32 @role = Role.new(params[:role])
33 if request.post?
33 if request.post?
34 @role.permissions = Permission.find(@params[:permission_ids]) if @params[:permission_ids]
34 @role.permissions = Permission.find(@params[:permission_ids]) if @params[:permission_ids]
35 if @role.save
35 if @role.save
36 flash[:notice] = 'Role was successfully created.'
36 flash[:notice] = l(:notice_successful_create)
37 redirect_to :action => 'list'
37 redirect_to :action => 'list'
38 end
38 end
39 end
39 end
40 @permissions = Permission.find(:all, :conditions => ["is_public=?", false], :order => 'sort ASC')
40 @permissions = Permission.find(:all, :conditions => ["is_public=?", false], :order => 'sort ASC')
41 end
41 end
42
42
43 def edit
43 def edit
44 @role = Role.find(params[:id])
44 @role = Role.find(params[:id])
45 if request.post? and @role.update_attributes(params[:role])
45 if request.post? and @role.update_attributes(params[:role])
46 @role.permissions = Permission.find(@params[:permission_ids] || [])
46 @role.permissions = Permission.find(@params[:permission_ids] || [])
47 Permission.allowed_to_role_expired
47 Permission.allowed_to_role_expired
48 flash[:notice] = 'Role was successfully updated.'
48 flash[:notice] = l(:notice_successful_update)
49 redirect_to :action => 'list'
49 redirect_to :action => 'list'
50 end
50 end
51 @permissions = Permission.find(:all, :conditions => ["is_public=?", false], :order => 'sort ASC')
51 @permissions = Permission.find(:all, :conditions => ["is_public=?", false], :order => 'sort ASC')
52 end
52 end
53
53
54 def destroy
54 def destroy
55 @role = Role.find(params[:id])
55 @role = Role.find(params[:id])
56 unless @role.members.empty?
56 unless @role.members.empty?
57 flash[:notice] = 'Some members have this role. Can\'t delete it.'
57 flash[:notice] = 'Some members have this role. Can\'t delete it.'
58 else
58 else
59 @role.destroy
59 @role.destroy
60 end
60 end
61 redirect_to :action => 'list'
61 redirect_to :action => 'list'
62 end
62 end
63
63
64 def workflow
64 def workflow
65 @role = Role.find_by_id(params[:role_id])
65 @role = Role.find_by_id(params[:role_id])
66 @tracker = Tracker.find_by_id(params[:tracker_id])
66 @tracker = Tracker.find_by_id(params[:tracker_id])
67
67
68 if request.post?
68 if request.post?
69 Workflow.destroy_all( ["role_id=? and tracker_id=?", @role.id, @tracker.id])
69 Workflow.destroy_all( ["role_id=? and tracker_id=?", @role.id, @tracker.id])
70 (params[:issue_status] || []).each { |old, news|
70 (params[:issue_status] || []).each { |old, news|
71 news.each { |new|
71 news.each { |new|
72 @role.workflows.build(:tracker_id => @tracker.id, :old_status_id => old, :new_status_id => new)
72 @role.workflows.build(:tracker_id => @tracker.id, :old_status_id => old, :new_status_id => new)
73 }
73 }
74 }
74 }
75 if @role.save
75 if @role.save
76 flash[:notice] = 'Workflow was successfully updated.'
76 flash[:notice] = l(:notice_successful_update)
77 end
77 end
78 end
78 end
79 @roles = Role.find_all
79 @roles = Role.find_all
80 @trackers = Tracker.find_all
80 @trackers = Tracker.find_all
81 @statuses = IssueStatus.find(:all, :include => :workflows)
81 @statuses = IssueStatus.find(:all, :include => :workflows)
82 end
82 end
83 end
83 end
@@ -1,60 +1,60
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class TrackersController < ApplicationController
18 class TrackersController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :require_admin
20 before_filter :require_admin
21
21
22 def index
22 def index
23 list
23 list
24 render :action => 'list'
24 render :action => 'list'
25 end
25 end
26
26
27 # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
27 # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
28 verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :list }
28 verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :list }
29
29
30 def list
30 def list
31 @tracker_pages, @trackers = paginate :trackers, :per_page => 10
31 @tracker_pages, @trackers = paginate :trackers, :per_page => 10
32 end
32 end
33
33
34 def new
34 def new
35 @tracker = Tracker.new(params[:tracker])
35 @tracker = Tracker.new(params[:tracker])
36 if request.post? and @tracker.save
36 if request.post? and @tracker.save
37 flash[:notice] = 'Tracker was successfully created.'
37 flash[:notice] = l(:notice_successful_create)
38 redirect_to :action => 'list'
38 redirect_to :action => 'list'
39 end
39 end
40 end
40 end
41
41
42 def edit
42 def edit
43 @tracker = Tracker.find(params[:id])
43 @tracker = Tracker.find(params[:id])
44 if request.post? and @tracker.update_attributes(params[:tracker])
44 if request.post? and @tracker.update_attributes(params[:tracker])
45 flash[:notice] = 'Tracker was successfully updated.'
45 flash[:notice] = l(:notice_successful_update)
46 redirect_to :action => 'list'
46 redirect_to :action => 'list'
47 end
47 end
48 end
48 end
49
49
50 def destroy
50 def destroy
51 @tracker = Tracker.find(params[:id])
51 @tracker = Tracker.find(params[:id])
52 unless @tracker.issues.empty?
52 unless @tracker.issues.empty?
53 flash[:notice] = "This tracker contains issues and can\'t be deleted."
53 flash[:notice] = "This tracker contains issues and can\'t be deleted."
54 else
54 else
55 @tracker.destroy
55 @tracker.destroy
56 end
56 end
57 redirect_to :action => 'list'
57 redirect_to :action => 'list'
58 end
58 end
59
59
60 end
60 end
@@ -1,88 +1,88
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class UsersController < ApplicationController
18 class UsersController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :require_admin
20 before_filter :require_admin
21
21
22 helper :sort
22 helper :sort
23 include SortHelper
23 include SortHelper
24 helper :custom_fields
24 helper :custom_fields
25 include CustomFieldsHelper
25 include CustomFieldsHelper
26
26
27 def index
27 def index
28 list
28 list
29 render :action => 'list'
29 render :action => 'list'
30 end
30 end
31
31
32 def list
32 def list
33 sort_init 'login', 'asc'
33 sort_init 'login', 'asc'
34 sort_update
34 sort_update
35 @user_count = User.count
35 @user_count = User.count
36 @user_pages = Paginator.new self, @user_count,
36 @user_pages = Paginator.new self, @user_count,
37 15,
37 15,
38 @params['page']
38 @params['page']
39 @users = User.find :all,:order => sort_clause,
39 @users = User.find :all,:order => sort_clause,
40 :limit => @user_pages.items_per_page,
40 :limit => @user_pages.items_per_page,
41 :offset => @user_pages.current.offset
41 :offset => @user_pages.current.offset
42 end
42 end
43
43
44 def add
44 def add
45 if request.get?
45 if request.get?
46 @user = User.new(:language => $RDM_DEFAULT_LANG)
46 @user = User.new(:language => $RDM_DEFAULT_LANG)
47 @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user) }
47 @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user) }
48 else
48 else
49 @user = User.new(params[:user])
49 @user = User.new(params[:user])
50 @user.admin = params[:user][:admin] || false
50 @user.admin = params[:user][:admin] || false
51 @user.login = params[:user][:login]
51 @user.login = params[:user][:login]
52 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation]
52 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation]
53 @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }
53 @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }
54 @user.custom_values = @custom_values
54 @user.custom_values = @custom_values
55 if @user.save
55 if @user.save
56 flash[:notice] = 'User was successfully created.'
56 flash[:notice] = l(:notice_successful_create)
57 redirect_to :action => 'list'
57 redirect_to :action => 'list'
58 end
58 end
59 end
59 end
60 end
60 end
61
61
62 def edit
62 def edit
63 @user = User.find(params[:id])
63 @user = User.find(params[:id])
64 if request.get?
64 if request.get?
65 @custom_values = UserCustomField.find(:all).collect { |x| @user.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
65 @custom_values = UserCustomField.find(:all).collect { |x| @user.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
66 else
66 else
67 @user.admin = params[:user][:admin] if params[:user][:admin]
67 @user.admin = params[:user][:admin] if params[:user][:admin]
68 @user.login = params[:user][:login] if params[:user][:login]
68 @user.login = params[:user][:login] if params[:user][:login]
69 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation] unless params[:password].nil? or params[:password].empty?
69 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation] unless params[:password].nil? or params[:password].empty?
70 if params[:custom_fields]
70 if params[:custom_fields]
71 @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }
71 @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }
72 @user.custom_values = @custom_values
72 @user.custom_values = @custom_values
73 end
73 end
74 if @user.update_attributes(params[:user])
74 if @user.update_attributes(params[:user])
75 flash[:notice] = 'User was successfully updated.'
75 flash[:notice] = l(:notice_successful_update)
76 redirect_to :action => 'list'
76 redirect_to :action => 'list'
77 end
77 end
78 end
78 end
79 end
79 end
80
80
81 def destroy
81 def destroy
82 User.find(params[:id]).destroy
82 User.find(params[:id]).destroy
83 redirect_to :action => 'list'
83 redirect_to :action => 'list'
84 rescue
84 rescue
85 flash[:notice] = "Unable to delete user"
85 flash[:notice] = "Unable to delete user"
86 redirect_to :action => 'list'
86 redirect_to :action => 'list'
87 end
87 end
88 end
88 end
@@ -1,56 +1,57
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class VersionsController < ApplicationController
18 class VersionsController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :find_project, :authorize
20 before_filter :find_project, :authorize
21
21
22 def edit
22 def edit
23 if request.post? and @version.update_attributes(params[:version])
23 if request.post? and @version.update_attributes(params[:version])
24 flash[:notice] = 'Version was successfully updated.'
24 flash[:notice] = l(:notice_successful_update)
25 redirect_to :controller => 'projects', :action => 'settings', :id => @project
25 redirect_to :controller => 'projects', :action => 'settings', :id => @project
26 end
26 end
27 end
27 end
28
28
29 def destroy
29 def destroy
30 @version.destroy
30 @version.destroy
31 redirect_to :controller => 'projects', :action => 'settings', :id => @project
31 redirect_to :controller => 'projects', :action => 'settings', :id => @project
32 rescue
32 rescue
33 flash[:notice] = "Unable to delete version"
33 flash[:notice] = "Unable to delete version"
34 redirect_to :controller => 'projects', :action => 'settings', :id => @project
34 redirect_to :controller => 'projects', :action => 'settings', :id => @project
35 end
35 end
36
36
37 def download
37 def download
38 @attachment = @version.attachments.find(params[:attachment_id])
38 @attachment = @version.attachments.find(params[:attachment_id])
39 @attachment.increment_download
39 @attachment.increment_download
40 send_file @attachment.diskfile, :filename => @attachment.filename
40 send_file @attachment.diskfile, :filename => @attachment.filename
41 rescue
41 rescue
42 flash[:notice]="Requested file doesn't exist or has been deleted."
42 flash[:notice] = l(:notice_file_not_found)
43 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
43 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
44 end
44 end
45
45
46 def destroy_file
46 def destroy_file
47 @version.attachments.find(params[:attachment_id]).destroy
47 @version.attachments.find(params[:attachment_id]).destroy
48 flash[:notice] = l(:notice_successful_delete)
48 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
49 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
49 end
50 end
50
51
51 private
52 private
52 def find_project
53 def find_project
53 @version = Version.find(params[:id])
54 @version = Version.find(params[:id])
54 @project = @version.project
55 @project = @version.project
55 end
56 end
56 end
57 end
@@ -1,97 +1,97
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 module ApplicationHelper
18 module ApplicationHelper
19
19
20 # return current logged in user or nil
20 # return current logged in user or nil
21 def loggedin?
21 def loggedin?
22 @logged_in_user
22 @logged_in_user
23 end
23 end
24
24
25 # return true if user is loggend in and is admin, otherwise false
25 # return true if user is loggend in and is admin, otherwise false
26 def admin_loggedin?
26 def admin_loggedin?
27 @logged_in_user and @logged_in_user.admin?
27 @logged_in_user and @logged_in_user.admin?
28 end
28 end
29
29
30 def authorize_for(controller, action)
30 def authorize_for(controller, action)
31 # check if action is allowed on public projects
31 # check if action is allowed on public projects
32 if @project.is_public? and Permission.allowed_to_public "%s/%s" % [ controller, action ]
32 if @project.is_public? and Permission.allowed_to_public "%s/%s" % [ controller, action ]
33 return true
33 return true
34 end
34 end
35 # check if user is authorized
35 # check if user is authorized
36 if @logged_in_user and (@logged_in_user.admin? or Permission.allowed_to_role( "%s/%s" % [ controller, action ], @logged_in_user.role_for_project(@project.id) ) )
36 if @logged_in_user and (@logged_in_user.admin? or Permission.allowed_to_role( "%s/%s" % [ controller, action ], @logged_in_user.role_for_project(@project.id) ) )
37 return true
37 return true
38 end
38 end
39 return false
39 return false
40 end
40 end
41
41
42 # Display a link if user is authorized
42 # Display a link if user is authorized
43 def link_to_if_authorized(name, options = {}, html_options = nil, *parameters_for_method_reference)
43 def link_to_if_authorized(name, options = {}, html_options = nil, *parameters_for_method_reference)
44 link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller], options[:action])
44 link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller], options[:action])
45 end
45 end
46
46
47 # Display a link to user's account page
47 # Display a link to user's account page
48 def link_to_user(user)
48 def link_to_user(user)
49 link_to user.display_name, :controller => 'account', :action => 'show', :id => user
49 link_to user.display_name, :controller => 'account', :action => 'show', :id => user
50 end
50 end
51
51
52 def format_date(date)
52 def format_date(date)
53 l_date(date) if date
53 l_date(date) if date
54 end
54 end
55
55
56 def format_time(time)
56 def format_time(time)
57 l_datetime(time) if time
57 l_datetime(time) if time
58 end
58 end
59
59
60 def pagination_links_full(paginator, options={}, html_options={})
60 def pagination_links_full(paginator, options={}, html_options={})
61 html =''
61 html =''
62 html << link_to(('&#171; ' + l(:label_previous) ), { :page => paginator.current.previous }) + ' ' if paginator.current.previous
62 html << link_to(('&#171; ' + l(:label_previous) ), { :page => paginator.current.previous }) + ' ' if paginator.current.previous
63 html << (pagination_links(paginator, options, html_options) || '')
63 html << (pagination_links(paginator, options, html_options) || '')
64 html << ' ' + link_to((l(:label_next) + ' &#187;'), { :page => paginator.current.next }) if paginator.current.next
64 html << ' ' + link_to((l(:label_next) + ' &#187;'), { :page => paginator.current.next }) if paginator.current.next
65 html
65 html
66 end
66 end
67
67
68 def error_messages_for(object_name, options = {})
68 def error_messages_for(object_name, options = {})
69 options = options.symbolize_keys
69 options = options.symbolize_keys
70 object = instance_variable_get("@#{object_name}")
70 object = instance_variable_get("@#{object_name}")
71 if object && !object.errors.empty?
71 if object && !object.errors.empty?
72 # build full_messages here with controller current language
72 # build full_messages here with controller current language
73 full_messages = []
73 full_messages = []
74 object.errors.each do |attr, msg|
74 object.errors.each do |attr, msg|
75 next if msg.nil?
75 next if msg.nil?
76 if attr == "base"
76 if attr == "base"
77 full_messages << l(msg)
77 full_messages << l(msg)
78 else
78 else
79 full_messages << "&#171; " + (l_has_string?("field_" + attr) ? l("field_" + attr) : object.class.human_attribute_name(attr)) + " &#187; " + l(msg)
79 full_messages << "&#171; " + (l_has_string?("field_" + attr) ? l("field_" + attr) : object.class.human_attribute_name(attr)) + " &#187; " + l(msg)
80 end
80 end
81 end
81 end
82 content_tag("div",
82 content_tag("div",
83 content_tag(
83 content_tag(
84 options[:header_tag] || "h2", lwr(:gui_validation_error, object.errors.count) + " :"
84 options[:header_tag] || "h2", lwr(:gui_validation_error, object.errors.count) + " :"
85 ) +
85 ) +
86 content_tag("ul", full_messages.collect { |msg| content_tag("li", msg) }),
86 content_tag("ul", full_messages.collect { |msg| content_tag("li", msg) }),
87 "id" => options[:id] || "errorExplanation", "class" => options[:class] || "errorExplanation"
87 "id" => options[:id] || "errorExplanation", "class" => options[:class] || "errorExplanation"
88 )
88 )
89 else
89 else
90 ""
90 ""
91 end
91 end
92 end
92 end
93
93
94 def lang_options_for_select
94 def lang_options_for_select
95 GLoc.valid_languages.collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]}
95 (GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }).collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]}
96 end
96 end
97 end
97 end
@@ -1,64 +1,67
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 module CustomFieldsHelper
18 module CustomFieldsHelper
19
19
20 def custom_field_tag(custom_value)
20 def custom_field_tag(custom_value)
21 custom_field = custom_value.custom_field
21 custom_field = custom_value.custom_field
22 field_name = "custom_fields[#{custom_field.id}]"
22 field_name = "custom_fields[#{custom_field.id}]"
23 field_id = "custom_fields_#{custom_field.id}"
24
23 case custom_field.field_format
25 case custom_field.field_format
24 when "string", "int", "date"
26 when "string", "int", "date"
25 text_field_tag field_name, custom_value.value
27 text_field_tag field_name, custom_value.value, :id => field_id
26 when "text"
28 when "text"
27 text_area_tag field_name, custom_value.value, :cols => 60, :rows => 3
29 text_area_tag field_name, custom_value.value, :id => field_id, :cols => 60, :rows => 3
28 when "bool"
30 when "bool"
29 check_box_tag(field_name, "1", custom_value.value == "1") +
31 check_box_tag(field_name, "1", custom_value.value == "1", :id => field_id) +
30 hidden_field_tag(field_name, "0")
32 hidden_field_tag(field_name, "0")
31 when "list"
33 when "list"
32 select_tag field_name,
34 select_tag field_name,
33 "<option></option>" + options_for_select(custom_field.possible_values.split('|'),
35 "<option></option>" + options_for_select(custom_field.possible_values.split('|'),
34 custom_value.value)
36 custom_value.value), :id => field_id
35 end
37 end
36 end
38 end
37
39
38 def custom_field_label_tag(custom_value)
40 def custom_field_label_tag(custom_value)
39 content_tag "label", custom_value.custom_field.name +
41 content_tag "label", custom_value.custom_field.name +
40 (custom_value.custom_field.is_required? ? " <span class=\"required\">*</span>" : "")
42 (custom_value.custom_field.is_required? ? " <span class=\"required\">*</span>" : ""),
43 :for => "custom_fields_#{custom_value.custom_field.id}"
41 end
44 end
42
45
43 def custom_field_tag_with_label(custom_value)
46 def custom_field_tag_with_label(custom_value)
44 case custom_value.custom_field.field_format
47 case custom_value.custom_field.field_format
45 when "bool"
48 when "bool"
46 custom_field_tag(custom_value) + " " + custom_field_label_tag(custom_value)
49 custom_field_tag(custom_value) + " " + custom_field_label_tag(custom_value)
47 else
50 else
48 custom_field_label_tag(custom_value) + "<br />" + custom_field_tag(custom_value)
51 custom_field_label_tag(custom_value) + "<br />" + custom_field_tag(custom_value)
49 end
52 end
50 end
53 end
51
54
52 def show_value(custom_value)
55 def show_value(custom_value)
53 case custom_value.custom_field.field_format
56 case custom_value.custom_field.field_format
54 when "bool"
57 when "bool"
55 l_YesNo(custom_value.value == "1")
58 l_YesNo(custom_value.value == "1")
56 else
59 else
57 custom_value.value
60 custom_value.value
58 end
61 end
59 end
62 end
60
63
61 def custom_field_formats_for_select
64 def custom_field_formats_for_select
62 CustomField::FIELD_FORMATS.keys.collect { |k| [ l(CustomField::FIELD_FORMATS[k]), k ] }
65 CustomField::FIELD_FORMATS.keys.collect { |k| [ l(CustomField::FIELD_FORMATS[k]), k ] }
63 end
66 end
64 end
67 end
@@ -1,57 +1,57
1 <h2><%=l(:label_my_account)%></h2>
1 <h2><%=l(:label_my_account)%></h2>
2
2
3 <p><%=l(:field_login)%>: <strong><%= @user.login %></strong><br />
3 <p><%=l(:field_login)%>: <strong><%= @user.login %></strong><br />
4 <%=l(:field_created_on)%>: <%= format_time(@user.created_on) %>,
4 <%=l(:field_created_on)%>: <%= format_time(@user.created_on) %>,
5 <%=l(:field_updated_on)%>: <%= format_time(@user.updated_on) %></p>
5 <%=l(:field_updated_on)%>: <%= format_time(@user.updated_on) %></p>
6
6
7 <%= error_messages_for 'user' %>
7 <%= error_messages_for 'user' %>
8
8
9 <div class="splitcontentleft">
9 <div class="splitcontentleft">
10 <div class="box">
10 <div class="box">
11 <h3><%=l(:label_information_plural)%></h3>
11 <h3><%=l(:label_information_plural)%></h3>
12 &nbsp;
12
13 <%= start_form_tag :action => 'my_account' %>
13 <%= start_form_tag :action => 'my_account' %>
14
14
15 <!--[form:user]-->
15 <!--[form:user]-->
16 <p><label for="user_firstname"><%=l(:field_firstname)%> <span class="required">*</span></label><br/>
16 <p><label for="user_firstname"><%=l(:field_firstname)%> <span class="required">*</span></label><br/>
17 <%= text_field 'user', 'firstname' %></p>
17 <%= text_field 'user', 'firstname' %></p>
18
18
19 <p><label for="user_lastname"><%=l(:field_lastname)%> <span class="required">*</span></label><br/>
19 <p><label for="user_lastname"><%=l(:field_lastname)%> <span class="required">*</span></label><br/>
20 <%= text_field 'user', 'lastname' %></p>
20 <%= text_field 'user', 'lastname' %></p>
21
21
22 <p><label for="user_mail"><%=l(:field_mail)%> <span class="required">*</span></label><br/>
22 <p><label for="user_mail"><%=l(:field_mail)%> <span class="required">*</span></label><br/>
23 <%= text_field 'user', 'mail' %></p>
23 <%= text_field 'user', 'mail', :size => 40 %></p>
24
24
25 <p><label for="user_language"><%=l(:field_language)%></label><br/>
25 <p><label for="user_language"><%=l(:field_language)%></label><br/>
26 <%= select("user", "language", lang_options_for_select) %></p>
26 <%= select("user", "language", lang_options_for_select) %></p>
27 <!--[eoform:user]-->
27 <!--[eoform:user]-->
28
28
29 <p><%= check_box 'user', 'mail_notification' %> <label for="user_mail_notification"><%=l(:field_mail_notification)%></label></p>
29 <p><%= check_box 'user', 'mail_notification' %> <label for="user_mail_notification"><%=l(:field_mail_notification)%></label></p>
30
30
31 <center><%= submit_tag l(:button_save) %></center>
31 <center><%= submit_tag l(:button_save) %></center>
32 <%= end_form_tag %>
32 <%= end_form_tag %>
33 </div>
33 </div>
34 </div>
34 </div>
35
35
36
36
37 <div class="splitcontentright">
37 <div class="splitcontentright">
38 <% unless @user.auth_source_id %>
38 <% unless @user.auth_source_id %>
39 <div class="box">
39 <div class="box">
40 <h3><%=l(:field_password)%></h3>
40 <h3><%=l(:field_password)%></h3>
41 &nbsp;
41
42 <%= start_form_tag :action => 'change_password' %>
42 <%= start_form_tag :action => 'change_password' %>
43
43
44 <p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label><br/>
44 <p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label><br/>
45 <%= password_field_tag 'password', nil, :size => 25 %></p>
45 <%= password_field_tag 'password', nil, :size => 25 %></p>
46
46
47 <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label><br/>
47 <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label><br/>
48 <%= password_field_tag 'new_password', nil, :size => 25 %></p>
48 <%= password_field_tag 'new_password', nil, :size => 25 %></p>
49
49
50 <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label><br/>
50 <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label><br/>
51 <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p>
51 <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p>
52
52
53 <center><%= submit_tag l(:button_save) %></center>
53 <center><%= submit_tag l(:button_save) %></center>
54 <%= end_form_tag %>
54 <%= end_form_tag %>
55 </div>
55 </div>
56 <% end %>
56 <% end %>
57 </div> No newline at end of file
57 </div>
@@ -1,16 +1,25
1 <h2><%=l(:field_mail_notification)%></h2>
1 <h2><%=l(:field_mail_notification)%></h2>
2
2
3 <p><%=l(:text_select_mail_notifications)%></p>
3 <p><%=l(:text_select_mail_notifications)%></p>
4
4
5 <%= start_form_tag ({}, :id => 'mail_options_form')%>
5 <%= start_form_tag ({}, :id => 'mail_options_form')%>
6 <% for action in @actions %>
6
7 <%= check_box_tag "action_ids[]", action.id, action.mail_enabled? %>
7 <% actions = @actions.group_by {|p| p.group_id } %>
8 <%= action.description %><br />
8 <% actions.keys.sort.each do |group_id| %>
9 <fieldset style="margin-top: 6px;"><legend><strong><%= l(Permission::GROUPS[group_id]) %></strong></legend>
10 <% actions[group_id].each do |p| %>
11 <div style="width:170px;float:left;"><%= check_box_tag "action_ids[]", p.id, p.mail_enabled? %>
12 <%= l(p.description.to_sym) %>
13 </div>
14 <% end %>
15 </fieldset>
9 <% end %>
16 <% end %>
17
18
10 <br />
19 <br />
11 <p>
20 <p>
12 <a href="javascript:checkAll('mail_options_form', true)"><%=l(:button_check_all)%></a> |
21 <a href="javascript:checkAll('mail_options_form', true)"><%=l(:button_check_all)%></a> |
13 <a href="javascript:checkAll('mail_options_form', false)"><%=l(:button_uncheck_all)%></a>
22 <a href="javascript:checkAll('mail_options_form', false)"><%=l(:button_uncheck_all)%></a>
14 </p>
23 </p>
15 <%= submit_tag l(:button_save) %>
24 <%= submit_tag l(:button_save) %>
16 <%= end_form_tag %> No newline at end of file
25 <%= end_form_tag %>
@@ -1,74 +1,72
1 <h2><%=l(:label_overview)%></h2>
1 <h2><%=l(:label_overview)%></h2>
2
2
3 <div class="splitcontentleft">
3 <div class="splitcontentleft">
4 <%= @project.description %>
4 <%= @project.description %>
5 <ul>
5 <ul>
6 <li><%=l(:field_homepage)%>: <%= link_to @project.homepage, @project.homepage %></li>
6 <li><%=l(:field_homepage)%>: <%= link_to @project.homepage, @project.homepage %></li>
7 <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
7 <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
8 <% for custom_value in @custom_values %>
8 <% for custom_value in @custom_values %>
9 <% if !custom_value.value.empty? %>
9 <% if !custom_value.value.empty? %>
10 <li><%= custom_value.custom_field.name%>: <%= custom_value.value%></li>
10 <li><%= custom_value.custom_field.name%>: <%= custom_value.value%></li>
11 <% end %>
11 <% end %>
12 <% end %>
12 <% end %>
13 </ul>
13 </ul>
14
14
15 <div class="box">
15 <div class="box">
16 <h3><%= image_tag "tracker" %> <%=l(:label_tracker_plural)%></h3>
16 <h3><%= image_tag "tracker" %> <%=l(:label_tracker_plural)%></h3>
17 <ul>
17 <ul>
18 <% for tracker in @trackers %>
18 <% for tracker in @trackers %>
19 <li><%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id => @project,
19 <li><%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id => @project,
20 :set_filter => 1,
20 :set_filter => 1,
21 "tracker_id" => tracker.id %>:
21 "tracker_id" => tracker.id %>:
22 <%= issue_count = Issue.count(:conditions => ["project_id=? and tracker_id=? and issue_statuses.is_closed=?", @project.id, tracker.id, false], :include => :status) %>
22 <%= issue_count = Issue.count(:conditions => ["project_id=? and tracker_id=? and issue_statuses.is_closed=?", @project.id, tracker.id, false], :include => :status) %>
23 <%= lwr(:label_open_issues, issue_count) %>
23 <%= lwr(:label_open_issues, issue_count) %>
24 </li>
24 </li>
25 <% end %>
25 <% end %>
26 </ul>
26 </ul>
27 <% if authorize_for 'projects', 'add_issue' %>
27 <% if authorize_for 'projects', 'add_issue' %>
28 &#187; <%=l(:label_issue_new)%>:
28 &#187; <%=l(:label_issue_new)%>:
29 <ul>
29 <ul>
30 <% @trackers.each do |tracker| %>
30 <% @trackers.each do |tracker| %>
31 <li><%= link_to tracker.name, :controller => 'projects', :action => 'add_issue', :id => @project, :tracker_id => tracker %></li>
31 <li><%= link_to tracker.name, :controller => 'projects', :action => 'add_issue', :id => @project, :tracker_id => tracker %></li>
32 <% end %>
32 <% end %>
33 </ul>
33 </ul>
34 <% end %>
34 <% end %>
35 <center><small>[ <%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %> ]</small></center>
35 <center><small>[ <%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %> ]</small></center>
36 </div>
36 </div>
37 </div>
37 </div>
38
38
39 <div class="splitcontentright">
39 <div class="splitcontentright">
40 <div class="box">
40 <div class="box">
41 <h3><%= image_tag "users" %> <%=l(:label_member_plural)%></h3>
41 <h3><%= image_tag "users" %> <%=l(:label_member_plural)%></h3>
42 <% for member in @members %>
42 <% for member in @members %>
43 <%= link_to_user member.user %> (<%= member.role.name %>)<br />
43 <%= link_to_user member.user %> (<%= member.role.name %>)<br />
44 <% end %>
44 <% end %>
45 </div>
45 </div>
46
46
47 <% if @subprojects %>
47 <% if @subprojects %>
48 <div class="box">
48 <div class="box">
49 <h3><%= image_tag "projects" %> <%=l(:label_subproject_plural)%></h3>
49 <h3><%= image_tag "projects" %> <%=l(:label_subproject_plural)%></h3>
50 <% for subproject in @subprojects %>
50 <% for subproject in @subprojects %>
51 <%= link_to subproject.name, :action => 'show', :id => subproject %><br />
51 <%= link_to subproject.name, :action => 'show', :id => subproject %><br />
52 <% end %>
52 <% end %>
53 </div>
53 </div>
54 <% end %>
54 <% end %>
55
55
56 <div class="box">
56 <div class="box">
57 <h3><%=l(:label_news_latest)%></h3>
57 <h3><%=l(:label_news_latest)%></h3>
58 <% for news in @news %>
58 <% for news in @news %>
59 <p>
59 <p><b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />
60 <b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />
61 <%= news.summary %>
60 <%= news.summary %>
62 <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small>
61 <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small></p>
63 </p>
64 <hr />
62 <hr />
65 <% end %>
63 <% end %>
66 <center><small>[ <%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %> ]</small></center>
64 <center><small>[ <%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %> ]</small></center>
67 </div>
65 </div>
68 </div>
66 </div>
69
67
70
68
71
69
72
70
73
71
74
72
@@ -1,289 +1,289
1 _gloc_rule_default: '|n| n==1 ? "" : "_plural" '
1 _gloc_rule_default: '|n| n==1 ? "" : "_plural" '
2
2
3 actionview_datehelper_select_day_prefix:
3 actionview_datehelper_select_day_prefix:
4 actionview_datehelper_select_month_names: Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre
4 actionview_datehelper_select_month_names: Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre
5 actionview_datehelper_select_month_names_abbr: Ene,Feb,Mar,Abr,Mayo,Jun,Jul,Ago,Sep,Oct,Nov,Dic
5 actionview_datehelper_select_month_names_abbr: Ene,Feb,Mar,Abr,Mayo,Jun,Jul,Ago,Sep,Oct,Nov,Dic
6 actionview_datehelper_select_month_prefix:
6 actionview_datehelper_select_month_prefix:
7 actionview_datehelper_select_year_prefix:
7 actionview_datehelper_select_year_prefix:
8 actionview_datehelper_time_in_words_day: 1 day
8 actionview_datehelper_time_in_words_day: 1 day
9 actionview_datehelper_time_in_words_day_plural: %d days
9 actionview_datehelper_time_in_words_day_plural: %d days
10 actionview_datehelper_time_in_words_hour_about: about an hour
10 actionview_datehelper_time_in_words_hour_about: about an hour
11 actionview_datehelper_time_in_words_hour_about_plural: about %d hours
11 actionview_datehelper_time_in_words_hour_about_plural: about %d hours
12 actionview_datehelper_time_in_words_hour_about_single: about an hour
12 actionview_datehelper_time_in_words_hour_about_single: about an hour
13 actionview_datehelper_time_in_words_minute: 1 minute
13 actionview_datehelper_time_in_words_minute: 1 minute
14 actionview_datehelper_time_in_words_minute_half: half a minute
14 actionview_datehelper_time_in_words_minute_half: half a minute
15 actionview_datehelper_time_in_words_minute_less_than: less than a minute
15 actionview_datehelper_time_in_words_minute_less_than: less than a minute
16 actionview_datehelper_time_in_words_minute_plural: %d minutes
16 actionview_datehelper_time_in_words_minute_plural: %d minutes
17 actionview_datehelper_time_in_words_minute_single: 1 minute
17 actionview_datehelper_time_in_words_minute_single: 1 minute
18 actionview_datehelper_time_in_words_second_less_than: less than a second
18 actionview_datehelper_time_in_words_second_less_than: less than a second
19 actionview_datehelper_time_in_words_second_less_than_plural: less than %d seconds
19 actionview_datehelper_time_in_words_second_less_than_plural: less than %d seconds
20 actionview_instancetag_blank_option: Please select
20 actionview_instancetag_blank_option: Please select
21
21
22 activerecord_error_inclusion: is not included in the list
22 activerecord_error_inclusion: is not included in the list
23 activerecord_error_exclusion: is reserved
23 activerecord_error_exclusion: is reserved
24 activerecord_error_invalid: is invalid
24 activerecord_error_invalid: is invalid
25 activerecord_error_confirmation: doesn't match confirmation
25 activerecord_error_confirmation: doesn't match confirmation
26 activerecord_error_accepted: must be accepted
26 activerecord_error_accepted: must be accepted
27 activerecord_error_empty: can't be empty
27 activerecord_error_empty: can't be empty
28 activerecord_error_blank: can't be blank
28 activerecord_error_blank: can't be blank
29 activerecord_error_too_long: is too long
29 activerecord_error_too_long: is too long
30 activerecord_error_too_short: is too short
30 activerecord_error_too_short: is too short
31 activerecord_error_wrong_length: is the wrong length
31 activerecord_error_wrong_length: is the wrong length
32 activerecord_error_taken: has already been taken
32 activerecord_error_taken: has already been taken
33 activerecord_error_not_a_number: is not a number
33 activerecord_error_not_a_number: is not a number
34
34
35 general_fmt_age: %d yr
35 general_fmt_age: %d aΓ±o
36 general_fmt_age_plural: %d yrs
36 general_fmt_age_plural: %d aΓ±os
37 general_fmt_date: %%b %%d, %%Y (%%a)
37 general_fmt_date: %%d/%%m/%%Y
38 general_fmt_datetime: %%b %%d, %%Y (%%a), %%I:%%M %%p
38 general_fmt_datetime: %%d/%%m/%%Y %%H:%%M
39 general_fmt_datetime_short: %%b %%d, %%I:%%M %%p
39 general_fmt_datetime_short: %%d/%%m %%H:%%M
40 general_fmt_time: %%I:%%M %%p
40 general_fmt_time: %%H:%%M
41 general_text_No: 'No'
41 general_text_No: 'No'
42 general_text_Yes: 'Yes'
42 general_text_Yes: 'SΓ­'
43 general_text_no: 'no'
43 general_text_no: 'no'
44 general_text_yes: 'yes'
44 general_text_yes: 'sΓ­'
45 general_lang_es: 'EspaΓ±ol'
45 general_lang_es: 'EspaΓ±ol'
46
46
47 notice_account_updated: Account was successfully updated.
47 notice_account_updated: Account was successfully updated.
48 notice_account_invalid_creditentials: Invalid user or password
48 notice_account_invalid_creditentials: Invalid user or password
49 notice_account_password_updated: Password was successfully updated.
49 notice_account_password_updated: Password was successfully updated.
50 notice_account_wrong_password: Wrong password
50 notice_account_wrong_password: Wrong password
51 notice_account_register_done: Account was successfully created.
51 notice_account_register_done: Account was successfully created.
52 notice_account_unknown_email: Unknown user.
52 notice_account_unknown_email: Unknown user.
53 notice_can_t_change_password: This account uses an external authentication source. Impossible to change the password.
53 notice_can_t_change_password: This account uses an external authentication source. Impossible to change the password.
54 notice_account_lost_email_sent: An email with instructions to choose a new password has been sent to you.
54 notice_account_lost_email_sent: An email with instructions to choose a new password has been sent to you.
55 notice_account_activated: Your account has been activated. You can now log in.
55 notice_account_activated: Your account has been activated. You can now log in.
56 notice_successful_create: Successful creation.
56 notice_successful_create: Successful creation.
57 notice_successful_update: Successful update.
57 notice_successful_update: Successful update.
58 notice_successful_delete: Successful deletion.
58 notice_successful_delete: Successful deletion.
59 notice_successful_connection: Successful connection.
59 notice_successful_connection: Successful connection.
60 notice_file_not_found: Requested file doesn't exist or has been deleted.
60 notice_file_not_found: Requested file doesn't exist or has been deleted.
61
61
62 gui_validation_error: 1 error
62 gui_validation_error: 1 error
63 gui_validation_error_plural: %d errors
63 gui_validation_error_plural: %d errores
64
64
65 field_name: Nombre
65 field_name: Nombre
66 field_description: DescripciΓ³n
66 field_description: DescripciΓ³n
67 field_summary: Resumen
67 field_summary: Resumen
68 field_is_required: Obligatorio
68 field_is_required: Obligatorio
69 field_firstname: Nombre
69 field_firstname: Nombre
70 field_lastname: Apellido
70 field_lastname: Apellido
71 field_mail: Email
71 field_mail: Email
72 field_filename: Fichero
72 field_filename: Fichero
73 #field_filesize: Size
73 field_filesize: TamaΓ±o
74 field_downloads: Telecargas
74 field_downloads: Telecargas
75 field_author: Autor
75 field_author: Autor
76 field_created_on: Creado
76 field_created_on: Creado
77 field_updated_on: Actualizado
77 field_updated_on: Actualizado
78 #field_field_format: Format
78 field_field_format: Formato
79 field_is_for_all: Para todos los proyectos
79 field_is_for_all: Para todos los proyectos
80 field_possible_values: Valores posibles
80 field_possible_values: Valores posibles
81 field_regexp: ExpresiΓ³n regular
81 field_regexp: ExpresiΓ³n regular
82 #field_min_length: Minimum length
82 #field_min_length: Minimum length
83 #field_max_length: Maximum length
83 #field_max_length: Maximum length
84 field_value: Valor
84 field_value: Valor
85 field_category: CategorΓ­a
85 field_category: CategorΓ­a
86 field_title: TΓ­tulo
86 field_title: TΓ­tulo
87 field_project: Proyecto
87 field_project: Proyecto
88 field_issue: PeticiΓ³n
88 field_issue: PeticiΓ³n
89 field_status: Estatuto
89 field_status: Estatuto
90 #field_notes: Notes
90 field_notes: Notas
91 field_is_closed: PeticiΓ³n resuelta
91 field_is_closed: PeticiΓ³n resuelta
92 field_is_default: Estatuto por defecto
92 field_is_default: Estatuto por defecto
93 field_html_color: Color
93 field_html_color: Color
94 field_tracker: Tracker
94 field_tracker: Tracker
95 field_subject: Tema
95 field_subject: Tema
96 #field_due_date: Due date
96 #field_due_date: Due date
97 field_assigned_to: Asignado a
97 field_assigned_to: Asignado a
98 field_priority: Prioridad
98 field_priority: Prioridad
99 field_fixed_version: VersiΓ³n corregida
99 field_fixed_version: VersiΓ³n corregida
100 field_user: Usuario
100 field_user: Usuario
101 field_role: Papel
101 field_role: Papel
102 field_homepage: Sitio web
102 field_homepage: Sitio web
103 field_is_public: PΓΊblico
103 field_is_public: PΓΊblico
104 #field_parent: Subproject de
104 #field_parent: Subproject de
105 field_is_in_chlog: Consultar las peticiones en el histΓ³rico
105 field_is_in_chlog: Consultar las peticiones en el histΓ³rico
106 field_login: Identificador
106 field_login: Identificador
107 field_mail_notification: NotificaciΓ³n por mail
107 field_mail_notification: NotificaciΓ³n por mail
108 field_admin: Administrador
108 field_admin: Administrador
109 field_locked: Cerrado
109 field_locked: Cerrado
110 field_last_login_on: Última conexión
110 field_last_login_on: Última conexión
111 field_language: Lengua
111 field_language: Lengua
112 field_effective_date: Fecha
112 field_effective_date: Fecha
113 field_password: ContraseΓ±a
113 field_password: ContraseΓ±a
114 field_new_password: Nueva contraseΓ±a
114 field_new_password: Nueva contraseΓ±a
115 field_password_confirmation: ConfirmaciΓ³n
115 field_password_confirmation: ConfirmaciΓ³n
116 field_version: VersiΓ³n
116 field_version: VersiΓ³n
117 field_type: Tipo
117 field_type: Tipo
118 #field_host: Host
118 #field_host: Host
119 #field_port: Port
119 #field_port: Port
120 #field_account: Account
120 #field_account: Account
121 #field_base_dn: Base DN
121 #field_base_dn: Base DN
122 #field_attr_login: Login attribute
122 #field_attr_login: Login attribute
123 #field_attr_firstname: Firstname attribute
123 #field_attr_firstname: Firstname attribute
124 #field_attr_lastname: Lastname attribute
124 #field_attr_lastname: Lastname attribute
125 #field_attr_mail: Email attribute
125 #field_attr_mail: Email attribute
126 #field_onthefly: On-the-fly user creation
126 #field_onthefly: On-the-fly user creation
127
127
128 label_user: Usuario
128 label_user: Usuario
129 label_user_plural: Usuarios
129 label_user_plural: Usuarios
130 label_user_new: Nuevo usuario
130 label_user_new: Nuevo usuario
131 label_project: Proyecto
131 label_project: Proyecto
132 label_project_new: Nuevo proyecto
132 label_project_new: Nuevo proyecto
133 label_project_plural: Proyectos
133 label_project_plural: Proyectos
134 #label_project_latest: Latest projects
134 #label_project_latest: Latest projects
135 label_issue: PeticiΓ³n
135 label_issue: PeticiΓ³n
136 label_issue_new: Nueva peticiΓ³n
136 label_issue_new: Nueva peticiΓ³n
137 label_issue_plural: Peticiones
137 label_issue_plural: Peticiones
138 label_issue_view_all: Ver todas las peticiones
138 label_issue_view_all: Ver todas las peticiones
139 label_document: Documento
139 label_document: Documento
140 label_document_new: Nuevo documento
140 label_document_new: Nuevo documento
141 label_document_plural: Documentos
141 label_document_plural: Documentos
142 label_role: Papel
142 label_role: Papel
143 label_role_plural: Papeles
143 label_role_plural: Papeles
144 label_role_new: Nuevo papel
144 label_role_new: Nuevo papel
145 label_role_and_permissions: Papeles y permisos
145 label_role_and_permissions: Papeles y permisos
146 label_member: Miembro
146 label_member: Miembro
147 label_member_new: Nuevo miembro
147 label_member_new: Nuevo miembro
148 label_member_plural: Miembros
148 label_member_plural: Miembros
149 label_tracker: Tracker
149 label_tracker: Tracker
150 label_tracker_plural: Trackers
150 label_tracker_plural: Trackers
151 label_tracker_new: Nuevo tracker
151 label_tracker_new: Nuevo tracker
152 label_workflow: Workflow
152 label_workflow: Workflow
153 label_issue_status: Estatuto de peticiΓ³n
153 label_issue_status: Estatuto de peticiΓ³n
154 label_issue_status_plural: Estatutos de las peticiones
154 label_issue_status_plural: Estatutos de las peticiones
155 label_issue_status_new: Nuevo estatuto
155 label_issue_status_new: Nuevo estatuto
156 label_issue_category: CategorΓ­a de las peticiones
156 label_issue_category: CategorΓ­a de las peticiones
157 label_issue_category_plural: CategorΓ­as de las peticiones
157 label_issue_category_plural: CategorΓ­as de las peticiones
158 label_issue_category_new: Nueva categorΓ­a
158 label_issue_category_new: Nueva categorΓ­a
159 label_custom_field: Campo personalizado
159 label_custom_field: Campo personalizado
160 label_custom_field_plural: Campos personalizados
160 label_custom_field_plural: Campos personalizados
161 label_custom_field_new: Nuevo campo personalizado
161 label_custom_field_new: Nuevo campo personalizado
162 label_enumerations: Listas de valores
162 label_enumerations: Listas de valores
163 label_enumeration_new: Nuevo valor
163 label_enumeration_new: Nuevo valor
164 label_information: Informacion
164 label_information: Informacion
165 label_information_plural: Informaciones
165 label_information_plural: Informaciones
166 label_please_login: ConexiΓ³n
166 label_please_login: ConexiΓ³n
167 #label_register: Register
167 #label_register: Register
168 #label_password_lost: Lost password
168 label_password_lost: ΒΏOlvidaste la contraseΓ±a?
169 label_home: Acogida
169 label_home: Acogida
170 label_my_page: Mi pΓ‘gina
170 label_my_page: Mi pΓ‘gina
171 label_my_account: Mi cuenta
171 label_my_account: Mi cuenta
172 label_my_projects: Mis proyectos
172 label_my_projects: Mis proyectos
173 label_administration: AdministraciΓ³n
173 label_administration: AdministraciΓ³n
174 label_login: ConexiΓ³n
174 label_login: ConexiΓ³n
175 label_logout: DesconexiΓ³n
175 label_logout: DesconexiΓ³n
176 label_help: Ayuda
176 label_help: Ayuda
177 label_reported_issues: Peticiones registradas
177 label_reported_issues: Peticiones registradas
178 label_assigned_to_me_issues: Peticiones que me estΓ‘n asignadas
178 label_assigned_to_me_issues: Peticiones que me estΓ‘n asignadas
179 label_last_login: Última conexión
179 label_last_login: Última conexión
180 label_last_updates: Actualizado
180 label_last_updates: Actualizado
181 label_last_updates_plural: %d Actualizados
181 label_last_updates_plural: %d Actualizados
182 label_registered_on: Inscrito el
182 label_registered_on: Inscrito el
183 label_activity: Actividad
183 label_activity: Actividad
184 label_new: Nuevo
184 label_new: Nuevo
185 label_logged_as: Conectado como
185 label_logged_as: Conectado como
186 #label_environment: Environment
186 #label_environment: Environment
187 #label_authentication: Authentication
187 #label_authentication: Authentication
188 #label_auth_source: Authentification mode
188 #label_auth_source: Authentification mode
189 #label_auth_source_new: New authentication mode
189 #label_auth_source_new: New authentication mode
190 #label_auth_source_plural: Authentification modes
190 #label_auth_source_plural: Authentification modes
191 #label_subproject: Subproject
191 #label_subproject: Subproject
192 #label_subproject_plural: Subprojects
192 #label_subproject_plural: Subprojects
193 #label_min_max_length: Min - Max length
193 #label_min_max_length: Min - Max length
194 #label_list: List
194 #label_list: List
195 label_date: Fecha
195 label_date: Fecha
196 #label_integer: Integer
196 #label_integer: Integer
197 #label_boolean: Boolean
197 #label_boolean: Boolean
198 #label_string: String
198 #label_string: String
199 #label_text: Text
199 #label_text: Text
200 #label_attribute: Attribute
200 #label_attribute: Attribute
201 #label_attribute_plural: Attributes
201 #label_attribute_plural: Attributes
202 label_download: %d Telecarga
202 label_download: %d Telecarga
203 label_download_plural: %d Telecargas
203 label_download_plural: %d Telecargas
204 #label_no_data: No data to display
204 #label_no_data: No data to display
205 label_change_status: Cambiar el estatuto
205 label_change_status: Cambiar el estatuto
206 label_history: HistΓ³rico
206 label_history: HistΓ³rico
207 label_attachment: Fichero
207 label_attachment: Fichero
208 label_attachment_new: Nuevo fichero
208 label_attachment_new: Nuevo fichero
209 #label_attachment_delete: Delete file
209 #label_attachment_delete: Delete file
210 label_attachment_plural: Ficheros
210 label_attachment_plural: Ficheros
211 #label_report: Report
211 #label_report: Report
212 #label_report_plural: Reports
212 #label_report_plural: Reports
213 label_news: Noticia
213 label_news: Noticia
214 label_news_new: Nueva noticia
214 label_news_new: Nueva noticia
215 label_news_plural: Noticias
215 label_news_plural: Noticias
216 label_news_latest: Últimas noticias
216 label_news_latest: Últimas noticias
217 label_news_view_all: Ver todas las noticias
217 label_news_view_all: Ver todas las noticias
218 label_change_log: Cambios
218 label_change_log: Cambios
219 label_settings: ConfiguraciΓ³n
219 label_settings: ConfiguraciΓ³n
220 label_overview: Vistazo
220 label_overview: Vistazo
221 label_version: VersiΓ³n
221 label_version: VersiΓ³n
222 label_version_new: Nueva versiΓ³n
222 label_version_new: Nueva versiΓ³n
223 label_version_plural: VersiΓ³nes
223 label_version_plural: VersiΓ³nes
224 label_confirmation: ConfirmaciΓ³n
224 label_confirmation: ConfirmaciΓ³n
225 #label_export_csv: Export to CSV
225 label_export_csv: Exportar a CSV
226 label_read: Leer...
226 label_read: Leer...
227 label_public_projects: Proyectos publicos
227 label_public_projects: Proyectos publicos
228 label_open_issues: Abierta
228 label_open_issues: Abierta
229 label_open_issues_plural: Abiertas
229 label_open_issues_plural: Abiertas
230 label_closed_issues: Cerrada
230 label_closed_issues: Cerrada
231 label_closed_issues_plural: Cerradas
231 label_closed_issues_plural: Cerradas
232 label_total: Total
232 label_total: Total
233 label_permissions: Permisos
233 label_permissions: Permisos
234 #label_current_status: Current status
234 #label_current_status: Current status
235 label_new_statuses_allowed: Nuevos estatutos autorizados
235 label_new_statuses_allowed: Nuevos estatutos autorizados
236 label_all: Todos
236 label_all: Todos
237 label_none: Ninguno
237 label_none: Ninguno
238 label_next: PrΓ³ximo
238 label_next: PrΓ³ximo
239 label_previous: Precedente
239 label_previous: Precedente
240 label_used_by: Utilizado por
240 label_used_by: Utilizado por
241
241
242 button_login: ConexiΓ³n
242 button_login: ConexiΓ³n
243 button_submit: Someter
243 button_submit: Someter
244 button_save: Validar
244 button_save: Validar
245 button_check_all: Seleccionar todo
245 button_check_all: Seleccionar todo
246 button_uncheck_all: No seleccionar nada
246 button_uncheck_all: No seleccionar nada
247 button_delete: Suprimir
247 button_delete: Suprimir
248 button_create: Crear
248 button_create: Crear
249 button_test: Testar
249 button_test: Testar
250 button_edit: Modificar
250 button_edit: Modificar
251 button_add: AΓ±adir
251 button_add: AΓ±adir
252 button_change: Cambiar
252 button_change: Cambiar
253 button_apply: Aplicar
253 button_apply: Aplicar
254 button_clear: Anular
254 button_clear: Anular
255 button_lock: Bloquear
255 button_lock: Bloquear
256 button_unlock: Desbloquear
256 button_unlock: Desbloquear
257 button_download: Telecargar
257 button_download: Telecargar
258 button_list: Listar
258 button_list: Listar
259 button_view: Ver
259 button_view: Ver
260
260
261 text_select_mail_notifications: Seleccionar las actividades que necesitan la activaciΓ³n de la notificaciΓ³n por mail.
261 text_select_mail_notifications: Seleccionar las actividades que necesitan la activaciΓ³n de la notificaciΓ³n por mail.
262 text_regexp_info: eg. ^[A-Z0-9]+$
262 text_regexp_info: eg. ^[A-Z0-9]+$
263 text_min_max_length_info: 0 para ninguna restricciΓ³n
263 text_min_max_length_info: 0 para ninguna restricciΓ³n
264 #text_possible_values_info: values separated with |
264 #text_possible_values_info: values separated with |
265 text_project_destroy_confirmation: ΒΏ EstΓ‘s seguro de querer eliminar el proyecto ?
265 text_project_destroy_confirmation: ΒΏ EstΓ‘s seguro de querer eliminar el proyecto ?
266 text_workflow_edit: Seleccionar un workflow para actualizar
266 text_workflow_edit: Seleccionar un workflow para actualizar
267
267
268 #default_role_manager: Manager
268 default_role_manager: Manager
269 #default_role_developper: Developer
269 default_role_developper: Desarrollador
270 #default_role_reporter: Reporter
270 default_role_reporter: Informador
271 default_tracker_bug: AnomalΓ­a
271 default_tracker_bug: AnomalΓ­a
272 default_tracker_feature: EvoluciΓ³n
272 default_tracker_feature: EvoluciΓ³n
273 default_tracker_support: Asistencia
273 default_tracker_support: Asistencia
274 default_issue_status_new: Nuevo
274 default_issue_status_new: Nuevo
275 default_issue_status_assigned: Asignada
275 default_issue_status_assigned: Asignada
276 default_issue_status_resolved: Resuelta
276 default_issue_status_resolved: Resuelta
277 default_issue_status_feedback: Comentario
277 default_issue_status_feedback: Comentario
278 default_issue_status_closed: Cerrada
278 default_issue_status_closed: Cerrada
279 default_issue_status_rejected: Rechazada
279 default_issue_status_rejected: Rechazada
280 default_doc_category_user: DocumentaciΓ³n del usuario
280 default_doc_category_user: DocumentaciΓ³n del usuario
281 default_doc_category_tech: DocumentaciΓ³n tecnica
281 default_doc_category_tech: DocumentaciΓ³n tecnica
282 default_priority_low: Bajo
282 default_priority_low: Bajo
283 default_priority_normal: Normal
283 default_priority_normal: Normal
284 default_priority_high: Alto
284 default_priority_high: Alto
285 default_priority_urgent: Urgente
285 default_priority_urgent: Urgente
286 default_priority_immediate: Ahora
286 default_priority_immediate: Ahora
287
287
288 enumeration_issue_priorities: Prioridad de las peticiones
288 enumeration_issue_priorities: Prioridad de las peticiones
289 enumeration_doc_categories: CategorΓ­as del documento
289 enumeration_doc_categories: CategorΓ­as del documento
@@ -1,354 +1,354
1 /* andreas08 - an open source xhtml/css website layout by Andreas Viklund - http://andreasviklund.com . Free to use in any way and for any purpose as long as the proper credits are given to the original designer. Version: 1.0, November 28, 2005 */
1 /* andreas08 - an open source xhtml/css website layout by Andreas Viklund - http://andreasviklund.com . Free to use in any way and for any purpose as long as the proper credits are given to the original designer. Version: 1.0, November 28, 2005 */
2 /* Edited by Jean-Philippe Lang *>
2 /* Edited by Jean-Philippe Lang *>
3 /**************** Body and tag styles ****************/
3 /**************** Body and tag styles ****************/
4
4
5
5
6 #header * {margin:0; padding:0;}
6 #header * {margin:0; padding:0;}
7 p, ul, ol, li {margin:0; padding:0;}
7 p, ul, ol, li {margin:0; padding:0;}
8
8
9
9
10 body{
10 body{
11 font:76% Verdana,Tahoma,Arial,sans-serif;
11 font:76% Verdana,Tahoma,Arial,sans-serif;
12 line-height:1.4em;
12 line-height:1.4em;
13 text-align:center;
13 text-align:center;
14 color:#303030;
14 color:#303030;
15 background:#e8eaec;
15 background:#e8eaec;
16 }
16 }
17
17
18
18
19 a{
19 a{
20 color:#467aa7;
20 color:#467aa7;
21 font-weight:bold;
21 font-weight:bold;
22 text-decoration:none;
22 text-decoration:none;
23 background-color:inherit;
23 background-color:inherit;
24 }
24 }
25
25
26 a:hover{color:#2a5a8a; text-decoration:none; background-color:inherit;}
26 a:hover{color:#2a5a8a; text-decoration:none; background-color:inherit;}
27 a img{border:none;}
27 a img{border:none;}
28
28
29 p{padding:0 0 1em 0;}
29 p{padding:0 0 1em 0;}
30 p form{margin-top:0; margin-bottom:20px;}
30 p form{margin-top:0; margin-bottom:20px;}
31
31
32 img.left,img.center,img.right{padding:4px; border:1px solid #a0a0a0;}
32 img.left,img.center,img.right{padding:4px; border:1px solid #a0a0a0;}
33 img.left{float:left; margin:0 12px 5px 0;}
33 img.left{float:left; margin:0 12px 5px 0;}
34 img.center{display:block; margin:0 auto 5px auto;}
34 img.center{display:block; margin:0 auto 5px auto;}
35 img.right{float:right; margin:0 0 5px 12px;}
35 img.right{float:right; margin:0 0 5px 12px;}
36
36
37 /**************** Header and navigation styles ****************/
37 /**************** Header and navigation styles ****************/
38
38
39 #container{
39 #container{
40 width:100%;
40 width:100%;
41 min-width: 800px;
41 min-width: 800px;
42 margin:5px auto;
42 margin:5px auto;
43 padding:1px 0;
43 padding:1px 0;
44 text-align:left;
44 text-align:left;
45 background:#ffffff;
45 background:#ffffff;
46 color:#303030;
46 color:#303030;
47 border:2px solid #a0a0a0;
47 border:2px solid #a0a0a0;
48 }
48 }
49
49
50 #header{
50 #header{
51 height:5.5em;
51 height:5.5em;
52 /*width:758px;*/
52 /*width:758px;*/
53 margin:0 1px 1px 1px;
53 margin:0 1px 1px 1px;
54 background:#467aa7;
54 background:#467aa7;
55 color:#ffffff;
55 color:#ffffff;
56 }
56 }
57
57
58 #header h1{
58 #header h1{
59 padding:14px 0 0 20px;
59 padding:14px 0 0 20px;
60 font-size:2.4em;
60 font-size:2.4em;
61 background-color:inherit;
61 background-color:inherit;
62 color:#fff; /*rgb(152, 26, 33);*/
62 color:#fff; /*rgb(152, 26, 33);*/
63 letter-spacing:-2px;
63 letter-spacing:-2px;
64 font-weight:normal;
64 font-weight:normal;
65 }
65 }
66
66
67 #header h2{
67 #header h2{
68 margin:10px 0 0 40px;
68 margin:10px 0 0 40px;
69 font-size:1.4em;
69 font-size:1.4em;
70 background-color:inherit;
70 background-color:inherit;
71 color:#f0f2f4;
71 color:#f0f2f4;
72 letter-spacing:-1px;
72 letter-spacing:-1px;
73 font-weight:normal;
73 font-weight:normal;
74 }
74 }
75
75
76 #navigation{
76 #navigation{
77 height:2.2em;
77 height:2.2em;
78 line-height:2.2em;
78 line-height:2.2em;
79 /*width:758px;*/
79 /*width:758px;*/
80 margin:0 1px;
80 margin:0 1px;
81 background:#578bb8;
81 background:#578bb8;
82 color:#ffffff;
82 color:#ffffff;
83 }
83 }
84
84
85 #navigation li{
85 #navigation li{
86 float:left;
86 float:left;
87 list-style-type:none;
87 list-style-type:none;
88 border-right:1px solid #ffffff;
88 border-right:1px solid #ffffff;
89 white-space:nowrap;
89 white-space:nowrap;
90 }
90 }
91
91
92 #navigation li.right {
92 #navigation li.right {
93 float:right;
93 float:right;
94 list-style-type:none;
94 list-style-type:none;
95 border-right:0;
95 border-right:0;
96 border-left:1px solid #ffffff;
96 border-left:1px solid #ffffff;
97 white-space:nowrap;
97 white-space:nowrap;
98 }
98 }
99
99
100 #navigation li a{
100 #navigation li a{
101 display:block;
101 display:block;
102 padding:0px 10px 0px 22px;
102 padding:0px 10px 0px 22px;
103 font-size:0.8em;
103 font-size:0.8em;
104 font-weight:normal;
104 font-weight:normal;
105 /*text-transform:uppercase;*/
105 /*text-transform:uppercase;*/
106 text-decoration:none;
106 text-decoration:none;
107 background-color:inherit;
107 background-color:inherit;
108 color: #ffffff;
108 color: #ffffff;
109 }
109 }
110
110
111 * html #navigation a {width:1%;}
111 * html #navigation a {width:1%;}
112
112
113 #navigation .selected,#navigation a:hover{
113 #navigation .selected,#navigation a:hover{
114 color:#ffffff;
114 color:#ffffff;
115 text-decoration:none;
115 text-decoration:none;
116 background-color: #80b0da;
116 background-color: #80b0da;
117 }
117 }
118
118
119 /**************** Icons links *******************/
119 /**************** Icons links *******************/
120 .picHome { background: url(../images/home.png) no-repeat 4px 50%; }
120 .picHome { background: url(../images/home.png) no-repeat 4px 50%; }
121 .picUser { background: url(../images/user.png) no-repeat 4px 50%; }
121 .picUser { background: url(../images/user.png) no-repeat 4px 50%; }
122 .picUserPage { background: url(../images/user_page.png) no-repeat 4px 50%; }
122 .picUserPage { background: url(../images/user_page.png) no-repeat 4px 50%; }
123 .picAdmin { background: url(../images/admin.png) no-repeat 4px 50%; }
123 .picAdmin { background: url(../images/admin.png) no-repeat 4px 50%; }
124 .picProject { background: url(../images/projects.png) no-repeat 4px 50%; }
124 .picProject { background: url(../images/projects.png) no-repeat 4px 50%; }
125 .picLogout { background: url(../images/logout.png) no-repeat 4px 50%; }
125 .picLogout { background: url(../images/logout.png) no-repeat 4px 50%; }
126 .picHelp { background: url(../images/help.png) no-repeat 4px 50%; }
126 .picHelp { background: url(../images/help.png) no-repeat 4px 50%; }
127
127
128 /**************** Content styles ****************/
128 /**************** Content styles ****************/
129
129
130 #content{
130 #content{
131 /*float:right;*/
131 /*float:right;*/
132 /*width:530px;*/
132 /*width:530px;*/
133 width: auto;
133 width: auto;
134 min-height: 500px;
134 min-height: 500px;
135 font-size:0.9em;
135 font-size:0.9em;
136 padding:20px 10px 10px 20px;
136 padding:20px 10px 10px 20px;
137 /*position: absolute;*/
137 /*position: absolute;*/
138 margin: 0 0 0 140px;
138 margin: 0 0 0 140px;
139 border-left: 1px dashed #c0c0c0;
139 border-left: 1px dashed #c0c0c0;
140 }
140 }
141
141
142 #content h2{
142 #content h2{
143 display:block;
143 display:block;
144 margin:0 0 16px 0;
144 margin:0 0 16px 0;
145 font-size:1.7em;
145 font-size:1.7em;
146 font-weight:normal;
146 font-weight:normal;
147 letter-spacing:-1px;
147 letter-spacing:-1px;
148 color:#505050;
148 color:#505050;
149 background-color:inherit;
149 background-color:inherit;
150 }
150 }
151
151
152 #content h2 a{font-weight:normal;}
152 #content h2 a{font-weight:normal;}
153 #content h3{margin:0 0 5px 0; font-size:1.4em; letter-spacing:-1px;}
153 #content h3{margin:0 0 12px 0; font-size:1.4em; letter-spacing:-1px;}
154 #content a:hover,#subcontent a:hover{text-decoration:underline;}
154 #content a:hover,#subcontent a:hover{text-decoration:underline;}
155 #content ul,#content ol{margin:0 5px 16px 35px;}
155 #content ul,#content ol{margin:0 5px 16px 35px;}
156 #content dl{margin:0 5px 10px 25px;}
156 #content dl{margin:0 5px 10px 25px;}
157 #content dt{font-weight:bold; margin-bottom:5px;}
157 #content dt{font-weight:bold; margin-bottom:5px;}
158 #content dd{margin:0 0 10px 15px;}
158 #content dd{margin:0 0 10px 15px;}
159
159
160
160
161 /***********************************************/
161 /***********************************************/
162
162
163 /*
163 /*
164 form{
164 form{
165 padding:15px;
165 padding:15px;
166 margin:0 0 20px 0;
166 margin:0 0 20px 0;
167 border:1px solid #c0c0c0;
167 border:1px solid #c0c0c0;
168 background-color:#CEE1ED;
168 background-color:#CEE1ED;
169 width:600px;
169 width:600px;
170 }
170 }
171 */
171 */
172
172
173 form {
173 form {
174 display: inline;
174 display: inline;
175 }
175 }
176
176
177 .noborder {
177 .noborder {
178 border:0px;
178 border:0px;
179 background-color:#fff;
179 background-color:#fff;
180 width:100%;
180 width:100%;
181 }
181 }
182
182
183 textarea {
183 textarea {
184 padding:0;
184 padding:0;
185 margin:0;
185 margin:0;
186 }
186 }
187
187
188 input {
188 input {
189 vertical-align: top;
189 vertical-align: top;
190 }
190 }
191
191
192 input.button-small
192 input.button-small
193 {
193 {
194 font-size: 0.8em;
194 font-size: 0.8em;
195 }
195 }
196
196
197 select.select-small
197 select.select-small
198 {
198 {
199 border: 1px solid #7F9DB9;
199 border: 1px solid #7F9DB9;
200 padding: 1px;
200 padding: 1px;
201 font-size: 0.8em;
201 font-size: 0.8em;
202 }
202 }
203
203
204 .active-filter
204 .active-filter
205 {
205 {
206 background-color: #F9FA9E;
206 background-color: #F9FA9E;
207
207
208 }
208 }
209
209
210 label {
210 label {
211 font-weight: bold;
211 font-weight: bold;
212 font-size: 1em;
212 font-size: 1em;
213 }
213 }
214
214
215 fieldset {
215 fieldset {
216 border:1px solid #7F9DB9;
216 border:1px solid #7F9DB9;
217 padding: 6px;
217 padding: 6px;
218 }
218 }
219
219
220 legend {
220 legend {
221 color: #505050;
221 color: #505050;
222
222
223 }
223 }
224
224
225 .required {
225 .required {
226 color: #bb0000;
226 color: #bb0000;
227 }
227 }
228
228
229 table.listTableContent {
229 table.listTableContent {
230 /*margin: 2em 2em 2em 0; */
230 /*margin: 2em 2em 2em 0; */
231 border:1px solid #c0c0c0;
231 border:1px solid #c0c0c0;
232 width:99%;
232 width:99%;
233 }
233 }
234
234
235 table.listTableContent td {
235 table.listTableContent td {
236 margin: 2px;
236 margin: 2px;
237
237
238 }
238 }
239
239
240 tr.ListHead {
240 tr.ListHead {
241 background-color:#467aa7;
241 background-color:#467aa7;
242 color:#FFFFFF;
242 color:#FFFFFF;
243 text-align:center;
243 text-align:center;
244 }
244 }
245
245
246 tr.ListHead a {
246 tr.ListHead a {
247 color:#FFFFFF;
247 color:#FFFFFF;
248 text-decoration:underline;
248 text-decoration:underline;
249 }
249 }
250
250
251 tr.odd {
251 tr.odd {
252 background-color: #C1E2F7;
252 background-color: #C1E2F7;
253 }
253 }
254 tr.even {
254 tr.even {
255 background-color:#CEE1ED;
255 background-color:#CEE1ED;
256 }
256 }
257
257
258 hr { border:0px; border-bottom:1px dashed #000000; }
258 hr { border:none; border-bottom: dotted 2px #c0c0c0; }
259
259
260
260
261 /**************** Sidebar styles ****************/
261 /**************** Sidebar styles ****************/
262
262
263 #subcontent{
263 #subcontent{
264 float:left;
264 float:left;
265 clear:both;
265 clear:both;
266 width:130px;
266 width:130px;
267 padding:20px 20px 10px 5px;
267 padding:20px 20px 10px 5px;
268 line-height:1.4em;
268 line-height:1.4em;
269 }
269 }
270
270
271 #subcontent h2{
271 #subcontent h2{
272 display:block;
272 display:block;
273 margin:0 0 15px 0;
273 margin:0 0 15px 0;
274 font-size:1.6em;
274 font-size:1.6em;
275 font-weight:normal;
275 font-weight:normal;
276 text-align:left;
276 text-align:left;
277 letter-spacing:-1px;
277 letter-spacing:-1px;
278 color:#505050;
278 color:#505050;
279 background-color:inherit;
279 background-color:inherit;
280 }
280 }
281
281
282 #subcontent p{margin:0 0 16px 0; font-size:0.9em;}
282 #subcontent p{margin:0 0 16px 0; font-size:0.9em;}
283
283
284 /**************** Menublock styles ****************/
284 /**************** Menublock styles ****************/
285
285
286 .menublock{margin:0 0 20px 8px; font-size:0.9em;}
286 .menublock{margin:0 0 20px 8px; font-size:0.9em;}
287 .menublock li{list-style:none; display:block; padding:1px; margin-bottom:0px;}
287 .menublock li{list-style:none; display:block; padding:1px; margin-bottom:0px;}
288 .menublock li a{font-weight:bold; text-decoration:none;}
288 .menublock li a{font-weight:bold; text-decoration:none;}
289 .menublock li a:hover{text-decoration:none;}
289 .menublock li a:hover{text-decoration:none;}
290 .menublock li ul{margin:3px 0 3px 15px; font-size:1em; font-weight:normal;}
290 .menublock li ul{margin:3px 0 3px 15px; font-size:1em; font-weight:normal;}
291 .menublock li ul li{margin-bottom:0;}
291 .menublock li ul li{margin-bottom:0;}
292 .menublock li ul a{font-weight:normal;}
292 .menublock li ul a{font-weight:normal;}
293
293
294 /**************** Searchbar styles ****************/
294 /**************** Searchbar styles ****************/
295
295
296 #searchbar{margin:0 0 20px 0;}
296 #searchbar{margin:0 0 20px 0;}
297 #searchbar form fieldset{margin-left:10px; border:0 solid;}
297 #searchbar form fieldset{margin-left:10px; border:0 solid;}
298
298
299 #searchbar #s{
299 #searchbar #s{
300 height:1.2em;
300 height:1.2em;
301 width:110px;
301 width:110px;
302 margin:0 5px 0 0;
302 margin:0 5px 0 0;
303 border:1px solid #a0a0a0;
303 border:1px solid #a0a0a0;
304 }
304 }
305
305
306 #searchbar #searchbutton{
306 #searchbar #searchbutton{
307 width:auto;
307 width:auto;
308 padding:0 1px;
308 padding:0 1px;
309 border:1px solid #808080;
309 border:1px solid #808080;
310 font-size:0.9em;
310 font-size:0.9em;
311 text-align:center;
311 text-align:center;
312 }
312 }
313
313
314 /**************** Footer styles ****************/
314 /**************** Footer styles ****************/
315
315
316 #footer{
316 #footer{
317 clear:both;
317 clear:both;
318 /*width:758px;*/
318 /*width:758px;*/
319 padding:5px 0;
319 padding:5px 0;
320 margin:0 1px;
320 margin:0 1px;
321 font-size:0.9em;
321 font-size:0.9em;
322 color:#f0f0f0;
322 color:#f0f0f0;
323 background:#467aa7;
323 background:#467aa7;
324 }
324 }
325
325
326 #footer p{padding:0; margin:0; text-align:center;}
326 #footer p{padding:0; margin:0; text-align:center;}
327 #footer a{color:#f0f0f0; background-color:inherit; font-weight:bold;}
327 #footer a{color:#f0f0f0; background-color:inherit; font-weight:bold;}
328 #footer a:hover{color:#ffffff; background-color:inherit; text-decoration: underline;}
328 #footer a:hover{color:#ffffff; background-color:inherit; text-decoration: underline;}
329
329
330 /**************** Misc classes and styles ****************/
330 /**************** Misc classes and styles ****************/
331
331
332 .splitcontentleft{float:left; width:49%;}
332 .splitcontentleft{float:left; width:49%;}
333 .splitcontentright{float:right; width:49%;}
333 .splitcontentright{float:right; width:49%;}
334 .clear{clear:both;}
334 .clear{clear:both;}
335 .small{font-size:0.8em;line-height:1.4em;padding:0 0 0 0;}
335 .small{font-size:0.8em;line-height:1.4em;padding:0 0 0 0;}
336 .hide{display:none;}
336 .hide{display:none;}
337 .textcenter{text-align:center;}
337 .textcenter{text-align:center;}
338 .textright{text-align:right;}
338 .textright{text-align:right;}
339 .important{color:#f02025; background-color:inherit; font-weight:bold;}
339 .important{color:#f02025; background-color:inherit; font-weight:bold;}
340
340
341 .box{
341 .box{
342 margin:0 0 20px 0;
342 margin:0 0 20px 0;
343 padding:10px;
343 padding:10px;
344 border:1px solid #c0c0c0;
344 border:1px solid #c0c0c0;
345 background-color:#fafbfc;
345 background-color:#fafbfc;
346 color:#505050;
346 color:#505050;
347 line-height:1.5em;
347 line-height:1.5em;
348 }
348 }
349
349
350 .login {
350 .login {
351 width: 50%;
351 width: 50%;
352 text-align: left;
352 text-align: left;
353 }
353 }
354
354
@@ -1,95 +1,100
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require "#{File.dirname(__FILE__)}/../test_helper"
18 require "#{File.dirname(__FILE__)}/../test_helper"
19
19
20 class AccountTest < ActionController::IntegrationTest
20 class AccountTest < ActionController::IntegrationTest
21 fixtures :users
21 fixtures :users
22
22
23 # Replace this with your real tests.
23 # Replace this with your real tests.
24 def test_login
24 def test_login
25 get "account/my_page"
25 get "account/my_page"
26 assert_redirected_to "account/login"
26 assert_redirected_to "account/login"
27 log_user('jsmith', 'jsmith')
27 log_user('jsmith', 'jsmith')
28
28
29 get "account/my_account"
29 get "account/my_account"
30 assert_response :success
30 assert_response :success
31 assert_template "account/my_account"
31 assert_template "account/my_account"
32 end
32 end
33
33
34 def test_change_password
34 def test_change_password
35 log_user('jsmith', 'jsmith')
35 log_user('jsmith', 'jsmith')
36 get "account/my_account"
36 get "account/my_account"
37 assert_response :success
37 assert_response :success
38 assert_template "account/my_account"
38 assert_template "account/my_account"
39
39
40 post "account/change_password", :password => 'jsmith', :new_password => "hello", :new_password_confirmation => "hello2"
40 post "account/change_password", :password => 'jsmith', :new_password => "hello", :new_password_confirmation => "hello2"
41 assert_response :success
41 assert_response :success
42 assert_template "account/my_account"
42 assert_tag :tag => "div", :attributes => { :class => "errorExplanation" }
43 assert_tag :tag => "div", :attributes => { :class => "errorExplanation" }
43
44
45 post "account/change_password", :password => 'jsmithZZ', :new_password => "hello", :new_password_confirmation => "hello"
46 assert_redirected_to "account/my_account"
47 assert_equal 'Wrong password', flash[:notice]
48
44 post "account/change_password", :password => 'jsmith', :new_password => "hello", :new_password_confirmation => "hello"
49 post "account/change_password", :password => 'jsmith', :new_password => "hello", :new_password_confirmation => "hello"
45 assert_response :success
50 assert_redirected_to "account/my_account"
46 log_user('jsmith', 'hello')
51 log_user('jsmith', 'hello')
47 end
52 end
48
53
49 def test_my_account
54 def test_my_account
50 log_user('jsmith', 'jsmith')
55 log_user('jsmith', 'jsmith')
51 get "account/my_account"
56 get "account/my_account"
52 assert_response :success
57 assert_response :success
53 assert_template "account/my_account"
58 assert_template "account/my_account"
54
59
55 post "account/my_account", :user => {:firstname => "Joe", :login => "root", :admin => 1}
60 post "account/my_account", :user => {:firstname => "Joe", :login => "root", :admin => 1}
56 assert_response :success
61 assert_response :success
57 assert_template "account/my_account"
62 assert_template "account/my_account"
58 user = User.find(2)
63 user = User.find(2)
59 assert_equal "Joe", user.firstname
64 assert_equal "Joe", user.firstname
60 assert_equal "jsmith", user.login
65 assert_equal "jsmith", user.login
61 assert_equal false, user.admin?
66 assert_equal false, user.admin?
62 end
67 end
63
68
64 def test_my_page
69 def test_my_page
65 log_user('jsmith', 'jsmith')
70 log_user('jsmith', 'jsmith')
66 get "account/my_page"
71 get "account/my_page"
67 assert_response :success
72 assert_response :success
68 assert_template "account/my_page"
73 assert_template "account/my_page"
69 end
74 end
70
75
71 def test_lost_password
76 def test_lost_password
72 get "account/lost_password"
77 get "account/lost_password"
73 assert_response :success
78 assert_response :success
74 assert_template "account/lost_password"
79 assert_template "account/lost_password"
75
80
76 post "account/lost_password", :mail => 'jsmith@somenet.foo'
81 post "account/lost_password", :mail => 'jsmith@somenet.foo'
77 assert_redirected_to "account/login"
82 assert_redirected_to "account/login"
78
83
79 token = Token.find(:first)
84 token = Token.find(:first)
80 assert_equal 'recovery', token.action
85 assert_equal 'recovery', token.action
81 assert_equal 'jsmith@somenet.foo', token.user.mail
86 assert_equal 'jsmith@somenet.foo', token.user.mail
82 assert !token.expired?
87 assert !token.expired?
83
88
84 get "account/lost_password", :token => token.value
89 get "account/lost_password", :token => token.value
85 assert_response :success
90 assert_response :success
86 assert_template "account/password_recovery"
91 assert_template "account/password_recovery"
87
92
88 post "account/lost_password", :token => token.value, :new_password => 'newpass', :new_password_confirmation => 'newpass'
93 post "account/lost_password", :token => token.value, :new_password => 'newpass', :new_password_confirmation => 'newpass'
89 assert_redirected_to "account/login"
94 assert_redirected_to "account/login"
90 assert_equal 'Password was successfully updated.', flash[:notice]
95 assert_equal 'Password was successfully updated.', flash[:notice]
91
96
92 log_user('jsmith', 'newpass')
97 log_user('jsmith', 'newpass')
93 assert_equal 0, Token.count
98 assert_equal 0, Token.count
94 end
99 end
95 end
100 end
@@ -1,61 +1,61
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require "#{File.dirname(__FILE__)}/../test_helper"
18 require "#{File.dirname(__FILE__)}/../test_helper"
19
19
20 class AdminTest < ActionController::IntegrationTest
20 class AdminTest < ActionController::IntegrationTest
21 fixtures :users
21 fixtures :users
22
22
23 def test_add_user
23 def test_add_user
24 log_user("admin", "admin")
24 log_user("admin", "admin")
25 get "/users/add"
25 get "/users/add"
26 assert_response :success
26 assert_response :success
27 assert_template "users/add"
27 assert_template "users/add"
28 post "/users/add", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09"
28 post "/users/add", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09"
29 assert_redirected_to "users/list"
29 assert_redirected_to "users/list"
30
30
31 user = User.find_by_login("psmith")
31 user = User.find_by_login("psmith")
32 assert_kind_of User, user
32 assert_kind_of User, user
33 logged_user = User.try_to_login("psmith", "psmith09")
33 logged_user = User.try_to_login("psmith", "psmith09")
34 assert_kind_of User, logged_user
34 assert_kind_of User, logged_user
35 assert_equal "Paul", logged_user.firstname
35 assert_equal "Paul", logged_user.firstname
36
36
37 post "users/edit", :id => user.id, :user => { :status => User::STATUS_LOCKED }
37 post "users/edit", :id => user.id, :user => { :status => User::STATUS_LOCKED }
38 assert_redirected_to "users/list"
38 assert_redirected_to "users/list"
39 locked_user = User.try_to_login("psmith", "psmith09")
39 locked_user = User.try_to_login("psmith", "psmith09")
40 assert_equal nil, locked_user
40 assert_equal nil, locked_user
41 end
41 end
42
42
43 def test_add_project
43 def test_add_project
44 log_user("admin", "admin")
44 log_user("admin", "admin")
45 get "projects/add"
45 get "projects/add"
46 assert_response :success
46 assert_response :success
47 assert_template "projects/add"
47 assert_template "projects/add"
48 post "projects/add", :project => { :name => "blog", :description => "weblog", :is_public => 1}
48 post "projects/add", :project => { :name => "blog", :description => "weblog", :is_public => 1}
49 assert_redirected_to "admin/projects"
49 assert_redirected_to "admin/projects"
50 assert_equal 'Project was successfully created.', flash[:notice]
50 assert_equal 'Successful creation.', flash[:notice]
51
51
52 project = Project.find_by_name("blog")
52 project = Project.find_by_name("blog")
53 assert_kind_of Project, project
53 assert_kind_of Project, project
54 assert_equal "weblog", project.description
54 assert_equal "weblog", project.description
55 assert_equal true, project.is_public?
55 assert_equal true, project.is_public?
56
56
57 get "admin/projects"
57 get "admin/projects"
58 assert_response :success
58 assert_response :success
59 assert_template "admin/projects"
59 assert_template "admin/projects"
60 end
60 end
61 end
61 end
General Comments 0
You need to be logged in to leave comments. Login now