mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-11 09:09:28 +00:00
Sortierungsmöglichkeit der Lehrveranstaltungen im Studienplan
This commit is contained in:
@@ -1145,7 +1145,8 @@ class lehrveranstaltung extends basis_db
|
||||
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
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id_parent,
|
||||
tbl_studienplan_lehrveranstaltung.sort stpllv_sort
|
||||
FROM lehre.tbl_lehrveranstaltung
|
||||
JOIN lehre.tbl_studienplan_lehrveranstaltung
|
||||
USING(lehrveranstaltung_id)
|
||||
@@ -1155,7 +1156,7 @@ class lehrveranstaltung extends basis_db
|
||||
{
|
||||
$qry.=" AND tbl_studienplan_lehrveranstaltung.semester=" . $this->db_add_param($semester, FHC_INTEGER);
|
||||
}
|
||||
$qry.=" ORDER BY semester, sort";
|
||||
$qry.=" ORDER BY stpllv_sort, semester, sort";
|
||||
$this->lehrveranstaltungen = array();
|
||||
if ($result = $this->db_query($qry))
|
||||
{
|
||||
|
||||
@@ -54,6 +54,7 @@ class studienplan extends basis_db
|
||||
protected $studienplan_lehrveranstaltung_id_parent; //integer
|
||||
protected $pflicht; //boolean
|
||||
protected $koordinator; //varchar(32)
|
||||
protected $sort;
|
||||
|
||||
|
||||
|
||||
@@ -388,7 +389,8 @@ class studienplan extends basis_db
|
||||
$obj->semester = $row->semester;
|
||||
$obj->studienplan_lehrveranstaltung_id_parent = $row->studienplan_lehrveranstaltung_id_parent;
|
||||
$obj->pflicht = $row->pflicht;
|
||||
$obj->koordinator = $row->koordinator;
|
||||
$obj->koordinator = $row->koordinator;
|
||||
$obj->sort = $row->sort;
|
||||
$data[]=$obj;
|
||||
}
|
||||
}
|
||||
@@ -415,6 +417,7 @@ class studienplan extends basis_db
|
||||
$obj->studienplan_lehrveranstaltung_id_parent = $this->studienplan_lehrveranstaltung_id_parent;
|
||||
$obj->pflicht = $this->pflicht;
|
||||
$obj->koordinator = $this->koordinator;
|
||||
$obj->sort = $this->sort;
|
||||
$data[]=$obj;
|
||||
}
|
||||
return $data;
|
||||
@@ -580,6 +583,7 @@ class studienplan extends basis_db
|
||||
$this->insertvon = $row->insertvon;
|
||||
$this->updateamum = $row->updateamum;
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->sort = $row->sort;
|
||||
$this->new=false;
|
||||
return true;
|
||||
}
|
||||
@@ -738,5 +742,36 @@ class studienplan extends basis_db
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichert die Sortierung
|
||||
* @param type $tudienplan_lehrveranstaltung_id
|
||||
* @param type $sort
|
||||
*/
|
||||
function saveSortierung($studienplan_lehrveranstaltung_id, $sort)
|
||||
{
|
||||
if($studienplan_lehrveranstaltung_id==NULL)
|
||||
$studienplan_lehrveranstaltung_id = $this->studienplan_lehrveranstaltung_id;
|
||||
|
||||
if($sort==NULL)
|
||||
$sort = $this->sort;
|
||||
|
||||
if(!(is_numeric($sort) || is_null($sort)))
|
||||
{
|
||||
$this->errormsg = "Es muss eine Zahl als Sortierungswert angegeben werden.";
|
||||
return false;
|
||||
}
|
||||
$qry = 'UPDATE lehre.tbl_studienplan_lehrveranstaltung '
|
||||
. 'SET sort='.$this->db_add_param($sort)
|
||||
. ' WHERE studienplan_lehrveranstaltung_id='.$this->db_add_param($studienplan_lehrveranstaltung_id).';';
|
||||
|
||||
$this->orgform_kurzbz = $qry;
|
||||
if(!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = "Fehler beim speichern der Sortierung.";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
+12
-1
@@ -2085,6 +2085,17 @@ if(!$result = @$db->db_query("SELECT ext_id FROM wawi.tbl_konto LIMIT 1;"))
|
||||
echo ' wawi.tbl_konto: Spalte ext_id hinzugefuegt!<br>';
|
||||
}
|
||||
|
||||
// Spalte sort in lehre.tbl_studienplan_lehrveranstaltung
|
||||
if(!$result = @$db->db_query("SELECT sort FROM lehre.tbl_studienplan_lehrveranstaltung LIMIT 1;"))
|
||||
{
|
||||
$qry = "ALTER TABLE lehre.tbl_studienplan_lehrveranstaltung ADD COLUMN sort integer;";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>lehre.tbl_studienplan_lehrveranstaltung: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo ' lehre.tbl_studienplan_lehrveranstaltung: Spalte sort hinzugefuegt!<br>';
|
||||
}
|
||||
|
||||
|
||||
echo '<br><br><br>';
|
||||
|
||||
@@ -2208,7 +2219,7 @@ $tabellen=array(
|
||||
"lehre.tbl_studienordnung" => array("studienordnung_id","studiengang_kz","version","gueltigvon","gueltigbis","bezeichnung","ects","studiengangbezeichnung","studiengangbezeichnung_englisch","studiengangkurzbzlang","akadgrad_id","insertamum","insertvon","updateamum","updatevon"),
|
||||
"lehre.tbl_studienordnung_semester" => array("studienordnung_semester_id","studienordnung_id","studiensemester_kurzbz","semester"),
|
||||
"lehre.tbl_studienplan" => array("studienplan_id","studienordnung_id","orgform_kurzbz","version","regelstudiendauer","sprache","aktiv","bezeichnung","insertamum","insertvon","updateamum","updatevon","semesterwochen","testtool_sprachwahl"),
|
||||
"lehre.tbl_studienplan_lehrveranstaltung" => array("studienplan_lehrveranstaltung_id","studienplan_id","lehrveranstaltung_id","semester","studienplan_lehrveranstaltung_id_parent","pflicht","koordinator","insertamum","insertvon","updateamum","updatevon"),
|
||||
"lehre.tbl_studienplan_lehrveranstaltung" => array("studienplan_lehrveranstaltung_id","studienplan_id","lehrveranstaltung_id","semester","studienplan_lehrveranstaltung_id_parent","pflicht","koordinator","insertamum","insertvon","updateamum","updatevon","sort"),
|
||||
"lehre.tbl_studienplatz" => array("studienplatz_id","studiengang_kz","studiensemester_kurzbz","orgform_kurzbz","ausbildungssemester","gpz","npz","insertamum","insertvon","updateamum","updatevon"),
|
||||
"lehre.tbl_stunde" => array("stunde","beginn","ende"),
|
||||
"lehre.tbl_stundenplan" => array("stundenplan_id","unr","mitarbeiter_uid","datum","stunde","ort_kurzbz","gruppe_kurzbz","titel","anmerkung","lehreinheit_id","studiengang_kz","semester","verband","gruppe","fix","updateamum","updatevon","insertamum","insertvon"),
|
||||
|
||||
@@ -573,6 +573,17 @@ function loadLehrveranstaltungSTPL(studienplan_id, bezeichnung, max_semester)
|
||||
{
|
||||
$("#tab-kompatibel").html("<p>Klicken Sie auf eine Lehrveranstaltung um die kompatiblen Lehrveranstaltungen anzuzeigen</p>");
|
||||
}
|
||||
|
||||
// Sortierung laden
|
||||
if(data.rslt.obj.attr("rel") !== "semester")
|
||||
{
|
||||
if(lvid!==undefined)
|
||||
loadSTPLSortierung(stpllvid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#tab-sortierung").html("<p>Klicken Sie auf eine Lehrveranstaltung um die Sortierung innerhalb der Studienplanansicht im CIS zu ändern.</p>");
|
||||
}
|
||||
});
|
||||
|
||||
if(!isLVFilterLoaded)
|
||||
@@ -677,6 +688,68 @@ function loadLVKompatibilitaet(lvid)
|
||||
|
||||
});
|
||||
}
|
||||
/*
|
||||
* lädt die Sortierung einer Lehrveranstaltung innerhalb eines Studienplans
|
||||
* @param {type} lvid
|
||||
* @returns {undefined}
|
||||
*/
|
||||
function loadSTPLSortierung(stpllvid)
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
dataType: "json",
|
||||
url: "../../soap/fhcomplete.php",
|
||||
data: {
|
||||
"typ": "json",
|
||||
"class": "studienplan",
|
||||
"method": "loadStudienplanLehrveranstaltung",
|
||||
"parameter_0":stpllvid
|
||||
},
|
||||
error: loadError
|
||||
}).success(function(data)
|
||||
{
|
||||
console.log(data);
|
||||
var html='';
|
||||
for(i in data.result)
|
||||
{
|
||||
if(data.result[i])
|
||||
{
|
||||
lvdata = data.result[i];
|
||||
html += 'Sortierung: <input type="number" id="stplSort" value="'+ClearNull(lvdata.sort)+'"><br/><input type="button" onclick="saveSortierung(\''+stpllvid+'\');" value="Speichern">';
|
||||
}
|
||||
}
|
||||
$("#tab-sortierung").html(html);
|
||||
});
|
||||
}
|
||||
|
||||
function saveSortierung(stpllvid)
|
||||
{
|
||||
var sort = $('#stplSort').val();
|
||||
if(sort === "")
|
||||
sort=null;
|
||||
|
||||
|
||||
console.log(sort);
|
||||
savedata = {
|
||||
"studienplan_lehrveranstaltung_id": stpllvid,
|
||||
"sort": sort
|
||||
};
|
||||
$.ajax(
|
||||
{
|
||||
dataType: "json",
|
||||
url: "../../soap/fhcomplete.php",
|
||||
type: "POST",
|
||||
data: {
|
||||
"typ": "json",
|
||||
"class": "studienplan",
|
||||
"method": "saveSortierung",
|
||||
"savedata": JSON.stringify(savedata)
|
||||
}
|
||||
}).success(function(d)
|
||||
{
|
||||
console.log(d);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -200,6 +200,7 @@ echo '
|
||||
<li><a href="#tab-lehrveranstaltungdetail">LV Details</a></li>
|
||||
<li><a href="#tab-regel">Regeln</a></li>
|
||||
<li><a href="#tab-kompatibel">Kompatibilität</a></li>
|
||||
<li><a href="#tab-sortierung">Sortierung</a></li>
|
||||
</ul>
|
||||
<div id="tab-lehrveranstaltungdetail">
|
||||
<p>Klicken Sie auf eine Lehrveranstaltung um die Details anzuzeigen</p>
|
||||
@@ -210,6 +211,9 @@ echo '
|
||||
<div id="tab-kompatibel">
|
||||
<p>Klicken Sie auf eine Lehrveranstaltung um die kompatiblen Lehrveranstaltungen anzuzeigen</p>
|
||||
</div>
|
||||
<div id="tab-sortierung">
|
||||
<p>Klicken Sie auf eine Lehrveranstaltung um die Sortierung innerhalb der Studienplanansicht im CIS zu ändern.</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Tabs ende -->
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user