Class: ODDB::View::Drugs::PatinfoComposite

Inherits:
HtmlGrid::Composite show all
Includes:
Print
Defined in:
src/view/drugs/patinfo.rb

Direct Known Subclasses

Admin::PatinfoPreviewComposite, PatinfoPrintComposite

Constant Summary

COLSPAN_MAP =
{
  [0,2] => 2,
}
COMPONENTS =
{
  [0,0] =>  :patinfo_name,
  [1,0] =>  :company_name,
  [0,1] =>  :print,
  [0,2] =>  :document,
}
CSS_CLASS =
'composite'
CSS_MAP =
{
  [0,0] => 'th',
  [1,0] => 'th right',
  [0,1,1,2] => 'list',
}
DEFAULT_CLASS =
HtmlGrid::Value
COMPONENT_CSS_MAP =
{
  [0,1] => 'list-b',
}

Instance Method Summary (collapse)

Methods included from Print

#print, #print_edit

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) document(model, session)

def company(model, session)

    if(seq = model.sequences.first)
      seq.registration.company_name
    end
  end


94
95
96
97
# File 'src/view/drugs/patinfo.rb', line 94

def document(model, session)
  document = model.send(session.language)
  document_composite(document, session)
end

- (Object) document_composite(model, session)



98
99
100
101
102
103
104
105
106
# File 'src/view/drugs/patinfo.rb', line 98

def document_composite(model, session)
  klass = case model
  when ODDB::PatinfoDocument2001
    View::Drugs::Patinfo2001InnerComposite
  else
    View::Drugs::PatinfoInnerComposite
  end
  klass.new(model, session, self)
end

- (Object) patinfo_name(model, session)



107
108
109
110
# File 'src/view/drugs/patinfo.rb', line 107

def patinfo_name(model, session)
  document = model.send(@session.language)
  @lookandfeel.lookup(:patinfo_name, document.name)
end