mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Entwicklungsteam: Adpatierungen für Sorierung und Anzeige Mitarbeiter Grid
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 fhcomplete.org
|
||||
*
|
||||
* 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: Manuela Thamer <manuela.thamer@technikum-wien.at>
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__). '/basis_db.class.php');
|
||||
require_once(dirname(__FILE__). '/sprache.class.php');
|
||||
require_once(dirname(__FILE__). '/functions.inc.php');
|
||||
|
||||
class besqualcode extends basis_db
|
||||
{
|
||||
//Objekt besqualcode
|
||||
public $result = array();
|
||||
|
||||
//Tabellenspalten
|
||||
public $besqualcode;
|
||||
public $besqualbez;
|
||||
|
||||
/**
|
||||
* Konstruktor - Laedt optional einen besqualcode
|
||||
* @param char $besqualcode Besqualcode der geladen werden soll.
|
||||
*/
|
||||
public function __construct($besqualcode = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if($besqualcode != null)
|
||||
$this->load($besqualcode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Liefert alle Lehrmodi aus der table tbl_besqualcode
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
$qry = "SELECT * FROM bis.tbl_besqual";
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
while ($row = $this->db_fetch_object())
|
||||
{
|
||||
$besqualcode = new besqualcode();
|
||||
|
||||
$besqualcode->besqualcode = $row->besqualcode;
|
||||
$besqualcode->besqualbez = $row->besqualbez;
|
||||
|
||||
$this->result[] = $besqualcode;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = "Fehler bei der Abfrage aufgetreten";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt einen besqualcode
|
||||
* @param char $besqualcode ID des Datensatzes der zu laden ist.
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load($besqualcode)
|
||||
{
|
||||
$qry = "SELECT
|
||||
*
|
||||
FROM
|
||||
bis.tbl_besqual
|
||||
WHERE
|
||||
besqualcode=".$this->db_add_param($besqualcode).";";
|
||||
|
||||
if (!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Lesen vom besqualcode';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->besqualcode = $row->besqualcode;
|
||||
$this->besqualbez = $row->besqualbez;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Es ist kein besqualcode mit dieser ID vorhanden';
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -29,6 +29,8 @@ class entwicklungsteam extends basis_db
|
||||
|
||||
//Tabellenspalten
|
||||
public $mitarbeiter_uid;
|
||||
public $nachname;
|
||||
public $vorname;
|
||||
public $studiengang_kz;
|
||||
public $besqualcode;
|
||||
public $beginn;
|
||||
@@ -70,7 +72,9 @@ class entwicklungsteam extends basis_db
|
||||
|
||||
//laden des Datensatzes
|
||||
$qry = "SELECT * FROM bis.tbl_entwicklungsteam JOIN bis.tbl_besqual USING(besqualcode)
|
||||
WHERE mitarbeiter_uid=".$this->db_add_param($mitarbeiter_uid)." AND studiengang_kz=".$this->db_add_param($studiengang_kz, FHC_INTEGER).";";
|
||||
WHERE mitarbeiter_uid=".$this->db_add_param($mitarbeiter_uid)." AND studiengang_kz=".$this->db_add_param($studiengang_kz, FHC_INTEGER);
|
||||
|
||||
$qry.=";";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
@@ -152,6 +156,11 @@ class entwicklungsteam extends basis_db
|
||||
$this->errormsg = 'Besondere Qualifikation muss eingetragen werden';
|
||||
return false;
|
||||
}
|
||||
if($this->beginn > $this->ende)
|
||||
{
|
||||
$this->errormsg = 'Endedatum darf nicht vor Anfangsdatum liegen';
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -292,14 +301,24 @@ class entwicklungsteam extends basis_db
|
||||
|
||||
/**
|
||||
* Liefert alle Entwicklungsteameinträge
|
||||
* @param $studiengang_kz Studiengangkennzeichen
|
||||
* @param int $studiengang_kz Studiengangkennzeichen.
|
||||
* @param char $sort Parameter, nach dem sortiert werden soll.
|
||||
* @return alle Entwicklungsteameinträge
|
||||
*/
|
||||
public function getAll($stg_kz=null)
|
||||
public function getAll($studiengang_kz = null, $sort = null)
|
||||
{
|
||||
$qry = "SELECT * FROM bis.tbl_entwicklungsteam";
|
||||
if($stg_kz!=null)
|
||||
$qry.=" WHERE studiengang_kz=".$this->db_add_param($stg_kz);
|
||||
$qry = "SELECT e.*, p.nachname, p.vorname FROM bis.tbl_entwicklungsteam e
|
||||
JOIN public.tbl_benutzer b ON e.mitarbeiter_uid = b.uid
|
||||
JOIN public.tbl_person p ON b.person_id = p.person_id
|
||||
";
|
||||
if ($studiengang_kz != null)
|
||||
$qry .= " WHERE e.studiengang_kz = ".$this->db_add_param($studiengang_kz);
|
||||
|
||||
if ($sort != null)
|
||||
{
|
||||
$qry .= " ORDER BY ".$sort;
|
||||
}
|
||||
|
||||
$qry .= ";";
|
||||
|
||||
if ($this->db_query($qry))
|
||||
@@ -309,6 +328,8 @@ class entwicklungsteam extends basis_db
|
||||
$obj = new entwicklungsteam();
|
||||
|
||||
$obj->mitarbeiter_uid = $row->mitarbeiter_uid;
|
||||
$obj->nachname = $row->nachname;
|
||||
$obj->vorname = $row->vorname;
|
||||
$obj->studiengang_kz = $row->studiengang_kz;
|
||||
$obj->besqualcode = $row->besqualcode;
|
||||
$obj->beginn = $row->beginn;
|
||||
|
||||
Reference in New Issue
Block a user