67 lines
2.5 KiB
Plaintext
67 lines
2.5 KiB
Plaintext
# encoding: utf-8
|
|
|
|
wb = xlsx_package.workbook
|
|
|
|
wb.add_worksheet(name: t('module_name.active')) do |sheet|
|
|
|
|
row = []
|
|
|
|
row << @act.field_label(:name) if !@act.enabled_name.blank?
|
|
|
|
row << @act.field_label(:idno) if !@act.enabled_idno.blank?
|
|
|
|
row << @act.field_label(:sex) if !@act.enabled_sex.blank?
|
|
|
|
row << @act.field_label(:birthday) if !@act.enabled_birthday.blank?
|
|
|
|
row << @act.field_label(:tel) if !@act.enabled_tel.blank?
|
|
|
|
row << @act.field_label(:phone) if !@act.enabled_phone.blank?
|
|
|
|
row << @act.field_label(:fax) if !@act.enabled_fax.blank?
|
|
|
|
row << @act.field_label(:email) if !@act.enabled_email.blank?
|
|
|
|
row << @act.field_label(:organization) if !@act.enabled_organization.blank?
|
|
|
|
row << @act.field_label(:title) if !@act.enabled_title.blank?
|
|
|
|
row << @act.field_label(:address) if !@act.enabled_address.blank?
|
|
|
|
row << @act.field_label(:emergency_contact_number) if !@act.enabled_emergency_contact_number.blank?
|
|
|
|
row << @act.field_label(:emergency_contact_person) if !@act.enabled_emergency_contact_person.blank?
|
|
|
|
row << @act.field_label(:vegetarian) if !@act.enabled_vegetarian.blank?
|
|
|
|
row << @act.field_label(:note) if !@act.enabled_note.blank?
|
|
|
|
sheet.add_row row
|
|
|
|
@act.act_signups.each do |signup|
|
|
|
|
row2 = []
|
|
|
|
row2 << signup.name if !@act.enabled_name.blank?
|
|
row2 << signup.idno if !@act.enabled_idno.blank?
|
|
row2 << signup.sex if !@act.enabled_sex.blank?
|
|
row2 << (signup.birthday.strftime("%Y-%m-%d") rescue "") if !@act.enabled_birthday.blank?
|
|
row2 << signup.tel if !@act.enabled_tel.blank?
|
|
row2 << signup.phone if !@act.enabled_phone.blank?
|
|
row2 << signup.fax if !@act.enabled_fax.blank?
|
|
row2 << signup.email if !@act.enabled_email.blank?
|
|
row2 << signup.organization if !@act.enabled_organization.blank?
|
|
row2 << signup.title if !@act.enabled_title.blank?
|
|
row2 << signup.address if !@act.enabled_address.blank?
|
|
row2 << signup.emergency_contact_number if !@act.enabled_emergency_contact_number.blank?
|
|
row2 << signup.emergency_contact_person if !@act.enabled_emergency_contact_person.blank?
|
|
row2 << (signup.vegetarian ? t(:yes_) : t(:no_)) if !@act.enabled_vegetarian.blank?
|
|
row2 << signup.note if !@act.enabled_note.blank?
|
|
|
|
sheet.add_row row2
|
|
end
|
|
|
|
|
|
end
|
|
|