Class: IssuesController

Inherits:
ApplicationController show all
Includes:
AttachmentsHelper, CustomFieldsHelper, IssueRelationsHelper, IssuesHelper, ProjectsHelper, QueriesHelper, Redmine::Export::PDF, SortHelper, WatchersHelper
Defined in:
app/controllers/issues_controller.rb

Overview

Redmine - project management software Copyright (C) 2006-2008 Jean-Philippe Lang

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Constant Summary

UPDATABLE_ATTRS_ON_TRANSITION =

Attributes that can be updated on workflow transition (without :edit permission) TODO: make it configurable (at least per role)

%w(status_id assigned_to_id fixed_version_id done_ratio) unless const_defined?(:UPDATABLE_ATTRS_ON_TRANSITION)

Instance Method Summary

Methods included from ProjectsHelper

#format_version_sharing, #link_to_version, #parent_project_select_tag, #project_settings_tabs, #render_project_hierarchy, #version_options_for_select

Methods included from CustomFieldsHelper

#custom_field_formats_for_select, #custom_field_label_tag, #custom_field_tag, #custom_field_tag_for_bulk_edit, #custom_field_tag_with_label, #custom_fields_tabs, #format_value, #show_value

Methods included from IssueRelationsHelper

#collection_for_relation_type_select

Methods included from WatchersHelper

#watcher_link, #watcher_tag, #watchers_list

Methods included from AttachmentsHelper

#link_to_attachments, #to_utf8

Methods included from QueriesHelper

#column_content, #column_header, #operators_for_select

Methods included from SortHelper

#sort_clause, #sort_clear, #sort_header_tag, #sort_init, #sort_link, #sort_name, #sort_update

Methods included from IssuesHelper

#find_name_by_reflection, #issue_list, #issues_to_csv, #render_custom_fields_rows, #render_descendants_tree, #render_issue_subject_with_tree, #render_issue_tooltip, #show_detail, #sidebar_queries

Methods included from ApplicationHelper

#accesskey, #authoring, #authorize_for, #avatar, #back_url_hidden_field_tag, #breadcrumb, #calendar_for, #check_all_links, #checked_image, #content_for, #context_menu_link, #due_date_distance_in_words, #format_activity_day, #format_activity_description, #format_activity_title, #format_version_name, #has_content?, #html_hours, #html_title, #image_to_function, #include_calendar_headers_tags, #label_tag_for, #labelled_tabular_form_for, #lang_options_for_select, #link_to_attachment, #link_to_if_authorized, #link_to_issue, #link_to_remote_if_authorized, #link_to_revision, #link_to_user, #other_formats_links, #page_header_title, #pagination_links_full, #parse_inline_attachments, #parse_non_pre_blocks, #parse_redmine_links, #parse_wiki_links, #path_to_stylesheet, #per_page_links, #principals_check_box_tags, #progress_bar, #project_nested_ul, #project_tree, #project_tree_options_for_select, #prompt_to_remote, #render_flash_messages, #render_page_hierarchy, #render_project_jump_box, #render_tabs, #reorder_links, #simple_format_without_paragraph, #stylesheet_path, #syntax_highlight, #textilizable, #time_tag, #to_path_param, #toggle_link, #truncate_lines, #truncate_single_line

Methods included from Redmine::WikiFormatting::Macros::Definitions

#exec_macro, #extract_macro_options

Methods included from Redmine::I18n

#current_language, #day_name, #find_language, #format_date, #format_time, included, #l, #l_hours, #l_or_humanize, #ll, #month_name, #set_language_if_valid, #valid_languages

Methods included from GravatarHelper::PublicMethods

#gravatar, #gravatar_api_url, #gravatar_for, #gravatar_url

Methods included from Redmine::Export::PDF

#gantt_to_pdf, #issue_to_pdf, #issues_to_pdf

Methods inherited from ApplicationController

accept_key_auth, #accept_key_auth_actions, #api_request?, #authorize, #authorize_global, #check_if_login_required, #check_project_privacy, #delete_broken_cookies, #deny_access, #filename_for_content_disposition, #find_current_user, #find_model_object, #find_project_from_association, #invalid_authenticity_token, #logged_user=, model_object, #parse_qvalues, #per_page_option, #redirect_back_or_default, #render_403, #render_404, #render_attachment_warning_if_needed, #render_error, #render_feed, #require_admin, #require_login, #set_localization, #user_setup

