module IvrHelper
def make_tooltip(block, actions, extensions)
sumary_tool_tip = []
sumary_tool_tip << "#{block.name}
#{_('Timeout_Response')}: #{block.timeout_response}
#{_('Timeout_Digits')}: #{block.timeout_digits}
#{_('Actions')}:
"
for action in actions do
sumary_tool_tip << "#{action.name}: #{action.data1}"
sumary_tool_tip << "=#{action.data2}" if action.data3 and action.data2.length > 0
sumary_tool_tip << "
"
end
sumary_tool_tip << "
#{_('Extensions')}:
"
for extension in extensions
sumary_tool_tip << "#{extension.exten}: #{extension.goto_ivr_block.name}
"
end
sumary_tool_tip.join("")
end
def draw_block(block,x,y,context, text_div, small = nil)
line_nr = 0
line_height = 12
top_spacing = 6
max_text_lenght = 20
box_height = 203
box_width = 150
small_cell_width = 30
small_cell_height = box_height / 7
text_top_align = 8
text_left_align = 10
actions = block.ivr_actions
extensions = block.ivr_extensions
content = []
sumary_tool_tip = make_tooltip(block, actions, extensions)
content << "document.getElementById('#{text_div}').innerHTML += \"