lecturer load lva load first steps
This commit is contained in:
@@ -16,4 +16,16 @@ class Lecturer < ActiveRecord::Base
|
||||
has_and_belongs_to_many :lvas
|
||||
mount_uploader :picture, PictureUploader
|
||||
resourcify
|
||||
|
||||
def load_tissdata
|
||||
url= "https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/"+self.oid.to_s+".xml"
|
||||
hash=Hash.from_xml(open(url).read)["tuvienna"]
|
||||
self.name=hash["person"]["firstname"]+" "+hash["person"]["lastname"]
|
||||
if hash["person"]["employee"]["employment"].is_a? Array
|
||||
self.email= hash["person"]["employee"]["employment"].first["emails"]["email"].first
|
||||
else
|
||||
self.email= hash["person"]["employee"]["employment"]["emails"]["email"].first
|
||||
end
|
||||
self.link= "https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/"+self.oid.to_s
|
||||
end
|
||||
end
|
||||
|
||||
@@ -87,7 +87,7 @@ class Lva < ActiveRecord::Base
|
||||
# rescue OpenURI::HTTPError => e
|
||||
# end
|
||||
self.name=hash["course"]["title"][I18n.locale.to_s]
|
||||
self.pruefungsinformation= hash["course"]["examinationModalities"][I18n.locale.to_s]
|
||||
self.pruefungsinformation = hash["course"]["examinationModalities"][I18n.locale.to_s]
|
||||
self.desc= hash["course"]["objective"][I18n.locale.to_s]+hash["course"]["teachingContent"][I18n.locale.to_s]
|
||||
self.typ=hash["course"]["courseType"]
|
||||
self.stunden=hash["course"]["weeklyHours"]
|
||||
|
||||
Reference in New Issue
Block a user