Methods included from Redmine::I18n

#current_language, #day_name, #find_language, #format_date, #format_time, included, #l, #l_hours, #l_or_humanize, #ll, #month_name, #set_language_if_valid, #valid_languages

Methods included from Redmine::Search::Controller

#default_search_scope, #default_search_scopes, included

Methods included from Redmine::MenuManager::MenuController

#current_menu_item, included, #menu_items, #redirect_to_project_menu_item

Instance Method Details

- (Object) auto_complete



469
470
471
472
473
474
475
476
477
478
479
# File 'app/controllers/issues_controller.rb', line 469

def auto_complete
  @issues = []
  q = params[:q].to_s
  if q.match(/^\d+$/)
    @issues << @project.issues.visible.find_by_id(q.to_i)
  end
  unless q.blank?
    @issues += @project.issues.visible.find(:all, :conditions => ["LOWER(#{Issue.table_name}.subject) LIKE ?", "%#{q.downcase}%"], :limit => 10)
  end
  render :layout => false
end

- (Object) bulk_edit

Bulk edit a set of issues



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'app/controllers/issues_controller.rb', line 247

def bulk_edit
  @issues.sort!
  if request.post?
    attributes = (params[:issue] || {}).reject {|k,v| v.blank?}
    attributes.keys.each {|k| attributes[k] = '' if attributes[k] == 'none'}
    attributes[:custom_field_values].reject! {|k,v| v.blank?} if attributes[:custom_field_values]
    
    unsaved_issue_ids = []
    @issues.each do |issue|
      issue.reload
      journal = issue.init_journal(User.current, params[:notes])
      issue.safe_attributes = attributes
      call_hook(:controller_issues_bulk_edit_before_save, { :params => params, :issue => issue })
      unless issue.save
        # Keep unsaved issue ids to display them in flash error
        unsaved_issue_ids << issue.id
      end
    end
    set_flash_from_bulk_issue_save(@issues, unsaved_issue_ids)
    redirect_back_or_default({:controller => 'issues', :action => 'index', :project_id => @project})
    return
  end
  @available_statuses = Workflow.available_statuses(@project)
  @custom_fields = @project.all_issue_custom_fields
end

- (Object) calendar



385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'app/controllers/issues_controller.rb', line 385

def calendar
  if params[:year] and params[:year].to_i > 1900
    @year = params[:year].to_i
    if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
      @month = params[:month].to_i
    end    
  end
  @year ||= Date.today.year
  @month ||= Date.today.month
  
  @calendar = Redmine::Helpers::Calendar.new(Date.civil(@year, @month, 1), current_language, :month)
  retrieve_query
  @query.group_by = nil
  if @query.valid?
    events = []
    events += @query.issues(:include => [:tracker, :assigned_to, :priority],
                            :conditions => ["((start_date BETWEEN ? AND ?) OR (due_date BETWEEN ? AND ?))", @calendar.startdt, @calendar.enddt, @calendar.startdt, @calendar.enddt]
                            )
    events += @query.versions(:conditions => ["effective_date BETWEEN ? AND ?", @calendar.startdt, @calendar.enddt])
                                   
    @calendar.events = events
  end
  
  render :layout => false if request.xhr?
end

- (Object) changes



94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'app/controllers/issues_controller.rb', line 94

def changes
  retrieve_query
  sort_init 'id', 'desc'
  sort_update(@query.sortable_columns)
  
  if @query.valid?
    @journals = @query.journals(:order => "#{Journal.table_name}.created_on DESC", 
                                :limit => 25)
  end
  @title = (@project ? @project.name : Setting.app_title) + ": " + (@query.new_record? ? l(:label_changes_details) : @query.name)
  render :layout => false, :content_type => 'application/atom+xml'
rescue ActiveRecord::RecordNotFound
  render_404
end

- (Object) context_menu



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'app/controllers/issues_controller.rb', line 411

