Fixed organization search.

This commit is contained in:
Martin Edenhofer 2012-11-14 03:02:48 +01:00
parent 579b58c620
commit 82d4084080

View file

@ -470,10 +470,10 @@ class TicketsController < ApplicationController
map( &:id ) map( &:id )
conditions = [ 'group_id IN (?)', group_ids ] conditions = [ 'group_id IN (?)', group_ids ]
else else
if !current_user.organization || !current_user.organization.shared if !current_user.organization || ( !current_user.organization.shared || current_user.organization.shared == false )
conditions = [ 'customer_id = ?', current_user.id ] conditions = [ 'customer_id = ?', current_user.id ]
else else
conditions = [ '( customer_id = ? OR organization_id = ? )', current_user.id, current_user.organization.shared ] conditions = [ '( customer_id = ? OR organization_id = ? )', current_user.id, current_user.organization.id ]
end end
end end