This commit is contained in:
BoHung Chiu 2022-06-14 21:32:48 +08:00
parent 0f348008d8
commit 22c37e3cb8
1 changed files with 10 additions and 3 deletions

View File

@ -436,6 +436,7 @@ class Admin::ApplicationFormsController < OrbitAdminController
end end
end end
def copy def copy
@application_form_setting = ApplicationFormSetting.first
@application_form = ApplicationFormMain.find(params[:id]).clone_new @application_form = ApplicationFormMain.find(params[:id]).clone_new
@members = @application_form.reviewer_ids_list.collect{|r_ids| MemberProfile.where(:id.in=>Array(r_ids)).to_a} @members = @application_form.reviewer_ids_list.collect{|r_ids| MemberProfile.where(:id.in=>Array(r_ids)).to_a}
@ -863,9 +864,15 @@ class Admin::ApplicationFormsController < OrbitAdminController
params.require(:application_form_template_setting).permit! params.require(:application_form_template_setting).permit!
end end
def application_form_params def application_form_params
tmp = params.require(:application_form_main).permit! if params.has_key?(:application_form_main)
tmp['reviewer_ids_list'] = tmp['reviewer_enables'].map{|k,i| Array((tmp['reviewer_ids_list'][k] rescue []))} tmp = params.require(:application_form_main).permit!
tmp['reviewer_enables'] = tmp['reviewer_enables'].map{|k,v| v.to_i != 0 ? true : false} if tmp['reviewer_enables']
tmp['reviewer_ids_list'] = tmp['reviewer_enables'].map{|k,i| Array((tmp['reviewer_ids_list'][k] rescue []))}
tmp['reviewer_enables'] = tmp['reviewer_enables'].map{|k,v| v.to_i != 0 ? true : false}
end
else
tmp = {}
end
tmp tmp
end end
def create_set (save_flag) def create_set (save_flag)