def context_menu
  @issues = Issue.find_all_by_id(params[:ids], :include => :project)
  if (@issues.size == 1)
    @issue = @issues.first
    @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
  end
  projects = @issues.collect(&:project).compact.uniq
  @project = projects.first if projects.size == 1

  @can = {:edit => (@project && User.current.allowed_to?(:edit_issues, @project)),
          :log_time => (@project && User.current.allowed_to?(:log_time, @project)),
          :update => (@project && (User.current.allowed_to?(:edit_issues, @project) || (User.current.allowed_to?(:change_status, @project) && @allowed_statuses && !@allowed_statuses.empty?))),
          :move => (@project && User.current.allowed_to?(:move_issues, @project)),
          :copy => (@issue && @project.trackers.include?(@issue.tracker) && User.current.allowed_to?(:add_issues, @project)),
          :delete => (@project && User.current.allowed_to?(:delete_issues, @project))
          }
  if @project
    @assignables = @project.assignable_users
    @assignables << @issue.assigned_to if @issue && @issue.assigned_to && !@assignables.include?(@issue.assigned_to)
    @trackers = @project.trackers
  end
  
  @priorities = IssuePriority.all.reverse
  @statuses = IssueStatus.find(:all, :order => 'position')
  @back = params[:back_url] || request.env['HTTP_REFERER']
  
  render :layout => false
end

- (Object) destroy



324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'app/controllers/issues_controller.rb', line 324

def destroy
  @hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f
  if @hours > 0
    case params[:todo]
    when 'destroy'
      # nothing to do
    when 'nullify'
      TimeEntry.update_all('issue_id = NULL', ['issue_id IN (?)', @issues])
    when 'reassign'
      reassign_to = @project.issues.find_by_id(params[:reassign_to_id])
      if reassign_to.nil?
        flash.now[:error] = l(:error_issue_not_found_in_project)
        return
      else
        TimeEntry.update_all("issue_id = #{reassign_to.id}", ['issue_id IN (?)', @issues])
      end
    else
      unless params[:format] == 'xml'
        # display the destroy form if it's a user request
        return
      end
    end
  end
  @issues.each(&:destroy)
  respond_to do |format|
    format.html { redirect_to :action => 'index', :project_id => @project }
    format.xml  { head :ok }
  end
end

- (Object) edit



183
184
185
186
187
188
189
190
191
192
# File 'app/controllers/issues_controller.rb', line 183

def edit
  update_issue_from_params

  @journal = @issue.current_journal

  respond_to do |format|
    format.html { }
    format.xml  { }
  end
end

- (Object) gantt



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'app/controllers/issues_controller.rb', line 354

def gantt
  @gantt = Redmine::Helpers::Gantt.new(params)
  retrieve_query
  @query.group_by = nil
  if @query.valid?
    events = []
    # Issues that have start and due dates
    events += @query.issues(:include => [:tracker, :assigned_to, :priority],
                            :order => "start_date, due_date",
                            :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)", @gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to]
                            )
    # Issues that don't have a due date but that are assigned to a version with a date
    events += @query.issues(:include => [:tracker, :assigned_to, :priority, :fixed_version],
                            :order => "start_date, effective_date",
                            :conditions => ["(((start_date>=? and start_date<=?) or (effective_date>=? and effective_date<=?) or (start_date<? and effective_date>?)) and start_date is not null and due_date is null and effective_date is not null)", @gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to, @gantt.date_from, @gantt.date_to]
                            )
    # Versions
    events += @query.versions(:conditions => ["effective_date BETWEEN ? AND ?", @gantt.date_from, @gantt.date_to])
                                 
    @gantt.events = events
  end
  
  basename = (@project ? "#{@project.identifier}-" : '') + 'gantt'
  
  respond_to do |format|
    format.html { render :template => "issues/gantt.rhtml", :layout => !request.xhr? }
    format.png  { send_data(@gantt.to_image, :disposition => 'inline', :type => 'image/png', :filename => "#{basename}.png") } if @gantt.respond_to?('to_image')
    format.pdf  { send_data(gantt_to_pdf(@gantt, @project), :type => 'application/pdf', :filename => "#{basename}.pdf") }
  end
end

- (Object) index



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'app/controllers/issues_controller.rb', line 56

