|
|
|
@ -101,6 +101,21 @@ class SoftapplicationsController < ApplicationController
|
|
|
|
|
# GET /softapplications/1/edit
|
|
|
|
|
def edit
|
|
|
|
|
@softapplication = Softapplication.find(params[:id])
|
|
|
|
|
|
|
|
|
|
@membership = User.current.memberships.all(:conditions => Project.visible_condition(User.current))
|
|
|
|
|
@option = []
|
|
|
|
|
# @contesting_project_count = @contesting_project_all.count
|
|
|
|
|
# @contesting_project_pages = Paginator.new @contesting_project_count, per_page_option, params['page']
|
|
|
|
|
@membership.each do |membership|
|
|
|
|
|
unless(membership.project.project_type==1)
|
|
|
|
|
membership.member_roles.each{|role|
|
|
|
|
|
if(role.role_id == 3)
|
|
|
|
|
@option << membership.project
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# POST /softapplications
|
|
|
|
@ -156,6 +171,7 @@ class SoftapplicationsController < ApplicationController
|
|
|
|
|
# @softapplication = Softapplication.find(params[:id])
|
|
|
|
|
@softapplication.attachments.map{|attach| attach.destroy }
|
|
|
|
|
@softapplication.save_attachments(params[:attachments])
|
|
|
|
|
@softapplication.deposit_project = params[:project]
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
if @softapplication.update_attributes(params[:softapplication])
|
|
|
|
|
format.html { redirect_to @softapplication, notice: 'Softapplication was successfully updated.' }
|
|
|
|
|