##// END OF EJS Templates
issue list: added 'Priority' column, removed 'Created on' column...
Jean-Philippe Lang -
r208:aa91ca0a8d0e
parent child
Show More
@@ -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, :order => 'position')
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, :priority ],
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, :order => 'position'
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], :order => 'position')
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,84 +1,84
1 <% if @query.new_record? %>
1 <% if @query.new_record? %>
2 <div class="contextual">
2 <div class="contextual">
3 <%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
3 <%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
4 </div>
4 </div>
5 <h2><%=l(:label_issue_plural)%></h2>
5 <h2><%=l(:label_issue_plural)%></h2>
6
6
7 <% form_tag({:action => 'list_issues'}, :id => 'query_form') do %>
7 <% form_tag({:action => 'list_issues'}, :id => 'query_form') do %>
8 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
8 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
9 <% end %>
9 <% end %>
10 <div class="contextual">
10 <div class="contextual">
11 <%= link_to_remote l(:button_apply),
11 <%= link_to_remote l(:button_apply),
12 { :url => { :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 },
12 { :url => { :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 },
13 :update => "content",
13 :update => "content",
14 :with => "Form.serialize('query_form')"
14 :with => "Form.serialize('query_form')"
15 }, :class => 'icon icon-edit' %>
15 }, :class => 'icon icon-edit' %>
16
16
17 <%= link_to l(:button_clear), {:controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1}, :class => 'icon icon-del' %>
17 <%= link_to l(:button_clear), {:controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1}, :class => 'icon icon-del' %>
18 <% if authorize_for('projects', 'add_query') %>
18 <% if authorize_for('projects', 'add_query') %>
19
19
20 <%= link_to_remote l(:button_save),
20 <%= link_to_remote l(:button_save),
21 { :url => { :controller => 'projects', :action => "add_query", :id => @project },
21 { :url => { :controller => 'projects', :action => "add_query", :id => @project },
22 :method => 'get',
22 :method => 'get',
23 :update => "content",
23 :update => "content",
24 :with => "Form.serialize('query_form')"
24 :with => "Form.serialize('query_form')"
25 }, :class => 'icon icon-save' %>
25 }, :class => 'icon icon-save' %>
26 <% end %>
26 <% end %>
27 </div>
27 </div>
28 <br />
28 <br />
29 <% else %>
29 <% else %>
30 <div class="contextual">
30 <div class="contextual">
31 <%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
31 <%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
32 <% if authorize_for('projects', 'add_query') %>
32 <% if authorize_for('projects', 'add_query') %>
33 <%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'icon icon-edit' %>
33 <%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'icon icon-edit' %>
34 <%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
34 <%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
35 <% end %>
35 <% end %>
36 </div>
36 </div>
37 <h2><%= @query.name %></h2>
37 <h2><%= @query.name %></h2>
38 <% end %>
38 <% end %>
39 <%= error_messages_for 'query' %>
39 <%= error_messages_for 'query' %>
40 <% if @query.valid? %>
40 <% if @query.valid? %>
41 <% if @issues.empty? %>
41 <% if @issues.empty? %>
42 <p><i><%= l(:label_no_data) %></i></p>
42 <p><i><%= l(:label_no_data) %></i></p>
43 <% else %>
43 <% else %>
44 &nbsp;
44 &nbsp;
45 <% form_tag({:controller => 'projects', :action => 'move_issues', :id => @project}, :id => 'issues_form' ) do %>
45 <% form_tag({:controller => 'projects', :action => 'move_issues', :id => @project}, :id => 'issues_form' ) do %>
46 <table class="list">
46 <table class="list">
47 <thead><tr>
47 <thead><tr>
48 <th></th>
48 <th></th>
49 <%= sort_header_tag('issues.id', :caption => '#') %>
49 <%= sort_header_tag('issues.id', :caption => '#') %>
50 <%= sort_header_tag('issues.tracker_id', :caption => l(:field_tracker)) %>
50 <%= sort_header_tag('issues.tracker_id', :caption => l(:field_tracker)) %>
51 <%= sort_header_tag('issue_statuses.name', :caption => l(:field_status)) %>
51 <%= sort_header_tag('issue_statuses.name', :caption => l(:field_status)) %>
52 <%= sort_header_tag('issues.priority_id', :caption => l(:field_priority)) %>
52 <th><%=l(:field_subject)%></th>
53 <th><%=l(:field_subject)%></th>
53 <%= sort_header_tag('users.lastname', :caption => l(:field_author)) %>
54 <%= sort_header_tag('users.lastname', :caption => l(:field_author)) %>
54 <%= sort_header_tag('issues.created_on', :caption => l(:field_created_on)) %>
55 <%= sort_header_tag('issues.updated_on', :caption => l(:field_updated_on)) %>
55 <%= sort_header_tag('issues.updated_on', :caption => l(:field_updated_on)) %>
56 </tr></thead>
56 </tr></thead>
57 <tbody>
57 <tbody>
58 <% for issue in @issues %>
58 <% for issue in @issues %>
59 <tr class="<%= cycle("odd", "even") %>">
59 <tr class="<%= cycle("odd", "even") %>">
60 <th style="width:15px;"><%= check_box_tag "issue_ids[]", issue.id, false, :id => "issue_#{issue.id}" %></th>
60 <th style="width:15px;"><%= check_box_tag "issue_ids[]", issue.id, false, :id => "issue_#{issue.id}" %></th>
61 <td align="center"><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td>
61 <td align="center"><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td>
62 <td align="center"><%= issue.tracker.name %></td>
62 <td align="center"><%= issue.tracker.name %></td>
63 <td><div class="square" style="background:#<%= issue.status.html_color %>;"></div> <%= issue.status.name %></td>
63 <td><div class="square" style="background:#<%= issue.status.html_color %>;"></div> <%= issue.status.name %></td>
64 <td align="center"><%= issue.priority.name %></td>
64 <td><%= link_to h(issue.subject), :controller => 'issues', :action => 'show', :id => issue %></td>
65 <td><%= link_to h(issue.subject), :controller => 'issues', :action => 'show', :id => issue %></td>
65 <td align="center"><%= issue.author.display_name %></td>
66 <td align="center"><%= issue.author.display_name %></td>
66 <td align="center"><%= format_time(issue.created_on) %></td>
67 <td align="center"><%= format_time(issue.updated_on) %></td>
67 <td align="center"><%= format_time(issue.updated_on) %></td>
68 </tr>
68 </tr>
69 <% end %>
69 <% end %>
70 </tbody>
70 </tbody>
71 </table>
71 </table>
72 <div class="contextual">
72 <div class="contextual">
73 <%= l(:label_export_to) %>
73 <%= l(:label_export_to) %>
74 <%= link_to 'CSV', {:action => 'export_issues_csv', :id => @project}, :class => 'icon icon-csv' %>,
74 <%= link_to 'CSV', {:action => 'export_issues_csv', :id => @project}, :class => 'icon icon-csv' %>,
75 <%= link_to 'PDF', {:action => 'export_issues_pdf', :id => @project}, :class => 'icon icon-pdf' %>
75 <%= link_to 'PDF', {:action => 'export_issues_pdf', :id => @project}, :class => 'icon icon-pdf' %>
76 </div>
76 </div>
77 <p><%= submit_tag l(:button_move), :class => "button-small" %>
77 <p><%= submit_tag l(:button_move), :class => "button-small" %>
78 &nbsp;
78 &nbsp;
79 <%= pagination_links_full @issue_pages %>
79 <%= pagination_links_full @issue_pages %>
80 [ <%= @issue_pages.current.first_item %> - <%= @issue_pages.current.last_item %> / <%= @issue_count %> ]
80 [ <%= @issue_pages.current.first_item %> - <%= @issue_pages.current.last_item %> / <%= @issue_count %> ]
81 </p>
81 </p>
82 <% end %>
82 <% end %>
83 <% end %>
83 <% end %>
84 <% end %> No newline at end of file
84 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now