Parent

Class/Module Index [+]

Quicksearch

Meeting

Public Class Methods

new_divid_for(parent) click to toggle source
# File app/models/meeting.rb, line 106
def self.new_divid_for(parent)
  "meeting_new_parent_" + parent.class.to_s + "_" + parent.id.to_s 
end
new_with_date_and_typ(parent,start, typ) click to toggle source
# File app/models/meeting.rb, line 96
def self.new_with_date_and_typ(parent,start, typ)
  m= Meeting.new
  m.parent=parent
  m.calentry=Calentry.new
  m.calentry.typ=2
  m.calentry.start=start
  m.calentry.dauer=4
  m.meetingtyp=typ
  m
end

Public Instance Methods

agenda_text() click to toggle source
# File app/models/meeting.rb, line 120
def agenda_text
    unless self.agenda.nil?
    t=  self.agenda.text 
    else
     t= ""
    end
  t
end
create_agenda() click to toggle source
# File app/models/meeting.rb, line 84
def create_agenda
  if self.agenda.nil?
    d=Document.new
    d.typ=11
    d.name="Agenda"
    unless self.meetingtyp.agenda.nil?
      d.text=self.meetingtyp.agenda.text
    end
    d.save
    self.agenda=d
  end
end
create_announcement(user) click to toggle source
# File app/models/meeting.rb, line 38
def create_announcement(user)
  if self.neuigkeit.nil?
  n = Neuigkeit.new
  
  n.title=self.text
  n.text ="Agenda im Anhang"
  n.rubrik = self.meetingtyp.rubrik
  n.author=user
    n.datum=Date.today
  n.save    
  self.neuigkeit= n
  end
end
create_calentry() click to toggle source
# File app/models/meeting.rb, line 77
def create_calentry
 if  self.calentry.nil?
   ce =Calentry.new
   ce.typ=2
   self.calentry=ce
 end
end
create_protocol() click to toggle source
# File app/models/meeting.rb, line 64
def create_protocol
 if self.protocol.nil?
   d=Document.new
   d.typ=10
   d.name="Protokoll"
   unless self.meetingtyp.protocol.nil?
     d.text=self.meetingtyp.protocol.text
   end
   d.save
   self.protocol=d
 end

end
divid() click to toggle source
# File app/models/meeting.rb, line 109
def divid
  "meeting_"+self.id.to_s
end
fix_calentry() click to toggle source
# File app/models/meeting.rb, line 57
def fix_calentry
  self.calentry.object=self unless self.calentry.nil?
  self.calentry.calendar = self.meetingtyp.rubrik.calendar 
end
protocol_text() click to toggle source
# File app/models/meeting.rb, line 128
  def protocol_text
 unless self.protocol.nil?
      t=  self.protocol.text 
      else
       t= ""
      end
    t  
end
public?() click to toggle source
# File app/models/meeting.rb, line 61
def public? 
  ! (self.intern)
end
text() click to toggle source
# File app/models/meeting.rb, line 26
 def text
   unless self.meetingtyp.try(:name).to_s.empty?  
     t =  self.meetingtyp.name.to_s+", "
   else
     t=""
     t = parent.title.to_s + ", " if self.name.empty?
   end 
   t= t+ self.name.to_s
#    t = t + " " + I18n.l(self.calentry.start) unless self.calentry.nil?
   t = t +" "+ I18n.t("date.am")+" "+ self.calentry.text unless self.calentry.nil?
   t
 end
title() click to toggle source
# File app/models/meeting.rb, line 22
def title
  self.text
end
update_announcement() click to toggle source
# File app/models/meeting.rb, line 51
def update_announcement
    n=self.neuigkeit
    n.title=self.text
    n.save
  
end
update_time_from_protocol() click to toggle source
# File app/models/meeting.rb, line 113
def update_time_from_protocol
  st= /Beginn[\s:]*([^<>]*)/.match(self.protocol.text)[1].to_s
  st= /Anfang[\s:]*([^<>]*)/.match(self.protocol.text)[1].to_s if st.empty?
  self.calentry.start=(self.calentry.start.to_date.to_s + " " +st).to_datetime unless st.empty?
  st= /Ende[\s:]*([^<>]*)/.match(self.protocol.text)[1].to_s 
 self.calentry.ende=(self.calentry.ende.to_date.to_s + " " +st).to_datetime unless st.empty?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.