Class: Crm::Reports::TechProductivityController

Inherits:
CrmController
  • Object
show all
Includes:
Controllers::ReportCommandFlashable
Defined in:
app/controllers/crm/reports/tech_productivity_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/crm/reports/tech_productivity_controller.rb', line 6

def show
  authorize! :read, CallLog
  command_attrs = tech_productivity_command_params
  unless helpers.user_has_role?(%w[admin technical_support_manager])
    command_attrs[:employee_ids] = [current_user.id.to_s] if command_attrs.present?
  end
  @report_command = ::Report::TechProductivity::TechProductivityCommand.new(command_attrs)
  @results = @report_command.execute

  flash_report_command_errors
  respond_to do |format|
    format.html
    format.turbo_stream
  end
end