app/controllers/activities_controller.rb
#
# Lists all current activities or specified by search conditions.
#

Lists all current activities or specified by search conditions.
Lists all current activities or specified by search conditions .
def list
    if params[:search] or session[:month] or session[:year]
      prepare_search_dates
      @client_id = Project.find(params[:search][:project_id]).client_id unless params[:search][:project_id].blank?
      @invoices = @client_id && Invoice.find_all_by_client_id_and_is_issued(@client_id, false, :order => "created_at DESC")
      @activities = Activity.list(params[:search])
    else
      @activities = Activity.list({}, {:page => params[:page]})
    end
  end
def list if params [ :search ] or session [ :month ] or session [ :year ] prepare_search_dates @client_id = Project . find ( params [ :search ] [ :project_id ] ) . client_id unless params [ :search ] [ :project_id ] . blank? @invoices = @client_id && Invoice . find_all_by_client_id_and_is_issued ( @client_id , false , :order => "created_at DESC" ) @activities = Activity . list ( params [ :search ] ) else @activities = Activity . list ( { } , { :page => params [ :page ] } ) end end
Lists all current activities or specified by search conditions.
Lists all current activities or specified by search conditions .
# Prepare params[:search] to be passed directly to Activity.list
 # Get client and his not issued invoices if client is selected
 # Get list of activities meeting specified conditions
 # Return all activities, paginated
