mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-08 23:59:28 +00:00
Verknüpfen von LVs mit einem Studienplan
This commit is contained in:
Executable
+74
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/* Copyright (C) 2006 Technikum-Wien
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Stefan Puraner <puraner@technikum-wien.at>
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__) . '/basis_db.class.php');
|
||||
require_once(dirname(__FILE__) . '/functions.inc.php');
|
||||
|
||||
class lehrtyp extends basis_db {
|
||||
|
||||
public $result = array();
|
||||
public $lehrtyp_kurzbz;
|
||||
public $bezeichnung;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Holt alle Lehrtypen aus der table tbl_lehrtyp
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function getAll(){
|
||||
$qry = "SELECT * FROM lehre.tbl_lehrtyp;";
|
||||
if (!$this->db_query($qry)) {
|
||||
$this->errormsg = 'Datensatz konnte nicht geladen werden';
|
||||
return false;
|
||||
}
|
||||
|
||||
while ($row = $this->db_fetch_object()) {
|
||||
$lehrtyp = new lehrtyp();
|
||||
$lehrtyp->lehrtyp_kurzbz = $row->lehrtyp_kurzbz;
|
||||
$lehrtyp->bezeichnung = $row->bezeichnung;
|
||||
$this->result[] = $lehrtyp;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function cleanResult()
|
||||
{
|
||||
$data = array();
|
||||
if(count($this->result)>0)
|
||||
{
|
||||
foreach ($this->result as $lt)
|
||||
{
|
||||
$obj = new stdClass();
|
||||
$obj->lehrtyp_kurzbz = $lt->lehrtyp_kurzbz;
|
||||
$obj->bezeichnung = $lt->bezeichnung;
|
||||
$data[] = $obj;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
+628
-664
File diff suppressed because it is too large
Load Diff
@@ -461,5 +461,31 @@ class organisationseinheit extends basis_db
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function cleanResult(){
|
||||
$data = array();
|
||||
if(count($this->result)>0){
|
||||
foreach($this->result as $oeEinheit){
|
||||
$obj = new stdClass();
|
||||
$obj->oe_kurzbz = $oeEinheit->oe_kurzbz;
|
||||
$obj->oe_parent_kurzbz = $oeEinheit->oe_parent_kurzbz;
|
||||
$obj->bezeichnung = $oeEinheit->bezeichnung;
|
||||
$obj->organisationseinheittyp_kurzbz = $oeEinheit->organisationseinheittyp_kurzbz;
|
||||
$obj->aktiv = $oeEinheit->aktiv;
|
||||
$obj->mailverteiler = $oeEinheit->mailverteiler;
|
||||
$data[]=$obj;
|
||||
}
|
||||
} else {
|
||||
$obj = new stdClass();
|
||||
$obj->oe_kurzbz = $this->oe_kurzbz;
|
||||
$obj->oe_parent_kurzbz = $this->oe_parent_kurzbz;
|
||||
$obj->bezeichnung = $this->bezeichnung;
|
||||
$obj->organisationseinheittyp_kurzbz = $this->organisationseinheittyp_kurzbz;
|
||||
$obj->aktiv = $this->aktiv;
|
||||
$obj->mailverteiler = $this->mailverteiler;
|
||||
$data[]=$obj;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -568,6 +568,25 @@ class studiengang extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Array mit allen Semestern des Studienganges
|
||||
*/
|
||||
public function getSemesterFromStudiengang($studiengang_kz)
|
||||
{
|
||||
$qry = "SELECT DISTINCT semester from lehre.tbl_lehrveranstaltung where studiengang_kz=".$this->db_add_param($studiengang_kz, FHC_INTEGER)." order by semester asc;";
|
||||
if(!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Datensatz konnte nicht geladen werden';
|
||||
return false;
|
||||
}
|
||||
$result = array();
|
||||
while ($row = $this->db_fetch_object()) {
|
||||
$result[]= $row->semester;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getStudiengangTyp($typ)
|
||||
{
|
||||
@@ -591,4 +610,4 @@ class studiengang extends basis_db
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -45,6 +45,16 @@ class studienplan extends basis_db
|
||||
protected $updatevon; // varchar
|
||||
protected $insertamum; // timestamp
|
||||
protected $insertvon; // varchar
|
||||
|
||||
//Tabellenspalten für Zwischentabelle tbl_studienplan_lehrveranstaltung
|
||||
protected $studienplan_lehrveranstaltung_id; //integer
|
||||
protected $lehrveranstaltung_id; //integer
|
||||
protected $semester; //smallint
|
||||
protected $studienplan_lehrveranstaltung_id_parent; //integer
|
||||
protected $pflicht; //boolean
|
||||
protected $koordinator; //varchar(32)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
@@ -369,6 +379,12 @@ class studienplan extends basis_db
|
||||
$obj->updatevon = $row->updatevon;
|
||||
$obj->insertamum = $row->insertamum;
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->studienplan_lehrveranstaltung_id = $row->studienplan_lehrveranstaltung_id;
|
||||
$obj->lehrveranstaltung_id = $row->lehrveranstaltung_id;
|
||||
$obj->semester = $row->semester;
|
||||
$obj->studienplan_lehrveranstaltung_id_parent = $row->studienplan_lehrveranstaltung_id_parent;
|
||||
$obj->pflicht = $row->pflicht;
|
||||
$obj->koordinator = $row->koordinator;
|
||||
$data[]=$obj;
|
||||
}
|
||||
}
|
||||
@@ -389,9 +405,179 @@ class studienplan extends basis_db
|
||||
$obj->updatevon = $this->updatevon;
|
||||
$obj->insertamum = $this->insertamum;
|
||||
$obj->insertvon = $this->insertvon;
|
||||
$obj->studienplan_lehrveranstaltung_id = $this->studienplan_lehrveranstaltung_id;
|
||||
$obj->lehrveranstaltung_id = $this->lehrveranstaltung_id;
|
||||
$obj->semester = $this->semester;
|
||||
$obj->studienplan_lehrveranstaltung_id_parent = $this->studienplan_lehrveranstaltung_id_parent;
|
||||
$obj->pflicht = $this->pflicht;
|
||||
$obj->koordinator = $this->koordinator;
|
||||
$data[]=$obj;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prüft ob eine Lehrveranstaltung im Studienplan enthalten ist
|
||||
* @return true wenn ja, sonst false
|
||||
*/
|
||||
public function containsLehrveranstaltung($studienplan_id, $lehrveranstaltung_id)
|
||||
{
|
||||
if (!is_numeric($studienplan_id) || $studienplan_id === '')
|
||||
{
|
||||
$this->errormsg = 'StudienplanID ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
if (!is_numeric($lehrveranstaltung_id) || $lehrveranstaltung_id === '')
|
||||
{
|
||||
$this->errormsg = 'LehrveranstaltungID ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry = "SELECT
|
||||
studienplan_lehrveranstaltung_id,
|
||||
semester as stpllv_semester,
|
||||
pflicht as stpllv_pflicht,
|
||||
koordinator as stpllv_koordinator,
|
||||
studienplan_lehrveranstaltung_id_parent
|
||||
FROM
|
||||
lehre.tbl_studienplan_lehrveranstaltung
|
||||
WHERE
|
||||
studienplan_id=" . $this->db_add_param($studienplan_id, FHC_INTEGER).
|
||||
" AND lehrveranstaltung_id=".$this->db_add_param($lehrveranstaltung_id, FHC_INTEGER).";";
|
||||
|
||||
if (!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Datensatz konnte nicht geladen werden';
|
||||
return false;
|
||||
}
|
||||
if($this->db_num_rows()!=0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lädt eine Lehrveranstaltung eines Studienplans aus der
|
||||
* Zwischentabelle tbl_studienplan_lehrveranstaltung
|
||||
* @param Studienplan ID
|
||||
* @param Lehrveranstaltung ID
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function loadLehrveranstaltungStudienplanByLvId($studienplan_id, $lehrveranstaltung_id){
|
||||
if($this->containsLehrveranstaltung($studienplan_id, $lehrveranstaltung_id))
|
||||
{
|
||||
if (!is_numeric($studienplan_id) || $studienplan_id === '') {
|
||||
$this->errormsg = 'StudienplanID ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
if (!is_numeric($lehrveranstaltung_id) || $lehrveranstaltung_id === '') {
|
||||
$this->errormsg = 'LehrveranstaltungID ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry = "SELECT
|
||||
tbl_lehrveranstaltung.*,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_id,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id,
|
||||
tbl_studienplan_lehrveranstaltung.semester as stpllv_semester,
|
||||
tbl_studienplan_lehrveranstaltung.pflicht as stpllv_pflicht,
|
||||
tbl_studienplan_lehrveranstaltung.koordinator as stpllv_koordinator,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id_parent
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung
|
||||
JOIN lehre.tbl_studienplan_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_id=" . $this->db_add_param($studienplan_id, FHC_INTEGER).
|
||||
" AND tbl_lehrveranstaltung.lehrveranstaltung_id=".$this->db_add_param($lehrveranstaltung_id, FHC_INTEGER).";";
|
||||
|
||||
if (!$this->db_query($qry)) {
|
||||
$this->errormsg = 'Datensatz konnte nicht geladen werden';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($row = $this->db_fetch_object()) {
|
||||
$this->studienplan_id = $row->studienplan_id;
|
||||
$this->stpllv_semester = $row->stpllv_semester;
|
||||
$this->stpllv_pflicht = $this->db_parse_bool($row->stpllv_pflicht);
|
||||
$this->stpllv_koordinator = $row->stpllv_koordinator;
|
||||
$this->studienplan_lehrveranstaltung_id = $row->studienplan_lehrveranstaltung_id;
|
||||
$this->studienplan_lehrveranstaltung_id_parent = $row->studienplan_lehrveranstaltung_id_parent;
|
||||
$this->new = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichert die Zuordnung einer Lehrveranstaltung zu einem Studienplan
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function saveStudienplanLehrveranstaltung() {
|
||||
|
||||
if ($this->new) {
|
||||
//Neuen Datensatz einfuegen
|
||||
$qry = 'BEGIN;INSERT INTO lehre.tbl_studienplan_lehrveranstaltung (studienplan_id, lehrveranstaltung_id,
|
||||
semester,studienplan_lehrveranstaltung_id_parent,pflicht, koordinator,
|
||||
insertamum, insertvon) VALUES (' .
|
||||
$this->db_add_param($this->studienplan_id, FHC_INTEGER) . ', ' .
|
||||
$this->db_add_param($this->lehrveranstaltung_id, FHC_INTEGER) . ', ' .
|
||||
$this->db_add_param($this->stpllv_semester, FHC_INTEGER) . ', ' .
|
||||
$this->db_add_param($this->studienplan_lehrveranstaltung_id_parent, FHC_INTEGER) . ', ' .
|
||||
$this->db_add_param($this->stpllv_pflicht, FHC_BOOLEAN) . ', ' .
|
||||
$this->db_add_param($this->stpllv_koordinator) . ', ' .
|
||||
'now(), ' .
|
||||
$this->db_add_param($this->insertvon) . ');';
|
||||
} else {
|
||||
//Pruefen ob studienplan_id eine gueltige Zahl ist
|
||||
if (!is_numeric($this->studienplan_lehrveranstaltung_id)) {
|
||||
$this->errormsg = 'studienplan_lehrveranstaltung_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
$qry = 'UPDATE lehre.tbl_studienplan_lehrveranstaltung SET' .
|
||||
' studienplan_id=' . $this->db_add_param($this->studienplan_id, FHC_INTEGER) . ', ' .
|
||||
' lehrveranstaltung_id=' . $this->db_add_param($this->lehrveranstaltung_id, FHC_INTEGER) . ', ' .
|
||||
' semester=' . $this->db_add_param($this->stpllv_semester, FHC_INTEGER) . ', ' .
|
||||
' studienplan_lehrveranstaltung_id_parent=' . $this->db_add_param($this->studienplan_lehrveranstaltung_id_parent, FHC_INTEGER) . ', ' .
|
||||
' pflicht=' . $this->db_add_param($this->stpllv_pflicht, FHC_BOOLEAN) . ', ' .
|
||||
//TODO sprache in Tabelle nicht vorhanden' sprache=' . $this->db_add_param($this->sprache) . ', ' .
|
||||
' koordinator=' . $this->db_add_param($this->stpllv_koordinator) . ', ' .
|
||||
' 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) {
|
||||
//naechste ID aus der Sequence holen
|
||||
$qry = "SELECT currval('lehre.seq_studienplan_studienplan_lehrveranstaltung_id') as id;";
|
||||
if ($this->db_query($qry)) {
|
||||
if ($row = $this->db_fetch_object()) {
|
||||
$this->studienplan_lehrveranstaltung_id = $row->id;
|
||||
$this->db_query('COMMIT');
|
||||
} else {
|
||||
$this->db_query('ROLLBACK');
|
||||
$this->errormsg = "Fehler beim Auslesen der Sequence";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$this->db_query('ROLLBACK');
|
||||
$this->errormsg = 'Fehler beim Auslesen der Sequence';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->errormsg = 'Fehler beim Speichern des Datensatzes';
|
||||
return false;
|
||||
}
|
||||
return $this->studienplan_lehrveranstaltung_id;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
+13
-2
@@ -39,7 +39,16 @@ $parameter=array();
|
||||
for($i=0;$i<100;$i++)
|
||||
{
|
||||
if(isset($_REQUEST['parameter_'.$i]))
|
||||
$parameter[]=$_REQUEST['parameter_'.$i];
|
||||
{
|
||||
if($_REQUEST['parameter_'.$i]=="true")
|
||||
$parameter[]=true;
|
||||
elseif($_REQUEST['parameter_'.$i]=="false")
|
||||
$parameter[]=false;
|
||||
elseif($_REQUEST['parameter_'.$i]=="null")
|
||||
$parameter[]=null;
|
||||
else
|
||||
$parameter[]=$_REQUEST['parameter_'.$i];
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
@@ -69,6 +78,7 @@ if(mb_stristr($method,'save'))
|
||||
|
||||
if(isset($loaddata['method']))
|
||||
{
|
||||
var_dump($loaddata);
|
||||
if(!$wsrecht->isUserAuthorized($uid, $loaddata['method']))
|
||||
die('keine Berechtigung');
|
||||
|
||||
@@ -97,6 +107,7 @@ if(mb_stristr($method,'save'))
|
||||
|
||||
if(!$error)
|
||||
{
|
||||
var_dump($savedata);
|
||||
// Attribute zuweisen zum Speichern
|
||||
foreach($savedata as $key=>$value)
|
||||
{
|
||||
@@ -106,7 +117,7 @@ if(mb_stristr($method,'save'))
|
||||
}
|
||||
|
||||
if(!$error && call_user_func_array(array($obj, $method), $parameter))
|
||||
{
|
||||
{
|
||||
$data['result']=$obj->cleanResult();
|
||||
$data['error']='false';
|
||||
$data['errormsg']='';
|
||||
|
||||
@@ -54,6 +54,36 @@ switch($method)
|
||||
$data['errormsg']=$lehrveranstaltung->errormsg;
|
||||
}
|
||||
break;
|
||||
case 'getSemesterFromStudiengang':
|
||||
$studiengang_kz = $_REQUEST['studiengang_kz'];
|
||||
$lehrveranstaltung = new lehrveranstaltung();
|
||||
if(($result = $lehrveranstaltung->getSemesterFromStudiengang($studiengang_kz)))
|
||||
{
|
||||
$data["result"]=$result;
|
||||
$data['error']='false';
|
||||
$data['errormsg']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['error']='true';
|
||||
$data['errormsg']=$lehrveranstaltung->errormsg;
|
||||
}
|
||||
break;
|
||||
case 'getLvTree':
|
||||
$studienplan_id = $_REQUEST['studienplan_id'];
|
||||
$lehrveranstaltung = new lehrveranstaltung();
|
||||
if(($result = $lehrveranstaltung->getLvTree($studienplan_id)))
|
||||
{
|
||||
$data["result"]=$result;
|
||||
$data['error']='false';
|
||||
$data['errormsg']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['error']='true';
|
||||
$data['errormsg']=$lehrveranstaltung->errormsg;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,21 @@ switch($method)
|
||||
$data['errormsg']=$studienplan->errormsg;
|
||||
}
|
||||
break;
|
||||
case 'getSemesterFromStudiengang':
|
||||
$studiengang_kz = $_REQUEST['studiengang_kz'];
|
||||
$studiengang = new studiengang();
|
||||
if(($result = $studiengang->getSemesterFromStudiengang($studiengang_kz)))
|
||||
{
|
||||
$data["result"]=$result;
|
||||
$data['error']='false';
|
||||
$data['errormsg']='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['error']='true';
|
||||
$data['errormsg']=$studiengang->errormsg;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+449
-18
@@ -43,7 +43,7 @@ function drawHeader(text)
|
||||
if(studienordnung_bezeichnung!='')
|
||||
text=text+' <b>></b> '+studienordnung_bezeichnung;
|
||||
if(studienplan_bezeichnung!='')
|
||||
text=text+' <b>></b> '+studienplan_bezeichnung;
|
||||
text=text+' <b>></b> '+studienplan_bezeichnung + " Beispieldaten";
|
||||
|
||||
|
||||
text=text+'</h2>';
|
||||
@@ -86,7 +86,7 @@ function StudienordnungLoaded(data)
|
||||
else
|
||||
{
|
||||
drawStudienordnungen(data.result);
|
||||
$( "#menueLinks" ).accordion("option","active",1);
|
||||
jqUi( "#menueLinks" ).accordion("option","active",1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ function StudienplanSTOLoaded(data)
|
||||
else
|
||||
{
|
||||
drawStudienplan(data.result);
|
||||
$( "#menueLinks" ).accordion("option","active",2);
|
||||
jqUi( "#menueLinks" ).accordion("option","active",2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,14 +157,195 @@ function loadLehrveranstaltungSTPL(studienplan_id, bezeichnung)
|
||||
dataType: "json",
|
||||
url: "../../soap/lehrveranstaltung.json.php",
|
||||
data: {
|
||||
"method": "loadLehrveranstaltungStudienplan",
|
||||
"typ": "json",
|
||||
"class": "lehrveranstaltung",
|
||||
"method": "getLvTree",
|
||||
// "parameter_0": 100, //for debugging
|
||||
"studienplan_id": studienplan_id
|
||||
},
|
||||
success: LehrveranstaltungSTPLLoaded,
|
||||
error: loadError
|
||||
});
|
||||
}).success(function(data)
|
||||
{
|
||||
if(data.result[0].lehrveranstaltung_id !== null)
|
||||
{
|
||||
$("#data").jstree({
|
||||
ui: {
|
||||
"select_limit": -1,
|
||||
"select_multiple_modifier": "ctrl"
|
||||
},
|
||||
json_data: {
|
||||
data: data.result
|
||||
},
|
||||
crrm: {
|
||||
move: {
|
||||
"always_copy": "multitree",
|
||||
"check_move": function(m) {
|
||||
//alert(m.o[0].id);
|
||||
// alert($("#data").jstree._get_parent(m.o));
|
||||
// if(jQuery.jstree._reference("#data")._get_children(m.np).find("li[id="+m.o[0].id+"]"))
|
||||
// {
|
||||
// //alert(jQuery.jstree._reference("#data")._get_children(m.np).find("li[id="+m.o[0].id+"]"));
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// return (m.ot === m.rt) || !m.rt.get_container().find("li[id="+m.o[0].id+"]").length;
|
||||
//console.log(m.rt._get_children(m.np).find("li[id="+m.o[0].id+"]").length+" "+m.np[0].id);
|
||||
//console.log(m.np.children().find("li[id="+m.o[0].id+"]").length);
|
||||
if(m.np.children().find("li[id="+m.o[0].id+"]").length !== 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
dnd: {
|
||||
"drag_check": function(data){
|
||||
return {
|
||||
after: true,
|
||||
before: true,
|
||||
inside: true
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
columns: [
|
||||
{width: 300, header: "Lehrveranstaltung", value: "bezeichnung", source: "metadata"},
|
||||
{width: 50, header: "ECTS", value: "ects", source: "metadata"},
|
||||
{width: 120, header: "Semesterstunden", value: "semesterstunden", source: "metadata"}
|
||||
],
|
||||
resizable: true
|
||||
},
|
||||
types: {
|
||||
"types" : {
|
||||
"valid_children" : ["semester", "lv"],
|
||||
"lv" : {
|
||||
icon : {
|
||||
//image : "test.jpg"
|
||||
},
|
||||
max_children: 0
|
||||
},
|
||||
"semester" : {
|
||||
"valid_children" : ["lv"]
|
||||
},
|
||||
"default" : {
|
||||
"valid_children" : [ "default" ]
|
||||
}
|
||||
}
|
||||
},
|
||||
sort : function(a, b){
|
||||
return this._get_node(a).attr("rel") > this._get_node(b).attr("rel");
|
||||
},
|
||||
plugins: ["themes", "ui", "dnd", "grid", "json_data", "crrm", "types", "sort"]
|
||||
}).bind("move_node.jstree", function(event, data)
|
||||
{
|
||||
saveJsondataFromTree("copy_"+data.rslt.o[0].id, studienplan_id);
|
||||
var root = data.inst.get_container_ul();
|
||||
var nodes = root[0].childNodes;
|
||||
for(var i=0; i<nodes.length; i++)
|
||||
{
|
||||
if(nodes[i].getAttribute("rel") !== "lv"){
|
||||
writeEctsSum(nodes[i]);
|
||||
}
|
||||
|
||||
}
|
||||
hideAllTreeColumns();
|
||||
}).bind("loaded.jstree", function(event, data)
|
||||
{
|
||||
var root = data.inst.get_container_ul();
|
||||
var nodes = root[0].childNodes;
|
||||
for(var i=0; i<nodes.length; i++)
|
||||
{
|
||||
if(nodes[i].getAttribute("rel") !== "lv"){
|
||||
writeEctsSum(nodes[i]);
|
||||
}
|
||||
|
||||
}
|
||||
}).bind("open_node.jstree", function(event, data)
|
||||
{
|
||||
var root = data.inst.get_container_ul();
|
||||
var nodes = root[0].childNodes;
|
||||
for(var i=0; i<nodes.length; i++)
|
||||
{
|
||||
if(nodes[i].getAttribute("rel") !== "lv"){
|
||||
writeEctsSum(nodes[i]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#data').addClass("jstree-drop");
|
||||
$('#data').css("border", "1px solid black");
|
||||
|
||||
$('#data').jstree({
|
||||
"json_data": {
|
||||
"data" : [ ]
|
||||
},
|
||||
crrm: {
|
||||
move: {
|
||||
"always_copy": "multitree"
|
||||
}
|
||||
},
|
||||
dnd: {
|
||||
"drag_check": function(data){
|
||||
return {
|
||||
after: true,
|
||||
before: true,
|
||||
inside: true
|
||||
};
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
columns: [
|
||||
{width: 300, header: "Lehrveranstaltung", value: "bezeichnung", source: "metadata"},
|
||||
{width: 80, header: "Semester", value: "semester", source: "metadata"},
|
||||
{width: 50, header: "ECTS", value: "ects", source: "metadata"},
|
||||
{width: 120, header: "Semesterstunden", value: "semesterstunden", source: "metadata"}
|
||||
],
|
||||
resizable: true
|
||||
},
|
||||
"plugins": ["themes", "json_data", "ui", "crrm", "dnd", "grid"]
|
||||
}).bind("move_node.jstree", function (e, data) {
|
||||
saveJsondataFromTree("copy_"+data.rslt.o[0].id, studienplan_id);
|
||||
writeEctsSum(data.rslt.np);
|
||||
hideAllTreeColumns();
|
||||
});
|
||||
}
|
||||
|
||||
$("#lehrveranstaltung").html("<h3>Organisationseinheit</h3><div id='oeDiv'></div>");
|
||||
$.ajax(
|
||||
{
|
||||
dataType: "json",
|
||||
url: "../../soap/fhcomplete.php",
|
||||
data: {
|
||||
"typ": "json",
|
||||
"class": "organisationseinheit",
|
||||
"method": "getAll",
|
||||
},
|
||||
error: loadError
|
||||
}).success(function(data)
|
||||
{
|
||||
var html = "<div><select id='oeDropdown' onchange='loadFilteredLehrveranstaltungen();'>";
|
||||
for(i in data.result)
|
||||
{
|
||||
if(data.result[i].aktiv===true)
|
||||
{
|
||||
html+="<option>"+data.result[i].bezeichnung+"</option>";
|
||||
}
|
||||
}
|
||||
html+="</select></div>";
|
||||
$("#oeDiv").html(html);
|
||||
loadLehrtypen();
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//LehrveranstaltungSTPLLoaded nicht in Verwendung
|
||||
function LehrveranstaltungSTPLLoaded(data)
|
||||
{
|
||||
if(data.error=='true')
|
||||
@@ -175,9 +356,33 @@ function LehrveranstaltungSTPLLoaded(data)
|
||||
{
|
||||
lehrveranstaltungen = data.result;
|
||||
drawLehrveranstaltung(data.result);
|
||||
$( "#menueRechts" ).accordion("option","active",0);
|
||||
jqUi( "#menueRechts" ).accordion("option","active",1);
|
||||
//drawLehrveranstaltungGrid();
|
||||
$("#lehrveranstaltung").html("<h2>Organisationseinheit</h2><h2>Lehrtyp</h2>");
|
||||
$("#lehrveranstaltung").html("<h3>Organisationseinheit</h3><div id='oeDiv'></div><h3>Lehrtyp</h3><div id='lehrtypenDiv'></div>");
|
||||
$.ajax(
|
||||
{
|
||||
dataType: "json",
|
||||
url: "../../soap/fhcomplete.php",
|
||||
data: {
|
||||
"typ": "json",
|
||||
"class": "organisationseinheit",
|
||||
"method": "getAll",
|
||||
},
|
||||
error: loadError
|
||||
}).success(function(data)
|
||||
{
|
||||
var html = "<select id='oeDropdown'>";
|
||||
for(i in data.result)
|
||||
{
|
||||
if(data.result[i].aktiv===true)
|
||||
{
|
||||
html+="<option>"+data.result[i].bezeichnung+"</option>";
|
||||
}
|
||||
|
||||
}
|
||||
html+="</select>";
|
||||
$("#oeDiv").html(html);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,6 +421,216 @@ function neuerStudienplan()
|
||||
$("#data").load('studienordnung.inc.php?method=neuerStudienplan&studiengang_kz='+studiengang_kz);
|
||||
}
|
||||
|
||||
/*
|
||||
* Funktion zum Laden des Baumes der
|
||||
* gefilterten LVs
|
||||
* */
|
||||
function loadFilteredLehrveranstaltungen()
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
dataType: "json",
|
||||
url: "../../soap/fhcomplete.php",
|
||||
data: {
|
||||
"typ": "json",
|
||||
"class": "lehrveranstaltung",
|
||||
"method": "load_lva",
|
||||
"parameter_0": studiengang_kz, //Studiengangskennzahl
|
||||
"parameter_1": $("#semesterDropdown").val(), //Semester
|
||||
"parameter_2": "null", //Lehrverzeichnis
|
||||
"parameter_3": true, //Lehre
|
||||
"parameter_4": true, //Aktiv
|
||||
"parameter_5": "bezeichnung", //Sortierung
|
||||
"parameter_6": $("#oeDropdown").val(), //Organisationseinheit KurzBz
|
||||
"parameter_7": $("#lehrtypDropdown").val() //Lehrtyp KurzBz
|
||||
},
|
||||
error: loadError
|
||||
}).success(function(data)
|
||||
{
|
||||
if(data.result[0].lehrveranstaltung_id!==null)
|
||||
{
|
||||
|
||||
if($("#lvListe").length === 0)
|
||||
{
|
||||
$("#filteredLVs").html("<h3>Lehrveranstaltungen</h3><div id='lvListe'></div>");
|
||||
}
|
||||
$("#lvListe").jstree({
|
||||
ui: {
|
||||
"select_limit": -1,
|
||||
"select_multiple_modifier": "ctrl"
|
||||
},
|
||||
json_data: {
|
||||
data: data.result
|
||||
},
|
||||
crrm: {
|
||||
move: {
|
||||
"check_move" : function(m)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
"always_copy": "multitree"
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
columns: [
|
||||
{width: 325, header: "Lehrveranstaltung", value: "bezeichnung", source: "metadata"},
|
||||
{width: 50, header: "ECTS", value: "ects", source: "metadata"},
|
||||
{width: 80, header: "Semester", value: "semester", source: "metadata"},
|
||||
{width: 120, header: "Semesterstunden", value: "semesterstunden", source: "metadata"}
|
||||
],
|
||||
resizable: true
|
||||
},
|
||||
plugins: ["themes", "ui", "dnd", "grid", "json_data", "crrm", "types"]
|
||||
}).bind("loaded.jstree", function(event, data)
|
||||
{
|
||||
hideAllTreeColumns();
|
||||
});
|
||||
} else {
|
||||
$("#filteredLVs .jstree-grid-wrapper").remove();
|
||||
if($("#lvListe").length !== 0)
|
||||
{
|
||||
$("#lvListe").remove();
|
||||
}
|
||||
$("h3:contains('Lehrveranstaltungen')").remove();
|
||||
$("#filteredLVs").append("<div id='lvListe'>Keine Einträge gefunden!</div>");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Funktion zum Laden der Daten für
|
||||
* das Dropdownfeld zum Filtern nach Lehrtyp
|
||||
*/
|
||||
function loadLehrtypen()
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
dataType: "json",
|
||||
url: "../../soap/fhcomplete.php",
|
||||
data: {
|
||||
"typ": "json",
|
||||
"class": "lehrtyp",
|
||||
"method": "getAll"
|
||||
},
|
||||
error: loadError
|
||||
}).success(function(data)
|
||||
{
|
||||
if($("#lehrtypenDiv").length === 0)
|
||||
{
|
||||
$("#lehrveranstaltung").append("<h3>Lehrtyp</h3><div id='lehrtypenDiv'></div>");
|
||||
}
|
||||
var html = "<select id='lehrtypDropdown' onchange='loadFilteredLehrveranstaltungen();'>";
|
||||
for(i in data.result)
|
||||
{
|
||||
html+="<option value='"+data.result[i].lehrtyp_kurzbz+"'>"+data.result[i].bezeichnung+"</option>";
|
||||
}
|
||||
html+="</select>";
|
||||
$("#lehrtypenDiv").html(html);
|
||||
loadSemester();
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Funktion zum Laden der Daten für
|
||||
* das Dropdownfeld zum Filtern nach Semester
|
||||
*/
|
||||
function loadSemester()
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
dataType: "json",
|
||||
url: "../../soap/studienplan.json.php",
|
||||
data: {
|
||||
"method": "getSemesterFromStudiengang",
|
||||
"studiengang_kz": studiengang_kz
|
||||
},
|
||||
error: loadError
|
||||
}).success(function(data)
|
||||
{
|
||||
if($("#semesterListe").length === 0)
|
||||
{
|
||||
$("#lehrveranstaltung").append("<h3>Semester</h3><div id='semesterListe'></div>");
|
||||
}
|
||||
var html = "<select id='semesterDropdown' onchange='loadFilteredLehrveranstaltungen();'>";
|
||||
html += "<option value='null'>Alle Semester</option>";
|
||||
for(i in data.result)
|
||||
{
|
||||
html+="<option value='"+data.result[i]+"'>"+data.result[i]+". Semester</option>";
|
||||
}
|
||||
html+="</select>";
|
||||
$("#semesterListe").html(html);
|
||||
loadFilteredLehrveranstaltungen();
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Funktion zum Verstecken der Spalten im Baum der
|
||||
* gefilterten LV-Liste
|
||||
*/
|
||||
function hideAllTreeColumns()
|
||||
{
|
||||
var headers = $("#filteredLVs .jstree-grid-header-cell");
|
||||
var separators = $("#filteredLVs .jstree-grid-separator");
|
||||
//separators[0].style.display = "none";
|
||||
for(var j=2; j<headers.length; j++)
|
||||
{
|
||||
headers[j].style.display = "none";
|
||||
separators[j].style.display = "none";
|
||||
var divs = $("#filteredLVs .jstree-grid-col-" + j);
|
||||
for (var i = 0; i < divs.length; i++)
|
||||
{
|
||||
divs[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function saveJsondataFromTree(data, studienplan_id)
|
||||
{
|
||||
var jsonData = $("#data").jstree("get_json", $("#"+data));
|
||||
var jsonString = JSON.stringify(jsonData);
|
||||
//alert(JSON.stringify(jsonString));
|
||||
loaddata = {
|
||||
"method" : "loadLehrveranstaltungStudienplanByLvId",
|
||||
"parameter_0" : studienplan_id,
|
||||
"parameter_1" : jsonData[0]["metadata"]["lehrveranstaltung_id"]
|
||||
};
|
||||
//alert(JSON.stringify(loaddata));
|
||||
|
||||
savedata = {
|
||||
"studienplan_id": studienplan_id,
|
||||
"lehrveranstaltung_id" : jsonData[0]["metadata"]["lehrveranstaltung_id"],
|
||||
"stpllv_semester": jsonData[0]["metadata"]["semester"],
|
||||
"studienplan_lehrveranstaltung_id_parent": "",
|
||||
"stpllv_pflicht": true
|
||||
};
|
||||
|
||||
// $.ajax(
|
||||
// {
|
||||
// dataType: "json",
|
||||
// url: "../../soap/fhcomplete.php",
|
||||
// type: "POST",
|
||||
// data: {
|
||||
// "typ": "json",
|
||||
// "class": "studienplan",
|
||||
// "method": "saveStudienplanLehrveranstaltung",
|
||||
// "loaddata": JSON.stringify(loaddata),
|
||||
// "savedata": JSON.stringify(savedata),
|
||||
// }
|
||||
// }).success(function(d)
|
||||
// {
|
||||
// alert(d);
|
||||
//// if(d.error !== "bereits vorhanden")
|
||||
//// {
|
||||
//// $("#jsonData").html(d);
|
||||
//// }
|
||||
//// else
|
||||
//// {
|
||||
//// alert("Lehrveranstaltung ist bereits im Studiengang enthalten!");
|
||||
//// $("#data").jstree("remove", $("#"+data));
|
||||
//// }
|
||||
// });
|
||||
}
|
||||
|
||||
function saveStudienordnung()
|
||||
{
|
||||
bezeichnung = $("#bezeichnung").val();
|
||||
@@ -240,16 +655,16 @@ function saveStudienordnung()
|
||||
loaddata={};
|
||||
|
||||
savedata = {
|
||||
"bezeichnung": bezeichnung,
|
||||
"version":version,
|
||||
"gueltigvon":gueltigvon,
|
||||
"gueltigbis":gueltigbis,
|
||||
"ects":ects,
|
||||
"studiengangbezeichnung":studiengangbezeichnung,
|
||||
"studiengangbezeichnungenglisch":studiengangbezeichnungenglisch,
|
||||
"studiengangkurzbzlang":studiengangkurzbzlang,
|
||||
"akadgrad_id":akadgrad_id,
|
||||
"studiengang_kz":studiengang_kz
|
||||
"bezeichnung": bezeichnung,
|
||||
"version":version,
|
||||
"gueltigvon":gueltigvon,
|
||||
"gueltigbis":gueltigbis,
|
||||
"ects":ects,
|
||||
"studiengangbezeichnung":studiengangbezeichnung,
|
||||
"studiengangbezeichnungenglisch":studiengangbezeichnungenglisch,
|
||||
"studiengangkurzbzlang":studiengangkurzbzlang,
|
||||
"akadgrad_id":akadgrad_id,
|
||||
"studiengang_kz":studiengang_kz
|
||||
};
|
||||
|
||||
|
||||
@@ -344,3 +759,19 @@ function StudienplanSaved(data)
|
||||
}
|
||||
}
|
||||
|
||||
function writeEctsSum(parent){
|
||||
//alert(parent);
|
||||
//console.log($("#data").jstree("get_children", parent));
|
||||
var cells = $(parent).find(".jstree-grid-col-1");
|
||||
var sum = 0;
|
||||
//console.log(cells);
|
||||
for(var i=1; i<cells.length; i++)
|
||||
{
|
||||
if(!isNaN(parseFloat(cells[i].childNodes[0].innerHTML)))
|
||||
{
|
||||
sum+=parseFloat(cells[i].childNodes[0].innerHTML);
|
||||
}
|
||||
//console.log(sum);
|
||||
}
|
||||
cells[0].childNodes[0].innerHTML = "<b>"+sum+"</b>";
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ require_once('../../include/studienplan.class.php');
|
||||
require_once('../../include/studiengang.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/lehrveranstaltung.class.php');
|
||||
|
||||
|
||||
$uid = get_uid();
|
||||
@@ -44,27 +45,54 @@ echo '<!DOCTYPE html>
|
||||
<link rel="stylesheet" href="../../skin/jquery-ui-1.9.2.custom.min.css" />
|
||||
<link rel="stylesheet" href="../../skin/fhcomplete.css" />
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" />
|
||||
<link rel="stylesheet" href="../../include/js/treeGrid/css/jquery.treegrid.css">
|
||||
|
||||
<script src="../../include/js/jquery1.9.min.js" type="text/javascript"></script>
|
||||
<script>var jqUi = jQuery.noConflict(true);</script>
|
||||
<script type="text/javascript" src="../../include/js/jstree/_lib/jquery.js"></script>
|
||||
<!-- Script zum erstellen des Trees-->
|
||||
<script type="text/javascript" src="../../include/js/jstree/jquery.jstree.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../include/js/treeGrid/jstreegrid.js"></script>
|
||||
|
||||
|
||||
<script src="studienordnung.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function()
|
||||
{
|
||||
$( "#menueLinks" ).accordion({
|
||||
heightStyle: "content",
|
||||
header: "h3",
|
||||
collapsible: true
|
||||
});
|
||||
$( "#menueRechts" ).accordion({
|
||||
jqUi( "#menueLinks" ).accordion({
|
||||
heightStyle: "content",
|
||||
header: "h3",
|
||||
collapsible: true
|
||||
});
|
||||
// jqUi( "#menueRechts" ).accordion({
|
||||
// heightStyle: "content",
|
||||
// header: "h2",
|
||||
// collapsible: true
|
||||
// });
|
||||
|
||||
';
|
||||
echo "
|
||||
jqUi('#menueRechts').addClass('ui-accordion ui-accordion-icons ui-widget ui-helper-reset')
|
||||
.find('h2')
|
||||
.addClass('ui-accordion-header ui-helper-reset ui-state-default ui-corner-top ui-corner-bottom')
|
||||
.hover(function() { $(this).toggleClass('ui-state-hover'); })
|
||||
.prepend('<span class=\"ui-icon ui-icon-triangle-1-e\"></span>')
|
||||
.click(function() {
|
||||
$(this)
|
||||
.toggleClass('ui-accordion-header-active ui-state-active ui-state-default ui-corner-bottom')
|
||||
.find('> .ui-icon').toggleClass('ui-icon-triangle-1-e ui-icon-triangle-1-s').end()
|
||||
.next().toggleClass('ui-accordion-content-active').slideToggle();
|
||||
return false;
|
||||
})
|
||||
.next()
|
||||
.addClass('ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom')
|
||||
.hide();
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>';
|
||||
<body>";
|
||||
if(!$rechte->isBerechtigt('lehre/studienordnung'))
|
||||
die('Sie haben keine Berechtigung für diese Seite');
|
||||
$studiengang = new studiengang();
|
||||
@@ -116,17 +144,50 @@ echo '
|
||||
<div id="header">
|
||||
|
||||
</div>
|
||||
<div id="data" >
|
||||
<div id="data" style="min-height: 10px;">
|
||||
|
||||
</div>
|
||||
<div id="jsonData">
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td valign="top" width="20%">
|
||||
<div id="menueRechts">
|
||||
<h3>Lehrveranstaltungen</h3>
|
||||
<div id="menueRechts" style="width: 420px;">
|
||||
<h2><a href=#>Filter</a></h2>
|
||||
<div style="margin:0px;padding:5px;">
|
||||
<p id="lehrveranstaltung" style="margin:0;padding:0;">
|
||||
Bitte wählen Sie zuerst einen Studienplan aus!
|
||||
</p>
|
||||
<div id="lehrveranstaltung" style="margin:0;padding:0; width: 400px;">
|
||||
Bitte wählen Sie zuerst einen Studienplan aus!';
|
||||
// var_dump($studiengang_kz);
|
||||
// $lv = new lehrveranstaltung();
|
||||
// $lv->load_lva($studiengang_kz, null, null, TRUE, TRUE);
|
||||
// $sem = $lv->lehrveranstaltungen[1]->semester;
|
||||
// echo "<ul>";
|
||||
// echo "<li>Semester ".$row->lehrveranstaltungen[1]->semester."</li><ul>";
|
||||
// foreach($lv->lehrveranstaltungen as $row)
|
||||
// {
|
||||
// if($sem==$row->semester)
|
||||
// {
|
||||
// echo "<li>".$row->bezeichnung."</li>";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// echo "</ul><li>".$row->semester."</li>";
|
||||
// echo "<ul><li>".$row->bezeichnung."</li>";
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// echo "</ul></ul>";
|
||||
|
||||
echo'
|
||||
</div>
|
||||
</div>
|
||||
<h2>Lehrveranstaltungen</h2>
|
||||
<div style="margin:0px;padding:5px;">
|
||||
<div id="filteredLVs" style="width: 400px;">
|
||||
<div id="lvListe">
|
||||
Keine Einträge gefunden!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user