diff --git a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php index ff694ff40..bc19974b4 100644 --- a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php +++ b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php @@ -660,7 +660,7 @@ if (isset($_REQUEST["freigabe"]) and ($_REQUEST["freigabe"] == 1)) // studentenquery $qry_stud = "SELECT - DISTINCT uid, vorname, nachname, matrikelnr + DISTINCT uid, prestudent_id, vorname, nachname, matrikelnr FROM campus.vw_student_lehrveranstaltung JOIN campus.vw_student USING(uid) @@ -674,7 +674,7 @@ if (isset($_REQUEST["freigabe"]) and ($_REQUEST["freigabe"] == 1)) while($row_stud = $db->db_fetch_object($result_stud)) { $lvgesamtnote = new lvgesamtnote(); - if ($lvgesamtnote->load($lvid,$row_stud->prestudent_uid,$stsem)) + if ($lvgesamtnote->load($lvid,$row_stud->prestudent_id,$stsem)) { if ($lvgesamtnote->benotungsdatum > $lvgesamtnote->freigabedatum) { diff --git a/include/beispiel.class.php b/include/beispiel.class.php index 17614ab7e..98b5c49dc 100644 --- a/include/beispiel.class.php +++ b/include/beispiel.class.php @@ -31,14 +31,14 @@ class beispiel extends basis_db public $beispiel_id; // Serial public $uebung_id; // integer public $bezeichnung; // varchar(32) - public $punkte; // real + public $punkte; // real public $updateamum; // timestamp public $updatevon; // varchar(16) public $insertamum; // timestamp public $insertvon; // varchar(16) - public $nummer; // smallint + public $nummer; // smallint - public $prestudent_id; //integer + public $uid; // varchar(32) public $vorbereitet; public $probleme; @@ -308,21 +308,21 @@ class beispiel extends basis_db * @param $beispiel_id * @return boolean */ - public function studentbeispiel_exists($prestudent_id,$beispiel_id) + public function studentbeispiel_exists($uid,$beispiel_id) { if(!is_numeric($beispiel_id)) { $this->errormsg = 'Beispiel_id muss eine gueltige Zahl sein'; return false; } - if(!is_numeric($prestudent_id)) + if(!is_numeric($uid)) { $this->errormsg = 'Prestudent_id muss eine gueltige Zahl sein'; return false; } $qry = "SELECT vorbereitet FROM campus.tbl_studentbeispiel - WHERE beispiel_id=".$this->db_add_param($beispiel_id,FHC_INTEGER)." AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER).';'; + WHERE beispiel_id=".$this->db_add_param($beispiel_id,FHC_INTEGER)." AND uid=".$this->db_add_param($uid).';'; if($this->db_query($qry)) { @@ -371,27 +371,27 @@ class beispiel extends basis_db * @param $beispiel_id * @return boolean */ - public function load_studentbeispiel($prestudent_id, $beispiel_id) + public function load_studentbeispiel($uid, $beispiel_id) { if(!is_numeric($beispiel_id)) { $this->errormsg = 'Beispiel_id muss eine gueltige Zahl sein'; return false; } - if(!is_numeric($prestudent_id)) + if(!is_numeric($uid)) { $this->errormsg = 'Prestudent_id muss eine gueltige Zahl sein'; return false; } $qry = "SELECT * FROM campus.tbl_studentbeispiel - WHERE prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER)." AND beispiel_id=".$this->db_add_param($beispiel_id, FHC_INTEGER).';'; + WHERE uid=".$this->db_add_param($uid)." AND beispiel_id=".$this->db_add_param($beispiel_id, FHC_INTEGER).';'; if($this->db_query($qry)) { if($row = $this->db_fetch_object()) { $this->beispiel_id = $row->beispiel_id; - $this->prestudent_id = $row->prestudent_id; + $this->uid = $row->uid; $this->vorbereitet = $this->db_parse_bool($row->vorbereitet); $this->probleme = $this->db_parse_bool($row->probleme); $this->updateamum = $row->updateamum; @@ -477,9 +477,9 @@ class beispiel extends basis_db if($new) { - $qry = 'INSERT INTO campus.tbl_studentbeispiel(prestudent_id, beispiel_id, vorbereitet, probleme, + $qry = 'INSERT INTO campus.tbl_studentbeispiel(uid, beispiel_id, vorbereitet, probleme, updateamum, updatevon, insertamum, insertvon) VALUES('. - $this->db_add_param($this->prestudent_id, FHC_INTEGER).','. + $this->db_add_param($this->uid).','. $this->db_add_param($this->beispiel_id, FHC_INTEGER).','. $this->db_add_param($this->vorbereitet,FHC_BOOLEAN).','. $this->db_add_param($this->probleme).','. @@ -495,7 +495,7 @@ class beispiel extends basis_db ' probleme='.$this->db_add_param($this->probleme, FHC_BOOLEAN).','. ' updateamum='.$this->db_add_param($this->updateamum).','. ' updatevon='.$this->db_add_param($this->updatevon). - " WHERE beispiel_id=".$this->db_add_param($this->beispiel_id, FHC_INTEGER)." AND prestudent_id=".$this->db_add_param($this->prestudent_id, FHC_INTEGER).';'; + " WHERE beispiel_id=".$this->db_add_param($this->beispiel_id, FHC_INTEGER)." AND uid=".$this->db_add_param($this->uid).';'; } if($this->db_query($qry)) diff --git a/include/note.class.php b/include/note.class.php index 6c119cae9..e17e514d7 100644 --- a/include/note.class.php +++ b/include/note.class.php @@ -1,196 +1,196 @@ -, - * Andreas Oesterreicher and - * Rudolf Hangl and - * Gerald Raab - */ -/** - * Klasse Note - * @create 2007-06-06 - */ -require_once(dirname(__FILE__).'/basis_db.class.php'); - -class note extends basis_db -{ - public $new; // boolean - public $result=array(); - - //Tabellenspalten - public $note; // smallint - public $bezeichnung; // varchar(32) - public $anmerkung; // varchar(256) - public $farbe; // varchar(6) +, + * Andreas Oesterreicher and + * Rudolf Hangl and + * Gerald Raab + */ +/** + * Klasse Note + * @create 2007-06-06 + */ +require_once(dirname(__FILE__).'/basis_db.class.php'); + +class note extends basis_db +{ + public $new; // boolean + public $result=array(); + + //Tabellenspalten + public $note; // smallint + public $bezeichnung; // varchar(32) + public $anmerkung; // varchar(256) + public $farbe; // varchar(6) public $positiv=true; // boolean public $notenwert; // boolean public $aktiv; // boolean - public $lehre; // boolean - - /** - * Konstruktor - * @param $note - */ - public function __construct($note = null) - { - parent::__construct(); - - if($note != null) - $this->load($note); - } - - /** - * Laedt eine Note - * @param $note - * @return true wenn ok, false im Fehlerfall - */ - public function load($note) - { - if(!is_numeric($note)) - { - $this->errormsg = 'Note ist ungueltig'; - return false; - } - - $qry = "SELECT * FROM lehre.tbl_note WHERE note=".$this->db_add_param($note); - - if($this->db_query($qry)) - { - if($row = $this->db_fetch_object()) - { - $this->note = $row->note; - $this->bezeichnung = $row->bezeichnung; - $this->anmerkung = $row->anmerkung; + public $lehre; // boolean + + /** + * Konstruktor + * @param $note + */ + public function __construct($note = null) + { + parent::__construct(); + + if($note != null) + $this->load($note); + } + + /** + * Laedt eine Note + * @param $note + * @return true wenn ok, false im Fehlerfall + */ + public function load($note) + { + if(!is_numeric($note)) + { + $this->errormsg = 'Note ist ungueltig'; + return false; + } + + $qry = "SELECT * FROM lehre.tbl_note WHERE note=".$this->db_add_param($note); + + if($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + $this->note = $row->note; + $this->bezeichnung = $row->bezeichnung; + $this->anmerkung = $row->anmerkung; $this->farbe = $row->farbe; - $this->notenwert = $row->notenwert; + $this->notenwert = $row->notenwert; $this->positiv = $this->db_parse_bool($row->positiv); $this->lehre = $this->db_parse_bool($row->lehre); - $this->aktiv = $this->db_parse_bool($row->aktiv); - return true; - } - else - { - $this->errormsg = 'Datensatz wurde nicht gefunden'; - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Prueft die Daten vor dem Speichern - * auf Gueltigkeit - */ - public function validate() - { - if(!is_numeric($this->note)) - { - $this->errormsg = 'Note ist ungueltig'; - return false; - } - return true; - } - - /** - * Speichert den aktuellen Datensatz in die Datenbank - * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt - * andernfalls wird der Datensatz mit der ID in $betriebsmittel_id aktualisiert - * @return true wenn ok, false im Fehlerfall - */ - public function save($new=null) - { - if($new==null) - $new=$this->new; - - if(!$this->validate()) - return false; - - if($new) - { - //Neuen Datensatz einfuegen - $qry='INSERT INTO lehre.tbl_note (note, bezeichnung, anmerkung, positiv, notenwert, aktiv, lehre) VALUES('. - $this->db_add_param($this->note).', '. - $this->db_add_param($this->bezeichnung).', '. - $this->db_add_param($this->anmerkung).', '. + $this->aktiv = $this->db_parse_bool($row->aktiv); + return true; + } + else + { + $this->errormsg = 'Datensatz wurde nicht gefunden'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Prueft die Daten vor dem Speichern + * auf Gueltigkeit + */ + public function validate() + { + if(!is_numeric($this->note)) + { + $this->errormsg = 'Note ist ungueltig'; + return false; + } + return true; + } + + /** + * Speichert den aktuellen Datensatz in die Datenbank + * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt + * andernfalls wird der Datensatz mit der ID in $betriebsmittel_id aktualisiert + * @return true wenn ok, false im Fehlerfall + */ + public function save($new=null) + { + if($new==null) + $new=$this->new; + + if(!$this->validate()) + return false; + + if($new) + { + //Neuen Datensatz einfuegen + $qry='INSERT INTO lehre.tbl_note (note, bezeichnung, anmerkung, positiv, notenwert, aktiv, lehre) VALUES('. + $this->db_add_param($this->note).', '. + $this->db_add_param($this->bezeichnung).', '. + $this->db_add_param($this->anmerkung).', '. $this->db_add_param($this->positiv, FHC_BOOLEAN).','. $this->db_add_param($this->notenwert).','. $this->db_add_parma($this->aktiv, FHC_BOOLEAN).','. - $this->db_add_param($htis->lehre, FHC_BOOLEAN).');'; - } - else - { - $qry='UPDATE lehre.tbl_note SET '. - 'note='.$this->db_add_param($this->note).', '. - 'bezeichnung='.$this->db_add_param($this->bezeichnung).', '. - 'anmerkung='.$this->db_add_param($this->anmerkung).', '. + $this->db_add_param($htis->lehre, FHC_BOOLEAN).');'; + } + else + { + $qry='UPDATE lehre.tbl_note SET '. + 'note='.$this->db_add_param($this->note).', '. + 'bezeichnung='.$this->db_add_param($this->bezeichnung).', '. + 'anmerkung='.$this->db_add_param($this->anmerkung).', '. 'positiv='.$this->db_add_param($this->positiv, FHC_BOOLEAN).', '. 'notenwert='.$this->db_add_param($this->notenwert).', '. 'aktiv='.$this->db_add_param($this->aktiv, FHC_BOOLEAN).', '. - 'lehre='.$this->db_add_param($this->lehre, FHC_BOOLEAN).' '. - 'WHERE note='.$this->db_add_param($this->note).';'; - } - - if($this->db_query($qry)) - { - return true; - } - else - { - $this->errormsg = "Fehler beim Speichern des Datensatzes"; - return false; - } - } - - /** - * Laedt alle Noten - * @return true wenn ok, false wenn Fehler - */ - public function getAll() - { - $qry = "SELECT * FROM lehre.tbl_note ORDER BY note"; - - if($this->db_query($qry)) - { - while($row = $this->db_fetch_object()) - { - $n = new note(); - - $n->note = $row->note; - $n->bezeichnung = $row->bezeichnung; - $n->anmerkung = $row->anmerkung; - $n->farbe = $row->farbe; + 'lehre='.$this->db_add_param($this->lehre, FHC_BOOLEAN).' '. + 'WHERE note='.$this->db_add_param($this->note).';'; + } + + if($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = "Fehler beim Speichern des Datensatzes"; + return false; + } + } + + /** + * Laedt alle Noten + * @return true wenn ok, false wenn Fehler + */ + public function getAll() + { + $qry = "SELECT * FROM lehre.tbl_note ORDER BY note"; + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $n = new note(); + + $n->note = $row->note; + $n->bezeichnung = $row->bezeichnung; + $n->anmerkung = $row->anmerkung; + $n->farbe = $row->farbe; $n->positiv = $this->db_parse_bool($row->positiv); $n->notenwert = $row->notenwert; $n->aktiv = $this->db_parse_bool($row->aktiv); - $n->lehre = $this->db_parse_bool($row->lehre); - - $this->result[] = $n; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } -} -?> + $n->lehre = $this->db_parse_bool($row->lehre); + + $this->result[] = $n; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } +} +?> diff --git a/include/studentnote.class.php b/include/studentnote.class.php index bc3ebf399..c6b015373 100755 --- a/include/studentnote.class.php +++ b/include/studentnote.class.php @@ -53,9 +53,9 @@ class studentnote extends basis_db * * @param $lehreinheit_id * @param $ss Studiensemester - * @param $prestudent_id + * @param $uid */ - public function calc_gesamtnote($lehreinheit_id, $ss, $prestudent_id) + public function calc_gesamtnote($lehreinheit_id, $ss, $uid) { $studentgesamtnote = 0; $counter = 0; @@ -71,7 +71,7 @@ class studentnote extends basis_db $ueb1_obj->load_uebung($lehreinheit_id,1); foreach($ueb1_obj->uebungen as $ueb1) { - $this->calc_l1_note($ueb1->uebung_id, $prestudent_id, $lehreinheit_id); + $this->calc_l1_note($ueb1->uebung_id, $uid, $lehreinheit_id); $note_x_gewicht_l1 += ($this->l1_note * $this->l1_gewicht); $gewichte_l1 += $this->l1_gewicht; if ($this->negativ) @@ -98,21 +98,16 @@ class studentnote extends basis_db * ?? berechnet irgendwas... * * @param $uebung_id - * @param $prestudent_id + * @param $uid * @param lehreinheit_id */ - public function calc_l1_note($uebung_id, $prestudent_id, $lehreinheit_id) + public function calc_l1_note($uebung_id, $uid, $lehreinheit_id) { if(!is_numeric($uebung_id)) { $this->errormsg='Uebung_id muss eine gueltige Zahl sein'; return false; } - if(!is_numeric($prestudent_id)) - { - $this->errormsg='Prestudent_id muss eine gueltige Zahl sein'; - return false; - } if(!is_numeric($lehreinheit_id)) { $this->errormsg='Lehreinheit_id muss eine gueltige Zahl sein'; @@ -145,7 +140,7 @@ class studentnote extends basis_db { if ($ueb->abgabe && !$ueb->beispiele) { - if ($this->calc_note($ueb->uebung_id, $prestudent_id)) + if ($this->calc_note($ueb->uebung_id, $uid)) { if (is_numeric($this->note)) { @@ -164,7 +159,7 @@ class studentnote extends basis_db } else { - $this->calc_punkte($ueb->uebung_id, $prestudent_id); + $this->calc_punkte($ueb->uebung_id, $uid); $punkte_gesamt += $this->punkte_gesamt; $punkte_mitarbeit += $this->punkte_mitarbeit; $punkte_eingetragen += $this->punkte_eingetragen; @@ -222,7 +217,7 @@ class studentnote extends basis_db else { $s = new uebung(); - $s->load_studentuebung($prestudent_id, $ueb1->uebung_id); + $s->load_studentuebung($uid, $ueb1->uebung_id); if ($s->note && $ueb1->gewicht) { if ($s->note == 5 && $ueb1->positiv) @@ -263,21 +258,16 @@ class studentnote extends basis_db /** * berechnet die note der übung - * @param uebung_id, prestudent_id + * @param uebung_id, uid * setzt this->note, this->gewicht */ - public function calc_note($uebung_id, $prestudent_id) + public function calc_note($uebung_id, $uid) { if(!is_numeric($uebung_id)) { $this->errormsg='Uebung_id muss eine gueltige Zahl sein'; return false; } - else if(!is_numeric($prestudent_id)) - { - $this->errormsg='Prestudent_id muss eine gueltige Zahl sein'; - return false; - } else { $note = null; @@ -287,7 +277,7 @@ class studentnote extends basis_db $ueb = new uebung(); $ueb->load($uebung_id); - if($ueb->load_studentuebung($prestudent_id, $uebung_id)) + if($ueb->load_studentuebung($uid, $uebung_id)) { $this->note = $ueb->note; $this->gewicht = $ueb->gewicht; @@ -305,21 +295,16 @@ class studentnote extends basis_db /** * berechnet die punkte der übung (kreuzerlliste) - * @param uebung_id, prestudent_id + * @param uebung_id, uid * setzt this->punkte_gesamt */ - public function calc_punkte($uebung_id, $prestudent_id) + public function calc_punkte($uebung_id, $uid) { if(!is_numeric($uebung_id)) { $this->errormsg='Uebung_id muss eine gueltige Zahl sein'; return false; } - else if(!is_numeric($prestudent_id)) - { - $this->errormsg='Prestudent_id muss eine gueltige Zahl sein'; - return false; - } else { $note = null; @@ -330,13 +315,13 @@ class studentnote extends basis_db //Eingetragen diese Kreuzerlliste $qry = "SELECT sum(punkte) as punkteeingetragen FROM campus.tbl_beispiel JOIN campus.tbl_studentbeispiel USING(beispiel_id) - WHERE uebung_id=".$this->db_add_param($uebung_id, FHC_INTEGER)." AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER)." AND vorbereitet=true"; + WHERE uebung_id=".$this->db_add_param($uebung_id, FHC_INTEGER)." AND uid=".$this->db_add_param($uid)." AND vorbereitet=true"; $punkte_eingetragen=0; if($this->db_query($qry)) if($row = $this->db_fetch_object()) $punkte_eingetragen = ($row->punkteeingetragen!=''?$row->punkteeingetragen:0); - if($ueb->load_studentuebung($prestudent_id, $uebung_id)) + if($ueb->load_studentuebung($uid, $uebung_id)) { $mitarbeit = $ueb->mitarbeitspunkte; } diff --git a/include/uebung.class.php b/include/uebung.class.php index b262de012..116e36d44 100644 --- a/include/uebung.class.php +++ b/include/uebung.class.php @@ -55,7 +55,7 @@ class uebung extends basis_db public $prozent; //Studentuebung - public $prestudent_id; // integer + public $uid; // varchar(32) public $mitarbeiter_uid; // varchar(16) public $abgabe_id; // integer public $note; // smalint @@ -156,18 +156,12 @@ class uebung extends basis_db /** * Laedt eine Studentuebung Zuordnung * - * @param $prestudent_id + * @param $uid * @param $uebung_id * @return boolean */ - public function load_studentuebung($prestudent_id, $uebung_id) + public function load_studentuebung($uid, $uebung_id) { - if(!is_numeric($prestudent_id)) - { - $this->errormsg = 'Prestudent_id muss eine gueltige Zahl sein'; - return false; - } - if(!is_numeric($uebung_id)) { $this->errormsg = 'Uebung_id muss eine gueltige Zahl sein'; @@ -175,13 +169,13 @@ class uebung extends basis_db } - $qry = "SELECT * FROM campus.tbl_studentuebung WHERE prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER)." AND uebung_id=".$this->db_add_param($uebung_id, FHC_INTEGER).";"; + $qry = "SELECT * FROM campus.tbl_studentuebung WHERE uid=".$this->db_add_param($uid)." AND uebung_id=".$this->db_add_param($uebung_id, FHC_INTEGER).";"; if($this->db_query($qry)) { if($row = $this->db_fetch_object()) { - $this->prestudent_id = $row->prestudent_id; + $this->uid = $row->uid; $this->mitarbeiter_uid = $row->mitarbeiter_uid; $this->abgabe_id = $row->abgabe_id; $this->uebung_id = $row->uebung_id; @@ -488,11 +482,6 @@ class uebung extends basis_db $this->errormsg = 'Uebung_id muss eine gueltige Zahl sein'; return false; } - if(!is_numeric($this->prestudent_id)) - { - $this->errormsg = 'Prestudent_id muss eine gueltige Zahl sein'; - return false; - } return true; } @@ -513,10 +502,10 @@ class uebung extends basis_db if($new) { - $qry = 'INSERT INTO campus.tbl_studentuebung(prestudent_id, mitarbeiter_uid, abgabe_id, uebung_id, + $qry = 'INSERT INTO campus.tbl_studentuebung(uid, mitarbeiter_uid, abgabe_id, uebung_id, note, mitarbeitspunkte, punkte, anmerkung, benotungsdatum, updateamum, updatevon, insertamum, insertvon) VALUES('. - $this->db_add_param($this->prestudent_id, FHC_INTEGER).','. + $this->db_add_param($this->uid).','. $this->db_add_param($this->mitarbeiter_uid).','. $this->db_add_param($this->abgabe_id, FHC_INTEGER).','. $this->db_add_param($this->uebung_id, FHC_INTEGER).','. @@ -544,7 +533,7 @@ class uebung extends basis_db ' updateamum='.$this->db_add_param($this->updateamum).','. ' updatevon='.$this->db_add_param($this->updatevon). " WHERE uebung_id=".$this->db_add_param($this->uebung_id, FHC_INTEGER). - " AND prestudent_id=".$this->db_add_param($this->prestudent_id, FHC_INTEGER).";"; + " AND uid=".$this->db_add_param($this->uid).";"; } if($this->db_query($qry)) diff --git a/vendor/FHC-vendor/angular-tablesort b/vendor/FHC-vendor/angular-tablesort new file mode 160000 index 000000000..da6cb0646 --- /dev/null +++ b/vendor/FHC-vendor/angular-tablesort @@ -0,0 +1 @@ +Subproject commit da6cb06462b3cea8af69a74090b06de73dcfc4d6