Improved error handling of ticket creation.

This commit is contained in:
Martin Edenhofer 2012-04-16 14:47:07 +02:00
parent abb7db9323
commit 879ba366ab
2 changed files with 7 additions and 2 deletions

View file

@ -87,12 +87,13 @@ class Index extends App.Controller
# find sender_id # find sender_id
sender = App.TicketArticleSender.findByAttribute("name", "Customer") sender = App.TicketArticleSender.findByAttribute("name", "Customer")
type = App.TicketArticleType.findByAttribute("name", "phone") type = App.TicketArticleType.findByAttribute("name", "phone")
group = App.Group.find(params.group_id) if params.group_id
group = App.Group.find(params.group_id)
# create article # create article
params['article'] = { params['article'] = {
from: params.customer_id_autocompletion, from: params.customer_id_autocompletion,
to: group.name, to: (group && group.name) || '',
subject: params.subject, subject: params.subject,
body: params.body, body: params.body,
ticket_article_type_id: type.id, ticket_article_type_id: type.id,
@ -127,6 +128,9 @@ class Index extends App.Controller
# create new create screen # create new create screen
@render() @render()
# scroll to top
window.scrollTo(0,0)
error: => error: =>
@log 'save failed!' @log 'save failed!'

View file

@ -1,4 +1,5 @@
class TicketsController < ApplicationController class TicketsController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :authentication_check before_filter :authentication_check
# GET /tickets # GET /tickets