mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 08:52:21 +00:00
Merge branch 'master' into feature-12510/Planner_ZeitaufzeichnungsCheckbox
This commit is contained in:
@@ -47,6 +47,7 @@ class bisverwendung extends basis_db
|
||||
public $dv_art;
|
||||
public $inkludierte_lehre;
|
||||
public $zeitaufzeichnungspflichtig;
|
||||
public $azgrelevant;
|
||||
|
||||
public $ba1bez;
|
||||
public $ba2bez;
|
||||
@@ -122,6 +123,7 @@ class bisverwendung extends basis_db
|
||||
$this->dv_art = $row->dv_art;
|
||||
$this->inkludierte_lehre = $row->inkludierte_lehre;
|
||||
$this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
|
||||
$this->azgrelevant = $this->db_parse_bool($row->azgrelevant);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -247,13 +249,21 @@ class bisverwendung extends basis_db
|
||||
{
|
||||
$zeitaufzeichnungspflichtig = 'null';
|
||||
}
|
||||
if(is_bool($this->azgrelevant))
|
||||
{
|
||||
$azgrelevant = $this->db_add_param($this->azgrelevant, FHC_BOOLEAN);
|
||||
}
|
||||
else
|
||||
{
|
||||
$azgrelevant = 'null';
|
||||
}
|
||||
|
||||
if($new)
|
||||
{
|
||||
//Neuen Datensatz anlegen
|
||||
$qry = "BEGIN;INSERT INTO bis.tbl_bisverwendung (ba1code, ba2code, beschausmasscode,
|
||||
verwendung_code, mitarbeiter_uid, hauptberufcode, hauptberuflich, habilitation, beginn, ende, vertragsstunden,
|
||||
updateamum, updatevon, insertamum, insertvon, dv_art, inkludierte_lehre, zeitaufzeichnungspflichtig) VALUES (".
|
||||
updateamum, updatevon, insertamum, insertvon, dv_art, inkludierte_lehre, zeitaufzeichnungspflichtig, azgrelevant) VALUES (".
|
||||
$this->db_add_param($this->ba1code, FHC_INTEGER).', '.
|
||||
$this->db_add_param($this->ba2code, FHC_INTEGER).', '.
|
||||
$this->db_add_param($this->beschausmasscode, FHC_INTEGER).', '.
|
||||
@@ -271,7 +281,8 @@ class bisverwendung extends basis_db
|
||||
$this->db_add_param($this->insertvon).', '.
|
||||
$this->db_add_param($this->dv_art).','.
|
||||
$this->db_add_param($this->inkludierte_lehre).','.
|
||||
$zeitaufzeichnungspflichtig. ');';
|
||||
$zeitaufzeichnungspflichtig.','.
|
||||
$azgrelevant. ');';
|
||||
|
||||
}
|
||||
else
|
||||
@@ -295,7 +306,8 @@ class bisverwendung extends basis_db
|
||||
" insertvon=".$this->db_add_param($this->insertvon).",".
|
||||
" dv_art=".$this->db_add_param($this->dv_art).",".
|
||||
" inkludierte_lehre=".$this->db_add_param($this->inkludierte_lehre).",".
|
||||
" zeitaufzeichnungspflichtig=". $zeitaufzeichnungspflichtig.
|
||||
" zeitaufzeichnungspflichtig=". $zeitaufzeichnungspflichtig.",".
|
||||
" azgrelevant =". $azgrelevant.
|
||||
" WHERE bisverwendung_id=".$this->db_add_param($this->bisverwendung_id, FHC_INTEGER);
|
||||
}
|
||||
|
||||
@@ -388,7 +400,7 @@ class bisverwendung extends basis_db
|
||||
$obj->dv_art = $row->dv_art;
|
||||
$obj->inkludierte_lehre = $row->inkludierte_lehre;
|
||||
$obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
|
||||
|
||||
$obj->azgrelevant = $this->db_parse_bool($row->azgrelevant);
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
@@ -445,6 +457,7 @@ class bisverwendung extends basis_db
|
||||
$obj->dv_art = $row->dv_art;
|
||||
$obj->inkludierte_lehre = $row->inkludierte_lehre;
|
||||
$obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
|
||||
$obj->azgrelevant = $this->db_parse_bool($row->azgrelevant);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -503,6 +516,7 @@ class bisverwendung extends basis_db
|
||||
$obj->dv_art = $row->dv_art;
|
||||
$obj->inkludierte_lehre = $row->inkludierte_lehre;
|
||||
$obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
|
||||
$obj->azgrelevant = $this->db_parse_bool($row->azgrelevant);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -524,12 +538,13 @@ class bisverwendung extends basis_db
|
||||
{
|
||||
//laden des Datensatzes
|
||||
$qry = "SELECT
|
||||
*
|
||||
*, tbl_hauptberuf.bezeichnung as hauptberuf
|
||||
FROM
|
||||
bis.tbl_bisverwendung
|
||||
LEFT JOIN bis.tbl_hauptberuf USING(hauptberufcode)
|
||||
WHERE
|
||||
mitarbeiter_uid=".$this->db_add_param($uid)."
|
||||
ORDER BY ende DESC NULLS LAST,beginn DESC NULLS LAST LIMIT 1;";
|
||||
ORDER BY ende DESC NULLS FIRST,beginn DESC NULLS LAST LIMIT 1;";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
@@ -543,6 +558,7 @@ class bisverwendung extends basis_db
|
||||
$this->mitarbeiter_uid = $row->mitarbeiter_uid;
|
||||
$this->hauptberufcode = $row->hauptberufcode;
|
||||
$this->hauptberuflich = $this->db_parse_bool($row->hauptberuflich);
|
||||
$this->hauptberuf = $row->hauptberuf;
|
||||
$this->habilitation = $this->db_parse_bool($row->habilitation);
|
||||
$this->beginn = $row->beginn;
|
||||
$this->ende = $row->ende;
|
||||
@@ -554,6 +570,7 @@ class bisverwendung extends basis_db
|
||||
$this->dv_art = $row->dv_art;
|
||||
$this->inkludierte_lehre = $row->inkludierte_lehre;
|
||||
$this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
|
||||
$this->azgrelevant = $this->db_parse_bool($row->azgrelevant);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -582,7 +599,7 @@ class bisverwendung extends basis_db
|
||||
(beginn<=now() OR beginn IS NULL)
|
||||
AND
|
||||
(ende>=now() OR ende IS NULL)
|
||||
ORDER BY ende DESC NULLS LAST,beginn DESC NULLS LAST LIMIT 1;";
|
||||
ORDER BY ende DESC NULLS FIRST,beginn DESC NULLS LAST LIMIT 1;";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
@@ -607,6 +624,7 @@ class bisverwendung extends basis_db
|
||||
$this->dv_art = $row->dv_art;
|
||||
$this->inkludierte_lehre = $row->inkludierte_lehre;
|
||||
$this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
|
||||
$this->azgrelevant = $this->db_parse_bool($row->azgrelevant);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -669,6 +687,7 @@ class bisverwendung extends basis_db
|
||||
$obj->dv_art = $row->dv_art;
|
||||
$obj->inkludierte_lehre = $row->inkludierte_lehre;
|
||||
$obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig);
|
||||
$obj->azgrelevant = $this->db_parse_bool($row->azgrelevant);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
@@ -797,5 +816,35 @@ class bisverwendung extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function inZeitaufzeichnungspflichtigPeriod($PeriodStartDate, $PeriodEndDate)
|
||||
{
|
||||
$PeriodStartDateISO = date('Y-m-d', strtotime($PeriodStartDate));
|
||||
$PeriodEndDateISO = date('Y-m-d', strtotime($PeriodEndDate));
|
||||
|
||||
$beginn = date('Y-m-d', strtotime($this->beginn));
|
||||
$end = date('Y-m-d', strtotime($this->ende));
|
||||
$zp = $this->zeitaufzeichnungspflichtig;
|
||||
|
||||
if ($zp)
|
||||
{
|
||||
if (
|
||||
(($PeriodStartDateISO >= $beginn) && (($PeriodStartDateISO <= $end) || is_null($this->ende)))
|
||||
||
|
||||
(($PeriodEndDateISO >= $beginn) && (($PeriodEndDateISO <= $end) || is_null($this->ende)))
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
+141
-9
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 fhcomplete.org
|
||||
/* Copyright (C) 2021 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
|
||||
@@ -339,11 +339,11 @@ class dokument extends basis_db
|
||||
}
|
||||
|
||||
$qry = "SELECT tbl_dokumentprestudent.* , tbl_dokument.*
|
||||
FROM public.tbl_dokumentprestudent
|
||||
FROM public.tbl_dokumentprestudent
|
||||
JOIN public.tbl_dokument USING(dokument_kurzbz)
|
||||
LEFT JOIN public.tbl_vorlage ON (tbl_dokumentprestudent.dokument_kurzbz = tbl_vorlage.vorlage_kurzbz)
|
||||
WHERE prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER);
|
||||
|
||||
|
||||
if(!$archivdokumente)
|
||||
{
|
||||
$qry.=" AND (tbl_vorlage.archivierbar = FALSE OR tbl_vorlage.archivierbar IS NULL)";
|
||||
@@ -401,7 +401,7 @@ class dokument extends basis_db
|
||||
}
|
||||
|
||||
$qry = "SELECT tbl_dokument.* , tbl_dokumentstudiengang.*
|
||||
FROM public.tbl_dokument
|
||||
FROM public.tbl_dokument
|
||||
JOIN public.tbl_dokumentstudiengang USING(dokument_kurzbz)
|
||||
LEFT JOIN public.tbl_vorlage ON (tbl_dokument.dokument_kurzbz = tbl_vorlage.vorlage_kurzbz)
|
||||
WHERE studiengang_kz=".$this->db_add_param($studiengang_kz, FHC_INTEGER);
|
||||
@@ -836,11 +836,11 @@ class dokument extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Liefert die Studiengänge bei denen das übergebene Dokument benötigt wird
|
||||
* @param string $dokument_kurzbz Kurzbz des Dokuments
|
||||
* @param integer $person_id Optional. Die Dokumente werden zusätzlich auf die Studiengänge eingeschränkt für die sich eine Person beworben hat.
|
||||
* @param integer $person_id Optional. Die Dokumente werden zusätzlich auf die Studiengänge eingeschränkt für die sich eine Person beworben hat.
|
||||
* @return object Objekt mit den Studiengängen oder false.
|
||||
*/
|
||||
public function getStudiengaengeDokument($dokument_kurzbz, $person_id = null)
|
||||
@@ -854,7 +854,7 @@ class dokument extends basis_db
|
||||
AND person_id =".$this->db_add_param($person_id, FHC_INTEGER)."
|
||||
AND tbl_prestudentstatus.status_kurzbz = 'Interessent'
|
||||
AND get_rolle_prestudent (prestudent_id, NULL) NOT IN ('Abgewiesener','Abbrecher')
|
||||
|
||||
|
||||
ORDER BY kuerzel";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
@@ -869,12 +869,12 @@ class dokument extends basis_db
|
||||
$stg_obj->studiengang_kz = $row->studiengang_kz;
|
||||
$stg_obj->english = $row->english;
|
||||
$stg_obj->stufe = $row->stufe;
|
||||
|
||||
|
||||
$this->result[] = $stg_obj;
|
||||
}
|
||||
return $stg_obj;
|
||||
}
|
||||
else
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -882,6 +882,138 @@ class dokument extends basis_db
|
||||
$this->errormsg="Fehler bei der Abfrage aufgetreten";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Akzeptiert ein bestimmtes Dokument
|
||||
* @param char $dokument_kurzbz Bezeichner Dokument.
|
||||
* @param int $person_id Personenkennzeichen.
|
||||
* @return boolean true wenn akzeptiert bzw geprüft ohne Akzeptieren, false wenn Fehler
|
||||
*/
|
||||
public function akzeptiereDokument($dokument_kurzbz, $person_id)
|
||||
{
|
||||
$db = new basis_db();
|
||||
$arrayDoksZuAkzeptieren = array();
|
||||
|
||||
//get Prestudent_ids
|
||||
$qry = "SELECT
|
||||
prestudent_id
|
||||
FROM
|
||||
tbl_prestudent ps, tbl_studiengang sg
|
||||
WHERE
|
||||
ps.studiengang_kz = sg.studiengang_kz
|
||||
AND sg.typ = 'm'
|
||||
AND person_id = ".$this->db_add_param($person_id)."
|
||||
AND not exists(
|
||||
SELECT *
|
||||
from tbl_dokumentprestudent dok
|
||||
where dok.prestudent_id = ps.prestudent_id
|
||||
and dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz).")";
|
||||
|
||||
//gibt ein Array von zu akzeptierenden Dokumenten zurück
|
||||
if ($db->db_query($qry))
|
||||
{
|
||||
$num_rows = $db->db_num_rows();
|
||||
|
||||
if ($num_rows > 0)
|
||||
{
|
||||
while ($row = $db->db_fetch_object())
|
||||
{
|
||||
$arrayDoksZuAkzeptieren[] = $row->prestudent_id;
|
||||
}
|
||||
|
||||
//für alle prestudent_ids das Dokument akzeptieren
|
||||
$qry = "INSERT INTO public.tbl_dokumentprestudent(dokument_kurzbz, prestudent_id) VALUES";
|
||||
|
||||
foreach ($arrayDoksZuAkzeptieren as $prestudent_id)
|
||||
{
|
||||
$qry .= "(".$this->db_add_param($dokument_kurzbz). ",". $prestudent_id. ")";
|
||||
|
||||
if (next($arrayDoksZuAkzeptieren) == true)
|
||||
{
|
||||
$qry .= ",";
|
||||
}
|
||||
}
|
||||
$qry .= ";";
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Akzeptieren';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* entakzeptiert ein bestimmtes Dokument
|
||||
* @param char $dokument_kurzbz Kurzbezeichnung des zu entakzeptierenden Dokuments.
|
||||
* @param int $person_id Personenkennzeichen.
|
||||
* @return boolean true wenn entakzeptiert bzw geprüft ohne Entakzeptieren, false wenn Fehler
|
||||
*/
|
||||
public function entakzeptiereDokument($dokument_kurzbz, $person_id)
|
||||
{
|
||||
$db = new basis_db();
|
||||
$arrayDoksZuEntakzeptieren = array();
|
||||
|
||||
//get Prestudent_ids
|
||||
$qry = "SELECT
|
||||
prestudent_id
|
||||
from
|
||||
tbl_dokumentprestudent
|
||||
join
|
||||
tbl_prestudent using (prestudent_id)
|
||||
where
|
||||
person_id = ".$this->db_add_param($person_id)."
|
||||
and dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz);
|
||||
|
||||
//gibt ein Array von zu Entakzeptierenden Dokumenten zurück
|
||||
if ($db->db_query($qry))
|
||||
{
|
||||
$num_rows = $db->db_num_rows();
|
||||
|
||||
if ($num_rows > 0)
|
||||
{
|
||||
while ($row = $db->db_fetch_object())
|
||||
{
|
||||
$arrayDoksZuEntakzeptieren[] = $row->prestudent_id;
|
||||
}
|
||||
|
||||
//für alle prestudent_ids das Dokument Entakzeptieren
|
||||
$qry = "DELETE FROM public.tbl_dokumentprestudent WHERE prestudent_id in (";
|
||||
|
||||
foreach ($arrayDoksZuEntakzeptieren as $prestudent_id)
|
||||
{
|
||||
$qry .= $prestudent_id;
|
||||
|
||||
if (next($arrayDoksZuEntakzeptieren) == true)
|
||||
{
|
||||
$qry .= ",";
|
||||
}
|
||||
}
|
||||
$qry .= ") AND dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz).";";
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Entakzeptieren';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+619
-618
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007 fhcomplete.org
|
||||
/* Copyright (C) 2021 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
|
||||
@@ -16,8 +16,9 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
|
||||
* Manuela Thamer <manuela.thamer@technikum-wien.at>.
|
||||
*/
|
||||
require_once(dirname(__FILE__).'/person.class.php');
|
||||
require_once(dirname(__FILE__).'/log.class.php');
|
||||
@@ -2215,9 +2216,9 @@ class prestudent extends person
|
||||
WHERE laststatus NOT IN ('Abbrecher', 'Abgewiesener', 'Absolvent')
|
||||
AND priorisierung <= ".$this->db_add_param($priorisierungAbsolut, FHC_INTEGER);
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
if ($result = $this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object($result))
|
||||
if ($row = $this->db_fetch_object($result))
|
||||
{
|
||||
return $row->prio_relativ;
|
||||
}
|
||||
@@ -2232,6 +2233,222 @@ class prestudent extends person
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prueft, ob eine Person einen aktuellen PreStudentstatus-Eintrag besitzt, der die ZGV Master ersetzt
|
||||
* @param int $person_id ID der zu überprüfenden Person.
|
||||
* @return true wenn vorhanden
|
||||
* false wenn nicht vorhanden
|
||||
* false und errormsg wenn Fehler aufgetreten ist
|
||||
*/
|
||||
public function existsZGVIntern($person_id)
|
||||
{
|
||||
if (!is_numeric($person_id))
|
||||
{
|
||||
$this->errormsg = 'Person_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$qry = "SELECT count(*) as anzahl FROM public.tbl_prestudent
|
||||
JOIN public.tbl_prestudentstatus USING (prestudent_id)
|
||||
JOIN public.tbl_studiengang USING (studiengang_kz)
|
||||
WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)."
|
||||
AND status_kurzbz in ('Absolvent','Diplomand','Unterbrecher','Student')
|
||||
AND typ in ('b','m','d')";
|
||||
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
if ($row = $this->db_fetch_object())
|
||||
{
|
||||
if ($row->anzahl > 0)
|
||||
{
|
||||
$this->errormsg = '';
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = '';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Befüllt MasterZGV-Felder: Nation mit Österreich und MasterZGV-code mit FH-Bachelor(I)
|
||||
* @param int $person_id Personenkennzeichen.
|
||||
* @param varchar $ort Ort.
|
||||
* @return true wenn erfolgreich durchgeführt
|
||||
* false und errormsg wenn ein Fehler aufgetreten ist
|
||||
*/
|
||||
public function setZGVMasterFields($person_id, $ort)
|
||||
{
|
||||
if (!is_numeric($person_id))
|
||||
{
|
||||
$this->errormsg = 'Person_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
$db = new basis_db();
|
||||
$arrayleereManations = array();
|
||||
|
||||
//all prestudent_ids mit Status Interessent
|
||||
$qry = "SELECT
|
||||
*
|
||||
FROM
|
||||
public.tbl_prestudent
|
||||
JOIN
|
||||
public.tbl_studiengang USING (studiengang_kz)
|
||||
WHERE
|
||||
person_id = ".$this->db_add_param($person_id)."
|
||||
AND
|
||||
typ ='m'
|
||||
And
|
||||
get_rolle_prestudent(prestudent_id, null) = 'Interessent';";
|
||||
|
||||
if ($db->db_query($qry))
|
||||
{
|
||||
$num_rows = $db->db_num_rows();
|
||||
|
||||
if ($num_rows > 0)
|
||||
{
|
||||
while ($row = $db->db_fetch_object())
|
||||
{
|
||||
$arrayleereManations[] = $row->prestudent_id;
|
||||
}
|
||||
|
||||
if ($arrayleereManations)
|
||||
{
|
||||
$qry = "UPDATE
|
||||
public.tbl_prestudent
|
||||
SET
|
||||
(zgvmanation, zgvmaort, zgvmas_code) = ('A',".$this->db_add_param($ort).",1)
|
||||
WHERE
|
||||
prestudent_id in (";
|
||||
|
||||
foreach ($arrayleereManations as $prestudent_id)
|
||||
{
|
||||
$qry .= $prestudent_id;
|
||||
|
||||
if (next($arrayleereManations) == true)
|
||||
{
|
||||
$qry .= ",";
|
||||
}
|
||||
}
|
||||
$qry .= ");";
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Eintragen zgvMasterFields';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prueft, ob eine Person einen aktuellen PreStudentstatus-Eintrag Interessent für einen Masterstudiengang besitzt
|
||||
* @param int $person_id ID der zu überprüfenden Person.
|
||||
* @return true wenn vorhanden, false wenn nicht vorhanden
|
||||
*/
|
||||
public function existsStatusInteressentMaster($person_id)
|
||||
{
|
||||
if (!is_numeric($person_id))
|
||||
{
|
||||
$this->errormsg = 'Person_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
$db = new basis_db();
|
||||
$prestudentsOfMaster = array();
|
||||
|
||||
$qry = "SELECT
|
||||
prestudent_id
|
||||
FROM
|
||||
tbl_prestudent ps, tbl_studiengang sg
|
||||
WHERE
|
||||
ps.studiengang_kz = sg.studiengang_kz
|
||||
AND
|
||||
sg.typ in ('m')
|
||||
AND
|
||||
person_id = ".$this->db_add_param($person_id)."
|
||||
And
|
||||
get_rolle_prestudent(prestudent_id, null) = 'Interessent';";
|
||||
|
||||
if ($db->db_query($qry))
|
||||
{
|
||||
$num_rows = $db->db_num_rows();
|
||||
if ($num_rows > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Liefert den wahrscheinlichen Studiengang der MasterZGV einer Person
|
||||
* @param int $person_id ID der zu überprüfenden Person.
|
||||
* @return string studiengangkurzbzlang
|
||||
*/
|
||||
public function getZGVMasterStg($person_id)
|
||||
{
|
||||
if (!is_numeric($person_id))
|
||||
{
|
||||
$this->errormsg = 'Person_id muss eine gueltige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry = "SELECT kurzbzlang
|
||||
FROM public.tbl_prestudent
|
||||
JOIN public.tbl_prestudentstatus USING (prestudent_id)
|
||||
JOIN public.tbl_studiengang USING (studiengang_kz)
|
||||
WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)."
|
||||
AND status_kurzbz in ('Absolvent','Diplomand','Unterbrecher','Student')
|
||||
AND typ in ('b','m','d')
|
||||
ORDER BY status_kurzbz ASC
|
||||
LIMIT 1;";
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
if ($row = $this->db_fetch_object())
|
||||
{
|
||||
$stg = $row->kurzbzlang;
|
||||
return $stg;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,10 +33,12 @@ const DEFAULT_SANCHO_FOOTER_IMG = 'sancho_footer_DEFAULT.jpg';
|
||||
* @param string $to Email-adress.
|
||||
* @param string $subject Subject of mail.
|
||||
* @param string $headerImg Filename of the specific Sancho header image.
|
||||
* @param string $footerImg
|
||||
* @param string $replyTo default Email-adress for reply.
|
||||
* @param string | array $cc
|
||||
* @return boolean True, if succeeded.
|
||||
*/
|
||||
function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerImg = DEFAULT_SANCHO_HEADER_IMG, $footerImg = DEFAULT_SANCHO_FOOTER_IMG, $replyTo = '')
|
||||
function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerImg = DEFAULT_SANCHO_HEADER_IMG, $footerImg = DEFAULT_SANCHO_FOOTER_IMG, $replyTo = '', $cc = '')
|
||||
{
|
||||
$from = 'sancho@'. DOMAIN;
|
||||
$sanchoHeader_img = dirname(__FILE__). '/../skin/images/sancho/'. $headerImg;
|
||||
@@ -69,6 +71,10 @@ function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerIm
|
||||
// * Set reply-to
|
||||
if (isset($replyTo) && $replyTo != '')
|
||||
$mail->setReplyTo($replyTo);
|
||||
|
||||
// * Set cc
|
||||
if (isset($cc) && $cc != '')
|
||||
$mail->setCCRecievers($cc);
|
||||
|
||||
// * embed the html content
|
||||
$mail->setHTMLContent($body);
|
||||
|
||||
Reference in New Issue
Block a user