Module: ODDB::State::Admin::CompanyUser

Includes:
User
Defined in:
src/state/global_predefine.rb,
src/state/admin/companyuser.rb

Constant Summary

RESOLVE_STATES =
{
  [ :fachinfo ]                 =>  State::Drugs::CompanyFachinfo,
  [ :registration ]             =>  State::Admin::CompanyRegistration,
  [ :registration, :patent ]    =>  State::Admin::CompanyPatent,
  [ :registration, :sequence ]  => State::Admin::CompanySequence,
  [ :registration,
    :sequence, :active_agent ] =>  State::Admin::CompanyActiveAgent,
  [ :registration,
    :sequence, :package ]        =>  State::Admin::CompanyPackage,
  [ :registration, :sequence,
    :package, :sl_entry ]        =>  State::Admin::CompanySlEntry,
}

Constants included from User

RESOLVE_STATES

Instance Method Summary (collapse)

Methods included from User

#user_navigation

Instance Method Details

- (Object) fipi_overview



46
47
48
49
50
# File 'src/state/admin/companyuser.rb', line 46

def fipi_overview
  if(company = @session.user.model)
    State::Companies::FiPiOverview.new(@session, company)
  end
end

- (Object) home_companies



58
59
60
61
62
63
64
65
# File 'src/state/admin/companyuser.rb', line 58

def home_companies
  klass = State::Companies::UserCompany
  if(self.is_a?(klass))
    State::Companies::Init.new(@session, nil)
  else
    klass.new(@session, @session.user.model)
  end
end

- (Boolean) limited?

Returns:

  • (Boolean)


66
67
68
# File 'src/state/admin/companyuser.rb', line 66

def limited?
  false
end

- (Object) new_fachinfo



51
52
53
54
55
56
57
# File 'src/state/admin/companyuser.rb', line 51

def new_fachinfo
  if((pointer = @session.user_input(:pointer)) \
      && (registration = pointer.resolve(@session)) \
      && @session.allowed?('edit', registration))
    _new_fachinfo(registration)
  end
end

- (Object) new_registration



77
78
79
80
81
82
83
84
85
# File 'src/state/admin/companyuser.rb', line 77

def new_registration
  pointer = Persistence::Pointer.new(:registration)
  item = Persistence::CreateItem.new(pointer)
  item.carry(:company, @session.user.model)
  item.carry(:company_name, @session.user.model.name)
  item.carry :sequences, {}
  item.carry :packages, []
  State::Admin::CompanyRegistration.new(@session, item)
end

- (Object) patinfo_stats



86
87
88
# File 'src/state/admin/companyuser.rb', line 86

def patinfo_stats
  State::Admin::PatinfoStatsCompanyUser.new(@session,[])
end

- (Object) patinfo_stats_company



89
90
91
# File 'src/state/admin/companyuser.rb', line 89

def patinfo_stats_company
  State::Admin::PatinfoStatsCompanyUser.new(@session,[])
end

- (Object) resolve_state(pointer, type = :standard)



69
70
71
72
73
74
75
76
# File 'src/state/admin/companyuser.rb', line 69

def resolve_state(pointer, type=:standard)
  if(pointer.skeleton == [:company] \
     && @session.allowed?('edit', pointer.to_yus_privilege))
    State::Companies::UserCompany
  else
    super
  end
end

- (Object) zones



92
93
94
# File 'src/state/admin/companyuser.rb', line 92

def zones
  [:admin, :analysis, :interactions,:drugs, :migel, :user, :substances, :companies]
end