Class: ODDB::State::Admin::Sequence

Inherits:
Global show all
Includes:
SequenceMethods
Defined in:
src/state/admin/root.rb,
src/state/admin/admin.rb,
src/state/admin/sequence.rb,
src/state/admin/companyuser.rb

Direct Known Subclasses

CompanySequence

Constant Summary

RECIPIENTS =
[]
VIEW =
View::Admin::RootSequence

Constants included from PatinfoPdfMethods

HTML_PARSER, PDF_DIR

Constants inherited from Global

HOME_STATE, ZONE

Constants inherited from Global

DIRECT_EVENT, GLOBAL_MAP, HOME_STATE, LIMITED, PRINT_STATES, READONLY_STATES, RESOLVE_STATES, REVERSE_MAP, VIEW, ZONE_NAVIGATION

Constants included from UmlautSort

FILTER_PAIRS

Instance Method Summary (collapse)

Methods included from SequenceMethods

#ajax_create_active_agent, #ajax_create_composition, #ajax_delete_active_agent, #ajax_delete_composition, #check_model, #delete, #new_active_agent, #new_package, #update, #update_compositions

Methods included from PatinfoPdfMethods

#assign_patinfo, #get_patinfo_input, #parse_patinfo, #store_slate_item

Methods inherited from Global

#zone_navigation

Methods inherited from Global

#_search_drugs, #_search_drugs_state, #_trigger, #add_to_interaction_basket, #allowed?, #atc_chooser, #checkout, #clear_interaction_basket, #creditable?, #direct_request_path, #doctorlist, #download, #export_csv, #extend, #fachinfo, #feedbacks, #help_navigation, #home_navigation, #home_state, #hospitallist, #interaction_basket, #limit_state, #limited?, #logout, #navigation, #notify, #password_reset, #paypal_return, #powerlink, #print, #proceed_download, #proceed_poweruser, #resolve, #resolve_state, #rss, #search, #show, #snapback_event, #sort, #sponsorlink, #suggest_address, #switch, #unique_email, #user_input, #user_navigation, #ywesee_contact, #zone_navigation, #zones

Methods included from LoginMethods

#autologin, #login

Methods included from UmlautSort

#sort_model, #umlaut_filter

Instance Method Details

- (Object) atc_request



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'src/state/admin/sequence.rb', line 312

def atc_request
  if((company = @model.company) && (addr = company.regulatory_email))
    lookandfeel = @session.lookandfeel
    config = ODDB.config
    mail = TMail::Mail.new
    mail.set_content_type('text', 'plain', 'charset'=>'UTF-8')
    mail.to = [addr]
    mail.from = config.mail_from
    mail.subject = "#{@model.name_base} #{@model.iksnr}"
    mail.date = Time.now
    mail.body = [
      lookandfeel.lookup(:atc_request_email),
      lookandfeel.lookup(:name) + ": " + @model.name_base,
      lookandfeel.lookup(:registration) + ": " + @model.iksnr,
      lookandfeel.lookup(:package) + ": " \
        + @model.packages.keys.join(","),
      lookandfeel._event_url(:resolve, {:pointer => @model.pointer}),
      nil, 
      lookandfeel.lookup(:thanks_for_cooperation),
    ].join("\n")
    mail['User-Agent'] = 'ODDB Download'
    Net::SMTP.start(config.smtp_server, config.smtp_port, config.smtp_domain,
                    config.smtp_user, config.smtp_pass,
                    config.smtp_authtype) { |smtp|
      smtp.sendmail(mail.encoded, config.smtp_user, [addr] + RECIPIENTS)
    }
    @model.atc_request_time = Time.now
    @model.odba_isolated_store
  end
  self
end