def index
  retrieve_query
  sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
  sort_update(@query.sortable_columns)
  
  if @query.valid?
    limit = case params[:format]
    when 'csv', 'pdf'
      Setting.issues_export_limit.to_i
    when 'atom'
      Setting.feeds_limit.to_i
    else
      per_page_option
    end
    
    @issue_count = @query.issue_count
    @issue_pages = Paginator.new self, @issue_count, limit, params['page']
    @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
                            :order => sort_clause, 
                            :offset => @issue_pages.current.offset, 
                            :limit => limit)
    @issue_count_by_group = @query.issue_count_by_group
    
    respond_to do |format|
      format.html { render :template => 'issues/index.rhtml', :layout => !request.xhr? }
      format.xml  { render :layout => false }
      format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
      format.csv  { send_data(issues_to_csv(@issues, @project), :type => 'text/csv; header=present', :filename => 'export.csv') }
      format.pdf  { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'export.pdf') }
    end
  else
    # Send html if the query is not valid
    render(:template => 'issues/index.rhtml', :layout => !request.xhr?)
  end
rescue ActiveRecord::RecordNotFound
  render_404
end

- (Object) move



273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'app/controllers/issues_controller.rb', line 273

def move
  @issues.sort!
  @copy = params[:copy_options] && params[:copy_options][:copy]
  @allowed_projects = []
  # find projects to which the user is allowed to move the issue
  if User.current.admin?
    # admin is allowed to move issues to any active (visible) project
    @allowed_projects = Project.find(:all, :conditions => Project.visible_by(User.current))
  else
    User.current.memberships.each {|m| @allowed_projects << m.project if m.roles.detect {|r| r.allowed_to?(:move_issues)}}
  end
  @target_project = @allowed_projects.detect {|p| p.id.to_s == params[:new_project_id]} if params[:new_project_id]
  @target_project ||= @project    
  @trackers = @target_project.trackers
  @available_statuses = Workflow.available_statuses(@project)
  if request.post?
    new_tracker = params[:new_tracker_id].blank? ? nil : @target_project.trackers.find_by_id(params[:new_tracker_id])
    unsaved_issue_ids = []
    moved_issues = []
    @issues.each do |issue|
      issue.reload
      changed_attributes = {}
      [:assigned_to_id, :status_id, :start_date, :due_date].each do |valid_attribute|
        unless params[valid_attribute].blank?
          changed_attributes[valid_attribute] = (params[valid_attribute] == 'none' ? nil : params[valid_attribute])
        end 
      end
      issue.init_journal(User.current)
      call_hook(:controller_issues_move_before_save, { :params => params, :issue => issue, :target_project => @target_project, :copy => !!@copy })
      if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes => changed_attributes})
        moved_issues << r
      else
        unsaved_issue_ids << issue.id
      end
    end
    set_flash_from_bulk_issue_save(@issues, unsaved_issue_ids)

    if params[:follow]
      if @issues.size == 1 && moved_issues.size == 1
        redirect_to :controller => 'issues', :action => 'show', :id => moved_issues.first
      else
        redirect_to :controller => 'issues', :action => 'index', :project_id => (@target_project || @project)
      end
    else
      redirect_to :controller => 'issues', :action => 'index', :project_id => @project
    end
    return
  end
  render :layout => false if request.xhr?
end

- (Object) new

Add a new issue The new issue will be created from an existing one if copy_from parameter is given



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'app/controllers/issues_controller.rb', line 129

def new
  @issue = Issue.new
  @issue.copy_from(params[:copy_from]) if params[:copy_from]
  @issue.project = @project
  # Tracker must be set before custom field values
  @issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first)
  if @issue.tracker.nil?
    render_error l(:error_no_tracker_in_project)
    return
  end
  if @issue.status.nil?
    render_error l(:error_no_default_issue_status)
    return
  end
  if params[:issue].is_a?(Hash)
    @issue.safe_attributes = params[:issue]
    @issue.watcher_user_ids = params[:issue]['watcher_user_ids'] if User.current.allowed_to?(:add_issue_watchers, @project)
  end
  @issue.author = User.current
  
  if request.get? || request.xhr?
    @issue.start_date ||= Date.today
  else
    call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
    if @issue.save
      attachments = Attachment.attach_files(@issue, params[:attachments])
      render_attachment_warning_if_needed(@issue)
      flash[:notice] = l(:notice_successful_create)
      call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
      respond_to do |format|
        format.html {
          redirect_to(params[:continue] ? { :action => 'new', :issue => {:tracker_id => @issue.tracker, 
                                                                         :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?} } :
                                          { :action => 'show', :id => @issue })
        }
        format.xml  { render :action => 'show', :status => :created, :location => url_for(:controller => 'issues', :action => 'show', :id => @issue) }
      end
      return
    else
      respond_to do |format|
        format.html { }
        format.xml  { render(:xml => @issue.errors, :status => :unprocessable_entity); return }
      end
    end
  end 
  @priorities = IssuePriority.all
  @allowed_statuses = @issue.new_statuses_allowed_to(User.current, true)
  render :layout => !request.xhr?
