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 # check if table is empty
if _.isEmpty(data.objects) if _.isEmpty(data.objects)
table = '' table = '<span>-' + App.i18n.translateContent( 'none' ) + '-</span>'
table = '-none-'
return $(table) return $(table)
# define normal header # define normal header

View file

@ -33,8 +33,9 @@ class App.TicketMerge extends App.ControllerModal
list = [] list = []
for t in data.customer.tickets for t in data.customer.tickets
ticketItem = App.Collection.find( 'Ticket', t.id ) if t.id isnt @ticket_id
list.push ticketItem ticketItem = App.Collection.find( 'Ticket', t.id )
list.push ticketItem
new App.ControllerTable( new App.ControllerTable(
el: @el.find('#ticket-merge-customer-tickets'), el: @el.find('#ticket-merge-customer-tickets'),
overview_extended: [ overview_extended: [
@ -59,8 +60,9 @@ class App.TicketMerge extends App.ControllerModal
list = [] list = []
for t in data.recent.tickets for t in data.recent.tickets
ticketItem = App.Collection.find( 'Ticket', t.id ) if t.id isnt @ticket_id
list.push ticketItem ticketItem = App.Collection.find( 'Ticket', t.id )
list.push ticketItem
new App.ControllerTable( new App.ControllerTable(
el: @el.find('#ticket-merge-recent-tickets'), el: @el.find('#ticket-merge-recent-tickets'),
overview_extended: [ overview_extended: [

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_state_type_id => Ticket::StateType.where( :name => ['new','open', 'pending reminder', 'pending action', 'closed'] )
) )
ticket = Ticket.find( params[:ticket_id] ) 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 # get related users
users = {} users = {}
@ -212,7 +212,7 @@ class TicketsController < ApplicationController
end end
} }
recent_viewed = History.recent_viewed_fulldata( current_user, 6 ) recent_viewed = History.recent_viewed_fulldata( current_user, 8 )
# return result # return result
render :json => { render :json => {