Do not show current ticket to offer to merge to.

This commit is contained in:
Martin Edenhofer 2012-10-18 21:39:59 +02:00
parent 303e960c5b
commit e4506dd1a3
3 changed files with 9 additions and 8 deletions

View file

@ -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

View file

@ -33,6 +33,7 @@ class App.TicketMerge extends App.ControllerModal
list = []
for t in data.customer.tickets
if t.id isnt @ticket_id
ticketItem = App.Collection.find( 'Ticket', t.id )
list.push ticketItem
new App.ControllerTable(
@ -59,6 +60,7 @@ class App.TicketMerge extends App.ControllerModal
list = []
for t in data.recent.tickets
if t.id isnt @ticket_id
ticketItem = App.Collection.find( 'Ticket', t.id )
list.push ticketItem
new App.ControllerTable(

View file

@ -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 => {