diff --git a/skin/croppie.css b/skin/croppie.css new file mode 100644 index 000000000..0af2e2c60 --- /dev/null +++ b/skin/croppie.css @@ -0,0 +1,250 @@ +.croppie-container { + width: 100%; + height: 100%; +} + +.croppie-container .cr-image { + z-index: -1; + position: absolute; + top: 0; + left: 0; + transform-origin: 0 0; + max-height: none; + max-width: none; +} + +.croppie-container .cr-boundary { + position: relative; + overflow: hidden; + margin: 0 auto; + z-index: 1; + width: 100%; + height: 100%; +} + +.croppie-container .cr-viewport, +.croppie-container .cr-resizer { + position: absolute; + border: 2px solid #fff; + margin: auto; + top: 0; + bottom: 0; + right: 0; + left: 0; + box-shadow: 0 0 2000px 2000px rgba(0, 0, 0, 0.5); + z-index: 0; +} + +.croppie-container .cr-resizer { + z-index: 2; + box-shadow: none; + pointer-events: none; +} + +.croppie-container .cr-resizer-vertical, +.croppie-container .cr-resizer-horisontal { + position: absolute; + pointer-events: all; +} + +.croppie-container .cr-resizer-vertical::after, +.croppie-container .cr-resizer-horisontal::after { + display: block; + position: absolute; + box-sizing: border-box; + border: 1px solid black; + background: #fff; + width: 10px; + height: 10px; + content: ''; +} + +.croppie-container .cr-resizer-vertical { + bottom: -5px; + cursor: row-resize; + width: 100%; + height: 10px; +} + +.croppie-container .cr-resizer-vertical::after { + left: 50%; + margin-left: -5px; +} + +.croppie-container .cr-resizer-horisontal { + right: -5px; + cursor: col-resize; + width: 10px; + height: 100%; +} + +.croppie-container .cr-resizer-horisontal::after { + top: 50%; + margin-top: -5px; +} + +.croppie-container .cr-original-image { + display: none; +} + +.croppie-container .cr-vp-circle { + border-radius: 50%; +} + +.croppie-container .cr-overlay { + z-index: 1; + position: absolute; + cursor: move; + touch-action: none; +} + +.croppie-container .cr-slider-wrap { + width: 75%; + margin: 15px auto; + text-align: center; +} + +.croppie-result { + position: relative; + overflow: hidden; +} + +.croppie-result img { + position: absolute; +} + +.croppie-container .cr-image, +.croppie-container .cr-overlay, +.croppie-container .cr-viewport { + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); +} + +/*************************************/ +/***** STYLING RANGE INPUT ***********/ +/*************************************/ +/*http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html */ +/*************************************/ + +.cr-slider { + -webkit-appearance: none; +/*removes default webkit styles*/ + /*border: 1px solid white; *//*fix for FF unable to apply focus style bug */ + width: 300px; +/*required for proper track sizing in FF*/ + max-width: 100%; + padding-top: 8px; + padding-bottom: 8px; + background-color: transparent; +} + +.cr-slider::-webkit-slider-runnable-track { + width: 100%; + height: 3px; + background: rgba(0, 0, 0, 0.5); + border: 0; + border-radius: 3px; +} + +.cr-slider::-webkit-slider-thumb { + -webkit-appearance: none; + border: none; + height: 16px; + width: 16px; + border-radius: 50%; + background: #ddd; + margin-top: -6px; +} + +.cr-slider:focus { + outline: none; +} +/* +.cr-slider:focus::-webkit-slider-runnable-track { +background: #ccc; +} +*/ + +.cr-slider::-moz-range-track { + width: 100%; + height: 3px; + background: rgba(0, 0, 0, 0.5); + border: 0; + border-radius: 3px; +} + +.cr-slider::-moz-range-thumb { + border: none; + height: 16px; + width: 16px; + border-radius: 50%; + background: #ddd; + margin-top: -6px; +} + +/*hide the outline behind the border*/ +.cr-slider:-moz-focusring { + outline: 1px solid white; + outline-offset: -1px; +} + +.cr-slider::-ms-track { + width: 100%; + height: 5px; + background: transparent; +/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */ + border-color: transparent;/*leave room for the larger thumb to overflow with a transparent border */ + border-width: 6px 0; + color: transparent;/*remove default tick marks*/ +} +.cr-slider::-ms-fill-lower { + background: rgba(0, 0, 0, 0.5); + border-radius: 10px; +} +.cr-slider::-ms-fill-upper { + background: rgba(0, 0, 0, 0.5); + border-radius: 10px; +} +.cr-slider::-ms-thumb { + border: none; + height: 16px; + width: 16px; + border-radius: 50%; + background: #ddd; + margin-top:1px; +} +.cr-slider:focus::-ms-fill-lower { + background: rgba(0, 0, 0, 0.5); +} +.cr-slider:focus::-ms-fill-upper { + background: rgba(0, 0, 0, 0.5); +} +/*******************************************/ + +/***********************************/ +/* Rotation Tools */ +/***********************************/ +.cr-rotate-controls { + position: absolute; + bottom: 5px; + left: 5px; + z-index: 1; +} +.cr-rotate-controls button { + border: 0; + background: none; +} +.cr-rotate-controls i:before { + display: inline-block; + font-style: normal; + font-weight: 900; + font-size: 22px; +} +.cr-rotate-l i:before { + content: '↺'; +} +.cr-rotate-r i:before { + content: '↻'; +} diff --git a/vilesci/fhausweis/bildpruefung.php b/vilesci/fhausweis/bildpruefung.php index 9b5ef7dc4..6be0cabac 100644 --- a/vilesci/fhausweis/bildpruefung.php +++ b/vilesci/fhausweis/bildpruefung.php @@ -342,12 +342,13 @@ $qry_anzahl_mitarbeiter = " FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) - JOIN public.tbl_akte USING (person_id) + LEFT JOIN PUBLIC.tbl_akte ON (tbl_akte.person_id = tbl_person.person_id + AND tbl_akte.dokument_kurzbz = 'Lichtbil' + AND (tbl_akte.inhalt IS NOT NULL OR tbl_akte.dms_id IS NOT NULL)) LEFT JOIN public.tbl_mitarbeiter ON (tbl_benutzer.uid=mitarbeiter_uid) WHERE foto is not NULL AND tbl_benutzer.aktiv - AND tbl_akte.dokument_kurzbz='Lichtbil' AND 'akzeptiert' NOT IN(SELECT fotostatus_kurzbz FROM public.tbl_person_fotostatus WHERE person_id=tbl_person.person_id ORDER BY datum desc, person_fotostatus_id desc LIMIT 1) AND 'abgewiesen' NOT IN (SELECT fotostatus_kurzbz FROM public.tbl_person_fotostatus @@ -367,12 +368,13 @@ $qry_anzahl_studenten = " FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) - JOIN public.tbl_akte USING (person_id) + LEFT JOIN PUBLIC.tbl_akte ON (tbl_akte.person_id = tbl_person.person_id + AND tbl_akte.dokument_kurzbz = 'Lichtbil' + AND (tbl_akte.inhalt IS NOT NULL OR tbl_akte.dms_id IS NOT NULL)) LEFT JOIN public.tbl_mitarbeiter ON (tbl_benutzer.uid=mitarbeiter_uid) WHERE foto is not NULL AND tbl_benutzer.aktiv - AND tbl_akte.dokument_kurzbz='Lichtbil' AND 'akzeptiert' NOT IN(SELECT fotostatus_kurzbz FROM public.tbl_person_fotostatus WHERE person_id=tbl_person.person_id ORDER BY datum desc, person_fotostatus_id desc LIMIT 1) AND 'abgewiesen' NOT IN (SELECT fotostatus_kurzbz FROM public.tbl_person_fotostatus @@ -392,11 +394,12 @@ $qry_anzahl_gesamt = " FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) - JOIN public.tbl_akte USING (person_id) + LEFT JOIN PUBLIC.tbl_akte ON (tbl_akte.person_id = tbl_person.person_id + AND tbl_akte.dokument_kurzbz = 'Lichtbil' + AND (tbl_akte.inhalt IS NOT NULL OR tbl_akte.dms_id IS NOT NULL)) WHERE foto is not NULL AND tbl_benutzer.aktiv - AND tbl_akte.dokument_kurzbz='Lichtbil' AND 'akzeptiert' NOT IN(SELECT fotostatus_kurzbz FROM public.tbl_person_fotostatus WHERE person_id=tbl_person.person_id ORDER BY datum desc, person_fotostatus_id desc LIMIT 1) AND 'abgewiesen' NOT IN (SELECT fotostatus_kurzbz FROM public.tbl_person_fotostatus @@ -418,24 +421,29 @@ echo '
// Laden einer Person deren Profilfoto noch nicht akzeptiert wurde $qry = " SELECT - *, + tbl_person.person_id, + tbl_person.vorname, + tbl_person.nachname, + tbl_akte.dokument_kurzbz, + tbl_akte.dms_id, (SELECT 1 FROM public.tbl_mitarbeiter JOIN public.tbl_benutzer ON(mitarbeiter_uid=uid) WHERE person_id=tbl_person.person_id LIMIT 1) as mitarbeiter FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) - JOIN public.tbl_akte USING (person_id) + LEFT JOIN PUBLIC.tbl_akte ON (tbl_akte.person_id = tbl_person.person_id + AND tbl_akte.dokument_kurzbz = 'Lichtbil' + AND (tbl_akte.inhalt IS NOT NULL OR tbl_akte.dms_id IS NOT NULL)) WHERE foto is not NULL AND tbl_benutzer.aktiv - AND tbl_akte.dokument_kurzbz='Lichtbil' ".$ansicht; if($error==true && $person_id!='') { // Wenn ein Fehler auftritt oder Bestof geklickt wird, wird die Person erneut angezeigt - $qry.=" AND person_id=".$db->db_add_param($person_id); + $qry.=" AND tbl_person.person_id=".$db->db_add_param($person_id); } else { @@ -470,7 +478,22 @@ if($result = $db->db_query($qry)) @@ -493,7 +516,12 @@ if($result = $db->db_query($qry)) echo ' '; echo ''; echo '


'; - echo 'Bild Upload'; + // Wenn es eine Akte mit Lichtbild gibt, das Foto aus der Akte laden (Parameter Akte im Link) sonst aus der Person + if ($row->dokument_kurzbz == 'Lichtbil') + echo 'Bild zuschneiden/Upload'; + else + echo 'Bild zuschneiden/Upload'; + if ($row->dms_id !='') { echo '

'; diff --git a/vilesci/fhausweis/bildzuschnitt.php b/vilesci/fhausweis/bildzuschnitt.php new file mode 100644 index 000000000..e1fabbb1e --- /dev/null +++ b/vilesci/fhausweis/bildzuschnitt.php @@ -0,0 +1,429 @@ + + */ + +require_once ('../../config/cis.config.inc.php'); +require_once ('../../config/global.config.inc.php'); +require_once ('../../include/functions.inc.php'); +require_once ('../../include/person.class.php'); +require_once ('../../include/prestudent.class.php'); +require_once ('../../include/benutzerberechtigung.class.php'); +require_once ('../../include/akte.class.php'); +require_once ('../../include/dokument.class.php'); +require_once ('../../include/mail.class.php'); +require_once ('../../include/phrasen.class.php'); +require_once ('../../include/dms.class.php'); +require_once ('../../include/fotostatus.class.php'); +require_once ('../../include/studiensemester.class.php'); +require_once ('../../include/nation.class.php'); +require_once ('../../include/personlog.class.php'); +//require_once ('../bewerbung.config.inc.php'); +//require_once ('../include/functions.inc.php'); + +header("Content-Type: text/html; charset=utf-8"); + +// session_cache_limiter('none'); //muss gesetzt werden sonst funktioniert der Download mit IE8 nicht +// session_start(); + +$sprache = getSprache(); +$p = new phrasen($sprache); +$log = new personlog(); + +$db = new basis_db(); + +if (isset($_GET['lang'])) + setSprache($_GET['lang']); + +$person_id = isset($_GET['person_id']) ? $_GET['person_id'] : ''; +$typ = isset($_GET['typ']) ? $_GET['typ'] : 'akte'; // Parameter ob das Bild aus der Akte oder der Person geladen werden soll +$uid = get_uid(); +$rechte = new benutzerberechtigung(); +$rechte->getBerechtigungen($uid); + +if(!$rechte->isBerechtigt('basis/fhausweis','suid')) +{ + die($rechte->errormsg); +} + +$dokumenttyp = 'Lichtbil'; + +$error = ''; +$message = ''; +$dokumenttyp_upload = ''; + +$PHP_SELF = $_SERVER['PHP_SELF']; ?> + + + + + <?php echo $p->t('bewerbung/fileUpload'); ?> + + + + + + + + + + + +'; + +if ($error === false) +{ + echo '
+ + '.$message.' +
'; +} +elseif ($error === true) +{ + echo '
+ + '.$p->t('global/fehleraufgetreten').' '.$message.' +
'; +} +echo ''; + +if ($person_id != '') +{ + echo ' + +

+
+
+
+
Upload Image
+
'; + + // Container für Bildzuschnitt + echo '
'; + echo' +
+ +

+ + +
+
+
+
+
+ + '; +} +else +{ + echo $p->t('bewerbung/fehlerKeinePersonId'); +} +function resize($filename, $width, $height) +{ + $ext = explode('.', $_FILES['file']['name']); + $ext = mb_strtolower($ext[count($ext) - 1]); + + // Hoehe und Breite neu berechnen + list ($width_orig, $height_orig) = getimagesize($filename); + + if ($width && ($width_orig < $height_orig)) + { + $width = ($height / $height_orig) * $width_orig; + } + else + { + $height = ($width / $width_orig) * $height_orig; + } + + $image_p = imagecreatetruecolor($width, $height); + + $image = imagecreatefromjpeg($filename); + + // 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; + + $tmpfname = tempnam(sys_get_temp_dir(), 'FHC'); + + imagejpeg($image_p, $tmpfname, 80); + + imagedestroy($image_p); + @imagedestroy($image); + return $tmpfname; +} + +// Sendet eine Email an die Assistenz, dass ein neues Dokument hochgeladen wurde +function sendDokumentupload($empfaenger_stgkz, $dokument_kurzbz, $orgform_kurzbz, $studiensemester_kurzbz, $prestudent_id, $dms_id) +{ + global $person_id, $p; + + // Array fuer Mailempfaenger. Vorruebergehende Loesung. Kindlm am 28.10.2015 + $empf_array = array(); + if (defined('BEWERBERTOOL_UPLOAD_EMPFAENGER')) + $empf_array = unserialize(BEWERBERTOOL_UPLOAD_EMPFAENGER); + + $person = new person(); + $person->load($person_id); + $dokumentbezeichnung = ''; + + $studiengang = new studiengang(); + $studiengang->load($empfaenger_stgkz); + $typ = new studiengang(); + $typ->getStudiengangTyp($studiengang->typ); + + $email = $p->t('bewerbung/emailDokumentuploadStart'); + $email .= '
-

Originalvorschau

+ '; + // Wenn es keine Akte mit Lichtbild gibt, das Foto der Person laden, sonst aus der Akte + if ($row->dokument_kurzbz == 'Lichtbil') + { + echo '

Originalvorschau

+ + '; + } + else + { + echo '

Originalvorschau

+ + '; + } + echo ' +

'; + $email .= ''; + $email .= ''; + $email .= ''; + $email .= ''; + $email .= ''; + $email .= '
' . $p->t('global/studiengang') . '' . $typ->bezeichnung . ' ' . $studiengang->bezeichnung . ($orgform_kurzbz != '' ? ' (' . $orgform_kurzbz . ')' : '') . '
' . $p->t('global/studiensemester') . '' . $studiensemester_kurzbz . '
' . $p->t('global/name') . '' . $person->vorname . ' ' . $person->nachname . '
' . $p->t('bewerbung/dokument') . ''; + $akte = new akte(); + $akte->getAkten($person_id, $dokument_kurzbz); + foreach ($akte->result as $row) + { + $dokument = new dokument(); + $dokument->loadDokumenttyp($row->dokument_kurzbz); + if ($row->insertvon == 'online') + { + if ($row->nachgereicht == true) + $email .= '- ' . $dokument->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE] . ' -> ' . $p->t('bewerbung/dokumentWirdNachgereicht') . '
'; + else + $email .= '' . $dokument->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE] . ' [' . $row->bezeichnung . ']
'; + $dokumentbezeichnung = $dokument->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]; + } + } + $email .= '
' . $p->t('bewerbung/prestudentID') . '' . $prestudent_id . '
'; + $email .= '
' . $p->t('bewerbung/emailBodyEnde'); + + // An der FHTW werden alle Mails von Bachelor-Studiengängen an das Infocenter geschickt, solange die Bewerbung noch nicht bestätigt wurde + if (CAMPUS_NAME == 'FH Technikum Wien') + { + if( defined('BEWERBERTOOL_MAILEMPFANG') && + BEWERBERTOOL_MAILEMPFANG != '' && + $studiengang->typ == 'b') + { + $empfaenger = BEWERBERTOOL_MAILEMPFANG; + } + else + $empfaenger = getMailEmpfaenger($studiengang->typ, '', $orgform_kurzbz); + } + else + { + $empfaenger = getMailEmpfaenger($empfaenger_stgkz); + } + + $mail = new mail($empfaenger, 'no-reply', $p->t('bewerbung/dokumentuploadZuBewerbung', array( + $dokumentbezeichnung + )) . ' ' . $person->vorname . ' ' . $person->nachname, 'Bitte sehen Sie sich die Nachricht in HTML Sicht an, um den Link vollständig darzustellen.'); + $mail->setHTMLContent($email); + if (! $mail->send()) + return false; + else + return true; +} + +?> + + diff --git a/vilesci/fhausweis/imageupload.php b/vilesci/fhausweis/imageupload.php new file mode 100644 index 000000000..c7eb7dd55 --- /dev/null +++ b/vilesci/fhausweis/imageupload.php @@ -0,0 +1,245 @@ + + */ +header("Content-Type: text/html; charset=utf-8"); + +require_once ('../../config/cis.config.inc.php'); +require_once ('../../include/functions.inc.php'); +require_once ('../../include/person.class.php'); +require_once ('../../include/benutzer.class.php'); +require_once ('../../include/akte.class.php'); +require_once ('../../include/phrasen.class.php'); +require_once ('../../include/fotostatus.class.php'); +require_once ('../../include/dms.class.php'); +require_once ('../../include/benutzerberechtigung.class.php'); + +$sprache = getSprache(); +$p = new phrasen($sprache); + +$uid = get_uid(); +$rechte = new benutzerberechtigung(); +$rechte->getBerechtigungen($uid); + +if(!$rechte->isBerechtigt('basis/fhausweis','suid')) +{ + die($rechte->errormsg); +} + +// Bild kommt im Seitenverhältnis 3:4 passend für FH-Ausweis +$base64_src = isset($_POST['src']) ? $_POST['src'] : die($p->t('global/fehlerBeiDerParameteruebergabe').'"src"'); +$person_id = isset($_POST['person_id']) ? $_POST['person_id'] : die($p->t('global/fehlerBeiDerParameteruebergabe').'"person_id"'); +$img_filename = isset($_POST['img_filename']) ? $_POST['img_filename'] : die($p->t('global/fehlerBeiDerParameteruebergabe').'"img_filename"'); +$img_type = isset($_POST['img_type']) ? $_POST['img_type'] : die($p->t('global/fehlerBeiDerParameteruebergabe').'"img_type"'); +$result_obj = array(); + +// Entfernt den data-string (data:image/png;base64,) vom Beginn des Codes damit nur der reine base64 Code zurueckgegeben wird +$base64_src = (preg_replace('/^data:(.*?)base64,/', '', $base64_src)); + +// Falls die $base64_src danach leer sein sollte, wird abgebrochen +if ($base64_src == '') +{ + $result_obj['type'] = "error"; + $result_obj['msg'] = "Fehler: $akte->errormsg"; + echo json_encode($result_obj); + exit; +} + +function resize($base64, $width, $height) // 828 x 1104 -> 240 x 320 +{ + ob_start(); + $image = imagecreatefromstring (base64_decode($base64)); + + // Hoehe und Breite neu berechnen + list ($width_orig, $height_orig) = getimagesizefromstring (base64_decode($base64)); + + if ($width && ($width_orig < $height_orig)) + { + $width = intval(($height / $height_orig) * $width_orig); + } + else + { + $height = intval(($width / $width_orig) * $height_orig); + } + + $image_p = imagecreatetruecolor($width, $height); + //$image = imagecreatefromjpeg($filename); + + // 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); + $retval = ob_get_contents(); + ob_end_clean(); + $retval = base64_encode($retval); + + @imagedestroy($image_p); + @imagedestroy($image); + return $retval; +} + +// Wenn der Fotostatus "Akzeptiert" ist, darf kein neues Foto hochgeladen werden +// Auskommentiert, da mit Recht basis/fhausweis schon möglich +/*$fs = new fotostatus(); +if ($fs->akzeptiert($person_id)) + die($p->t('profil/profilfotoUploadGesperrt'));*/ + +// DMS eintrag erstellen +$ext = strtolower(pathinfo($img_filename, PATHINFO_EXTENSION)); +$dms_filename = uniqid(); +$dms_filename .= "." . $ext; +$filename_path = DMS_PATH . $dms_filename; + +// Im DMS wird das Bild in der Originalauflösung von 828x1104 gespeichert +$newfile = fopen($filename_path, 'w'); +fwrite($newfile, base64_decode($base64_src)); + +if (fclose($newfile)) +{ + // Wenn Akte mit DMS-ID vorhanden, dann neue DMS-Version hochladen + $akte = new akte(); + $version = '0'; + $dms_id = ''; + if ($akte->getAkten($person_id, 'Lichtbil')) + { + // Erste Akte @todo: Ist auch so in content/akte.php. Kann irrefuehrende Ergebisse liefern, wenn bereits mehrere Akten des selben Typs vorhanden sind. + if (isset($akte->result[0])) + { + $akte = $akte->result[0]; + if ($akte->dms_id != '') + { + $dms = new dms(); + $dms->load($akte->dms_id); + + $version = $dms->version + 1; + $dms_id = $akte->dms_id; + } + } + } + + $dms = new dms(); + + $dms->dms_id = $dms_id; + $dms->version = $version; + $dms->kategorie_kurzbz = 'Akte'; + + $dms->insertamum = date('Y-m-d H:i:s'); + $dms->insertvon = $uid; + $dms->mimetype = cutString($img_type, 256); + $dms->filename = $dms_filename; + $dms->name = cutString($img_filename, 256, '~', true); + + if ($dms->save(true)) + { + $dms_id = $dms->dms_id; + + $akte = new akte(); + + if ($akte->getAkten($person_id, 'Lichtbil')) + { + if (count($akte->result) > 0) + { + $akte = $akte->result[0]; + $akte->new = false; + $akte->updateamum = date('Y-m-d H:i:s'); + $akte->updatevon = $uid; + } + else + { + $akte->new = true; + $akte->insertamum = date('Y-m-d H:i:s'); + $akte->insertvon = $uid; + } + } + else + { + $akte->new = true; + $akte->insertamum = date('Y-m-d H:i:s'); + $akte->insertvon = $uid; + } + + $akte->dokument_kurzbz = 'Lichtbil'; + $akte->person_id = $person_id; + //$akte->inhalt = base64_encode($content); Fotos werden nur als DMS und in tbl_person gespeichert + $akte->mimetype = $img_type; + $akte->erstelltam = date('Y-m-d H:i:s'); + $akte->gedruckt = false; + $akte->titel = cutString($img_filename, 32, '~', true); // Filename + $akte->bezeichnung = "Lichtbild gross"; + $akte->uid = ''; + $akte->nachgereicht = false; +// $akte->anmerkung = ''; Auch bei nachträglichem Upload bleibt die Anmerkung erhalten + $akte->dms_id = $dms_id; + + if (! $akte->save()) + { + $result_obj['type'] = "error"; + $result_obj['msg'] = "Fehler: $akte->errormsg"; + echo json_encode($result_obj); + } + } + else + { + $result_obj['type'] = "error"; + $result_obj['msg'] = $p->t('global/fehlerBeimSpeichernDerDaten'); + echo json_encode($result_obj); + } +} +else +{ + $result_obj['type'] = "error"; + $result_obj['msg'] = $p->t('global/dateiNichtErfolgreichHochgeladen'); + echo json_encode($result_obj); +} + +// Bild in tbl_person auf 240x320 skalieren +$base64_src = resize($base64_src, 240, 320); + +$person = new person(); +if ($person->load($person_id)) +{ + // base64 Wert in die Datenbank speichern + $person->foto = $base64_src; + $person->new = false; + // Fotostatus auf "hochgeladen" setzen + if ($person->save()) + { + $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 = $uid; + $fs->updateamum = date('Y-m-d H:i:s'); + $fs->updatevon = $uid; + if (! $fs->save(true)) + echo 'Fehler beim Setzen des Bildstatus'; + else + { + $result_obj['type'] = "success"; + $result_obj['msg'] = "Bild wurde erfolgreich gespeichert"; + echo json_encode($result_obj); + } + } + else + { + $result_obj['type'] = "error"; + $result_obj['msg'] = "" . $person->errormsg . ""; + echo json_encode($result_obj); + } +}