##// END OF EJS Templates
Anonymous users can now be allowed to create, edit, comment issues, comment news and post messages in the forums....
Anonymous users can now be allowed to create, edit, comment issues, comment news and post messages in the forums. These permissions need to be explicitly given to the Anonymous role (Admin -> Roles & Permissions -> Anonymous). git-svn-id: http://redmine.rubyforge.org/svn/trunk@919 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r879:fa95501fe5e8
r906:987a5aa22114
Show More
journal.rb
47 lines | 2.0 KiB | text/x-ruby | RubyLexer
Jean-Philippe Lang
improved issues change history...
r52 # redMine - project management software
# Copyright (C) 2006 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 Journal < ActiveRecord::Base
belongs_to :journalized, :polymorphic => true
Jean-Philippe Lang
added rss/atom feeds at project levels for:...
r336 # added as a quick fix to allow eager loading of the polymorphic association
# since always associated to an issue, for now
belongs_to :issue, :foreign_key => :journalized_id
Jean-Philippe Lang
improved issues change history...
r52 belongs_to :user
Jean-Philippe Lang
replaced deprecated ":dependent => true" statements...
r120 has_many :details, :class_name => "JournalDetail", :dependent => :delete_all
Jean-Philippe Lang
Search engines now supports pagination....
r755
acts_as_searchable :columns => 'notes',
:include => :issue,
:project_key => "#{Issue.table_name}.project_id",
:date_column => "#{Issue.table_name}.created_on"
Jean-Philippe Lang
Fixed: unable to add a file to an issue without entering a note....
r840
Jean-Philippe Lang
Added issues status changes on the activity view (initial patch by Cyril Mougel)....
r879 acts_as_event :title => Proc.new {|o| "#{o.issue.tracker.name} ##{o.issue.id}: #{o.issue.subject}" + ((s = o.new_status) ? " (#{s})" : '') },
Jean-Philippe Lang
ProjectsController#list_issues, #export_issues_csv and #export_issues_pdf merged into IssuesController#index...
r874 :description => :notes,
Jean-Philippe Lang
Added issues status changes on the activity view (initial patch by Cyril Mougel)....
r879 :author => :user,
Jean-Philippe Lang
ProjectsController#list_issues, #export_issues_csv and #export_issues_pdf merged into IssuesController#index...
r874 :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id}}
Jean-Philippe Lang
Fixed: unable to add a file to an issue without entering a note....
r840 def save
# Do not save an empty journal
(details.empty? && notes.blank?) ? false : super
end
Jean-Philippe Lang
Added issues status changes on the activity view (initial patch by Cyril Mougel)....
r879
# Returns the new status if the journal contains a status change, otherwise nil
def new_status
c = details.detect {|detail| detail.prop_key == 'status_id'}
(c && c.value) ? IssueStatus.find_by_id(c.value.to_i) : nil
end
Jean-Philippe Lang
improved issues change history...
r52 end