From 4c5241dd959535d78b58465e4d2786fc58c7e87c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 8 May 2023 15:37:30 +0200 Subject: [PATCH] Bei fehlender Signatur in Enduploads wird ein Mail an den Studiengang geschickt --- cis/private/lehre/abgabe_student_details.php | 38 ++++++++++++++++++-- locale/de-AT/abgabetool.php | 2 +- locale/en-US/abgabetool.php | 2 +- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/cis/private/lehre/abgabe_student_details.php b/cis/private/lehre/abgabe_student_details.php index 582924b8c..9e2dcc901 100644 --- a/cis/private/lehre/abgabe_student_details.php +++ b/cis/private/lehre/abgabe_student_details.php @@ -94,6 +94,7 @@ else $abstract = (isset($_POST['abstract'])?$_POST['abstract']:'-1'); $abstract_en = (isset($_POST['abstract_en'])?$_POST['abstract_en']:'-1'); $seitenanzahl = (isset($_POST['seitenanzahl'])?$_POST['seitenanzahl']:'-1'); + $signaturVorhanden = (isset($_POST['signaturVorhanden']) && $_POST['signaturVorhanden']=='true'?true:false); } $user = get_uid(); @@ -260,6 +261,35 @@ if($command=='add') echo "".$p->t('global/fehleraufgetreten')."
 "; $command=''; } + + if ($signaturVorhanden === false) + { + // Mail an Studiengang wenn keine Signatur gefunden wurde + $student = new student(); + if(!$student->load($projektarbeit_obj->student_uid)) + die($p->t('global/userNichtGefunden')); + + $stg_obj = new studiengang(); + if(!$stg_obj->load($student->studiengang_kz)) + die($p->t('global/fehlerBeimLesenAusDatenbank')); + + $subject = 'Abgabe ohne Signatur'; + $tomail = $stg_obj->email; + $data = array( + 'vorname' => $student->vorname, + 'nachname' => $student->nachname, + 'studiengang' => $stg_obj->bezeichnung + ); + + $mailres = sendSanchoMail( + 'ParbeitsbeurteilungSiganturFehlt', + $data, + $tomail, + $subject, + 'sancho_header_min_bw.jpg', + 'sancho_footer_min_bw.jpg' + ); + } } else { @@ -301,7 +331,7 @@ if($command=="update" && $error!=true) else { echo $p->t('global/dateiNichtErfolgreichHochgeladen'); - } + }$htmlstr .= ''."\n"; } else // endupload type { @@ -312,12 +342,14 @@ if($command=="update" && $error!=true) move_uploaded_file($_FILES['datei']['tmp_name'], PAABGABE_PATH.$paabgabe_id.'_'.$uid.'.pdf'); } + $signaturVorhanden = true; + if (file_exists(PAABGABE_PATH.$paabgabe_id.'_'.$uid.'.pdf')) { // Check if the document is signed $signList = SignatureLib::list(PAABGABE_PATH.$paabgabe_id.'_'.$uid.'.pdf'); if (is_array($signList) && count($signList) > 0) - { + {$htmlstr .= ''."\n"; // The document is signed } elseif ($signList === null) @@ -326,6 +358,7 @@ if($command=="update" && $error!=true) } else { + $signaturVorhanden = false; $uploadedDocumentSigned = $p->t('abgabetool/uploadedDocumentNotSignedStudent'); } @@ -357,6 +390,7 @@ if($command=="update" && $error!=true) $htmlstr .= ''."\n"; $htmlstr .= ''."\n"; $htmlstr .= ''."\n"; + $htmlstr .= ''."\n"; $htmlstr .= "\n"; $htmlstr .= "".$p->t('abgabetool/spracheDerArbeit').":"; $sprache = @$db->db_query("SELECT sprache FROM public.tbl_sprache"); diff --git a/locale/de-AT/abgabetool.php b/locale/de-AT/abgabetool.php index 831b60602..f3b2cfac5 100644 --- a/locale/de-AT/abgabetool.php +++ b/locale/de-AT/abgabetool.php @@ -91,7 +91,7 @@ $this->phrasen['abgabetool/projektbeurteilungDownload']='Projektbeurteilung heru $this->phrasen['abgabetool/projektbeurteilungErstDownload']='Erst-/Begutachter'; $this->phrasen['abgabetool/projektbeurteilungZweitDownload']='Zweitbegutachter'; $this->phrasen['abgabetool/fehlerErmittelnEndabgabeProjektarbeit']='Fehler beim Ermitteln des Enduplaods der Projektarbeit'; -$this->phrasen['abgabetool/uploadedDocumentNotSignedStudent']='Achtung - Das Dokument enthält keine elektronische Signatur. Bitte signieren Sie das Dokument.'; +$this->phrasen['abgabetool/uploadedDocumentNotSignedStudent']='Es konnte keine gültige digitale Signatur erkannt werden. Bitte wenden Sie sich an Ihren Studiengang ob Ihre Endabgabe erfolgreich war und die Arbeit zur Benotung vorgelegt werden kann.'; $this->phrasen['abgabetool/uploadedDocumentNotSigned']='Signatur fehlt'; $this->phrasen['abgabetool/uploadedDocumentSigned']='Signatur vorhanden'; $this->phrasen['abgabetool/senatsMitglied']='Mitglied Prüfungssenat'; diff --git a/locale/en-US/abgabetool.php b/locale/en-US/abgabetool.php index 3b7e12a45..b77e25d92 100644 --- a/locale/en-US/abgabetool.php +++ b/locale/en-US/abgabetool.php @@ -91,7 +91,7 @@ $this->phrasen['abgabetool/projektbeurteilungDownload']='Thesis-Assessment downl $this->phrasen['abgabetool/projektbeurteilungErstDownload']='First-/Assessor'; $this->phrasen['abgabetool/projektbeurteilungZweitDownload']='Second Assessor'; $this->phrasen['abgabetool/fehlerErmittelnEndabgabeProjektarbeit']='Error when getting endupload of project work'; -$this->phrasen['abgabetool/uploadedDocumentNotSignedStudent']='Warning - the document does not contain an electronic signature. Please sign the document.'; +$this->phrasen['abgabetool/uploadedDocumentNotSignedStudent']='The document does not contain an electronic signature. Please inform your Dregree Programm to verify the upload'; $this->phrasen['abgabetool/uploadedDocumentNotSigned']='Signature not found'; $this->phrasen['abgabetool/uploadedDocumentSigned']='Signature found'; $this->phrasen['abgabetool/senatsMitglied']='Examiner';