Class: ODDB::View::User::FiPiOfferInputForm

Inherits:
Form
  • Object
show all
Includes:
HtmlGrid::ErrorMessage
Defined in:
src/view/user/fipi_offer_input.rb

Defined Under Namespace

Classes: RadioButton

Constant Summary

COMPONENTS =
{
  [0,0]   => 'fi_activation_charge',
  [1,0]   => :fi_activation_charge_value,
  [0,1]   => :fi_quantity_txt,
  [1,1]   => :fi_quantity,
  [1,2]   => :fi_update,
  [0,4]   => 'pi_activation_charge',
  [1,4]   => :pi_activation_charge_value,
  [0,5]   => :pi_quantity_txt,
  [1,5]   => :pi_quantity,
  [1,6]   => :pi_update,
  [1,7]   => :submit,
}
CSS_MAP =
{
  [0,0,2,3] =>  'list bg',
  [0,4,2,3] =>  'list bg',
  [1,7]     =>  'list',
}
COLSPAN_MAP =
{
  [0,8] => 2,
}
DEFAULT_CLASS =
HtmlGrid::Value
LABELS =
false
SYMBOL_MAP =
{
  :fi_quantity  => HtmlGrid::InputText,
  :pi_quantity  => HtmlGrid::InputText,
}
EVENT =
:calculate_offer
FORM_METHOD =
'POST'

Constants included from FormMethods

ACCEPT_CHARSET, DEFAULT_CLASS, EVENT

Instance Method Summary (collapse)

Methods included from FormMethods

#delete_item, #delete_item_warn, #get_event_button, #post_event_button

Instance Method Details

- (Object) fi_activation_charge_value(model, session)



132
133
134
135
# File 'src/view/user/fipi_offer_input.rb', line 132

def fi_activation_charge_value(model, session)
  price = FI_UPLOAD_PRICES[:activation]
  @lookandfeel.lookup(:swiss_francs, price.to_s)
end

- (Object) fi_quantity_txt(model, session)



92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'src/view/user/fipi_offer_input.rb', line 92

def fi_quantity_txt(model, session)
  text = HtmlGrid::RichText.new(model, session, self)
  text << @lookandfeel.lookup(:fi_quantity0)
  span = HtmlGrid::Span.new(model, session, self)
  span.value = @lookandfeel.lookup(:fachinfo_column)
  span.css_class = 'bold'
  text << span
  text << @lookandfeel.lookup(:fi_quantity1)
  price = FI_UPLOAD_PRICES[:annual_fee]
  text << price.to_s
  text << @lookandfeel.lookup(:fi_quantity2)
  text
end

- (Object) fi_update(model, session)



105
106
107
108
109
110
111
# File 'src/view/user/fipi_offer_input.rb', line 105

def fi_update(model, session)
  fi_upd = 'update_autonomous' # set default
  fi_upd = model.fi_update if(model.respond_to?(:fi_update))
  radio1 = RadioButton.new('fi_update', 'update_ywesee', fi_upd)
  radio2 = RadioButton.new('fi_update', 'update_autonomous', fi_upd)
  View::User::FiPiRadioButtons.new([ radio1, radio2 ], session) 
end

- (Object) pi_activation_charge_value(model, session)



136
137
138
139
# File 'src/view/user/fipi_offer_input.rb', line 136

def pi_activation_charge_value(model, session)
  price = PI_UPLOAD_PRICES[:activation]
  @lookandfeel.lookup(:swiss_francs, price.to_s)
end

- (Object) pi_quantity_txt(model, session)



112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'src/view/user/fipi_offer_input.rb', line 112

def pi_quantity_txt(model, session)
  text = HtmlGrid::RichText.new(model, session, self)
  text << @lookandfeel.lookup(:pi_quantity0)
  span = HtmlGrid::Span.new(model, session, self)
  span.value = @lookandfeel.lookup(:patinfo_column)
  span.css_class = 'bold'
  text << span
  text << @lookandfeel.lookup(:pi_quantity1)
  price = PI_UPLOAD_PRICES[:annual_fee]
  text << price.to_s
  text << @lookandfeel.lookup(:pi_quantity2)
  text
end

- (Object) pi_update(model, session)



125
126
127
128
129
130
131
# File 'src/view/user/fipi_offer_input.rb', line 125

def pi_update(model, session)
  pi_upd = 'update_autonomous' # set default
  pi_upd = model.pi_update if(model.respond_to?(:pi_update))
  radio1 = RadioButton.new('pi_update', 'update_ywesee', pi_upd)
  radio2 = RadioButton.new('pi_update', 'update_autonomous', pi_upd)
  View::User::FiPiRadioButtons.new([ radio1, radio2 ], session) 
end