Kleinigkeiten, formatierung, bugfix

This commit is contained in:
Thomas Blazek
2013-07-25 16:59:28 +02:00
parent 0e4574603d
commit 0620185a8b
3 changed files with 22 additions and 21 deletions

View File

@@ -9,7 +9,7 @@ class LvasController < ApplicationController
# GET /lvas/1 # GET /lvas/1
def show def show
@lva = Lva.find(params[:id]) @lva = Lva.find_by_id(params[:id])
@toolbar_elements<<{:icon=>:pencil,:text =>I18n.t('common.edit'),:path => edit_lva_path(@lva)} @toolbar_elements<<{:icon=>:pencil,:text =>I18n.t('common.edit'),:path => edit_lva_path(@lva)}
end end

View File

@@ -3,14 +3,15 @@ class ModulsController < ApplicationController
# GET /moduls.json # GET /moduls.json
def index def index
@moduls = Modul.all @moduls = Modul.all
if !params[:studium_id].nil? if @moduls
@studium=Studium.find(params[:studium_id]) if !params[:studium_id].nil?
end @studium=Studium.find_by_id(params[:studium_id])
respond_to do |format| end
format.html # index.html.erb respond_to do |format|
format.json { render json: @moduls } format.html # index.html.erb
format.json { render json: @moduls }
end
end end
end end
# GET /moduls/1 # GET /moduls/1

View File

@@ -40,19 +40,19 @@ private
## ##
# Lade Daten aus TISS und füge diese in die Datenbank ein. # Lade Daten aus TISS und füge diese in die Datenbank ein.
def load_tissdata def load_tissdata
url= "https://tiss.tuwien.ac.at/api/course/"+ self.lvanr.to_s+"-2012W" url= "https://tiss.tuwien.ac.at/api/course/"+ self.lvanr.to_s+"-2012W"
begin begin
@hash=Hash.from_xml(open(url).read)["tuvienna"] @hash=Hash.from_xml(open(url).read)["tuvienna"]
@person=[] @person=[]
if @hash["course"]["lecturers"]["oid"].is_a? String if @hash["course"]["lecturers"]["oid"].is_a? String
@person = @hash["course"]["lecturers"]["oid"] @person = @hash["course"]["lecturers"]["oid"]
else else
@hash["course"]["lecturers"]["oid"].each do |pid| @hash["course"]["lecturers"]["oid"].each do |pid|
@person << Hash.from_xml(open("https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/" + pid.to_s + ".xml").read)["tuvienna"]["person"] @person << Hash.from_xml(open("https://tiss.tuwien.ac.at/adressbuch/adressbuch/person_via_oid/" + pid.to_s + ".xml").read)["tuvienna"]["person"]
end end
end end
rescue OpenURI::HTTPError => e rescue OpenURI::HTTPError => e
end end
end end