diff --git a/cis/private/tools/psearch.php b/cis/private/tools/psearch.php
index 07573e6c4..b4e99e819 100644
--- a/cis/private/tools/psearch.php
+++ b/cis/private/tools/psearch.php
@@ -119,7 +119,7 @@
else
{
//$sql_query = "SELECT DISTINCT tbl_person.uid, titel, nachname, vornamen, telefonklappe AS teltw, (tbl_person.uid || '@technikum-wien.at') AS emailtw, foto, -1 AS studiengang_kz, -1 AS semester, ort_kurzbz as ort FROM public.tbl_person, public.tbl_mitarbeiter WHERE tbl_mitarbeiter.uid=tbl_person.uid AND public.tbl_funktion.funktion_kurzbz='$cmbChoice' AND public.tbl_personfunktion.funktion_kurzbz=public.tbl_funktion.funktion_kurzbz AND tbl_person.uid=public.tbl_personfunktion.uid AND aktiv=TRUE UNION SELECT DISTINCT tbl_person.uid, (''::varchar) AS titel, nachname, vornamen, (''::varchar) AS teltw, (tbl_person.uid || '@technikum-wien.at') AS emailtw, foto, studiengang_kz, semester, ''::varchar as ort FROM public.tbl_person, public.tbl_student WHERE semester<10 AND tbl_person.uid=tbl_student.uid AND public.tbl_funktion.funktion_kurzbz='$cmbChoice' AND public.tbl_personfunktion.funktion_kurzbz=public.tbl_funktion.funktion_kurzbz AND tbl_person.uid=public.tbl_personfunktion.uid AND aktiv=TRUE ORDER BY nachname, vornamen";
- $sql_query = "SELECT DISTINCT uid, titelpre, titelpost, nachname, vorname, vornamen, standort_kurzbz, telefonklappe AS teltw, (uid || '@technikum-wien.at') AS emailtw, foto, -1 AS studiengang_kz, -1 AS semester, ort_kurzbz as ort FROM campus.vw_mitarbeiter JOIN public.tbl_benutzerfunktion using(uid) WHERE funktion_kurzbz='$cmbChoice' UNION SELECT DISTINCT uid, titelpre,titelpost, nachname, vorname, vornamen,(''::varchar) AS standort_kurzbz, (''::varchar) AS teltw, (uid || '@technikum-wien.at') AS emailtw, foto, vw_student.studiengang_kz, semester, ''::varchar as ort FROM campus.vw_student JOIN public.tbl_benutzerfunktion using(uid) WHERE semester<10 AND funktion_kurzbz='$cmbChoice' ORDER BY nachname, vorname";
+ $sql_query = "SELECT DISTINCT uid, titelpre, titelpost, nachname, vorname, vornamen, standort_kurzbz, telefonklappe AS teltw, (uid || '@technikum-wien.at') AS emailtw, foto, -1 AS studiengang_kz, -1 AS semester, ort_kurzbz as ort FROM campus.vw_mitarbeiter JOIN public.tbl_benutzerfunktion using(uid) WHERE funktion_kurzbz='$cmbChoice' AND aktiv UNION SELECT DISTINCT uid, titelpre,titelpost, nachname, vorname, vornamen,(''::varchar) AS standort_kurzbz, (''::varchar) AS teltw, (uid || '@technikum-wien.at') AS emailtw, foto, vw_student.studiengang_kz, semester, ''::varchar as ort FROM campus.vw_student JOIN public.tbl_benutzerfunktion using(uid) WHERE semester<10 AND funktion_kurzbz='$cmbChoice' AND aktiv ORDER BY nachname, vorname";
}
}
else
diff --git a/content/bildupload.php b/content/bildupload.php
index 939ed9f8a..42f41408a 100644
--- a/content/bildupload.php
+++ b/content/bildupload.php
@@ -45,6 +45,7 @@ function resize($filename, $width, $height)
// Hoehe und Breite neu berechnen
list($width_orig, $height_orig) = getimagesize($filename);
+
if ($width && ($width_orig < $height_orig))
{
$width = ($height / $height_orig) * $width_orig;
@@ -55,11 +56,15 @@ function resize($filename, $width, $height)
}
$image_p = imagecreatetruecolor($width, $height);
-
- //Bilder vergroessern/verkleinern und wieder zurueckschreiben
-
+
$image = imagecreatefromjpeg($filename);
- imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
+
+ //Bild nur verkleinern aber nicht vergroessern
+ if($width_orig>$width || $height_orig>$height)
+ imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
+ else
+ $image_p = $image;
+
imagejpeg($image_p, $filename, 80);
imagedestroy($image_p);
@@ -89,7 +94,7 @@ if(isset($_POST['submitbild']))
$width=101;
$height=130;
- //--check that it's a jpeg or gif or png
+ //--check that it's a jpeg
if ($ext=='jpg' || $ext=='jpeg')
{
$filename = $_FILES['bild']['tmp_name'];
@@ -103,6 +108,22 @@ if(isset($_POST['submitbild']))
fclose($fp);
$akte = new akte($conn);
+
+ if($akte->getAkten($_GET['person_id'], 'Lichtbil'))
+ {
+ if(count($akte->result)>0)
+ {
+ $akte = $akte->result[0];
+ $akte->new = false;
+ }
+ else
+ $akte->new = true;
+ }
+ else
+ {
+ $akte->new = true;
+ }
+
$akte->dokument_kurzbz = 'Lichtbil';
$akte->person_id = $_GET['person_id'];
$akte->inhalt = strhex($content);
@@ -117,7 +138,7 @@ if(isset($_POST['submitbild']))
$akte->insertvon = $user;
$akte->uid = '';
- if(!$akte->save(true))
+ if(!$akte->save())
{
echo "Fehler: $akte->errormsg";
}
@@ -149,7 +170,7 @@ if(isset($_POST['submitbild']))
echo ''.$person->errormsg.'
';
}
else
- echo "File ist kein gueltiges Bild
";
+ echo "Derzeit koennen nur Bilder im JPG Format hochgeladen werden
";
}
}
diff --git a/content/fasDBDML.php b/content/fasDBDML.php
index 037dec61e..e47f489ff 100644
--- a/content/fasDBDML.php
+++ b/content/fasDBDML.php
@@ -490,6 +490,49 @@ if(!$error)
$errormsg = 'Falsche Paramenteruebergabe';
}
}
+ elseif(isset($_POST['type']) && $_POST['type']=='imagedelete')
+ {
+ if(isset($_POST['person_id']) && is_numeric($_POST['person_id']))
+ {
+ if(($_POST['studiengang_kz']!='' && !$rechte->isBerechtigt('admin', $_POST['studiengang_kz'],'suid') &&
+ !$rechte->isBerechtigt('assistenz', $_POST['studiengang_kz'], 'suid')) ||
+ ($_POST['studiengang_kz']=='' && !$rechte->isBerechtigt('admin', null, 'suid') &&
+ !$rechte->isBerechtigt('mitarbeiter', null, 'suid')))
+ {
+ $return = false;
+ $errormsg = 'Keine Berechtigung';
+ $data = '';
+ $error = true;
+ }
+ else
+ {
+ $qry = "UPDATE public.tbl_person SET foto=null WHERE person_id='".$_POST['person_id']."'";
+ if(pg_query($conn, $qry))
+ {
+ $qry = "DELETE FROM public.tbl_akte WHERE person_id='".$_POST['person_id']."' AND dokument_kurzbz='Lichtbil'";
+ if(pg_query($conn, $qry))
+ {
+ $return = true;
+ }
+ else
+ {
+ $return = false;
+ $errormsg = 'Fehler beim Loeschen des grossen Bildes';
+ }
+ }
+ else
+ {
+ $return = false;
+ $errormsg = 'Fehler beim Loeschen des Bildes';
+ }
+ }
+ }
+ else
+ {
+ $return = false;
+ $errormsg = 'Falsche Parameteruebergabe'.$_POST['person_id'].'x';
+ }
+ }
elseif(isset($_POST['type']) && $_POST['type']=='getvariable')
{
$variable = new variable($conn, null, null, true);
diff --git a/content/statistik/bewerberstatistik.php b/content/statistik/bewerberstatistik.php
index 23124b0e7..de97f5ff9 100644
--- a/content/statistik/bewerberstatistik.php
+++ b/content/statistik/bewerberstatistik.php
@@ -45,7 +45,7 @@ echo '
| Personen | +Stg | +
|---|---|
| $row->anzahlpers | $row->anzahlstg |
| $summestudenten |