|
|
|
@ -375,11 +375,14 @@ class BidsController < ApplicationController
|
|
|
|
|
@option = []
|
|
|
|
|
@membership.each do |membership|
|
|
|
|
|
unless(membership.project.project_type==1)
|
|
|
|
|
membership.member_roles.each{|role|
|
|
|
|
|
if(role.role_id == 3)
|
|
|
|
|
@option << membership.project
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
if membership.user.allowed_to?(:quote_project,membership.project)
|
|
|
|
|
@option << membership.project
|
|
|
|
|
end
|
|
|
|
|
#membership.member_roles.each{|role|
|
|
|
|
|
# if(role.role_id == 3)
|
|
|
|
|
# @option << membership.project
|
|
|
|
|
# end
|
|
|
|
|
#}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -454,14 +457,14 @@ class BidsController < ApplicationController
|
|
|
|
|
if (User.current.logged? && User.current.member_of_course?(@bid.courses.first))
|
|
|
|
|
# flash[:notice] = ""
|
|
|
|
|
@membership = User.current.coursememberships.all(:conditions => Course.visible_condition(User.current))
|
|
|
|
|
@option = []
|
|
|
|
|
@membership.each do |membership|
|
|
|
|
|
membership.member_roles.each{|role|
|
|
|
|
|
if(role.role_id == 3)
|
|
|
|
|
@option << membership.course
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
#@option = []
|
|
|
|
|
#@membership.each do |membership|
|
|
|
|
|
# membership.member_roles.each{|role|
|
|
|
|
|
# if(role.role_id == 3)
|
|
|
|
|
# @option << membership.course
|
|
|
|
|
# end
|
|
|
|
|
# }
|
|
|
|
|
#end
|
|
|
|
|
|
|
|
|
|
@user = @bid.author
|
|
|
|
|
@bidding_project = @bid.biding_projects.all
|
|
|
|
@ -990,7 +993,7 @@ class BidsController < ApplicationController
|
|
|
|
|
return true if current_user.admin?
|
|
|
|
|
#return 0 if @bid.courses.first.project_type == Project::ProjectType_project
|
|
|
|
|
currentUser = User.current
|
|
|
|
|
render_403 unless currentUser.member_of_cousrse?(@bid.courses.first)
|
|
|
|
|
render_403 unless currentUser.member_of_course?(@bid.courses.first)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|