molten-trunk/molten5/app/controllers/cases_controller.rb
# Requires Ruby as the case owner could be a queue or a user
Requires Ruby as the case owner could be a queue or a user
Requires Ruby as the case owner could be a queue or a user
def sort_cases_by_owner(cases,options)
    if options[:order] == 'ASC'
      cases.sort! { |x,y| x.owner.sort_name <=> y.owner.sort_name }
    else
      cases.sort! { |x,y| y.owner.sort_name <=> x.owner.sort_name }
    end
    WillPaginate::Collection.create((params[:page] || 1),per_page) do |pager|
      pager.replace(cases[offset..(offset+per_page)])
      pager.total_entries = cases.size
    end
  end
def sort_cases_by_owner ( cases , options ) if options [ :order ] == 'ASC' cases . sort! { | x , y | x . owner . sort_name <=> y . owner . sort_name } else cases . sort! { | x , y | y . owner . sort_name <=> x . owner . sort_name } end WillPaginate :: Collection . create ( ( params [ :page ] || 1 ) , per_page ) do | pager | pager . replace ( cases [ offset .. ( offset + per_page ) ] ) pager . total_entries = cases . size end end
Requires Ruby as the case owner could be a queue or a user
Requires Ruby as the case owner could be a queue or a user
cases
options