class YDIM::Html::View::InvoiceComposite

Constants

FORM_ID
COMPONENTS
CSS_MAP
EVENT

Public Instance Methods

button(key, model) click to toggle source
# File lib/ydim/html/view/invoice.rb, line 201
def button(key, model)
              button = HtmlGrid::Button.new(key, model, @session, self)
              url = @lookandfeel._event_url(key, {:unique_id => model.unique_id})
              button.set_attribute('onClick', 
    "this.form.event.value='#{key}'; this.form.submit()")
              button
      end
init() click to toggle source
Calls superclass method
# File lib/ydim/html/view/invoice.rb, line 169
def init
        if(@model.unique_id.nil?)
                @components = {
                        [0,0]       =>    components[[0,0]],
                        [0,1]       =>    :submit,
                }
                @css_map = { 1 => 'padded' }
        elsif(@model.items.empty?)
                @components = {
                        [0,0]       =>    components[[0,0]],
                        [0,1]       =>    :items,
                        [0,2]       =>    :submit,
                }
                @css_map = { 2 => 'padded' }
        end
        super
end

Private Instance Methods

hidden_fields(context) click to toggle source
Calls superclass method
# File lib/ydim/html/view/invoice.rb, line 186
def hidden_fields(context)
        super << context.hidden('unique_id', @model.unique_id)
end
items(model) click to toggle source
# File lib/ydim/html/view/invoice.rb, line 189
def items(model)
        ItemList.new(model.items, @session, self)
end
pdf(model) click to toggle source
# File lib/ydim/html/view/invoice.rb, line 192
def pdf(model)
        button = HtmlGrid::Button.new(:pdf, model, @session, self)
        url = @lookandfeel._event_url(:pdf, {:unique_id => model.unique_id})
        button.set_attribute('onClick', "document.location.href='#{url}'")
        button
end
send_invoice(model) click to toggle source
# File lib/ydim/html/view/invoice.rb, line 198
      def send_invoice(model)
  button(:send_invoice, model)
end