Module: Crm::CustomerSearchHelper

Defined in:
app/helpers/crm/customer_search_helper.rb

Overview

View helpers for the CRM customer search screens.

Used by app/views/searches/customer_search/_mass_drop_sales_rep.html.erb.

See Also:

Instance Method Summary collapse

Instance Method Details

#drop_sales_rep_options_for_selectArray<Array(String, Integer)>

Options for the sales rep <select> on customer search drop-action forms.

Sales managers can pick any drop-action rep (plus an "All" entry); other
users are locked to themselves.

Returns:

  • (Array<Array(String, Integer)>)

    [label, value] pairs for options_for_select



15
16
17
18
19
20
21
# File 'app/helpers/crm/customer_search_helper.rb', line 15

def drop_sales_rep_options_for_select
  if user_has_role?("sales_manager")
    [%w[All all]] + @search.drop_action_reps_for_select
  else
    [[@context_user.full_name, @context_user.id]]
  end
end