end

- (Object) preview



454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File 'app/controllers/issues_controller.rb', line 454

def preview
  @issue = @project.issues.find_by_id(params[:id]) unless params[:id].blank?
  if @issue
    @attachements = @issue.attachments
    @description = params[:issue] && params[:issue][:description]
    if @description && @description.gsub(/(\r?\n|\n\r?)/, "\n") == @issue.description.to_s.gsub(/(\r?\n|\n\r?)/, "\n")
      @description = nil
    end
    @notes = params[:notes]
  else
    @description = (params[:issue] ? params[:issue][:description] : nil)
  end
  render :layout => false
end

- (Object) reply



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'app/controllers/issues_controller.rb', line 223

def reply
  journal = Journal.find(params[:journal_id]) if params[:journal_id]
  if journal
    user = journal.user
    text = journal.notes
  else
    user = @issue.author
    text = @issue.description
  end
  # Replaces pre blocks with [...]
  text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
  content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
  content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
    
  render(:update) { |page|
    page.<< "$('notes').value = \"#{escape_javascript content}\";"
    page.show 'update'
    page << "Form.Element.focus('notes');"
    page << "Element.scrollTo('update');"
    page << "$('notes').scrollTop = $('notes').scrollHeight - $('notes').clientHeight;"
  }
end

- (Object) show



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'app/controllers/issues_controller.rb', line 109

def show
  @journals = @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC")
  @journals.each_with_index {|j,i| j.indice = i+1}
  @journals.reverse! if User.current.wants_comments_in_reverse_order?
  @changesets = @issue.changesets.visible.all
  @changesets.reverse! if User.current.wants_comments_in_reverse_order?
  @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
  @edit_allowed = User.current.allowed_to?(:edit_issues, @project)
  @priorities = IssuePriority.all
  @time_entry = TimeEntry.new
  respond_to do |format|
    format.html { render :template => 'issues/show.rhtml' }
    format.xml  { render :layout => false }
    format.atom { render :action => 'changes', :layout => false, :content_type => 'application/atom+xml' }
    format.pdf  { send_data(issue_to_pdf(@issue), :type => 'application/pdf', :filename => "#{@project.identifier}-#{@issue.id}.pdf") }
  end
end

- (Object) update



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'app/controllers/issues_controller.rb', line 194

def update
  update_issue_from_params

  if @issue.save_issue_with_child_records(params, @time_entry)
    render_attachment_warning_if_needed(@issue)
    flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record?

    respond_to do |format|
      format.html { redirect_back_or_default({:action => 'show', :id => @issue}) }
      format.xml  { head :ok }
    end
  else
    render_attachment_warning_if_needed(@issue)
    flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record?
    @journal = @issue.current_journal

    respond_to do |format|
      format.html { render :action => 'edit' }
      format.xml  { render :xml => @issue.errors, :status => :unprocessable_entity }
    end
  end
  
rescue ActiveRecord::StaleObjectError
  # Optimistic locking exception
  flash.now[:error] = l(:notice_locking_conflict)
  # Remove the previously added attachments if issue was not updated
  attachments[:files].each(&:destroy) if attachments[:files]
end

- (Object) update_form



440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'app/controllers/issues_controller.rb', line 440

def update_form
  if params[:id].blank?
    @issue = Issue.new
    @issue.project = @project
  else
    @issue = @project.issues.visible.find(params[:id])
  end
  @issue.attributes = params[:issue]
  @allowed_statuses = ([@issue.status] + @issue.status.find_new_statuses_allowed_to(User.current.roles_for_project(@project), @issue.tracker)).uniq
  @priorities = IssuePriority.all
  
  render :partial => 'attributes'
end