|
|
|
@ -56,13 +56,17 @@ module HomeworkAttachHelper
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def user_projects_option
|
|
|
|
|
projects = Project.where("id < 8")
|
|
|
|
|
cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
|
|
|
|
|
memberships = User.current.memberships.all(:conditions => cond)
|
|
|
|
|
projects = memberships.map(&:project)
|
|
|
|
|
type = []
|
|
|
|
|
projects.each do |project|
|
|
|
|
|
option = []
|
|
|
|
|
option << project.name
|
|
|
|
|
option << project.id
|
|
|
|
|
type << option
|
|
|
|
|
if project != nil
|
|
|
|
|
option = []
|
|
|
|
|
option << project.name
|
|
|
|
|
option << project.id
|
|
|
|
|
type << option
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
type
|
|
|
|
|
end
|
|
|
|
|