added simple message browsing functionality
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@266 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -22,6 +22,22 @@ class MailingListsController < ApplicationController
|
||||
|
||||
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
|
||||
verify :method => :post, :only => [ :destroy ]
|
||||
|
||||
def messages
|
||||
if params[:year] and params[:year].to_i > 1900
|
||||
@year = params[:year].to_i
|
||||
if params[:month] and params[:month].to_i > 0 and params[:month].to_i < 13
|
||||
@month = params[:month].to_i
|
||||
end
|
||||
end
|
||||
@year ||= Date.today.year
|
||||
@month ||= Date.today.month
|
||||
@date_from = Date.civil(@year, @month, 1)
|
||||
@date_to = (@date_from >> 1)-1
|
||||
|
||||
@messages = @mailing_list.messages.find(:all, :conditions => ["parent_id is null and sent_on>=? and sent_on<=?", @date_from, @date_to])
|
||||
render :layout => false if request.xhr?
|
||||
end
|
||||
|
||||
def add
|
||||
@mailing_list = MailingList.new(:project => @project, :admin => logged_in_user)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class MailingMessagesController < ApplicationController
|
||||
layout 'base'
|
||||
|
||||
before_filter :find_project, :authorize
|
||||
|
||||
def show
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
def find_project
|
||||
@message = MailingMessage.find(params[:id], :include => :mailing_list)
|
||||
@project = @message.mailing_list.project
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render_404
|
||||
end
|
||||
end
|
||||
@@ -79,6 +79,7 @@ class ProjectsController < ApplicationController
|
||||
def show
|
||||
@custom_values = @project.custom_values.find(:all, :include => :custom_field)
|
||||
@members = @project.members.find(:all, :include => [:user, :role])
|
||||
@mailing_lists = @project.mailing_lists
|
||||
@subprojects = @project.children if @project.children.size > 0
|
||||
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "news.created_on DESC")
|
||||
@trackers = Tracker.find(:all, :order => 'position')
|
||||
|
||||
Reference in New Issue
Block a user