Fixed ticket creation.
This commit is contained in:
parent
0794af75e7
commit
f89df1d06b
1 changed files with 19 additions and 16 deletions
|
@ -150,25 +150,26 @@ class Index extends App.Controller
|
||||||
|
|
||||||
# disable form
|
# disable form
|
||||||
@formDisable(e)
|
@formDisable(e)
|
||||||
|
ui = @
|
||||||
object.save(
|
object.save(
|
||||||
success: (r) =>
|
success: ->
|
||||||
|
|
||||||
# notify UI
|
# notify UI
|
||||||
@notify
|
ui.notify
|
||||||
type: 'success',
|
type: 'success',
|
||||||
msg: T('Ticket %s created!', r.number),
|
msg: T('Ticket %s created!', @.number),
|
||||||
link: "#ticket/zoom/#{r.id}"
|
link: "#ticket/zoom/#{@.id}"
|
||||||
timeout: 12000,
|
timeout: 12000,
|
||||||
|
|
||||||
# create new create screen
|
# create new create screen
|
||||||
@render()
|
ui.render()
|
||||||
|
|
||||||
# scroll to top
|
# scroll to top
|
||||||
@scrollTo()
|
ui.scrollTo()
|
||||||
|
|
||||||
error: =>
|
error: ->
|
||||||
@log 'save failed!'
|
ui.log 'save failed!'
|
||||||
|
ui.formEnable(e)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -209,17 +210,19 @@ class UserNew extends App.ControllerModal
|
||||||
return
|
return
|
||||||
|
|
||||||
# save user
|
# save user
|
||||||
|
ui = @
|
||||||
user.save(
|
user.save(
|
||||||
success: (r) =>
|
success: ->
|
||||||
@modalHide()
|
console.log('-------', @, ui)
|
||||||
realname = r.firstname + ' ' + r.lastname
|
ui.modalHide()
|
||||||
$('#create_customer_id').val(r.id)
|
realname = @.firstname + ' ' + @.lastname
|
||||||
|
$('#create_customer_id').val(@.id)
|
||||||
$('#create_customer_id_autocompletion').val(realname)
|
$('#create_customer_id_autocompletion').val(realname)
|
||||||
|
|
||||||
# start customer info controller
|
# start customer info controller
|
||||||
@userInfo( user_id: r.id )
|
ui.userInfo( user_id: @.id )
|
||||||
error: =>
|
error: ->
|
||||||
@modalHide()
|
ui.modalHide()
|
||||||
)
|
)
|
||||||
|
|
||||||
Config.Routes['ticket_create'] = Index
|
Config.Routes['ticket_create'] = Index
|
Loading…
Reference in a new issue