Do not show current ticket to offer to merge to.
This commit is contained in:
parent
303e960c5b
commit
e4506dd1a3
3 changed files with 9 additions and 8 deletions
|
@ -49,8 +49,7 @@ class App.ControllerTable extends App.Controller
|
|||
|
||||
# check if table is empty
|
||||
if _.isEmpty(data.objects)
|
||||
table = ''
|
||||
table = '-none-'
|
||||
table = '<span>-' + App.i18n.translateContent( 'none' ) + '-</span>'
|
||||
return $(table)
|
||||
|
||||
# define normal header
|
||||
|
|
|
@ -33,8 +33,9 @@ class App.TicketMerge extends App.ControllerModal
|
|||
|
||||
list = []
|
||||
for t in data.customer.tickets
|
||||
ticketItem = App.Collection.find( 'Ticket', t.id )
|
||||
list.push ticketItem
|
||||
if t.id isnt @ticket_id
|
||||
ticketItem = App.Collection.find( 'Ticket', t.id )
|
||||
list.push ticketItem
|
||||
new App.ControllerTable(
|
||||
el: @el.find('#ticket-merge-customer-tickets'),
|
||||
overview_extended: [
|
||||
|
@ -59,8 +60,9 @@ class App.TicketMerge extends App.ControllerModal
|
|||
|
||||
list = []
|
||||
for t in data.recent.tickets
|
||||
ticketItem = App.Collection.find( 'Ticket', t.id )
|
||||
list.push ticketItem
|
||||
if t.id isnt @ticket_id
|
||||
ticketItem = App.Collection.find( 'Ticket', t.id )
|
||||
list.push ticketItem
|
||||
new App.ControllerTable(
|
||||
el: @el.find('#ticket-merge-recent-tickets'),
|
||||
overview_extended: [
|
||||
|
|
|
@ -193,7 +193,7 @@ class TicketsController < ApplicationController
|
|||
:ticket_state_type_id => Ticket::StateType.where( :name => ['new','open', 'pending reminder', 'pending action', 'closed'] )
|
||||
)
|
||||
ticket = Ticket.find( params[:ticket_id] )
|
||||
ticket_list = Ticket.where( :customer_id => ticket.customer_id, :ticket_state_id => ticket_states ).limit(6)
|
||||
ticket_list = Ticket.where( :customer_id => ticket.customer_id, :ticket_state_id => ticket_states ).where( 'id != ?', [ ticket.id ] ) .limit(6)
|
||||
|
||||
# get related users
|
||||
users = {}
|
||||
|
@ -212,7 +212,7 @@ class TicketsController < ApplicationController
|
|||
end
|
||||
}
|
||||
|
||||
recent_viewed = History.recent_viewed_fulldata( current_user, 6 )
|
||||
recent_viewed = History.recent_viewed_fulldata( current_user, 8 )
|
||||
|
||||
# return result
|
||||
render :json => {
|
||||
|
|
Loading…
Reference in a new issue