Class: ClientLogin::TicketsController

Inherits:
BaseController
  • Object
show all
Includes:
ControllerMixins::Tickets
Defined in:
app/controllers/client_login/tickets_controller.rb

Instance Method Summary collapse

Methods included from ControllerMixins::Tickets

#create!

Instance Method Details

#createObject

POST /tickets



19
20
21
22
# File 'app/controllers/client_login/tickets_controller.rb', line 19

def create
  @ticket.estimated_hours = 0.0
  create!(:client_login_ticket_path) # In ControllerMixins::Tickets module
end

#newObject

GET /tickets/new



15
16
# File 'app/controllers/client_login/tickets_controller.rb', line 15

def new
end

#showObject

GET /tickets/:id



25
26
27
28
29
30
31
32
33
34
# File 'app/controllers/client_login/tickets_controller.rb', line 25

def show
  @work_units = WorkUnit.for_ticket(@ticket).sort_by_scheduled_at
  unless @ticket.estimated_hours
    flash.now[:notice] = "NOTE: The estimated amount of time to complete this ticket has not been entered."
  end

  if @ticket.percentage_complete.to_i > 100
    flash.now[:notice] = "WARNING: Ticket has exceeded the estimated amount of time to be completed."
  end
end