Module: ODDB::View::Admin::SequenceDisplay

Included in:
ResellerSequenceForm, SequenceForm, SequenceInnerComposite
Defined in:
src/view/admin/sequence.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) atc_class(model, session)



277
278
279
# File 'src/view/admin/sequence.rb', line 277

def atc_class(model, session)
  self::class::DEFAULT_CLASS.new(:code, model.atc_class, session, self)
end

- (Object) atc_descr(model, session)



280
281
282
283
284
285
286
287
# File 'src/view/admin/sequence.rb', line 280

def atc_descr(model, session)
  if(atc = model.atc_class)
    txt = HtmlGrid::Text.new(:atc_descr, model, session, self)
    txt.label = true
    txt.value = atc.description(@lookandfeel.language)
    txt
  end
end

- (Object) atc_request(model, session)



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'src/view/admin/sequence.rb', line 288

def atc_request(model, session)
  if(time = model.atc_request_time)
    days = ((((Time.now - @model.atc_request_time) / 60) / 60) / 24)
    output = "#{@lookandfeel.lookup(:atc_request_time)}"
    if(days > 1)
      output + "#{days.round} #{@lookandfeel.lookup(:atc_request_days)}"
    else
      days = (days * 24)  
      output + "#{days.round} #{@lookandfeel.lookup(:atc_request_hours)}"
    end
  else
    button = HtmlGrid::Button.new(:atc_request, @model, @session, self)
    button.value = @lookandfeel.lookup(:atc_request)
    url = @lookandfeel.event_url(:atc_request)
    button.set_attribute('onclick', "location.href='#{url}'")
    button
  end
end