From af021019ded080dcba92cd1e324af32805aa6fc7 Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Tue, 26 Nov 2013 15:26:09 +0000 Subject: [PATCH] =?UTF-8?q?Studienordnung:=20LVs=20mit=20Studienplan=20ver?= =?UTF-8?q?kn=C3=BCpfen;=20speichern=20der=20verkn=C3=BCpften=20LVs=20in?= =?UTF-8?q?=20DB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/lehrveranstaltung.class.php | 4 +- include/studienplan.class.php | 2 +- vilesci/lehre/studienordnung.js | 72 +++++++++++++++++++---------- 3 files changed, 50 insertions(+), 28 deletions(-) diff --git a/include/lehrveranstaltung.class.php b/include/lehrveranstaltung.class.php index 731547b96..7c51fa2e5 100644 --- a/include/lehrveranstaltung.class.php +++ b/include/lehrveranstaltung.class.php @@ -919,8 +919,6 @@ class lehrveranstaltung extends basis_db $qry.=" AND tbl_studienplan_lehrveranstaltung.semester=" . $this->db_add_param($semester, FHC_INTEGER); } $qry.=" ORDER BY semester, sort"; -// echo $qry; -// var_dump($qry); $this->lehrveranstaltungen = array(); if ($result = $this->db_query($qry)) { while ($row = $this->db_fetch_object($result)) { @@ -971,7 +969,6 @@ class lehrveranstaltung extends basis_db $this->lehrveranstaltungen[] = $obj; } -// var_dump($this->lehrveranstaltungen); return true; } else { @@ -1097,6 +1094,7 @@ class lehrveranstaltung extends basis_db $data->attr = array(); $data->attr["id"]=$lv->lehrveranstaltung_id; $data->attr["rel"] = $lv->lehrtyp_kurzbz; + $data->attr["studienplan_lehrveranstaltung_id"] = $lv->studienplan_lehrveranstaltung_id; $values[] = $data; } } diff --git a/include/studienplan.class.php b/include/studienplan.class.php index 1f9bc5baa..a616d9470 100644 --- a/include/studienplan.class.php +++ b/include/studienplan.class.php @@ -556,7 +556,7 @@ class studienplan extends basis_db ' updateamum= now(), ' . ' updatevon=' . $this->db_add_param($this->updatevon) . ' ' . ' WHERE studienplan_lehrveranstaltung_id=' . $this->db_add_param($this->studienplan_lehrveranstaltung_id, FHC_INTEGER, false) . ';'; - } + } if ($this->db_query($qry)) { if ($this->new) { diff --git a/vilesci/lehre/studienordnung.js b/vilesci/lehre/studienordnung.js index a692cbeb4..1409d9878 100644 --- a/vilesci/lehre/studienordnung.js +++ b/vilesci/lehre/studienordnung.js @@ -45,7 +45,7 @@ function drawHeader(text) if(studienordnung_bezeichnung!='') text=text+' > '+studienordnung_bezeichnung; if(studienplan_bezeichnung!='') - text=text+' > '+studienplan_bezeichnung + " Beispieldaten"; + text=text+' > '+studienplan_bezeichnung; text=text+''; @@ -274,7 +274,7 @@ function loadLehrveranstaltungSTPL(studienplan_id, bezeichnung) "action": function(obj){ if(obj.children().find("li").length === 0) { - var conf = confirm("Wollen Sie das \""+this.get_text(obj)+"\" wirklich löschen?"); + var conf = confirm("Wollen Sie \""+this.get_text(obj)+"\" wirklich aus diesem Studienplan löschen?"); if(conf) { this.remove(obj); @@ -283,7 +283,7 @@ function loadLehrveranstaltungSTPL(studienplan_id, bezeichnung) } else { - alert("Element darf keine Elemente beinhalten!"); + alert("Da zu löschende Element darf keine Elemente beinhalten!"); } } } @@ -311,6 +311,7 @@ function loadLehrveranstaltungSTPL(studienplan_id, bezeichnung) { var root = data.inst.get_container_ul(); var nodes = root[0].childNodes; +// console.log(nodes); for(var i=0; i 2) - { - lvParent = node; - } - +// var lvParent = ""; +// if(node.length > 2) +// { +// lvParent = node; +// } +// console.log(node.parent().parent()); savedata = { "studienplan_id": studienplan_id, "lehrveranstaltung_id" : jsonData[0]["metadata"]["lehrveranstaltung_id"], - "stpllv_semester": node.closest("li[rel=semester]").attr("id"), + "semester": node.closest("li[rel=semester]").attr("id"), "studienplan_lehrveranstaltung_id_parent": node.parent().parent().attr("studienplan_lehrveranstaltung_id"), //TODO parent richtig auslesen - "stpllv_pflicht": true + "pflicht": true }; $.ajax( @@ -908,16 +915,33 @@ function StudienplanSaved(data) function writeEctsSum(parent) { - var cells = $(parent).find(".jstree-grid-col-1"); - var sum = 0; - for(var i=1; i 0) { - sum+=parseFloat(cells[i].childNodes[0].innerHTML); - } + writeEctsSum($(parent).children("ul").children()[i]); + } + } +// console.log($(parent).attr("rel")); + if($(parent).attr("rel") !== "lv") + { + var cells = $(parent).find(".jstree-grid-col-1"); + // console.log(cells); + var sum = 0; + for(var j=1; j"; + // console.log(cells[0].childNodes[0]); } - cells[0].childNodes[0].innerHTML = ""+sum+""; } function writeOverallSum(root)