";
@@ -150,19 +151,34 @@ if(isset($_POST['submitbild']))
$person->foto = $content;
$person->new = false;
if($person->save())
- echo "Bild wurde erfolgreich gespeichert
- ";
+ {
+ $fs = new fotostatus();
+ $fs->person_id=$person->person_id;
+ $fs->fotostatus_kurzbz='hochgeladen';
+ $fs->datum = date('Y-m-d');
+ $fs->insertamum = date('Y-m-d H:i:s');
+ $fs->insertvon = $user;
+ $fs->updateamum = date('Y-m-d H:i:s');
+ $fs->updatevon = $user;
+ if(!$fs->save(true))
+ echo 'Fehler beim Setzen des Bildstatus';
+ else
+ {
+ echo "Bild wurde erfolgreich gespeichert
+ ";
+ }
+ }
else
echo ''.$person->errormsg.' ';
}
diff --git a/include/fotostatus.class.php b/include/fotostatus.class.php
new file mode 100755
index 000000000..f62bb5a86
--- /dev/null
+++ b/include/fotostatus.class.php
@@ -0,0 +1,189 @@
+ and
+ */
+require_once(dirname(__FILE__).'/basis_db.class.php');
+
+class fotostatus extends basis_db
+{
+ public $new; // boolean
+ public $result = array(); // adresse Objekt
+
+ //Tabellenspalten
+ public $fotostatus_kurzbz; // varchar(32)
+ public $beschreibung; // varchar(256)
+
+ public $person_fotostatus_id; // integer
+ public $person_id; // integer
+ public $datum; // date
+ public $updateamum; // timestamp
+ public $updatevon; // string
+ public $insertamum; // timestamp
+ public $insertvon; // string
+
+ /**
+ * Konstruktor
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ /**
+ * Prueft ob das Profilfoto der Person bereits akzeptiert wurde
+ * @param $person_id
+ */
+ public function akzeptiert($person_id)
+ {
+ $qry = "SELECT
+ *
+ FROM
+ public.tbl_person_fotostatus
+ WHERE
+ person_id=".$this->db_add_param($person_id)."
+ AND fotostatus_kurzbz='akzeptiert'";
+ if($result = $this->db_query($qry))
+ {
+ if($this->db_num_rows($result)>0)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ $this->errormsg = 'Fehler beim Laden der Daten';
+ return false;
+ }
+ }
+
+ public function save($new=null)
+ {
+ if(is_null($new))
+ $new = $this->new;
+
+ if($new)
+ {
+ $qry = 'BEGIN;INSERT INTO public.tbl_person_fotostatus(person_id, fotostatus_kurzbz, datum,
+ insertamum, insertvon, updateamum, updatevon) VALUES('.
+ $this->db_add_param($this->person_id).','.
+ $this->db_add_param($this->fotostatus_kurzbz).','.
+ $this->db_add_param($this->datum).','.
+ $this->db_add_param($this->insertamum).','.
+ $this->db_add_param($this->insertvon).','.
+ $this->db_add_param($this->updateamum).','.
+ $this->db_add_param($this->updatevon).');';
+ }
+ else
+ {
+ $qry = 'UPDATE public.tbl_person_fotostatus SET '.
+ 'person_id='.$this->db_add_param($this->person_id).', '.
+ 'fotostatus_kurzbz='.$this->db_add_param($this->fotostatus_kurzbz).', '.
+ 'datum='.$this->db_add_param($this->datum).', '.
+ 'updateamum='.$this->db_add_param($this->updateamum).', '.
+ 'updatevon='.$this->db_add_param($this->updatevon).' '.
+ 'WHERE person_fotostatus_id='.$this->db_add_param($this->person_fotostatus_id);
+ }
+
+ if($result = $this->db_query($qry))
+ {
+ if($new)
+ {
+ // ID aus der Sequence holen
+ $qry="SELECT currval('public.seq_person_fotostatus_person_fotostatus_id') as id;";
+ if($this->db_query($qry))
+ {
+ if($row = $this->db_fetch_object())
+ {
+ $this->person_fotostatus_id = $row->id;
+ $this->db_query('COMMIT');
+ return true;
+ }
+ else
+ {
+ $this->db_query('ROLLBACK');
+ $this->errormsg = "Fehler beim Auslesen der Sequence";
+ return false;
+ }
+ }
+ else
+ {
+ $this->db_query('ROLLBACK');
+ $this->errormsg = 'Fehler beim Auslesen der Sequence';
+ return false;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ $this->errormsg = 'Fehler beim Speichern des Fotostatus';
+ return false;
+ }
+ }
+
+ /**
+ * Laedt den letzten Fotostatus einer Person
+ * @param $person_id
+ */
+ public function getLastFotoStatus($person_id)
+ {
+ $qry = 'SELECT
+ *
+ FROM
+ public.tbl_person_fotostatus
+ WHERE
+ person_id='.$this->db_add_param($person_id).'
+ ORDER BY datum desc, person_fotostatus_id DESC
+ LIMIT 1';
+
+ if($result = $this->db_query($qry))
+ {
+ if($row = $this->db_fetch_object($result))
+ {
+ $this->person_fotostatus_id = $row->person_fotostatus_id;
+ $this->person_id = $row->person_id;
+ $this->fotostatus_kurzbz = $row->fotostatus_kurzbz;
+ $this->datum = $row->datum;
+ $this->insertamum = $row->insertamum;
+ $this->insertvon = $row->insertvon;
+ $this->updateaum = $row->updateamum;
+ $this->updatevon = $row->updatevon;
+
+ return true;
+ }
+ else
+ {
+ $this->errormsg = 'Eintrag wurde nicht gefunden';
+ return false;
+ }
+ }
+ else
+ {
+ $this->errormsg = 'Fehler beim Laden der Daten';
+ return false;
+ }
+ }
+}
+?>
diff --git a/locale/de-AT/profil.php b/locale/de-AT/profil.php
index fd3644606..831e4ec81 100644
--- a/locale/de-AT/profil.php
+++ b/locale/de-AT/profil.php
@@ -60,4 +60,5 @@ $this->phrasen['profil/fotofreigeben']='Sperre des Profilfotos aufheben';
$this->phrasen['profil/fotosperren']='Profilfoto sperren';
$this->phrasen['profil/infotextSperre']='Gesperrte Profilbilder werden nur für Zutrittskarten verwendet und scheinen nicht auf Anwesenheitslisten oder in der Personensuche auf';
$this->phrasen['profil/profilfotoGesperrt']='Profilfoto gesperrt';
+$this->phrasen['profil/profilfotoUploadGesperrt']='Der Upload des Profilfotos ist nicht mehr möglich';
?>
diff --git a/system/FH-Complete.txp b/system/FH-Complete.txp
index a73eb9b08..3f6e8b7c4 100644
--- a/system/FH-Complete.txp
+++ b/system/FH-Complete.txp
@@ -9197,7 +9197,7 @@
369070200
- 455
+ 47420001
@@ -26449,7 +26449,7 @@
{E76B9DCC-0F11-4283-9226-6A9E0CE91E76}
- fk_person_personfotostatus
+ fk_person_person_fotostatus0{14359BEE-7B30-4A4C-9D45-1725CF111C7A}0
@@ -26469,7 +26469,7 @@
{435F72C8-6F6D-4FC5-BC8F-516F28671EEB}
- 8872
+ 88822265
@@ -26481,18 +26481,18 @@
859
- 7506
+ 75253790
- 7475
+ 74943790{212EE094-9435-454C-8AEC-E6317BF51755}
- fk_fotostatus_personfotostatus
+ fk_fotostatus_person_fotostatus0{3229D757-B586-44B2-9344-642F168203E6}0
@@ -26512,7 +26512,7 @@
{435F72C8-6F6D-4FC5-BC8F-516F28671EEB}
- 7192
+ 71963910
@@ -26524,11 +26524,11 @@
4019
- 7248
+ 72573921
- 7248
+ 72573890
@@ -29196,8 +29196,8 @@
00-28
- 3851
- 7795
+ 3853
+ 81070851204
@@ -29236,7 +29236,7 @@
378765430
- 854
+ 87535601
@@ -33368,7 +33368,7 @@
{43669901-FA47-44FB-87F4-B95989732B93}
- fk_person_personfotostatus
+ fk_person_person_fotostatus0{ABFCC2FB-5F14-4E81-B53D-DB8BC7B97C81}0
@@ -33388,7 +33388,7 @@
{A3D836BC-B6F6-47F1-BD50-9C33D439E2FE}
- 6930
+ 69353629
@@ -33400,18 +33400,18 @@
3622
- 6970
+ 69803756
- 6970
+ 69803787{FFAEB0A2-7C93-4760-9FCD-18E27CE7D9AB}
- fk_fotostatus_personfotostatus
+ fk_fotostatus_person_fotostatus0{905662B6-96E2-486D-B8B8-9BAA08E88A2D}0
@@ -33431,23 +33431,23 @@
{A3D836BC-B6F6-47F1-BD50-9C33D439E2FE}
- 7496
- 3899
+ 7599
+ 3893
- 7795
- 3953
+ 8107
+ 3955
- 7764
- 3953
+ 8076
+ 3955
- 7428
+ 74493965
- 7397
+ 74183965
@@ -49414,7 +49414,7 @@
{117121F4-B6F0-4DA2-892E-D0CF6FA1BE85}
- fk_person_personfotostatus
+ fk_person_person_fotostatus0{434CB90D-607D-4E8A-971B-B00AEE0EEE61}0
@@ -49440,7 +49440,7 @@
{9A74E2A2-6606-40C2-B9DF-F91D9BDD93D0}
- fk_fotostatus_personfotostatus
+ fk_fotostatus_person_fotostatus0{45117CC8-415C-4F9E-A629-B6ACD4CE74B0}0
@@ -49602,7 +49602,7 @@
Technikum Wien2.02009-04-17T11:15:21.000+02:00
- 2012-06-18T16:44:47.677+02:00
+ 2012-06-20T09:42:03.081+02:00FH-Complete 2.0<?xml-stylesheet type="text/xsl" href="FHCompleteTDM3PG83.xsl"?>
@@ -151495,7 +151495,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
{E1B9C780-5FB0-4A24-A124-8EFB08C483E4}
- personfotostatus_id
+ person_fotostatus_id1{D8A1F5EC-E373-4B78-9134-4AA02ED76E6A}0
@@ -151513,7 +151513,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
10
-
personfotostatus_id
+
person_fotostatus_id
0
@@ -151847,7 +151847,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
{2CDA30F7-34F0-4D6C-94A0-5C0DAD4E8F3F}
- personfotostatus_id
+ person_fotostatus_id0{FFB59F5A-AC85-4B33-9967-0E56B879CCAF}0
@@ -175509,7 +175509,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
{94403655-C8DB-4232-B606-E0FC702DFDAC}
- fk_person_personfotostatus
+ fk_person_person_fotostatus0{1C7204B5-A622-446A-9749-D813009292F0}0
@@ -175527,7 +175527,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
0-1
-
fk_person_personfotostatus
+
fk_person_person_fotostatus
00
@@ -175567,7 +175567,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
{526289A5-6F74-4DF5-B548-8FFF3D6909FE}
- fk_fotostatus_personfotostatus
+ fk_fotostatus_person_fotostatus0{6B04C8CC-6FB1-40C0-81B5-5BFA94F3A895}0
@@ -175585,7 +175585,7 @@ Wenn FALSE haengt die Anzahl der Fragen pro Level von der Gesamtzahl pro Level a
0-1
-