@ -38,7 +38,6 @@ class Project < ActiveRecord::Base
:conditions = > " #{ Principal . table_name } .type='Group' OR ( #{ Principal . table_name } .type='User' AND #{ Principal . table_name } .status= #{ Principal :: STATUS_ACTIVE } ) "
has_many :users , :through = > :members
has_many :principals , :through = > :member_principals , :source = > :principal
has_many :enabled_modules , :dependent = > :delete_all
has_and_belongs_to_many :trackers , :order = > " #{ Tracker . table_name } .position "
has_many :issues , :dependent = > :destroy , :include = > [ :status , :tracker ]
@ -160,6 +159,10 @@ class Project < ActiveRecord::Base
self . where ( 'project_type = ?' , 1 )
end
# 获取项目的资源类型列表
def attachmenttypes
@attachmenttypes = Attachmentstype . find ( :all , :conditions = > [ " #{ Attachmentstype . table_name } .typeId= ? " , self . attachmenttype ] )
end
# 项目留言 added by fq
def self . add_jour ( user , notes )
@ -726,7 +729,8 @@ class Project < ActiveRecord::Base
'custom_fields' ,
'tracker_ids' ,
'issue_custom_field_ids' ,
'project_type'
'project_type' ,
'attachmenttype'