##// END OF EJS Templates
added the ability to set the sort order for trackers...
Jean-Philippe Lang -
r206:fa688d48e673
parent child
Show More
@@ -0,0 +1,10
1 class AddTrackerPosition < ActiveRecord::Migration
2 def self.up
3 add_column :trackers, :position, :integer, :default => 1, :null => false
4 Tracker.find(:all).each_with_index {|tracker, i| tracker.update_attribute(:position, i+1)}
5 end
6
7 def self.down
8 remove_column :trackers, :position
9 end
10 end
@@ -1,72 +1,72
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' unless request.xhr?
24 render :action => 'list' unless request.xhr?
25 end
25 end
26
26
27 def list
27 def list
28 @custom_fields_by_type = CustomField.find(:all).group_by {|f| f.type.to_s }
28 @custom_fields_by_type = CustomField.find(:all).group_by {|f| f.type.to_s }
29 @tab = params[:tab] || 'IssueCustomField'
29 @tab = params[:tab] || 'IssueCustomField'
30 render :action => "list", :layout => false if request.xhr?
30 render :action => "list", :layout => false if request.xhr?
31 end
31 end
32
32
33 def new
33 def new
34 case params[:type]
34 case params[:type]
35 when "IssueCustomField"
35 when "IssueCustomField"
36 @custom_field = IssueCustomField.new(params[:custom_field])
36 @custom_field = IssueCustomField.new(params[:custom_field])
37 @custom_field.trackers = Tracker.find(params[:tracker_ids]) if params[:tracker_ids]
37 @custom_field.trackers = Tracker.find(params[:tracker_ids]) if params[:tracker_ids]
38 when "UserCustomField"
38 when "UserCustomField"
39 @custom_field = UserCustomField.new(params[:custom_field])
39 @custom_field = UserCustomField.new(params[:custom_field])
40 when "ProjectCustomField"
40 when "ProjectCustomField"
41 @custom_field = ProjectCustomField.new(params[:custom_field])
41 @custom_field = ProjectCustomField.new(params[:custom_field])
42 else
42 else
43 redirect_to :action => 'list'
43 redirect_to :action => 'list'
44 return
44 return
45 end
45 end
46 if request.post? and @custom_field.save
46 if request.post? and @custom_field.save
47 flash[:notice] = l(:notice_successful_create)
47 flash[:notice] = l(:notice_successful_create)
48 redirect_to :action => 'list', :tab => @custom_field.type
48 redirect_to :action => 'list', :tab => @custom_field.type
49 end
49 end
50 @trackers = Tracker.find(:all)
50 @trackers = Tracker.find(:all, :order => 'position')
51 end
51 end
52
52
53 def edit
53 def edit
54 @custom_field = CustomField.find(params[:id])
54 @custom_field = CustomField.find(params[:id])
55 if request.post? and @custom_field.update_attributes(params[:custom_field])
55 if request.post? and @custom_field.update_attributes(params[:custom_field])
56 if @custom_field.is_a? IssueCustomField
56 if @custom_field.is_a? IssueCustomField
57 @custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : []
57 @custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : []
58 end
58 end
59 flash[:notice] = l(:notice_successful_update)
59 flash[:notice] = l(:notice_successful_update)
60 redirect_to :action => 'list', :tab => @custom_field.type
60 redirect_to :action => 'list', :tab => @custom_field.type
61 end
61 end
62 @trackers = Tracker.find(:all)
62 @trackers = Tracker.find(:all, :order => 'position')
63 end
63 end
64
64
65 def destroy
65 def destroy
66 @custom_field = CustomField.find(params[:id]).destroy
66 @custom_field = CustomField.find(params[:id]).destroy
67 redirect_to :action => 'list', :tab => @custom_field.type
67 redirect_to :action => 'list', :tab => @custom_field.type
68 rescue
68 rescue
69 flash[:notice] = "Unable to delete custom field"
69 flash[:notice] = "Unable to delete custom field"
70 redirect_to :action => 'list'
70 redirect_to :action => 'list'
71 end
71 end
72 end
72 end
@@ -1,562 +1,562
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
2 # Copyright (C) 2006-2007 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 'csv'
18 require 'csv'
19
19
20 class ProjectsController < ApplicationController
20 class ProjectsController < ApplicationController
21 layout 'base'
21 layout 'base'
22 before_filter :find_project, :authorize, :except => [ :index, :list, :add ]
22 before_filter :find_project, :authorize, :except => [ :index, :list, :add ]
23 before_filter :require_admin, :only => [ :add, :destroy ]
23 before_filter :require_admin, :only => [ :add, :destroy ]
24
24
25 helper :sort
25 helper :sort
26 include SortHelper
26 include SortHelper
27 helper :custom_fields
27 helper :custom_fields
28 include CustomFieldsHelper
28 include CustomFieldsHelper
29 helper :ifpdf
29 helper :ifpdf
30 include IfpdfHelper
30 include IfpdfHelper
31 helper IssuesHelper
31 helper IssuesHelper
32 helper :queries
32 helper :queries
33 include QueriesHelper
33 include QueriesHelper
34
34
35 def index
35 def index
36 list
36 list
37 render :action => 'list' unless request.xhr?
37 render :action => 'list' unless request.xhr?
38 end
38 end
39
39
40 # Lists public projects
40 # Lists public projects
41 def list
41 def list
42 sort_init 'name', 'asc'
42 sort_init 'name', 'asc'
43 sort_update
43 sort_update
44 @project_count = Project.count(:all, :conditions => ["is_public=?", true])
44 @project_count = Project.count(:all, :conditions => ["is_public=?", true])
45 @project_pages = Paginator.new self, @project_count,
45 @project_pages = Paginator.new self, @project_count,
46 15,
46 15,
47 params['page']
47 params['page']
48 @projects = Project.find :all, :order => sort_clause,
48 @projects = Project.find :all, :order => sort_clause,
49 :conditions => ["is_public=?", true],
49 :conditions => ["is_public=?", true],
50 :limit => @project_pages.items_per_page,
50 :limit => @project_pages.items_per_page,
51 :offset => @project_pages.current.offset
51 :offset => @project_pages.current.offset
52
52
53 render :action => "list", :layout => false if request.xhr?
53 render :action => "list", :layout => false if request.xhr?
54 end
54 end
55
55
56 # Add a new project
56 # Add a new project
57 def add
57 def add
58 @custom_fields = IssueCustomField.find(:all)
58 @custom_fields = IssueCustomField.find(:all)
59 @root_projects = Project.find(:all, :conditions => "parent_id is null")
59 @root_projects = Project.find(:all, :conditions => "parent_id is null")
60 @project = Project.new(params[:project])
60 @project = Project.new(params[:project])
61 if request.get?
61 if request.get?
62 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
62 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project) }
63 else
63 else
64 @project.custom_fields = CustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
64 @project.custom_fields = CustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
65 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
65 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
66 @project.custom_values = @custom_values
66 @project.custom_values = @custom_values
67 if params[:repository_enabled] && params[:repository_enabled] == "1"
67 if params[:repository_enabled] && params[:repository_enabled] == "1"
68 @project.repository = Repository.new
68 @project.repository = Repository.new
69 @project.repository.attributes = params[:repository]
69 @project.repository.attributes = params[:repository]
70 end
70 end
71 if @project.save
71 if @project.save
72 flash[:notice] = l(:notice_successful_create)
72 flash[:notice] = l(:notice_successful_create)
73 redirect_to :controller => 'admin', :action => 'projects'
73 redirect_to :controller => 'admin', :action => 'projects'
74 end
74 end
75 end
75 end
76 end
76 end
77
77
78 # Show @project
78 # Show @project
79 def show
79 def show
80 @custom_values = @project.custom_values.find(:all, :include => :custom_field)
80 @custom_values = @project.custom_values.find(:all, :include => :custom_field)
81 @members = @project.members.find(:all, :include => [:user, :role])
81 @members = @project.members.find(:all, :include => [:user, :role])
82 @subprojects = @project.children if @project.children.size > 0
82 @subprojects = @project.children if @project.children.size > 0
83 @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
83 @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
84 @trackers = Tracker.find(:all)
84 @trackers = Tracker.find(:all, :order => 'position')
85 @open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN issue_statuses ON issue_statuses.id = issues.status_id", :conditions => ["project_id=? and issue_statuses.is_closed=?", @project.id, false])
85 @open_issues_by_tracker = Issue.count(:group => :tracker, :joins => "INNER JOIN issue_statuses ON issue_statuses.id = issues.status_id", :conditions => ["project_id=? and issue_statuses.is_closed=?", @project.id, false])
86 @total_issues_by_tracker = Issue.count(:group => :tracker, :conditions => ["project_id=?", @project.id])
86 @total_issues_by_tracker = Issue.count(:group => :tracker, :conditions => ["project_id=?", @project.id])
87 end
87 end
88
88
89 def settings
89 def settings
90 @root_projects = Project::find(:all, :conditions => ["parent_id is null and id <> ?", @project.id])
90 @root_projects = Project::find(:all, :conditions => ["parent_id is null and id <> ?", @project.id])
91 @custom_fields = IssueCustomField.find(:all)
91 @custom_fields = IssueCustomField.find(:all)
92 @issue_category ||= IssueCategory.new
92 @issue_category ||= IssueCategory.new
93 @member ||= @project.members.new
93 @member ||= @project.members.new
94 @roles = Role.find(:all, :order => 'position')
94 @roles = Role.find(:all, :order => 'position')
95 @users = User.find_active(:all) - @project.users
95 @users = User.find_active(:all) - @project.users
96 @custom_values ||= ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
96 @custom_values ||= ProjectCustomField.find(:all).collect { |x| @project.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x) }
97 end
97 end
98
98
99 # Edit @project
99 # Edit @project
100 def edit
100 def edit
101 if request.post?
101 if request.post?
102 @project.custom_fields = IssueCustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
102 @project.custom_fields = IssueCustomField.find(params[:custom_field_ids]) if params[:custom_field_ids]
103 if params[:custom_fields]
103 if params[:custom_fields]
104 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
104 @custom_values = ProjectCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @project, :value => params["custom_fields"][x.id.to_s]) }
105 @project.custom_values = @custom_values
105 @project.custom_values = @custom_values
106 end
106 end
107 if params[:repository_enabled]
107 if params[:repository_enabled]
108 case params[:repository_enabled]
108 case params[:repository_enabled]
109 when "0"
109 when "0"
110 @project.repository = nil
110 @project.repository = nil
111 when "1"
111 when "1"
112 @project.repository ||= Repository.new
112 @project.repository ||= Repository.new
113 @project.repository.attributes = params[:repository]
113 @project.repository.attributes = params[:repository]
114 end
114 end
115 end
115 end
116 @project.attributes = params[:project]
116 @project.attributes = params[:project]
117 if @project.save
117 if @project.save
118 flash[:notice] = l(:notice_successful_update)
118 flash[:notice] = l(:notice_successful_update)
119 redirect_to :action => 'settings', :id => @project
119 redirect_to :action => 'settings', :id => @project
120 else
120 else
121 settings
121 settings
122 render :action => 'settings'
122 render :action => 'settings'
123 end
123 end
124 end
124 end
125 end
125 end
126
126
127 # Delete @project
127 # Delete @project
128 def destroy
128 def destroy
129 if request.post? and params[:confirm]
129 if request.post? and params[:confirm]
130 @project.destroy
130 @project.destroy
131 redirect_to :controller => 'admin', :action => 'projects'
131 redirect_to :controller => 'admin', :action => 'projects'
132 end
132 end
133 end
133 end
134
134
135 # Add a new issue category to @project
135 # Add a new issue category to @project
136 def add_issue_category
136 def add_issue_category
137 if request.post?
137 if request.post?
138 @issue_category = @project.issue_categories.build(params[:issue_category])
138 @issue_category = @project.issue_categories.build(params[:issue_category])
139 if @issue_category.save
139 if @issue_category.save
140 flash[:notice] = l(:notice_successful_create)
140 flash[:notice] = l(:notice_successful_create)
141 redirect_to :action => 'settings', :tab => 'categories', :id => @project
141 redirect_to :action => 'settings', :tab => 'categories', :id => @project
142 else
142 else
143 settings
143 settings
144 render :action => 'settings'
144 render :action => 'settings'
145 end
145 end
146 end
146 end
147 end
147 end
148
148
149 # Add a new version to @project
149 # Add a new version to @project
150 def add_version
150 def add_version
151 @version = @project.versions.build(params[:version])
151 @version = @project.versions.build(params[:version])
152 if request.post? and @version.save
152 if request.post? and @version.save
153 flash[:notice] = l(:notice_successful_create)
153 flash[:notice] = l(:notice_successful_create)
154 redirect_to :action => 'settings', :tab => 'versions', :id => @project
154 redirect_to :action => 'settings', :tab => 'versions', :id => @project
155 end
155 end
156 end
156 end
157
157
158 # Add a new member to @project
158 # Add a new member to @project
159 def add_member
159 def add_member
160 @member = @project.members.build(params[:member])
160 @member = @project.members.build(params[:member])
161 if request.post?
161 if request.post?
162 if @member.save
162 if @member.save
163 flash[:notice] = l(:notice_successful_create)
163 flash[:notice] = l(:notice_successful_create)
164 redirect_to :action => 'settings', :tab => 'members', :id => @project
164 redirect_to :action => 'settings', :tab => 'members', :id => @project
165 else
165 else
166 settings
166 settings
167 render :action => 'settings'
167 render :action => 'settings'
168 end
168 end
169 end
169 end
170 end
170 end
171
171
172 # Show members list of @project
172 # Show members list of @project
173 def list_members
173 def list_members
174 @members = @project.members
174 @members = @project.members
175 end
175 end
176
176
177 # Add a new document to @project
177 # Add a new document to @project
178 def add_document
178 def add_document
179 @categories = Enumeration::get_values('DCAT')
179 @categories = Enumeration::get_values('DCAT')
180 @document = @project.documents.build(params[:document])
180 @document = @project.documents.build(params[:document])
181 if request.post? and @document.save
181 if request.post? and @document.save
182 # Save the attachments
182 # Save the attachments
183 params[:attachments].each { |a|
183 params[:attachments].each { |a|
184 Attachment.create(:container => @document, :file => a, :author => logged_in_user) unless a.size == 0
184 Attachment.create(:container => @document, :file => a, :author => logged_in_user) unless a.size == 0
185 } if params[:attachments] and params[:attachments].is_a? Array
185 } if params[:attachments] and params[:attachments].is_a? Array
186 flash[:notice] = l(:notice_successful_create)
186 flash[:notice] = l(:notice_successful_create)
187 Mailer.deliver_document_add(@document) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
187 Mailer.deliver_document_add(@document) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
188 redirect_to :action => 'list_documents', :id => @project
188 redirect_to :action => 'list_documents', :id => @project
189 end
189 end
190 end
190 end
191
191
192 # Show documents list of @project
192 # Show documents list of @project
193 def list_documents
193 def list_documents
194 @documents = @project.documents.find :all, :include => :category
194 @documents = @project.documents.find :all, :include => :category
195 end
195 end
196
196
197 # Add a new issue to @project
197 # Add a new issue to @project
198 def add_issue
198 def add_issue
199 @tracker = Tracker.find(params[:tracker_id])
199 @tracker = Tracker.find(params[:tracker_id])
200 @priorities = Enumeration::get_values('IPRI')
200 @priorities = Enumeration::get_values('IPRI')
201 @issue = Issue.new(:project => @project, :tracker => @tracker)
201 @issue = Issue.new(:project => @project, :tracker => @tracker)
202 if request.get?
202 if request.get?
203 @issue.start_date = Date.today
203 @issue.start_date = Date.today
204 @custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue) }
204 @custom_values = @project.custom_fields_for_issues(@tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue) }
205 else
205 else
206 @issue.attributes = params[:issue]
206 @issue.attributes = params[:issue]
207 @issue.author_id = self.logged_in_user.id if self.logged_in_user
207 @issue.author_id = self.logged_in_user.id if self.logged_in_user
208 # Multiple file upload
208 # Multiple file upload
209 @attachments = []
209 @attachments = []
210 params[:attachments].each { |a|
210 params[:attachments].each { |a|
211 @attachments << Attachment.new(:container => @issue, :file => a, :author => logged_in_user) unless a.size == 0
211 @attachments << Attachment.new(:container => @issue, :file => a, :author => logged_in_user) unless a.size == 0
212 } if params[:attachments] and params[:attachments].is_a? Array
212 } if params[:attachments] and params[:attachments].is_a? Array
213 @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]) }
213 @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]) }
214 @issue.custom_values = @custom_values
214 @issue.custom_values = @custom_values
215 if @issue.save
215 if @issue.save
216 @attachments.each(&:save)
216 @attachments.each(&:save)
217 flash[:notice] = l(:notice_successful_create)
217 flash[:notice] = l(:notice_successful_create)
218 Mailer.deliver_issue_add(@issue) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
218 Mailer.deliver_issue_add(@issue) if Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
219 redirect_to :action => 'list_issues', :id => @project
219 redirect_to :action => 'list_issues', :id => @project
220 end
220 end
221 end
221 end
222 end
222 end
223
223
224 # Show filtered/sorted issues list of @project
224 # Show filtered/sorted issues list of @project
225 def list_issues
225 def list_issues
226 sort_init 'issues.id', 'desc'
226 sort_init 'issues.id', 'desc'
227 sort_update
227 sort_update
228
228
229 retrieve_query
229 retrieve_query
230
230
231 @results_per_page_options = [ 15, 25, 50, 100 ]
231 @results_per_page_options = [ 15, 25, 50, 100 ]
232 if params[:per_page] and @results_per_page_options.include? params[:per_page].to_i
232 if params[:per_page] and @results_per_page_options.include? params[:per_page].to_i
233 @results_per_page = params[:per_page].to_i
233 @results_per_page = params[:per_page].to_i
234 session[:results_per_page] = @results_per_page
234 session[:results_per_page] = @results_per_page
235 else
235 else
236 @results_per_page = session[:results_per_page] || 25
236 @results_per_page = session[:results_per_page] || 25
237 end
237 end
238
238
239 if @query.valid?
239 if @query.valid?
240 @issue_count = Issue.count(:include => [:status, :project], :conditions => @query.statement)
240 @issue_count = Issue.count(:include => [:status, :project], :conditions => @query.statement)
241 @issue_pages = Paginator.new self, @issue_count, @results_per_page, params['page']
241 @issue_pages = Paginator.new self, @issue_count, @results_per_page, params['page']
242 @issues = Issue.find :all, :order => sort_clause,
242 @issues = Issue.find :all, :order => sort_clause,
243 :include => [ :author, :status, :tracker, :project ],
243 :include => [ :author, :status, :tracker, :project ],
244 :conditions => @query.statement,
244 :conditions => @query.statement,
245 :limit => @issue_pages.items_per_page,
245 :limit => @issue_pages.items_per_page,
246 :offset => @issue_pages.current.offset
246 :offset => @issue_pages.current.offset
247 end
247 end
248 @trackers = Tracker.find :all
248 @trackers = Tracker.find :all, :order => 'position'
249 render :layout => false if request.xhr?
249 render :layout => false if request.xhr?
250 end
250 end
251
251
252 # Export filtered/sorted issues list to CSV
252 # Export filtered/sorted issues list to CSV
253 def export_issues_csv
253 def export_issues_csv
254 sort_init 'issues.id', 'desc'
254 sort_init 'issues.id', 'desc'
255 sort_update
255 sort_update
256
256
257 retrieve_query
257 retrieve_query
258 render :action => 'list_issues' and return unless @query.valid?
258 render :action => 'list_issues' and return unless @query.valid?
259
259
260 @issues = Issue.find :all, :order => sort_clause,
260 @issues = Issue.find :all, :order => sort_clause,
261 :include => [ :author, :status, :tracker, :priority, {:custom_values => :custom_field} ],
261 :include => [ :author, :status, :tracker, :priority, {:custom_values => :custom_field} ],
262 :conditions => @query.statement
262 :conditions => @query.statement
263
263
264 ic = Iconv.new('ISO-8859-1', 'UTF-8')
264 ic = Iconv.new('ISO-8859-1', 'UTF-8')
265 export = StringIO.new
265 export = StringIO.new
266 CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
266 CSV::Writer.generate(export, l(:general_csv_separator)) do |csv|
267 # csv header fields
267 # csv header fields
268 headers = [ "#", l(:field_status),
268 headers = [ "#", l(:field_status),
269 l(:field_tracker),
269 l(:field_tracker),
270 l(:field_priority),
270 l(:field_priority),
271 l(:field_subject),
271 l(:field_subject),
272 l(:field_author),
272 l(:field_author),
273 l(:field_start_date),
273 l(:field_start_date),
274 l(:field_due_date),
274 l(:field_due_date),
275 l(:field_done_ratio),
275 l(:field_done_ratio),
276 l(:field_created_on),
276 l(:field_created_on),
277 l(:field_updated_on)
277 l(:field_updated_on)
278 ]
278 ]
279 for custom_field in @project.all_custom_fields
279 for custom_field in @project.all_custom_fields
280 headers << custom_field.name
280 headers << custom_field.name
281 end
281 end
282 csv << headers.collect {|c| ic.iconv(c) }
282 csv << headers.collect {|c| ic.iconv(c) }
283 # csv lines
283 # csv lines
284 @issues.each do |issue|
284 @issues.each do |issue|
285 fields = [issue.id, issue.status.name,
285 fields = [issue.id, issue.status.name,
286 issue.tracker.name,
286 issue.tracker.name,
287 issue.priority.name,
287 issue.priority.name,
288 issue.subject,
288 issue.subject,
289 issue.author.display_name,
289 issue.author.display_name,
290 issue.start_date ? l_date(issue.start_date) : nil,
290 issue.start_date ? l_date(issue.start_date) : nil,
291 issue.due_date ? l_date(issue.due_date) : nil,
291 issue.due_date ? l_date(issue.due_date) : nil,
292 issue.done_ratio,
292 issue.done_ratio,
293 l_datetime(issue.created_on),
293 l_datetime(issue.created_on),
294 l_datetime(issue.updated_on)
294 l_datetime(issue.updated_on)
295 ]
295 ]
296 for custom_field in @project.all_custom_fields
296 for custom_field in @project.all_custom_fields
297 fields << (show_value issue.custom_value_for(custom_field))
297 fields << (show_value issue.custom_value_for(custom_field))
298 end
298 end
299 csv << fields.collect {|c| ic.iconv(c.to_s) }
299 csv << fields.collect {|c| ic.iconv(c.to_s) }
300 end
300 end
301 end
301 end
302 export.rewind
302 export.rewind
303 send_data(export.read, :type => 'text/csv; header=present', :filename => 'export.csv')
303 send_data(export.read, :type => 'text/csv; header=present', :filename => 'export.csv')
304 end
304 end
305
305
306 # Export filtered/sorted issues to PDF
306 # Export filtered/sorted issues to PDF
307 def export_issues_pdf
307 def export_issues_pdf
308 sort_init 'issues.id', 'desc'
308 sort_init 'issues.id', 'desc'
309 sort_update
309 sort_update
310
310
311 retrieve_query
311 retrieve_query
312 render :action => 'list_issues' and return unless @query.valid?
312 render :action => 'list_issues' and return unless @query.valid?
313
313
314 @issues = Issue.find :all, :order => sort_clause,
314 @issues = Issue.find :all, :order => sort_clause,
315 :include => [ :author, :status, :tracker, :project, :custom_values ],
315 :include => [ :author, :status, :tracker, :project, :custom_values ],
316 :conditions => @query.statement
316 :conditions => @query.statement
317
317
318 @options_for_rfpdf ||= {}
318 @options_for_rfpdf ||= {}
319 @options_for_rfpdf[:file_name] = "export.pdf"
319 @options_for_rfpdf[:file_name] = "export.pdf"
320 render :layout => false
320 render :layout => false
321 end
321 end
322
322
323 def move_issues
323 def move_issues
324 @issues = @project.issues.find(params[:issue_ids]) if params[:issue_ids]
324 @issues = @project.issues.find(params[:issue_ids]) if params[:issue_ids]
325 redirect_to :action => 'list_issues', :id => @project and return unless @issues
325 redirect_to :action => 'list_issues', :id => @project and return unless @issues
326 @projects = []
326 @projects = []
327 # find projects to which the user is allowed to move the issue
327 # find projects to which the user is allowed to move the issue
328 @logged_in_user.memberships.each {|m| @projects << m.project if Permission.allowed_to_role("projects/move_issues", m.role_id)}
328 @logged_in_user.memberships.each {|m| @projects << m.project if Permission.allowed_to_role("projects/move_issues", m.role_id)}
329 # issue can be moved to any tracker
329 # issue can be moved to any tracker
330 @trackers = Tracker.find(:all)
330 @trackers = Tracker.find(:all)
331 if request.post? and params[:new_project_id] and params[:new_tracker_id]
331 if request.post? and params[:new_project_id] and params[:new_tracker_id]
332 new_project = Project.find(params[:new_project_id])
332 new_project = Project.find(params[:new_project_id])
333 new_tracker = Tracker.find(params[:new_tracker_id])
333 new_tracker = Tracker.find(params[:new_tracker_id])
334 @issues.each { |i|
334 @issues.each { |i|
335 # project dependent properties
335 # project dependent properties
336 unless i.project_id == new_project.id
336 unless i.project_id == new_project.id
337 i.category = nil
337 i.category = nil
338 i.fixed_version = nil
338 i.fixed_version = nil
339 end
339 end
340 # move the issue
340 # move the issue
341 i.project = new_project
341 i.project = new_project
342 i.tracker = new_tracker
342 i.tracker = new_tracker
343 i.save
343 i.save
344 }
344 }
345 flash[:notice] = l(:notice_successful_update)
345 flash[:notice] = l(:notice_successful_update)
346 redirect_to :action => 'list_issues', :id => @project
346 redirect_to :action => 'list_issues', :id => @project
347 end
347 end
348 end
348 end
349
349
350 def add_query
350 def add_query
351 @query = Query.new(params[:query])
351 @query = Query.new(params[:query])
352 @query.project = @project
352 @query.project = @project
353 @query.user = logged_in_user
353 @query.user = logged_in_user
354
354
355 params[:fields].each do |field|
355 params[:fields].each do |field|
356 @query.add_filter(field, params[:operators][field], params[:values][field])
356 @query.add_filter(field, params[:operators][field], params[:values][field])
357 end if params[:fields]
357 end if params[:fields]
358
358
359 if request.post? and @query.save
359 if request.post? and @query.save
360 flash[:notice] = l(:notice_successful_create)
360 flash[:notice] = l(:notice_successful_create)
361 redirect_to :controller => 'reports', :action => 'issue_report', :id => @project
361 redirect_to :controller => 'reports', :action => 'issue_report', :id => @project
362 end
362 end
363 render :layout => false if request.xhr?
363 render :layout => false if request.xhr?
364 end
364 end
365
365
366 # Add a news to @project
366 # Add a news to @project
367 def add_news
367 def add_news
368 @news = News.new(:project => @project)
368 @news = News.new(:project => @project)
369 if request.post?
369 if request.post?
370 @news.attributes = params[:news]
370 @news.attributes = params[:news]
371 @news.author_id = self.logged_in_user.id if self.logged_in_user
371 @news.author_id = self.logged_in_user.id if self.logged_in_user
372 if @news.save
372 if @news.save
373 flash[:notice] = l(:notice_successful_create)
373 flash[:notice] = l(:notice_successful_create)
374 redirect_to :action => 'list_news', :id => @project
374 redirect_to :action => 'list_news', :id => @project
375 end
375 end
376 end
376 end
377 end
377 end
378
378
379 # Show news list of @project
379 # Show news list of @project
380 def list_news
380 def list_news
381 @news_pages, @news = paginate :news, :per_page => 10, :conditions => ["project_id=?", @project.id], :include => :author, :order => "news.created_on DESC"
381 @news_pages, @news = paginate :news, :per_page => 10, :conditions => ["project_id=?", @project.id], :include => :author, :order => "news.created_on DESC"
382 render :action => "list_news", :layout => false if request.xhr?
382 render :action => "list_news", :layout => false if request.xhr?
383 end
383 end
384
384
385 def add_file
385 def add_file
386 if request.post?
386 if request.post?
387 @version = @project.versions.find_by_id(params[:version_id])
387 @version = @project.versions.find_by_id(params[:version_id])
388 # Save the attachments
388 # Save the attachments
389 @attachments = []
389 @attachments = []
390 params[:attachments].each { |file|
390 params[:attachments].each { |file|
391 next unless file.size > 0
391 next unless file.size > 0
392 a = Attachment.create(:container => @version, :file => file, :author => logged_in_user)
392 a = Attachment.create(:container => @version, :file => file, :author => logged_in_user)
393 @attachments << a unless a.new_record?
393 @attachments << a unless a.new_record?
394 } if params[:attachments] and params[:attachments].is_a? Array
394 } if params[:attachments] and params[:attachments].is_a? Array
395 Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? and Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
395 Mailer.deliver_attachments_add(@attachments) if !@attachments.empty? and Permission.find_by_controller_and_action(params[:controller], params[:action]).mail_enabled?
396 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
396 redirect_to :controller => 'projects', :action => 'list_files', :id => @project
397 end
397 end
398 @versions = @project.versions
398 @versions = @project.versions
399 end
399 end
400
400
401 def list_files
401 def list_files
402 @versions = @project.versions
402 @versions = @project.versions
403 end
403 end
404
404
405 # Show changelog for @project
405 # Show changelog for @project
406 def changelog
406 def changelog
407 @trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true])
407 @trackers = Tracker.find(:all, :conditions => ["is_in_chlog=?", true], :order => 'position')
408 if request.get?
408 if request.get?
409 @selected_tracker_ids = @trackers.collect {|t| t.id.to_s }
409 @selected_tracker_ids = @trackers.collect {|t| t.id.to_s }
410 else
410 else
411 @selected_tracker_ids = params[:tracker_ids].collect { |id| id.to_i.to_s } if params[:tracker_ids] and params[:tracker_ids].is_a? Array
411 @selected_tracker_ids = params[:tracker_ids].collect { |id| id.to_i.to_s } if params[:tracker_ids] and params[:tracker_ids].is_a? Array
412 end
412 end
413 @selected_tracker_ids ||= []
413 @selected_tracker_ids ||= []
414 @fixed_issues = @project.issues.find(:all,
414 @fixed_issues = @project.issues.find(:all,
415 :include => [ :fixed_version, :status, :tracker ],
415 :include => [ :fixed_version, :status, :tracker ],
416 :conditions => [ "issue_statuses.is_closed=? and issues.tracker_id in (#{@selected_tracker_ids.join(',')}) and issues.fixed_version_id is not null", true],
416 :conditions => [ "issue_statuses.is_closed=? and issues.tracker_id in (#{@selected_tracker_ids.join(',')}) and issues.fixed_version_id is not null", true],
417 :order => "versions.effective_date DESC, issues.id DESC"
417 :order => "versions.effective_date DESC, issues.id DESC"
418 ) unless @selected_tracker_ids.empty?
418 ) unless @selected_tracker_ids.empty?
419 @fixed_issues ||= []
419 @fixed_issues ||= []
420 end
420 end
421
421
422 def activity
422 def activity
423 if params[:year] and params[:year].to_i > 1900
423 if params[:year] and params[:year].to_i > 1900
424 @year = params[:year].to_i
424 @year = params[:year].to_i
425 if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
425 if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
426 @month = params[:month].to_i
426 @month = params[:month].to_i
427 end
427 end
428 end
428 end
429 @year ||= Date.today.year
429 @year ||= Date.today.year
430 @month ||= Date.today.month
430 @month ||= Date.today.month
431
431
432 @date_from = Date.civil(@year, @month, 1)
432 @date_from = Date.civil(@year, @month, 1)
433 @date_to = (@date_from >> 1)-1
433 @date_to = (@date_from >> 1)-1
434
434
435 @events_by_day = {}
435 @events_by_day = {}
436
436
437 unless params[:show_issues] == "0"
437 unless params[:show_issues] == "0"
438 @project.issues.find(:all, :include => [:author, :status], :conditions => ["issues.created_on>=? and issues.created_on<=?", @date_from, @date_to] ).each { |i|
438 @project.issues.find(:all, :include => [:author, :status], :conditions => ["issues.created_on>=? and issues.created_on<=?", @date_from, @date_to] ).each { |i|
439 @events_by_day[i.created_on.to_date] ||= []
439 @events_by_day[i.created_on.to_date] ||= []
440 @events_by_day[i.created_on.to_date] << i
440 @events_by_day[i.created_on.to_date] << i
441 }
441 }
442 @show_issues = 1
442 @show_issues = 1
443 end
443 end
444
444
445 unless params[:show_news] == "0"
445 unless params[:show_news] == "0"
446 @project.news.find(:all, :conditions => ["news.created_on>=? and news.created_on<=?", @date_from, @date_to], :include => :author ).each { |i|
446 @project.news.find(:all, :conditions => ["news.created_on>=? and news.created_on<=?", @date_from, @date_to], :include => :author ).each { |i|
447 @events_by_day[i.created_on.to_date] ||= []
447 @events_by_day[i.created_on.to_date] ||= []
448 @events_by_day[i.created_on.to_date] << i
448 @events_by_day[i.created_on.to_date] << i
449 }
449 }
450 @show_news = 1
450 @show_news = 1
451 end
451 end
452
452
453 unless params[:show_files] == "0"
453 unless params[:show_files] == "0"
454 Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN versions ON versions.id = attachments.container_id", :conditions => ["attachments.container_type='Version' and versions.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
454 Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN versions ON versions.id = attachments.container_id", :conditions => ["attachments.container_type='Version' and versions.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
455 @events_by_day[i.created_on.to_date] ||= []
455 @events_by_day[i.created_on.to_date] ||= []
456 @events_by_day[i.created_on.to_date] << i
456 @events_by_day[i.created_on.to_date] << i
457 }
457 }
458 @show_files = 1
458 @show_files = 1
459 end
459 end
460
460
461 unless params[:show_documents] == "0"
461 unless params[:show_documents] == "0"
462 @project.documents.find(:all, :conditions => ["documents.created_on>=? and documents.created_on<=?", @date_from, @date_to] ).each { |i|
462 @project.documents.find(:all, :conditions => ["documents.created_on>=? and documents.created_on<=?", @date_from, @date_to] ).each { |i|
463 @events_by_day[i.created_on.to_date] ||= []
463 @events_by_day[i.created_on.to_date] ||= []
464 @events_by_day[i.created_on.to_date] << i
464 @events_by_day[i.created_on.to_date] << i
465 }
465 }
466 Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN documents ON documents.id = attachments.container_id", :conditions => ["attachments.container_type='Document' and documents.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
466 Attachment.find(:all, :select => "attachments.*", :joins => "LEFT JOIN documents ON documents.id = attachments.container_id", :conditions => ["attachments.container_type='Document' and documents.project_id=? and attachments.created_on>=? and attachments.created_on<=?", @project.id, @date_from, @date_to], :include => :author ).each { |i|
467 @events_by_day[i.created_on.to_date] ||= []
467 @events_by_day[i.created_on.to_date] ||= []
468 @events_by_day[i.created_on.to_date] << i
468 @events_by_day[i.created_on.to_date] << i
469 }
469 }
470 @show_documents = 1
470 @show_documents = 1
471 end
471 end
472
472
473 render :layout => false if request.xhr?
473 render :layout => false if request.xhr?
474 end
474 end
475
475
476 def calendar
476 def calendar
477 if params[:year] and params[:year].to_i > 1900
477 if params[:year] and params[:year].to_i > 1900
478 @year = params[:year].to_i
478 @year = params[:year].to_i
479 if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
479 if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
480 @month = params[:month].to_i
480 @month = params[:month].to_i
481 end
481 end
482 end
482 end
483 @year ||= Date.today.year
483 @year ||= Date.today.year
484 @month ||= Date.today.month
484 @month ||= Date.today.month
485
485
486 @date_from = Date.civil(@year, @month, 1)
486 @date_from = Date.civil(@year, @month, 1)
487 @date_to = (@date_from >> 1)-1
487 @date_to = (@date_from >> 1)-1
488 # start on monday
488 # start on monday
489 @date_from = @date_from - (@date_from.cwday-1)
489 @date_from = @date_from - (@date_from.cwday-1)
490 # finish on sunday
490 # finish on sunday
491 @date_to = @date_to + (7-@date_to.cwday)
491 @date_to = @date_to + (7-@date_to.cwday)
492
492
493 @issues = @project.issues.find(:all, :include => [:tracker, :status, :assigned_to, :priority], :conditions => ["((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", @date_from, @date_to, @date_from, @date_to])
493 @issues = @project.issues.find(:all, :include => [:tracker, :status, :assigned_to, :priority], :conditions => ["((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", @date_from, @date_to, @date_from, @date_to])
494 render :layout => false if request.xhr?
494 render :layout => false if request.xhr?
495 end
495 end
496
496
497 def gantt
497 def gantt
498 if params[:year] and params[:year].to_i >0
498 if params[:year] and params[:year].to_i >0
499 @year_from = params[:year].to_i
499 @year_from = params[:year].to_i
500 if params[:month] and params[:month].to_i >=1 and params[:month].to_i <= 12
500 if params[:month] and params[:month].to_i >=1 and params[:month].to_i <= 12
501 @month_from = params[:month].to_i
501 @month_from = params[:month].to_i
502 else
502 else
503 @month_from = 1
503 @month_from = 1
504 end
504 end
505 else
505 else
506 @month_from ||= (Date.today << 1).month
506 @month_from ||= (Date.today << 1).month
507 @year_from ||= (Date.today << 1).year
507 @year_from ||= (Date.today << 1).year
508 end
508 end
509
509
510 @zoom = (params[:zoom].to_i > 0 and params[:zoom].to_i < 5) ? params[:zoom].to_i : 2
510 @zoom = (params[:zoom].to_i > 0 and params[:zoom].to_i < 5) ? params[:zoom].to_i : 2
511 @months = (params[:months].to_i > 0 and params[:months].to_i < 25) ? params[:months].to_i : 6
511 @months = (params[:months].to_i > 0 and params[:months].to_i < 25) ? params[:months].to_i : 6
512
512
513 @date_from = Date.civil(@year_from, @month_from, 1)
513 @date_from = Date.civil(@year_from, @month_from, 1)
514 @date_to = (@date_from >> @months) - 1
514 @date_to = (@date_from >> @months) - 1
515 @issues = @project.issues.find(:all, :order => "start_date, due_date", :include => [:tracker, :status, :assigned_to, :priority], :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null)", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to])
515 @issues = @project.issues.find(:all, :order => "start_date, due_date", :include => [:tracker, :status, :assigned_to, :priority], :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null)", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to])
516
516
517 if params[:output]=='pdf'
517 if params[:output]=='pdf'
518 @options_for_rfpdf ||= {}
518 @options_for_rfpdf ||= {}
519 @options_for_rfpdf[:file_name] = "gantt.pdf"
519 @options_for_rfpdf[:file_name] = "gantt.pdf"
520 render :template => "projects/gantt.rfpdf", :layout => false
520 render :template => "projects/gantt.rfpdf", :layout => false
521 else
521 else
522 render :template => "projects/gantt.rhtml"
522 render :template => "projects/gantt.rhtml"
523 end
523 end
524 end
524 end
525
525
526 private
526 private
527 # Find project of id params[:id]
527 # Find project of id params[:id]
528 # if not found, redirect to project list
528 # if not found, redirect to project list
529 # Used as a before_filter
529 # Used as a before_filter
530 def find_project
530 def find_project
531 @project = Project.find(params[:id])
531 @project = Project.find(params[:id])
532 @html_title = @project.name
532 @html_title = @project.name
533 rescue ActiveRecord::RecordNotFound
533 rescue ActiveRecord::RecordNotFound
534 render_404
534 render_404
535 end
535 end
536
536
537 # Retrieve query from session or build a new query
537 # Retrieve query from session or build a new query
538 def retrieve_query
538 def retrieve_query
539 if params[:query_id]
539 if params[:query_id]
540 @query = @project.queries.find(params[:query_id])
540 @query = @project.queries.find(params[:query_id])
541 session[:query] = @query
541 session[:query] = @query
542 else
542 else
543 if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id
543 if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id
544 # Give it a name, required to be valid
544 # Give it a name, required to be valid
545 @query = Query.new(:name => "_")
545 @query = Query.new(:name => "_")
546 @query.project = @project
546 @query.project = @project
547 if params[:fields] and params[:fields].is_a? Array
547 if params[:fields] and params[:fields].is_a? Array
548 params[:fields].each do |field|
548 params[:fields].each do |field|
549 @query.add_filter(field, params[:operators][field], params[:values][field])
549 @query.add_filter(field, params[:operators][field], params[:values][field])
550 end
550 end
551 else
551 else
552 @query.available_filters.keys.each do |field|
552 @query.available_filters.keys.each do |field|
553 @query.add_short_filter(field, params[field]) if params[field]
553 @query.add_short_filter(field, params[field]) if params[field]
554 end
554 end
555 end
555 end
556 session[:query] = @query
556 session[:query] = @query
557 else
557 else
558 @query = session[:query]
558 @query = session[:query]
559 end
559 end
560 end
560 end
561 end
561 end
562 end
562 end
@@ -1,167 +1,167
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 ReportsController < ApplicationController
18 class ReportsController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :find_project, :authorize
20 before_filter :find_project, :authorize
21
21
22 def issue_report
22 def issue_report
23 @statuses = IssueStatus.find(:all, :order => 'position')
23 @statuses = IssueStatus.find(:all, :order => 'position')
24
24
25 case params[:detail]
25 case params[:detail]
26 when "tracker"
26 when "tracker"
27 @field = "tracker_id"
27 @field = "tracker_id"
28 @rows = Tracker.find :all
28 @rows = Tracker.find :all, :order => 'position'
29 @data = issues_by_tracker
29 @data = issues_by_tracker
30 @report_title = l(:field_tracker)
30 @report_title = l(:field_tracker)
31 render :template => "reports/issue_report_details"
31 render :template => "reports/issue_report_details"
32 when "priority"
32 when "priority"
33 @field = "priority_id"
33 @field = "priority_id"
34 @rows = Enumeration::get_values('IPRI')
34 @rows = Enumeration::get_values('IPRI')
35 @data = issues_by_priority
35 @data = issues_by_priority
36 @report_title = l(:field_priority)
36 @report_title = l(:field_priority)
37 render :template => "reports/issue_report_details"
37 render :template => "reports/issue_report_details"
38 when "category"
38 when "category"
39 @field = "category_id"
39 @field = "category_id"
40 @rows = @project.issue_categories
40 @rows = @project.issue_categories
41 @data = issues_by_category
41 @data = issues_by_category
42 @report_title = l(:field_category)
42 @report_title = l(:field_category)
43 render :template => "reports/issue_report_details"
43 render :template => "reports/issue_report_details"
44 when "author"
44 when "author"
45 @field = "author_id"
45 @field = "author_id"
46 @rows = @project.members.collect { |m| m.user }
46 @rows = @project.members.collect { |m| m.user }
47 @data = issues_by_author
47 @data = issues_by_author
48 @report_title = l(:field_author)
48 @report_title = l(:field_author)
49 render :template => "reports/issue_report_details"
49 render :template => "reports/issue_report_details"
50 else
50 else
51 @queries = @project.queries.find :all, :conditions => ["is_public=? or user_id=?", true, (logged_in_user ? logged_in_user.id : 0)]
51 @queries = @project.queries.find :all, :conditions => ["is_public=? or user_id=?", true, (logged_in_user ? logged_in_user.id : 0)]
52 @trackers = Tracker.find(:all)
52 @trackers = Tracker.find(:all, :order => 'position')
53 @priorities = Enumeration::get_values('IPRI')
53 @priorities = Enumeration::get_values('IPRI')
54 @categories = @project.issue_categories
54 @categories = @project.issue_categories
55 @authors = @project.members.collect { |m| m.user }
55 @authors = @project.members.collect { |m| m.user }
56 issues_by_tracker
56 issues_by_tracker
57 issues_by_priority
57 issues_by_priority
58 issues_by_category
58 issues_by_category
59 issues_by_author
59 issues_by_author
60 render :template => "reports/issue_report"
60 render :template => "reports/issue_report"
61 end
61 end
62 end
62 end
63
63
64 def delays
64 def delays
65 @trackers = Tracker.find(:all)
65 @trackers = Tracker.find(:all)
66 if request.get?
66 if request.get?
67 @selected_tracker_ids = @trackers.collect {|t| t.id.to_s }
67 @selected_tracker_ids = @trackers.collect {|t| t.id.to_s }
68 else
68 else
69 @selected_tracker_ids = params[:tracker_ids].collect { |id| id.to_i.to_s } if params[:tracker_ids] and params[:tracker_ids].is_a? Array
69 @selected_tracker_ids = params[:tracker_ids].collect { |id| id.to_i.to_s } if params[:tracker_ids] and params[:tracker_ids].is_a? Array
70 end
70 end
71 @selected_tracker_ids ||= []
71 @selected_tracker_ids ||= []
72 @raw =
72 @raw =
73 ActiveRecord::Base.connection.select_all("SELECT datediff( a.created_on, b.created_on ) as delay, count(a.id) as total
73 ActiveRecord::Base.connection.select_all("SELECT datediff( a.created_on, b.created_on ) as delay, count(a.id) as total
74 FROM issue_histories a, issue_histories b, issues i
74 FROM issue_histories a, issue_histories b, issues i
75 WHERE a.status_id =5
75 WHERE a.status_id =5
76 AND a.issue_id = b.issue_id
76 AND a.issue_id = b.issue_id
77 AND a.issue_id = i.id
77 AND a.issue_id = i.id
78 AND i.tracker_id in (#{@selected_tracker_ids.join(',')})
78 AND i.tracker_id in (#{@selected_tracker_ids.join(',')})
79 AND b.id = (
79 AND b.id = (
80 SELECT min( c.id )
80 SELECT min( c.id )
81 FROM issue_histories c
81 FROM issue_histories c
82 WHERE b.issue_id = c.issue_id )
82 WHERE b.issue_id = c.issue_id )
83 GROUP BY delay") unless @selected_tracker_ids.empty?
83 GROUP BY delay") unless @selected_tracker_ids.empty?
84 @raw ||=[]
84 @raw ||=[]
85
85
86 @x_from = 0
86 @x_from = 0
87 @x_to = 0
87 @x_to = 0
88 @y_from = 0
88 @y_from = 0
89 @y_to = 0
89 @y_to = 0
90 @sum_total = 0
90 @sum_total = 0
91 @sum_delay = 0
91 @sum_delay = 0
92 @raw.each do |r|
92 @raw.each do |r|
93 @x_to = [r['delay'].to_i, @x_to].max
93 @x_to = [r['delay'].to_i, @x_to].max
94 @y_to = [r['total'].to_i, @y_to].max
94 @y_to = [r['total'].to_i, @y_to].max
95 @sum_total = @sum_total + r['total'].to_i
95 @sum_total = @sum_total + r['total'].to_i
96 @sum_delay = @sum_delay + r['total'].to_i * r['delay'].to_i
96 @sum_delay = @sum_delay + r['total'].to_i * r['delay'].to_i
97 end
97 end
98 end
98 end
99
99
100 private
100 private
101 # Find project of id params[:id]
101 # Find project of id params[:id]
102 def find_project
102 def find_project
103 @project = Project.find(params[:id])
103 @project = Project.find(params[:id])
104 rescue ActiveRecord::RecordNotFound
104 rescue ActiveRecord::RecordNotFound
105 render_404
105 render_404
106 end
106 end
107
107
108 def issues_by_tracker
108 def issues_by_tracker
109 @issues_by_tracker ||=
109 @issues_by_tracker ||=
110 ActiveRecord::Base.connection.select_all("select s.id as status_id,
110 ActiveRecord::Base.connection.select_all("select s.id as status_id,
111 s.is_closed as closed,
111 s.is_closed as closed,
112 t.id as tracker_id,
112 t.id as tracker_id,
113 count(i.id) as total
113 count(i.id) as total
114 from
114 from
115 issues i, issue_statuses s, trackers t
115 issues i, issue_statuses s, trackers t
116 where
116 where
117 i.status_id=s.id
117 i.status_id=s.id
118 and i.tracker_id=t.id
118 and i.tracker_id=t.id
119 and i.project_id=#{@project.id}
119 and i.project_id=#{@project.id}
120 group by s.id, s.is_closed, t.id")
120 group by s.id, s.is_closed, t.id")
121 end
121 end
122
122
123 def issues_by_priority
123 def issues_by_priority
124 @issues_by_priority ||=
124 @issues_by_priority ||=
125 ActiveRecord::Base.connection.select_all("select s.id as status_id,
125 ActiveRecord::Base.connection.select_all("select s.id as status_id,
126 s.is_closed as closed,
126 s.is_closed as closed,
127 p.id as priority_id,
127 p.id as priority_id,
128 count(i.id) as total
128 count(i.id) as total
129 from
129 from
130 issues i, issue_statuses s, enumerations p
130 issues i, issue_statuses s, enumerations p
131 where
131 where
132 i.status_id=s.id
132 i.status_id=s.id
133 and i.priority_id=p.id
133 and i.priority_id=p.id
134 and i.project_id=#{@project.id}
134 and i.project_id=#{@project.id}
135 group by s.id, s.is_closed, p.id")
135 group by s.id, s.is_closed, p.id")
136 end
136 end
137
137
138 def issues_by_category
138 def issues_by_category
139 @issues_by_category ||=
139 @issues_by_category ||=
140 ActiveRecord::Base.connection.select_all("select s.id as status_id,
140 ActiveRecord::Base.connection.select_all("select s.id as status_id,
141 s.is_closed as closed,
141 s.is_closed as closed,
142 c.id as category_id,
142 c.id as category_id,
143 count(i.id) as total
143 count(i.id) as total
144 from
144 from
145 issues i, issue_statuses s, issue_categories c
145 issues i, issue_statuses s, issue_categories c
146 where
146 where
147 i.status_id=s.id
147 i.status_id=s.id
148 and i.category_id=c.id
148 and i.category_id=c.id
149 and i.project_id=#{@project.id}
149 and i.project_id=#{@project.id}
150 group by s.id, s.is_closed, c.id")
150 group by s.id, s.is_closed, c.id")
151 end
151 end
152
152
153 def issues_by_author
153 def issues_by_author
154 @issues_by_author ||=
154 @issues_by_author ||=
155 ActiveRecord::Base.connection.select_all("select s.id as status_id,
155 ActiveRecord::Base.connection.select_all("select s.id as status_id,
156 s.is_closed as closed,
156 s.is_closed as closed,
157 a.id as author_id,
157 a.id as author_id,
158 count(i.id) as total
158 count(i.id) as total
159 from
159 from
160 issues i, issue_statuses s, users a
160 issues i, issue_statuses s, users a
161 where
161 where
162 i.status_id=s.id
162 i.status_id=s.id
163 and i.author_id=a.id
163 and i.author_id=a.id
164 and i.project_id=#{@project.id}
164 and i.project_id=#{@project.id}
165 group by s.id, s.is_closed, a.id")
165 group by s.id, s.is_closed, a.id")
166 end
166 end
167 end
167 end
@@ -1,102 +1,102
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 verify :method => :post, :only => [ :destroy, :move ],
22 verify :method => :post, :only => [ :destroy, :move ],
23 :redirect_to => { :action => :list }
23 :redirect_to => { :action => :list }
24
24
25 def index
25 def index
26 list
26 list
27 render :action => 'list' unless request.xhr?
27 render :action => 'list' unless request.xhr?
28 end
28 end
29
29
30 def list
30 def list
31 @role_pages, @roles = paginate :roles, :per_page => 10, :order => "position"
31 @role_pages, @roles = paginate :roles, :per_page => 10, :order => "position"
32 render :action => "list", :layout => false if request.xhr?
32 render :action => "list", :layout => false if request.xhr?
33 end
33 end
34
34
35 def new
35 def new
36 @role = Role.new(params[:role])
36 @role = Role.new(params[:role])
37 if request.post?
37 if request.post?
38 @role.permissions = Permission.find(params[:permission_ids]) if params[:permission_ids]
38 @role.permissions = Permission.find(params[:permission_ids]) if params[:permission_ids]
39 if @role.save
39 if @role.save
40 flash[:notice] = l(:notice_successful_create)
40 flash[:notice] = l(:notice_successful_create)
41 redirect_to :action => 'list'
41 redirect_to :action => 'list'
42 end
42 end
43 end
43 end
44 @permissions = Permission.find(:all, :conditions => ["is_public=?", false], :order => 'sort ASC')
44 @permissions = Permission.find(:all, :conditions => ["is_public=?", false], :order => 'sort ASC')
45 end
45 end
46
46
47 def edit
47 def edit
48 @role = Role.find(params[:id])
48 @role = Role.find(params[:id])
49 if request.post? and @role.update_attributes(params[:role])
49 if request.post? and @role.update_attributes(params[:role])
50 @role.permissions = Permission.find(params[:permission_ids] || [])
50 @role.permissions = Permission.find(params[:permission_ids] || [])
51 Permission.allowed_to_role_expired
51 Permission.allowed_to_role_expired
52 flash[:notice] = l(:notice_successful_update)
52 flash[:notice] = l(:notice_successful_update)
53 redirect_to :action => 'list'
53 redirect_to :action => 'list'
54 end
54 end
55 @permissions = Permission.find(:all, :conditions => ["is_public=?", false], :order => 'sort ASC')
55 @permissions = Permission.find(:all, :conditions => ["is_public=?", false], :order => 'sort ASC')
56 end
56 end
57
57
58 def destroy
58 def destroy
59 @role = Role.find(params[:id])
59 @role = Role.find(params[:id])
60 unless @role.members.empty?
60 unless @role.members.empty?
61 flash[:notice] = 'Some members have this role. Can\'t delete it.'
61 flash[:notice] = 'Some members have this role. Can\'t delete it.'
62 else
62 else
63 @role.destroy
63 @role.destroy
64 end
64 end
65 redirect_to :action => 'list'
65 redirect_to :action => 'list'
66 end
66 end
67
67
68 def move
68 def move
69 @role = Role.find(params[:id])
69 @role = Role.find(params[:id])
70 case params[:position]
70 case params[:position]
71 when 'highest'
71 when 'highest'
72 @role.move_to_top
72 @role.move_to_top
73 when 'higher'
73 when 'higher'
74 @role.move_higher
74 @role.move_higher
75 when 'lower'
75 when 'lower'
76 @role.move_lower
76 @role.move_lower
77 when 'lowest'
77 when 'lowest'
78 @role.move_to_bottom
78 @role.move_to_bottom
79 end if params[:position]
79 end if params[:position]
80 redirect_to :action => 'list'
80 redirect_to :action => 'list'
81 end
81 end
82
82
83 def workflow
83 def workflow
84 @role = Role.find_by_id(params[:role_id])
84 @role = Role.find_by_id(params[:role_id])
85 @tracker = Tracker.find_by_id(params[:tracker_id])
85 @tracker = Tracker.find_by_id(params[:tracker_id])
86
86
87 if request.post?
87 if request.post?
88 Workflow.destroy_all( ["role_id=? and tracker_id=?", @role.id, @tracker.id])
88 Workflow.destroy_all( ["role_id=? and tracker_id=?", @role.id, @tracker.id])
89 (params[:issue_status] || []).each { |old, news|
89 (params[:issue_status] || []).each { |old, news|
90 news.each { |new|
90 news.each { |new|
91 @role.workflows.build(:tracker_id => @tracker.id, :old_status_id => old, :new_status_id => new)
91 @role.workflows.build(:tracker_id => @tracker.id, :old_status_id => old, :new_status_id => new)
92 }
92 }
93 }
93 }
94 if @role.save
94 if @role.save
95 flash[:notice] = l(:notice_successful_update)
95 flash[:notice] = l(:notice_successful_update)
96 end
96 end
97 end
97 end
98 @roles = Role.find(:all, :order => 'position')
98 @roles = Role.find(:all, :order => 'position')
99 @trackers = Tracker.find :all
99 @trackers = Tracker.find(:all, :order => 'position')
100 @statuses = IssueStatus.find(:all, :include => :workflows, :order => 'position')
100 @statuses = IssueStatus.find(:all, :include => :workflows, :order => 'position')
101 end
101 end
102 end
102 end
@@ -1,60 +1,75
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' unless request.xhr?
24 render :action => 'list' unless request.xhr?
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, :order => 'position'
32 render :action => "list", :layout => false if request.xhr?
32 render :action => "list", :layout => false if request.xhr?
33 end
33 end
34
34
35 def new
35 def new
36 @tracker = Tracker.new(params[:tracker])
36 @tracker = Tracker.new(params[:tracker])
37 if request.post? and @tracker.save
37 if request.post? and @tracker.save
38 flash[:notice] = l(:notice_successful_create)
38 flash[:notice] = l(:notice_successful_create)
39 redirect_to :action => 'list'
39 redirect_to :action => 'list'
40 end
40 end
41 end
41 end
42
42
43 def edit
43 def edit
44 @tracker = Tracker.find(params[:id])
44 @tracker = Tracker.find(params[:id])
45 if request.post? and @tracker.update_attributes(params[:tracker])
45 if request.post? and @tracker.update_attributes(params[:tracker])
46 flash[:notice] = l(:notice_successful_update)
46 flash[:notice] = l(:notice_successful_update)
47 redirect_to :action => 'list'
47 redirect_to :action => 'list'
48 end
48 end
49 end
49 end
50
50
51 def move
52 @tracker = Tracker.find(params[:id])
53 case params[:position]
54 when 'highest'
55 @tracker.move_to_top
56 when 'higher'
57 @tracker.move_higher
58 when 'lower'
59 @tracker.move_lower
60 when 'lowest'
61 @tracker.move_to_bottom
62 end if params[:position]
63 redirect_to :action => 'list'
64 end
65
51 def destroy
66 def destroy
52 @tracker = Tracker.find(params[:id])
67 @tracker = Tracker.find(params[:id])
53 unless @tracker.issues.empty?
68 unless @tracker.issues.empty?
54 flash[:notice] = "This tracker contains issues and can\'t be deleted."
69 flash[:notice] = "This tracker contains issues and can\'t be deleted."
55 else
70 else
56 @tracker.destroy
71 @tracker.destroy
57 end
72 end
58 redirect_to :action => 'list'
73 redirect_to :action => 'list'
59 end
74 end
60 end
75 end
@@ -1,167 +1,167
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 Query < ActiveRecord::Base
18 class Query < ActiveRecord::Base
19 belongs_to :project
19 belongs_to :project
20 belongs_to :user
20 belongs_to :user
21 serialize :filters
21 serialize :filters
22
22
23 attr_protected :project, :user
23 attr_protected :project, :user
24
24
25 validates_presence_of :name, :on => :save
25 validates_presence_of :name, :on => :save
26
26
27 @@operators = { "=" => :label_equals,
27 @@operators = { "=" => :label_equals,
28 "!" => :label_not_equals,
28 "!" => :label_not_equals,
29 "o" => :label_open_issues,
29 "o" => :label_open_issues,
30 "c" => :label_closed_issues,
30 "c" => :label_closed_issues,
31 "!*" => :label_none,
31 "!*" => :label_none,
32 "*" => :label_all,
32 "*" => :label_all,
33 "<t+" => :label_in_less_than,
33 "<t+" => :label_in_less_than,
34 ">t+" => :label_in_more_than,
34 ">t+" => :label_in_more_than,
35 "t+" => :label_in,
35 "t+" => :label_in,
36 "t" => :label_today,
36 "t" => :label_today,
37 ">t-" => :label_less_than_ago,
37 ">t-" => :label_less_than_ago,
38 "<t-" => :label_more_than_ago,
38 "<t-" => :label_more_than_ago,
39 "t-" => :label_ago,
39 "t-" => :label_ago,
40 "~" => :label_contains,
40 "~" => :label_contains,
41 "!~" => :label_not_contains }
41 "!~" => :label_not_contains }
42
42
43 cattr_reader :operators
43 cattr_reader :operators
44
44
45 @@operators_by_filter_type = { :list => [ "=", "!" ],
45 @@operators_by_filter_type = { :list => [ "=", "!" ],
46 :list_status => [ "o", "=", "!", "c", "*" ],
46 :list_status => [ "o", "=", "!", "c", "*" ],
47 :list_optional => [ "=", "!", "!*", "*" ],
47 :list_optional => [ "=", "!", "!*", "*" ],
48 :date => [ "<t+", ">t+", "t+", "t", ">t-", "<t-", "t-" ],
48 :date => [ "<t+", ">t+", "t+", "t", ">t-", "<t-", "t-" ],
49 :date_past => [ ">t-", "<t-", "t-", "t" ],
49 :date_past => [ ">t-", "<t-", "t-", "t" ],
50 :text => [ "~", "!~" ] }
50 :text => [ "~", "!~" ] }
51
51
52 cattr_reader :operators_by_filter_type
52 cattr_reader :operators_by_filter_type
53
53
54 def initialize(attributes = nil)
54 def initialize(attributes = nil)
55 super attributes
55 super attributes
56 self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
56 self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
57 self.is_public = true
57 self.is_public = true
58 end
58 end
59
59
60 def validate
60 def validate
61 filters.each_key do |field|
61 filters.each_key do |field|
62 errors.add field.gsub(/\_id$/, ""), :activerecord_error_blank unless
62 errors.add field.gsub(/\_id$/, ""), :activerecord_error_blank unless
63 # filter requires one or more values
63 # filter requires one or more values
64 (values_for(field) and !values_for(field).first.empty?) or
64 (values_for(field) and !values_for(field).first.empty?) or
65 # filter doesn't require any value
65 # filter doesn't require any value
66 ["o", "c", "!*", "*", "t"].include? operator_for(field)
66 ["o", "c", "!*", "*", "t"].include? operator_for(field)
67 end if filters
67 end if filters
68 end
68 end
69
69
70 def available_filters
70 def available_filters
71 return @available_filters if @available_filters
71 return @available_filters if @available_filters
72 @available_filters = { "status_id" => { :type => :list_status, :order => 1, :values => IssueStatus.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
72 @available_filters = { "status_id" => { :type => :list_status, :order => 1, :values => IssueStatus.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
73 "tracker_id" => { :type => :list, :order => 2, :values => Tracker.find(:all).collect{|s| [s.name, s.id.to_s] } },
73 "tracker_id" => { :type => :list, :order => 2, :values => Tracker.find(:all, :order => 'position').collect{|s| [s.name, s.id.to_s] } },
74 "priority_id" => { :type => :list, :order => 3, :values => Enumeration.find(:all, :conditions => ['opt=?','IPRI']).collect{|s| [s.name, s.id.to_s] } },
74 "priority_id" => { :type => :list, :order => 3, :values => Enumeration.find(:all, :conditions => ['opt=?','IPRI']).collect{|s| [s.name, s.id.to_s] } },
75 "subject" => { :type => :text, :order => 8 },
75 "subject" => { :type => :text, :order => 8 },
76 "created_on" => { :type => :date_past, :order => 9 },
76 "created_on" => { :type => :date_past, :order => 9 },
77 "updated_on" => { :type => :date_past, :order => 10 },
77 "updated_on" => { :type => :date_past, :order => 10 },
78 "start_date" => { :type => :date, :order => 11 },
78 "start_date" => { :type => :date, :order => 11 },
79 "due_date" => { :type => :date, :order => 12 } }
79 "due_date" => { :type => :date, :order => 12 } }
80 unless project.nil?
80 unless project.nil?
81 # project specific filters
81 # project specific filters
82 @available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => @project.users.collect{|s| [s.name, s.id.to_s] } }
82 @available_filters["assigned_to_id"] = { :type => :list_optional, :order => 4, :values => @project.users.collect{|s| [s.name, s.id.to_s] } }
83 @available_filters["author_id"] = { :type => :list, :order => 5, :values => @project.users.collect{|s| [s.name, s.id.to_s] } }
83 @available_filters["author_id"] = { :type => :list, :order => 5, :values => @project.users.collect{|s| [s.name, s.id.to_s] } }
84 @available_filters["category_id"] = { :type => :list_optional, :order => 6, :values => @project.issue_categories.collect{|s| [s.name, s.id.to_s] } }
84 @available_filters["category_id"] = { :type => :list_optional, :order => 6, :values => @project.issue_categories.collect{|s| [s.name, s.id.to_s] } }
85 @available_filters["fixed_version_id"] = { :type => :list_optional, :order => 7, :values => @project.versions.collect{|s| [s.name, s.id.to_s] } }
85 @available_filters["fixed_version_id"] = { :type => :list_optional, :order => 7, :values => @project.versions.collect{|s| [s.name, s.id.to_s] } }
86 # remove category filter if no category defined
86 # remove category filter if no category defined
87 @available_filters.delete "category_id" if @available_filters["category_id"][:values].empty?
87 @available_filters.delete "category_id" if @available_filters["category_id"][:values].empty?
88 end
88 end
89 @available_filters
89 @available_filters
90 end
90 end
91
91
92 def add_filter(field, operator, values)
92 def add_filter(field, operator, values)
93 # values must be an array
93 # values must be an array
94 return unless values and values.is_a? Array # and !values.first.empty?
94 return unless values and values.is_a? Array # and !values.first.empty?
95 # check if field is defined as an available filter
95 # check if field is defined as an available filter
96 if available_filters.has_key? field
96 if available_filters.has_key? field
97 filter_options = available_filters[field]
97 filter_options = available_filters[field]
98 # check if operator is allowed for that filter
98 # check if operator is allowed for that filter
99 #if @@operators_by_filter_type[filter_options[:type]].include? operator
99 #if @@operators_by_filter_type[filter_options[:type]].include? operator
100 # allowed_values = values & ([""] + (filter_options[:values] || []).collect {|val| val[1]})
100 # allowed_values = values & ([""] + (filter_options[:values] || []).collect {|val| val[1]})
101 # filters[field] = {:operator => operator, :values => allowed_values } if (allowed_values.first and !allowed_values.first.empty?) or ["o", "c", "!*", "*", "t"].include? operator
101 # filters[field] = {:operator => operator, :values => allowed_values } if (allowed_values.first and !allowed_values.first.empty?) or ["o", "c", "!*", "*", "t"].include? operator
102 #end
102 #end
103 filters[field] = {:operator => operator, :values => values }
103 filters[field] = {:operator => operator, :values => values }
104 end
104 end
105 end
105 end
106
106
107 def add_short_filter(field, expression)
107 def add_short_filter(field, expression)
108 return unless expression
108 return unless expression
109 parms = expression.scan(/^(o|c|\!|\*)?(.*)$/).first
109 parms = expression.scan(/^(o|c|\!|\*)?(.*)$/).first
110 add_filter field, (parms[0] || "="), [parms[1] || ""]
110 add_filter field, (parms[0] || "="), [parms[1] || ""]
111 end
111 end
112
112
113 def has_filter?(field)
113 def has_filter?(field)
114 filters and filters[field]
114 filters and filters[field]
115 end
115 end
116
116
117 def operator_for(field)
117 def operator_for(field)
118 has_filter?(field) ? filters[field][:operator] : nil
118 has_filter?(field) ? filters[field][:operator] : nil
119 end
119 end
120
120
121 def values_for(field)
121 def values_for(field)
122 has_filter?(field) ? filters[field][:values] : nil
122 has_filter?(field) ? filters[field][:values] : nil
123 end
123 end
124
124
125 def statement
125 def statement
126 sql = "1=1"
126 sql = "1=1"
127 sql << " AND issues.project_id=%d" % project.id if project
127 sql << " AND issues.project_id=%d" % project.id if project
128 filters.each_key do |field|
128 filters.each_key do |field|
129 v = values_for field
129 v = values_for field
130 next unless v and !v.empty?
130 next unless v and !v.empty?
131 sql = sql + " AND " unless sql.empty?
131 sql = sql + " AND " unless sql.empty?
132 case operator_for field
132 case operator_for field
133 when "="
133 when "="
134 sql = sql + "issues.#{field} IN (" + v.each(&:to_i).join(",") + ")"
134 sql = sql + "issues.#{field} IN (" + v.each(&:to_i).join(",") + ")"
135 when "!"
135 when "!"
136 sql = sql + "issues.#{field} NOT IN (" + v.each(&:to_i).join(",") + ")"
136 sql = sql + "issues.#{field} NOT IN (" + v.each(&:to_i).join(",") + ")"
137 when "!*"
137 when "!*"
138 sql = sql + "issues.#{field} IS NULL"
138 sql = sql + "issues.#{field} IS NULL"
139 when "*"
139 when "*"
140 sql = sql + "issues.#{field} IS NOT NULL"
140 sql = sql + "issues.#{field} IS NOT NULL"
141 when "o"
141 when "o"
142 sql = sql + "issue_statuses.is_closed=#{connection.quoted_false}" if field == "status_id"
142 sql = sql + "issue_statuses.is_closed=#{connection.quoted_false}" if field == "status_id"
143 when "c"
143 when "c"
144 sql = sql + "issue_statuses.is_closed=#{connection.quoted_true}" if field == "status_id"
144 sql = sql + "issue_statuses.is_closed=#{connection.quoted_true}" if field == "status_id"
145 when ">t-"
145 when ">t-"
146 sql = sql + "issues.#{field} >= '%s'" % connection.quoted_date(Date.today - v.first.to_i)
146 sql = sql + "issues.#{field} >= '%s'" % connection.quoted_date(Date.today - v.first.to_i)
147 when "<t-"
147 when "<t-"
148 sql = sql + "issues.#{field} <= '" + (Date.today - v.first.to_i).strftime("%Y-%m-%d") + "'"
148 sql = sql + "issues.#{field} <= '" + (Date.today - v.first.to_i).strftime("%Y-%m-%d") + "'"
149 when "t-"
149 when "t-"
150 sql = sql + "issues.#{field} = '" + (Date.today - v.first.to_i).strftime("%Y-%m-%d") + "'"
150 sql = sql + "issues.#{field} = '" + (Date.today - v.first.to_i).strftime("%Y-%m-%d") + "'"
151 when ">t+"
151 when ">t+"
152 sql = sql + "issues.#{field} >= '" + (Date.today + v.first.to_i).strftime("%Y-%m-%d") + "'"
152 sql = sql + "issues.#{field} >= '" + (Date.today + v.first.to_i).strftime("%Y-%m-%d") + "'"
153 when "<t+"
153 when "<t+"
154 sql = sql + "issues.#{field} <= '" + (Date.today + v.first.to_i).strftime("%Y-%m-%d") + "'"
154 sql = sql + "issues.#{field} <= '" + (Date.today + v.first.to_i).strftime("%Y-%m-%d") + "'"
155 when "t+"
155 when "t+"
156 sql = sql + "issues.#{field} = '" + (Date.today + v.first.to_i).strftime("%Y-%m-%d") + "'"
156 sql = sql + "issues.#{field} = '" + (Date.today + v.first.to_i).strftime("%Y-%m-%d") + "'"
157 when "t"
157 when "t"
158 sql = sql + "issues.#{field} = '%s'" % connection.quoted_date(Date.today)
158 sql = sql + "issues.#{field} = '%s'" % connection.quoted_date(Date.today)
159 when "~"
159 when "~"
160 sql = sql + "issues.#{field} LIKE '%#{connection.quote_string(v.first)}%'"
160 sql = sql + "issues.#{field} LIKE '%#{connection.quote_string(v.first)}%'"
161 when "!~"
161 when "!~"
162 sql = sql + "issues.#{field} NOT LIKE '%#{connection.quote_string(v.first)}%'"
162 sql = sql + "issues.#{field} NOT LIKE '%#{connection.quote_string(v.first)}%'"
163 end
163 end
164 end if filters and valid?
164 end if filters and valid?
165 sql
165 sql
166 end
166 end
167 end
167 end
@@ -1,32 +1,33
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 Tracker < ActiveRecord::Base
18 class Tracker < ActiveRecord::Base
19 before_destroy :check_integrity
19 before_destroy :check_integrity
20 has_many :issues
20 has_many :issues
21 has_many :workflows, :dependent => :delete_all
21 has_many :workflows, :dependent => :delete_all
22 has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => 'custom_fields_trackers', :association_foreign_key => 'custom_field_id'
22 has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => 'custom_fields_trackers', :association_foreign_key => 'custom_field_id'
23 acts_as_list
23
24
24 validates_presence_of :name
25 validates_presence_of :name
25 validates_uniqueness_of :name
26 validates_uniqueness_of :name
26 validates_format_of :name, :with => /^[\w\s\'\-]*$/i
27 validates_format_of :name, :with => /^[\w\s\'\-]*$/i
27
28
28 private
29 private
29 def check_integrity
30 def check_integrity
30 raise "Can't delete tracker" if Issue.find(:first, :conditions => ["tracker_id=?", self.id])
31 raise "Can't delete tracker" if Issue.find(:first, :conditions => ["tracker_id=?", self.id])
31 end
32 end
32 end
33 end
@@ -1,24 +1,31
1 <div class="contextual">
1 <div class="contextual">
2 <%= link_to l(:label_tracker_new), {:action => 'new'}, :class => 'icon icon-add' %>
2 <%= link_to l(:label_tracker_new), {:action => 'new'}, :class => 'icon icon-add' %>
3 </div>
3 </div>
4
4
5 <h2><%=l(:label_tracker_plural)%></h2>
5 <h2><%=l(:label_tracker_plural)%></h2>
6
6
7 <table class="list">
7 <table class="list">
8 <thead><tr>
8 <thead><tr>
9 <th><%=l(:label_tracker)%></th>
9 <th><%=l(:label_tracker)%></th>
10 <th><%=l(:button_sort)%></th>
10 <th></th>
11 <th></th>
11 </tr></thead>
12 </tr></thead>
12 <tbody>
13 <tbody>
13 <% for tracker in @trackers %>
14 <% for tracker in @trackers %>
14 <tr class="<%= cycle("odd", "even") %>">
15 <tr class="<%= cycle("odd", "even") %>">
15 <td><%= link_to tracker.name, :action => 'edit', :id => tracker %></td>
16 <td><%= link_to tracker.name, :action => 'edit', :id => tracker %></td>
16 <td align="center">
17 <td align="center">
18 <%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:action => 'move', :id => tracker, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %>
19 <%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:action => 'move', :id => tracker, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> -
20 <%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:action => 'move', :id => tracker, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %>
21 <%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:action => 'move', :id => tracker, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %>
22 </td>
23 <td align="center">
17 <%= button_to l(:button_delete), { :action => 'destroy', :id => tracker }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
24 <%= button_to l(:button_delete), { :action => 'destroy', :id => tracker }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
18 </td>
25 </td>
19 </tr>
26 </tr>
20 <% end %>
27 <% end %>
21 </tbody>
28 </tbody>
22 </table>
29 </table>
23
30
24 <%= pagination_links_full @tracker_pages %> No newline at end of file
31 <%= pagination_links_full @tracker_pages %>
@@ -1,129 +1,129
1 == redMine changelog
1 == redMine changelog
2
2
3 redMine - project management software
3 redMine - project management software
4 Copyright (C) 2006-2007 Jean-Philippe Lang
4 Copyright (C) 2006-2007 Jean-Philippe Lang
5 http://redmine.rubyforge.org/
5 http://redmine.rubyforge.org/
6
6
7
7
8 == xx/xx/2006 v0.4.2
8 == xx/xx/2006 v0.4.2
9
9
10 * Rails 1.2 is now required
10 * Rails 1.2 is now required
11 * settings are now stored in the database and editable through the application in: Admin -> Settings (config_custom.rb is no longer used)
11 * settings are now stored in the database and editable through the application in: Admin -> Settings (config_custom.rb is no longer used)
12 * mail notifications added when a document, a file or an attachment is added
12 * mail notifications added when a document, a file or an attachment is added
13 * tooltips added on Gantt chart and calender to view the details of the issues
13 * tooltips added on Gantt chart and calender to view the details of the issues
14 * ability to set the sort order for roles, issue statuses
14 * ability to set the sort order for roles, trackers, issue statuses
15 * added missing fields to csv export: priority, start date, due date, done ratio
15 * added missing fields to csv export: priority, start date, due date, done ratio
16 * all icons replaced (new icons are based on GPL icon set: "KDE Crystal Diamond 2.5" -by paolino- and "kNeu! Alpha v0.1" -by Pablo Fabregat-)
16 * all icons replaced (new icons are based on GPL icon set: "KDE Crystal Diamond 2.5" -by paolino- and "kNeu! Alpha v0.1" -by Pablo Fabregat-)
17 * added back "fixed version" field on issue screen and in filters
17 * added back "fixed version" field on issue screen and in filters
18 * project settings screen split in 4 tabs
18 * project settings screen split in 4 tabs
19 * fixed: subprojects count is always 0 on projects list
19 * fixed: subprojects count is always 0 on projects list
20 * fixed: setting an issue status as default status leads to an sql error with SQLite
20 * fixed: setting an issue status as default status leads to an sql error with SQLite
21 * fixed: unable to delete an issue status even if it's not used yet
21 * fixed: unable to delete an issue status even if it's not used yet
22 * fixed: filters ignored when exporting a predefined query to csv/pdf
22 * fixed: filters ignored when exporting a predefined query to csv/pdf
23
23
24
24
25 == 01/03/2006 v0.4.1
25 == 01/03/2006 v0.4.1
26
26
27 * fixed: emails have no recipient when one of the project members has notifications disabled
27 * fixed: emails have no recipient when one of the project members has notifications disabled
28
28
29
29
30 == 01/02/2006 v0.4.0
30 == 01/02/2006 v0.4.0
31
31
32 * simple SVN browser added (just needs svn binaries in PATH)
32 * simple SVN browser added (just needs svn binaries in PATH)
33 * comments can now be added on news
33 * comments can now be added on news
34 * "my page" is now customizable
34 * "my page" is now customizable
35 * more powerfull and savable filters for issues lists
35 * more powerfull and savable filters for issues lists
36 * improved issues change history
36 * improved issues change history
37 * new functionality: move an issue to another project or tracker
37 * new functionality: move an issue to another project or tracker
38 * new functionality: add a note to an issue
38 * new functionality: add a note to an issue
39 * new report: project activity
39 * new report: project activity
40 * "start date" and "% done" fields added on issues
40 * "start date" and "% done" fields added on issues
41 * project calendar added
41 * project calendar added
42 * gantt chart added (exportable to pdf)
42 * gantt chart added (exportable to pdf)
43 * single/multiple issues pdf export added
43 * single/multiple issues pdf export added
44 * issues reports improvements
44 * issues reports improvements
45 * multiple file upload for issues, documents and files
45 * multiple file upload for issues, documents and files
46 * option to set maximum size of uploaded files
46 * option to set maximum size of uploaded files
47 * textile formating of issue and news descritions (RedCloth required)
47 * textile formating of issue and news descritions (RedCloth required)
48 * integration of DotClear jstoolbar for textile formatting
48 * integration of DotClear jstoolbar for textile formatting
49 * calendar date picker for date fields (LGPL DHTML Calendar http://sourceforge.net/projects/jscalendar)
49 * calendar date picker for date fields (LGPL DHTML Calendar http://sourceforge.net/projects/jscalendar)
50 * new filter in issues list: Author
50 * new filter in issues list: Author
51 * ajaxified paginators
51 * ajaxified paginators
52 * news rss feed added
52 * news rss feed added
53 * option to set number of results per page on issues list
53 * option to set number of results per page on issues list
54 * localized csv separator (comma/semicolon)
54 * localized csv separator (comma/semicolon)
55 * csv output encoded to ISO-8859-1
55 * csv output encoded to ISO-8859-1
56 * user custom field displayed on account/show
56 * user custom field displayed on account/show
57 * default configuration improved (default roles, trackers, status, permissions and workflows)
57 * default configuration improved (default roles, trackers, status, permissions and workflows)
58 * language for default configuration data can now be chosen when running 'load_default_data' task
58 * language for default configuration data can now be chosen when running 'load_default_data' task
59 * javascript added on custom field form to show/hide fields according to the format of custom field
59 * javascript added on custom field form to show/hide fields according to the format of custom field
60 * fixed: custom fields not in csv exports
60 * fixed: custom fields not in csv exports
61 * fixed: project settings now displayed according to user's permissions
61 * fixed: project settings now displayed according to user's permissions
62 * fixed: application error when no version is selected on projects/add_file
62 * fixed: application error when no version is selected on projects/add_file
63 * fixed: public actions not authorized for members of non public projects
63 * fixed: public actions not authorized for members of non public projects
64 * fixed: non public projects were shown on welcome screen even if current user is not a member
64 * fixed: non public projects were shown on welcome screen even if current user is not a member
65
65
66
66
67 == 10/08/2006 v0.3.0
67 == 10/08/2006 v0.3.0
68
68
69 * user authentication against multiple LDAP (optional)
69 * user authentication against multiple LDAP (optional)
70 * token based "lost password" functionality
70 * token based "lost password" functionality
71 * user self-registration functionality (optional)
71 * user self-registration functionality (optional)
72 * custom fields now available for issues, users and projects
72 * custom fields now available for issues, users and projects
73 * new custom field format "text" (displayed as a textarea field)
73 * new custom field format "text" (displayed as a textarea field)
74 * project & administration drop down menus in navigation bar for quicker access
74 * project & administration drop down menus in navigation bar for quicker access
75 * text formatting is preserved for long text fields (issues, projects and news descriptions)
75 * text formatting is preserved for long text fields (issues, projects and news descriptions)
76 * urls and emails are turned into clickable links in long text fields
76 * urls and emails are turned into clickable links in long text fields
77 * "due date" field added on issues
77 * "due date" field added on issues
78 * tracker selection filter added on change log
78 * tracker selection filter added on change log
79 * Localization plugin replaced with GLoc 1.1.0 (iconv required)
79 * Localization plugin replaced with GLoc 1.1.0 (iconv required)
80 * error messages internationalization
80 * error messages internationalization
81 * german translation added (thanks to Karim Trott)
81 * german translation added (thanks to Karim Trott)
82 * data locking for issues to prevent update conflicts (using ActiveRecord builtin optimistic locking)
82 * data locking for issues to prevent update conflicts (using ActiveRecord builtin optimistic locking)
83 * new filter in issues list: "Fixed version"
83 * new filter in issues list: "Fixed version"
84 * active filters are displayed with colored background on issues list
84 * active filters are displayed with colored background on issues list
85 * custom configuration is now defined in config/config_custom.rb
85 * custom configuration is now defined in config/config_custom.rb
86 * user object no more stored in session (only user_id)
86 * user object no more stored in session (only user_id)
87 * news summary field is no longer required
87 * news summary field is no longer required
88 * tables and forms redesign
88 * tables and forms redesign
89 * Fixed: boolean custom field not working
89 * Fixed: boolean custom field not working
90 * Fixed: error messages for custom fields are not displayed
90 * Fixed: error messages for custom fields are not displayed
91 * Fixed: invalid custom fields should have a red border
91 * Fixed: invalid custom fields should have a red border
92 * Fixed: custom fields values are not validated on issue update
92 * Fixed: custom fields values are not validated on issue update
93 * Fixed: unable to choose an empty value for 'List' custom fields
93 * Fixed: unable to choose an empty value for 'List' custom fields
94 * Fixed: no issue categories sorting
94 * Fixed: no issue categories sorting
95 * Fixed: incorrect versions sorting
95 * Fixed: incorrect versions sorting
96
96
97
97
98 == 07/12/2006 - v0.2.2
98 == 07/12/2006 - v0.2.2
99
99
100 * Fixed: bug in "issues list"
100 * Fixed: bug in "issues list"
101
101
102
102
103 == 07/09/2006 - v0.2.1
103 == 07/09/2006 - v0.2.1
104
104
105 * new databases supported: Oracle, PostgreSQL, SQL Server
105 * new databases supported: Oracle, PostgreSQL, SQL Server
106 * projects/subprojects hierarchy (1 level of subprojects only)
106 * projects/subprojects hierarchy (1 level of subprojects only)
107 * environment information display in admin/info
107 * environment information display in admin/info
108 * more filter options in issues list (rev6)
108 * more filter options in issues list (rev6)
109 * default language based on browser settings (Accept-Language HTTP header)
109 * default language based on browser settings (Accept-Language HTTP header)
110 * issues list exportable to CSV (rev6)
110 * issues list exportable to CSV (rev6)
111 * simple_format and auto_link on long text fields
111 * simple_format and auto_link on long text fields
112 * more data validations
112 * more data validations
113 * Fixed: error when all mail notifications are unchecked in admin/mail_options
113 * Fixed: error when all mail notifications are unchecked in admin/mail_options
114 * Fixed: all project news are displayed on project summary
114 * Fixed: all project news are displayed on project summary
115 * Fixed: Can't change user password in users/edit
115 * Fixed: Can't change user password in users/edit
116 * Fixed: Error on tables creation with PostgreSQL (rev5)
116 * Fixed: Error on tables creation with PostgreSQL (rev5)
117 * Fixed: SQL error in "issue reports" view with PostgreSQL (rev5)
117 * Fixed: SQL error in "issue reports" view with PostgreSQL (rev5)
118
118
119
119
120 == 06/25/2006 - v0.1.0
120 == 06/25/2006 - v0.1.0
121
121
122 * multiple users/multiple projects
122 * multiple users/multiple projects
123 * role based access control
123 * role based access control
124 * issue tracking system
124 * issue tracking system
125 * fully customizable workflow
125 * fully customizable workflow
126 * documents/files repository
126 * documents/files repository
127 * email notifications on issue creation and update
127 * email notifications on issue creation and update
128 * multilanguage support (except for error messages):english, french, spanish
128 * multilanguage support (except for error messages):english, french, spanish
129 * online manual in french (unfinished) No newline at end of file
129 * online manual in french (unfinished)
General Comments 0
You need to be logged in to leave comments. Login now