Sha256: 7b59713814ce65c692edd6cda8b440f949a29cec17c8c093ed8d745234ca7a06

Contents?: true

Size: 781 Bytes

Versions: 11

Compression:

Stored size: 781 Bytes

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
module Admin::FieldsHelper

  # Returns the list of :null and :safe database column transitions.
  # Only these options should be shown on the custom field edit form.
  def field_edit_as_options(field = nil)
    # Return every available field_type if no restriction
    options = (field.as.present? ? field.available_as : Field.field_types).keys
    options.map{|k| [t("field_types.#{k}.title"), k] }
  end

  def field_group_options
    FieldGroup.all.map {|fg| [fg.name, fg.id]}
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 app/helpers/admin/fields_helper.rb
fat_free_crm-0.13.5 app/helpers/admin/fields_helper.rb
fat_free_crm-0.13.4 app/helpers/admin/fields_helper.rb
fat_free_crm-0.13.3 app/helpers/admin/fields_helper.rb
fat_free_crm-0.13.2 app/helpers/admin/fields_helper.rb
fat_free_crm-0.12.3 app/helpers/admin/fields_helper.rb
fat_free_crm-0.12.2 app/helpers/admin/fields_helper.rb
fat_free_crm-0.13.1 app/helpers/admin/fields_helper.rb
fat_free_crm-0.12.1 app/helpers/admin/fields_helper.rb
fat_free_crm-0.13.0 app/helpers/admin/fields_helper.rb
fat_free_crm-0.12.0 app/helpers/admin/fields_helper.rb