Class: Redmine::FieldFormat::List

Inherits:
Base
  • Object
show all
Defined in:
lib/redmine/field_format.rb

Direct Known Subclasses

BoolFormat, ListFormat, RecordList

Instance Method Summary collapse

Methods inherited from Base

#before_custom_field_save, #cast_custom_value, #cast_single_value, #cast_value, field_attributes, #formatted_custom_value, #formatted_value, #group_statement, #join_for_order_statement, #label, #name, #order_statement, #possible_custom_value_options, #possible_values_options, #target_class, #validate_custom_field, #validate_custom_value, #validate_single_value

Methods included from I18n

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

Instance Method Details

#bulk_edit_tag(view, tag_id, tag_name, custom_field, objects, value, options = {}) ⇒ Object


450
451
452
453
454
455
456
# File 'lib/redmine/field_format.rb', line 450

def bulk_edit_tag(view, tag_id, tag_name, custom_field, objects, value, options={})
  opts = []
  opts << [l(:label_no_change_option), ''] unless custom_field.multiple?
  opts << [l(:label_none), '__none__'] unless custom_field.is_required?
  opts += possible_values_options(custom_field, objects)
  view.select_tag(tag_name, view.options_for_select(opts, value), options.merge(:multiple => custom_field.multiple?))
end

#edit_tag(view, tag_id, tag_name, custom_value, options = {}) ⇒ Object


442
443
444
445
446
447
448
# File 'lib/redmine/field_format.rb', line 442

def edit_tag(view, tag_id, tag_name, custom_value, options={})
  if custom_value.custom_field.edit_tag_style == 'check_box'
    check_box_edit_tag(view, tag_id, tag_name, custom_value, options)
  else
    select_edit_tag(view, tag_id, tag_name, custom_value, options)
  end
end

#query_filter_options(custom_field, query) ⇒ Object


458
459
460
# File 'lib/redmine/field_format.rb', line 458

def query_filter_options(custom_field, query)
  {:type => :list_optional, :values => possible_values_options(custom_field, query.project)}
end