From b8da40b4aef44564e2e7cb189e59d4a57cbdffbc Mon Sep 17 00:00:00 2001 From: Spen Date: Wed, 1 May 2013 19:11:22 +0800 Subject: [PATCH] ntu_dropdown_fix --- app/models/user/user.rb | 2 +- .../front_end/member_staff_lists/index.html.erb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 6da52e24..c4b84134 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -181,7 +181,7 @@ class User def self.get_member_list_attribute_value(user_id,role_type,field_key) @attribute = ::Attribute.where(:key => role_type).first @AttributeField = ::AttributeField.where(:key => field_key, :attribute_id => @attribute.id).first - return ::AttributeValue.where(attribute_field_id: @AttributeField.id, :user_id => user_id).first[I18n.locale.to_s] + return ::AttributeValue.where(attribute_field_id: @AttributeField.id, :user_id => user_id).first end def create_dept_cache diff --git a/vendor/built_in_modules/member_staff/app/views/panel/member_staff/front_end/member_staff_lists/index.html.erb b/vendor/built_in_modules/member_staff/app/views/panel/member_staff/front_end/member_staff_lists/index.html.erb index fd8b6df1..0ae9c276 100644 --- a/vendor/built_in_modules/member_staff/app/views/panel/member_staff/front_end/member_staff_lists/index.html.erb +++ b/vendor/built_in_modules/member_staff/app/views/panel/member_staff/front_end/member_staff_lists/index.html.erb @@ -97,19 +97,19 @@ - <%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title")) %> + <%= show_attribute_value(@member_lists.get_member_list_attribute_value(member.id,"staff","job_title").get_value_by_locale(I18n.locale)) rescue '' %> <%= link_to member.name, "mailto:#{member.email}" %> <%= member.office_tel %> - <%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business")) %> + <%= nl2br(@member_lists.get_member_list_attribute_value(member.id,"staff","business").get_value_by_locale(I18n.locale)) rescue '' %> - <%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent") %> + <%= @member_lists.get_member_list_attribute_value(member.id,"staff","agent").get_value_by_locale(I18n.locale) rescue '' %>