Class: ODDB::View::Companies::UserCompanyForm

Inherits:
Form
  • Object
show all
Includes:
HtmlGrid::ErrorMessage, HtmlGrid::InfoMessage
Defined in:
src/view/companies/company.rb

Direct Known Subclasses

AjaxCompanyForm, PowerLinkCompanyForm

Constant Summary

COMPONENTS =
{
  [0,0]     =>  :company_name,
  [2,0]     =>  :invoice_email,
  [0,1]     =>  :contact,
  [2,1]     =>  :contact_email,
  [2,2]     =>  :regulatory_email,
  #[1,2]      => :set_pass,
  [0,4]     =>  :address,
  [0,5]     =>  :plz,
  [2,5]     =>  :city,
  [0,6]     =>  :fon,
  [2,6]     =>  :fax,
  [0,7]     =>  :url,
  [2,7]     =>  :address_email,
  [0,9]     =>  :business_area,
  [2,9]     =>  :ean13,
  [0,10]    =>  :registration_count,
  [0,11]    =>  :generic_type,
  [2,11]    =>  :complementary_type,
  [1,12]    =>  :submit,
  [3,12]     => :patinfo_stats,
  [3,13]  => :fipi_overview,
}
CSS_MAP =
{
  [0,0,4,14]  => 'list',
}
COMPONENT_CSS_MAP =
{
  [1,0,3,2] =>  'standard',
  [3,2] =>  'standard',
  [1,4,3,8] =>  'standard',
}
LABELS =
true
LEGACY_INTERFACE =
false
SYMBOL_MAP =
{
  :nbsp                 =>  HtmlGrid::Text,
  :address_header       => HtmlGrid::Text,
  :business_area        =>  HtmlGrid::Select,
  :generic_type         =>  HtmlGrid::Select,
  :complementary_type   => HtmlGrid::Select,
  :registration_count   => HtmlGrid::Value,  
  :invoice_email        =>  HtmlGrid::Value,
}
TAG_METHOD =
:multipart_form

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) address(model, session = @session)



157
158
159
# File 'src/view/companies/company.rb', line 157

def address(model, session=@session)
  address_delegate(model, :address)
end

- (Object) address_delegate(model, symbol)



160
161
162
163
164
165
166
167
# File 'src/view/companies/company.rb', line 160

def address_delegate(model, symbol)
  input = HtmlGrid::InputText.new(symbol,
    model.address(0), @session, self)
  if(input.value.is_a?(Array))
    input.value = input.value.join(', ')
  end
  input
end

- (Object) city(model, session = @session)



168
169
170
# File 'src/view/companies/company.rb', line 168

def city(model, session=@session)
  address_delegate(model, :city)
end

- (Object) company_name(model, session = @session)



171
172
173
# File 'src/view/companies/company.rb', line 171

def company_name(model, session=@session)
  HtmlGrid::InputText.new('name', model, session, self)
end

- (Object) fax(model, session = @session)



174
175
176
# File 'src/view/companies/company.rb', line 174

def fax(model, session=@session)
  address_delegate(model, :fax)
end

- (Object) fipi_overview(model, session = @session)



177
178
179
180
181
182
# File 'src/view/companies/company.rb', line 177

def fipi_overview(model, session=@session)
  link = HtmlGrid::Link.new(:fipi_overview, model, @session, self)
  link.href = @lookandfeel._event_url(:fipi_overview, 
                                      :pointer => @model.pointer)
  link
end

- (Object) fon(model, session = @session)



183
184
185
# File 'src/view/companies/company.rb', line 183

def fon(model, session=@session)
  address_delegate(model, :fon)
end

- (Object) init



152
153
154
155
156
# File 'src/view/companies/company.rb', line 152

def init
  super
  error_message()
  info_message()
end

- (Object) patinfo_stats(model, session = @session)



186
187
188
189
190
191
192
193
194
# File 'src/view/companies/company.rb', line 186

def patinfo_stats(model, session=@session)
  link = HtmlGrid::Link.new(:patinfo_stats, model , session, self)
  args = {
    :pointer =>  model.pointer,
  }
  link.href = @lookandfeel._event_url(:patinfo_stats, args)
  link.set_attribute('title', @lookandfeel.lookup(:patinfo_stats))
  link
end

- (Object) plz(model, session = @session)



195
196
197
# File 'src/view/companies/company.rb', line 195

def plz(model, session=@session)
  address_delegate(model, :plz)
end

- (Object) set_pass(model, session = @session)



198
199
200
201
202
203
# File 'src/view/companies/company.rb', line 198

def set_pass(model, session=@session)
  button = HtmlGrid::Button.new(:set_pass, model, session, self)
  script = 'this.form.event.value="set_pass"; this.form.submit();'
  button.set_attribute('onClick', script)
  button
end