Remove StudentIDNO for privacy.

This commit is contained in:
BoHung Chiu 2020-07-03 10:28:14 +08:00
parent 0d9cacc77d
commit 3c1c1d40da
3 changed files with 10 additions and 11 deletions

View File

@ -344,7 +344,7 @@ class Admin::OlympiamanagementsController < OrbitAdminController
@student_data_field = StudentDataField.create(:sign_up_setting_id=>@sign_up_setting.id) if @student_data_field.nil?
@field_infos = @student_data_field.student_data_fields
@student_data_list = []
@fields = [ "school_code", "school_name" , "StudentName" ,"StudentSex","StudentIDNO","birth_date","StudentClass","StudentPhone","StudentCode","StudentAddress","StudentArea","StudentIdentity"]
@fields = [ "school_code", "school_name" , "StudentName" ,"StudentSex","birth_date","StudentClass","StudentPhone","StudentCode","StudentAddress","StudentArea","StudentIdentity"]
@student_data_fields.each do |field|
@tmp_student_data = []
@fields.each do |field_name|
@ -456,10 +456,10 @@ class Admin::OlympiamanagementsController < OrbitAdminController
@student_params.select{|key,value| value.to_s.blank?}.keys.each do |key|
@error_msg << "#{I18n.t('olympiamanagement.'+key)}欄位值為空"
end
@id_error_msg = checkid(@student_params['StudentIDNO'])
if @id_error_msg.length != 0
@error_msg << @id_error_msg
end
# @id_error_msg = checkid(@student_params['StudentIDNO'])
# if @id_error_msg.length != 0
# @error_msg << @id_error_msg
# end
@olympia_student_data = OlympiaStudentDataField.find(params[:id]) rescue nil
if (@student_params['StudentIdentity'] == '1' || @student_params['StudentIdentity'] == '2') && (@student_params['olympia_student_images']['0']['StudentFile'].nil? rescue true)
if(@olympia_student_data.olympia_student_images.empty? || !@olympia_student_data.olympia_student_images.first.student_file.file.present? rescue true)

View File

@ -286,7 +286,7 @@ class OlympiamanagementsController < ApplicationController
@school_data = OlympiaSchoolDataFields.where(:account_number=>session[:olympia_login_id],:sign_up_setting_id=>@sign_up_setting.id,:approved=>true).first
@record_fields = [['school_name','school_code'],['school_address'],['class_number','enrollment_limited'],
['office_tel_number','fax'],['mobile_number','email'],['principal_signature','dean_signature']]
@student_fields = ['serial_number','StudentName','StudentSex','StudentClass','StudentIDNO','birth_date','StudentArea','StudentIdentity']
@student_fields = ['serial_number','StudentName','StudentSex','StudentClass','birth_date','StudentArea','StudentIdentity']
@student_data_field = StudentDataField.where(:sign_up_setting_id=>@sign_up_setting.id).first
@student_data_field = StudentDataField.create(:sign_up_setting_id=>@sign_up_setting.id) if @student_data_field.nil?
@field_infos = @student_data_field.student_data_fields
@ -687,10 +687,10 @@ class OlympiamanagementsController < ApplicationController
@student_params.select{|key,value| value.to_s.blank?}.keys.each do |key|
@error_msg << "#{I18n.t('olympiamanagement.'+key)}欄位值為空"
end
@id_error_msg = checkid(@student_params['StudentIDNO'])
if @id_error_msg.length != 0
@error_msg << I18n.t('olympiamanagement.id_number_error')
end
# @id_error_msg = checkid(@student_params['StudentIDNO'])
# if @id_error_msg.length != 0
# @error_msg << I18n.t('olympiamanagement.id_number_error')
# end
if (@student_params['StudentIdentity'] == '1' || @student_params['StudentIdentity'] == '2') && (@student_params['remove_image']=='true' || (@student_params['olympia_student_images']['0']['student_file'].nil? rescue true))
if @student_params['remove_image']=='true' || (@olympia_student_data.olympia_student_images.empty? || !@olympia_student_data.olympia_student_images.first.student_file.file.present? rescue true)
@error_msg << I18n.t('olympiamanagement.StudentFile')

View File

@ -8,7 +8,6 @@ class StudentDataField
field :student_data_fields , type: Array , default: [{'StudentIdentity'=>{'type'=>'select_string','hint'=>{'zh_tw'=>'','en'=>''},'values'=>{'zh_tw'=>['一般身分','科展得獎者','科學班'],'en'=>['General identity','Science Fair Winner','Science Class']},'required'=>"true"}},
{'StudentName'=>{'type'=>'String','size'=>'20','hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentSex'=>{'type'=>'radio','size'=>'20','choices'=>['M','F'],'values'=>{'zh_tw'=>['男','女'],'en'=>['Male','Female']},'hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentIDNO'=>{'type'=>'String','size'=>'20','hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentBirthYear'=>{'type'=>'Year','hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentBirthMonth'=>{'type'=>'select_num','range'=>[1,12],'hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},
{'StudentBirthDay'=>{'type'=>'select_num','range'=>[1,31],'hint'=>{'zh_tw'=>'','en'=>''},'required'=>"true"}},