diff --git a/app/controllers/admin/technology_transfers_controller.rb b/app/controllers/admin/technology_transfers_controller.rb index edc4d66..91fab2d 100644 --- a/app/controllers/admin/technology_transfers_controller.rb +++ b/app/controllers/admin/technology_transfers_controller.rb @@ -49,9 +49,9 @@ class Admin::TechnologyTransfersController < OrbitMemberController end def update_frontend_setting - @member = MemberProfile.find(intro_params['member_profile_id']) rescue nil - @intro = CourseIntro.find_by(:member_profile_id=>@member.id) rescue nil - @intro = @intro.nil? ? CourseIntro.new({:member_profile_id=>@member.id}) : @intro + @member = MemberProfile.find(params['member_profile_id']) rescue nil + @intro = TechnologyTransferIntro.find_by(:member_profile_id=>@member.id) rescue nil + @intro = @intro.nil? ? TechnologyTransferIntro.new({:member_profile_id=>@member.id}) : @intro @intro.update_attributes(intro_params) @intro.save redirect_to URI.encode('/admin/members/'+@member.to_param+'/TechnologyTransfer') @@ -59,7 +59,7 @@ class Admin::TechnologyTransfersController < OrbitMemberController def toggle_hide if params[:ids] - @projects = Course.any_in(_id: params[:ids]) + @projects = TechnologyTransfer.any_in(_id: params[:ids]) @projects.each do |project| project.is_hidden = params[:disable] diff --git a/app/controllers/personal_technology_transfers_controller.rb b/app/controllers/personal_technology_transfers_controller.rb index 52eb9f3..47cae25 100644 --- a/app/controllers/personal_technology_transfers_controller.rb +++ b/app/controllers/personal_technology_transfers_controller.rb @@ -28,6 +28,8 @@ class PersonalTechnologyTransfersController < ApplicationController t << {"value" => (tt.send("technology_transfer_category").title rescue "")} when "authors" t << {"value" => (tt.send(:member_profile).name rescue "")} + when "patent_granted" + t << {"value" => (tt.patent_granted ? t("personal_technology_transfer.y_es") : t("personal_technology_transfer.n_o"))} else t << {"value" => (tt.send(fs) rescue "")} end diff --git a/app/models/technology_transfer.rb b/app/models/technology_transfer.rb index 696ca47..5cbcb14 100644 --- a/app/models/technology_transfer.rb +++ b/app/models/technology_transfer.rb @@ -64,6 +64,8 @@ class TechnologyTransfer pd_data << {"data_title" => (p.patent_granted ? "Yes" : "No")} elsif t == "authors" pd_data << {"data_title" => (p.member_profile.name rescue "")} + elsif t == "patent_granted" + pd_data << {"data_title" => (p.patent_granted ? t("personal_technology_transfer.y_es") : t("personal_technology_transfer.n_o"))} else pd_data << { "data_title" => p.send(t) } end diff --git a/app/views/admin/technology_transfers/frontend_setting.html.erb b/app/views/admin/technology_transfers/frontend_setting.html.erb index f3b3377..32b7868 100644 --- a/app/views/admin/technology_transfers/frontend_setting.html.erb +++ b/app/views/admin/technology_transfers/frontend_setting.html.erb @@ -3,7 +3,7 @@ <%= stylesheet_link_tag "lib/main-list" %> <% end %> -<%= form_for(:course_intro, :url => update_frontend_setting_admin_technology_transfers_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %> +<%= form_for(:technology_transfer_intro, :url => update_frontend_setting_admin_technology_transfers_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %>