module StatsHelper def sort_link_helper(text, param) key = param order = "desc" order = "asc" if params[:sort] == param and params[:order] == "desc" options = { :url => {:action => 'list', :params => params.merge({:order => order, :sort => key, :page => nil})}, :update => 'table', :before => "Element.show('spinner')", :success => "Element.hide('spinner')" } html_options = { :title => _('Sort_by_this_field'), :href => url_for(:action => 'list', :params => params.merge({:order => order, :sort => key, :page => nil})), :class => "nb" } link_to_remote(text, options, html_options, :loading => "Element.show('spinner');", :complete=> "Element.hide('spinner');") end def sort_td_class_helper(item) item = item.to_s pic = "sortup.gif" if params[:order] == "asc" and item == params[:sort] pic = "sortdown.gif" if params[:order] == "desc" and item == params[:sort] image_tag pic, :style => 'border-style:none', :title => "sortup" if pic end def show_call_dst(call, text_class) dest = Destination.find(:first, :conditions => ["prefix = ?", call.prefix]) dest_txt = [] if dest @direction_cache ||= {} direction = @direction_cache[dest.direction_code.to_s] ||= dest.direction dest_txt << "#{direction.name.to_s + " " if direction }#{dest.subcode} #{dest.name}" end dest_txt << _("User_dialed")+ ": " + hide_dst_for_user(current_user, 'gui', call.dst) dest_txt << _("Prefix_used")+ ": " + call.prefix.to_s if call.prefix.to_s.length > 0 rez = ["