Adjust send_email field to multiple options.
This commit is contained in:
parent
3caa63bb46
commit
d2edc29945
|
@ -391,7 +391,7 @@ class Admin::AsksController < OrbitAdminController
|
||||||
end
|
end
|
||||||
temp_params = temp_params.merge({reviewer: current_user.member_profile, review_time: DateTime.now})
|
temp_params = temp_params.merge({reviewer: current_user.member_profile, review_time: DateTime.now})
|
||||||
@ask_question.update_attributes(temp_params)
|
@ask_question.update_attributes(temp_params)
|
||||||
if @ask_question.send_email
|
if @ask_question.send_email?
|
||||||
build_email(@ask_question)
|
build_email(@ask_question)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ class AskQuestion
|
||||||
|
|
||||||
field :reply, type: String
|
field :reply, type: String
|
||||||
field :comment, type: String
|
field :comment, type: String
|
||||||
field :send_email, type: Boolean, default: false
|
|
||||||
field :situation, type: String, default: "is_email_not_confirmed" # 預設email未驗證
|
field :situation, type: String, default: "is_email_not_confirmed" # 預設email未驗證
|
||||||
|
field :send_email, type: Integer, default: 0
|
||||||
field :email_id
|
field :email_id
|
||||||
field :verify_email_id
|
field :verify_email_id
|
||||||
field :custom_values, type: Hash, default: {}
|
field :custom_values, type: Hash, default: {}
|
||||||
|
@ -75,5 +75,9 @@ class AskQuestion
|
||||||
def display_format_string(num, str_length)
|
def display_format_string(num, str_length)
|
||||||
format("%0#{str_length}d", num)
|
format("%0#{str_length}d", num)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def send_email?
|
||||||
|
self.send_email == 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -97,9 +97,34 @@
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="5">
|
<td colspan="5">
|
||||||
<%= f.label :send_email %><%= f.radio_button :send_email, 1, checked: @ask_question.send_email? %><%= t('ask.yes') %>
|
<%= f.label :send_email, class: "control-label muted" %>
|
||||||
|
|
||||||
<%= f.radio_button :send_email, 0, checked: !@ask_question.send_email? %><%= t('ask.no') %>
|
<div class="controls">
|
||||||
|
<label class="radio inline">
|
||||||
|
<%= f.radio_button :send_email, 1 %>
|
||||||
|
<%= t('ask.system_Email') %>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="radio inline">
|
||||||
|
<%= f.radio_button :send_email, 0 %>
|
||||||
|
<%= t('ask.no') %>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="radio inline">
|
||||||
|
<%= f.radio_button :send_email, 2 %>
|
||||||
|
<%= t('ask.phone') %>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="radio inline">
|
||||||
|
<%= f.radio_button :send_email, 3 %>
|
||||||
|
<%= t('ask.fax') %>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="radio inline">
|
||||||
|
<%= f.radio_button :send_email, 4 %>
|
||||||
|
<%= t('ask.paper') %>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -99,6 +99,10 @@ en:
|
||||||
is_published: Processed and Published
|
is_published: Processed and Published
|
||||||
'yes': 'Yes'
|
'yes': 'Yes'
|
||||||
'no': 'No'
|
'no': 'No'
|
||||||
|
system_Email: System Email
|
||||||
|
phone: Phone
|
||||||
|
fax: Fax
|
||||||
|
paper: Paper
|
||||||
required: Required
|
required: Required
|
||||||
datepicker: Select a Date
|
datepicker: Select a Date
|
||||||
enable_range_setting: Enable Time Range Setting
|
enable_range_setting: Enable Time Range Setting
|
||||||
|
|
|
@ -102,6 +102,10 @@ zh_tw:
|
||||||
is_published: 已處理並發佈網頁
|
is_published: 已處理並發佈網頁
|
||||||
'yes': 是
|
'yes': 是
|
||||||
'no': 否
|
'no': 否
|
||||||
|
system_Email: 系統發信
|
||||||
|
phone: 電話
|
||||||
|
fax: 傳真
|
||||||
|
paper: 回覆函
|
||||||
required: 必填
|
required: 必填
|
||||||
datepicker: 選擇日期
|
datepicker: 選擇日期
|
||||||
enable_range_setting: 啟用時間區段設定
|
enable_range_setting: 啟用時間區段設定
|
||||||
|
|
|
@ -112,6 +112,8 @@ module Ask
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
fix_reviewer
|
fix_reviewer
|
||||||
|
AskQuestion.where(send_email: false).update_all(send_email: 0)
|
||||||
|
AskQuestion.where(send_email: true).update_all(send_email: 1)
|
||||||
OrbitApp.registration "Ask", :type => "ModuleApp" do
|
OrbitApp.registration "Ask", :type => "ModuleApp" do
|
||||||
module_label "ask.ask"
|
module_label "ask.ask"
|
||||||
base_url File.expand_path File.dirname(__FILE__)
|
base_url File.expand_path File.dirname(__FILE__)
|
||||||
|
|
Loading…
Reference in New Issue