diff --git a/application/libraries/SignatureLib.php b/application/libraries/SignatureLib.php new file mode 100644 index 000000000..132545219 --- /dev/null +++ b/application/libraries/SignatureLib.php @@ -0,0 +1,75 @@ +sendsJson() + ->authenticateWith(SIGNATUR_USER, SIGNATUR_PASSWORD) + ->body('{"filename": "'.basename($inputFileName).'", "content": "'.base64_encode($inputFileContent).'"}') + ->expectsJson() + ->send(); + } + } + catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception + { + error_log($cee->getMessage()); + } + catch (Exception $e) // any other exception + { + error_log($e->getMessage()); + } + + // If the response is fine + if (isset($resultPost->body) && is_object($resultPost->body) + && isset($resultPost->body->retval) && is_array($resultPost->body->retval)) + { + return $resultPost->body->retval; + } + + // Otherwise return a null as error + return null; + } +} + diff --git a/application/views/templates/FHC-Footer.php b/application/views/templates/FHC-Footer.php index 8c0b8a4e9..31ee96950 100644 --- a/application/views/templates/FHC-Footer.php +++ b/application/views/templates/FHC-Footer.php @@ -60,11 +60,7 @@ if ($bootstrap3 === true) generateJSsInclude('vendor/twbs/bootstrap3/dist/js/bootstrap.min.js'); // Bootstrap 5 JS - if ($bootstrap5 === true) - { - generateJSsInclude('vendor/popperjs/popperjs2/core@2'); - generateJSsInclude('vendor/twbs/bootstrap5/dist/js/bootstrap.min.js'); - } + if ($bootstrap5 === true) generateJSsInclude('vendor/twbs/bootstrap5/dist/js/bootstrap.bundle.min.js'); // Moment JS if ($momentjs2 === true) diff --git a/cis/private/lehre/abgabe_lektor_details.php b/cis/private/lehre/abgabe_lektor_details.php index e3bf5c40d..142af5527 100644 --- a/cis/private/lehre/abgabe_lektor_details.php +++ b/cis/private/lehre/abgabe_lektor_details.php @@ -37,6 +37,7 @@ require_once('../../../include/phrasen.class.php'); require_once('../../../include/projektarbeit.class.php'); require_once('../../../include/projektbetreuer.class.php'); require_once('../../../include/sancho.inc.php'); +require_once('../../../application/libraries/SignatureLib.php'); if (!$db = new basis_db()) $db=false; @@ -590,7 +591,9 @@ while ($row=@$db->db_fetch_object($result)) $htmlstr .= "\n"; $htmlstr .= "\n"; $htmlstr .= "\n"; - if(!$row->abgabedatum) + + $uploadedDocumentSigned = null; + if (!$row->abgabedatum) { if ($row->datumdb_fetch_object($result)) $fcol='#000000'; } } - //$htmlstr .= "fixtermin=='t'?'checked=\"checked\"':'')." >"; - //$htmlstr .= "fixtermin=='t'?'checked="checked" style="background-color:#FF0000;"':'')." disabled>"; + if($row->fixtermin=='t') { $htmlstr .= "J"; @@ -659,11 +661,12 @@ while ($row=@$db->db_fetch_object($result)) $htmlstr .= " \n"; $htmlstr .= " \n"; $htmlstr .= " ".($row->abgabedatum==''?' ':$datum_obj->formatDatum($row->abgabedatum,'d.m.Y'))."\n"; - if($user==$row->insertvon && $betreuerart!="Zweitbegutachter") + + if ($user==$row->insertvon && $betreuerart!="Zweitbegutachter") { $htmlstr .= " "; - if(!$row->abgabedatum) + if (!$row->abgabedatum) { $htmlstr .= " "; } @@ -692,6 +695,56 @@ while ($row=@$db->db_fetch_object($result)) { $htmlstr .= "     "; } + + if (file_exists(PAABGABE_PATH.$row->paabgabe_id.'_'.$uid.'.pdf')) + { + $signaturVorhanden = false; + if ($row->paabgabetyp_kurzbz == 'end') + { + if(defined('ABGABETOOL_CHECK_SIGNATURE') && ABGABETOOL_CHECK_SIGNATURE) + { + // Check if the document is signed + $signList = SignatureLib::list(PAABGABE_PATH.$row->paabgabe_id.'_'.$uid.'.pdf'); + if (is_array($signList) && count($signList) > 0) + { + $signaturVorhanden = true; + // The document is signed + } + elseif ($signList === null) + { + $uploadedDocumentSigned = 'WARNING: signature server error'; + } + else + { + $uploadedDocumentSigned = $p->t('abgabetool/uploadedDocumentNotSigned'); + } + } + } + if ($uploadedDocumentSigned != null) + { + $htmlstr .= ' + +
+ '.$uploadedDocumentSigned.' +
+ '; + } + elseif($signaturVorhanden) + { + $htmlstr .= ' + +
+ '.$p->t('abgabetool/uploadedDocumentSigned').' +
+ '; + } + } + else + { + $htmlstr .= "     "; + } + + $htmlstr .= " \n"; @@ -710,7 +763,7 @@ $htmlstr .= ''."\n"; //$htmlstr .= ""; $htmlstr .= "  "; -$htmlstr .= " \n"; +$htmlstr .= " \n"; $htmlstr .= " '."\n"; } - else + else // endupload type { //Upload der Endabgabe - Eingabe der Zusatzdaten $command='add'; - if(!$error) + if (!$error) { move_uploaded_file($_FILES['datei']['tmp_name'], PAABGABE_PATH.$paabgabe_id.'_'.$uid.'.pdf'); } - if(file_exists(PAABGABE_PATH.$paabgabe_id.'_'.$uid.'.pdf')) + + $signaturVorhanden = true; + + if (file_exists(PAABGABE_PATH.$paabgabe_id.'_'.$uid.'.pdf')) { + if(defined('ABGABETOOL_CHECK_SIGNATURE') && ABGABETOOL_CHECK_SIGNATURE) + { + // Check if the document is signed + $signList = SignatureLib::list(PAABGABE_PATH.$paabgabe_id.'_'.$uid.'.pdf'); + if (is_array($signList) && count($signList) > 0) + { + // The document is signed + } + elseif ($signList === null) + { + $uploadedDocumentSigned = 'WARNING: signature server error'; + } + else + { + $signaturVorhanden = false; + $uploadedDocumentSigned = $p->t('abgabetool/uploadedDocumentNotSignedStudent'); + } + } + /*$qry="UPDATE campus.tbl_paabgabe SET abgabedatum = now(), updatevon = '".$user."', @@ -339,6 +393,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"); @@ -372,6 +427,21 @@ if($command=="update" && $error!=true) $htmlstr .= ''.$p->t('abgabetool/seitenanzahl').':* '."\n"; $htmlstr .=" \n"; + + // If there are info about the signed document + if ($uploadedDocumentSigned != null) + { + $htmlstr .= "\n"; + $htmlstr .= ""; + $htmlstr .= '
+ + '.$uploadedDocumentSigned.' +
'; + $htmlstr .= ""; + $htmlstr .= "\n"; + } + + $htmlstr .=" \n"; $htmlstr .="

".$p->t('abgabetool/eidesstattlicheErklaerung')."

\n"; $htmlstr .= "".$p->t('abgabetool/gelesenUndAkzeptiert').":* "; $htmlstr .=" * ".$p->t('abgabetool/pflichtfeld')." diff --git a/cis/private/lehre/lvincoming.php b/cis/private/lehre/lvincoming.php deleted file mode 100644 index f81292aab..000000000 --- a/cis/private/lehre/lvincoming.php +++ /dev/null @@ -1,146 +0,0 @@ - - * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > - * Rudolf Hangl < rudolf.hangl@technikum-wien.at > - */ -require_once('../../../config/cis.config.inc.php'); -require_once('../../../include/studiensemester.class.php'); -require_once('../../../include/studiengang.class.php'); - -$db = new basis_db(); - -$stsem = new studiensemester(); -$stsem->getNextStudiensemester(); - -$stg = new studiengang(); -$stg->getAll(); -?> - - - - - - - - Lehrveranstaltungen - Übersicht - - - - -   - - - - - - - - - - - -
-  Lehrveranstaltungen - Übersicht ('.$stsem->studiensemester_kurzbz.') -
 
- '; - - $qry = "SELECT - tbl_lehrveranstaltung.lehrveranstaltung_id, tbl_lehrveranstaltung.studiengang_kz, - tbl_lehrveranstaltung.bezeichnung, tbl_lehrveranstaltung.semester, - tbl_lehrveranstaltung.bezeichnung_english, tbl_lehrveranstaltung.incoming, - tbl_lehrveranstaltung.sprache, - ( - SELECT - count(*) - FROM - campus.vw_student_lehrveranstaltung - JOIN public.tbl_student ON(uid=student_uid) - JOIN public.tbl_prestudentstatus USING(prestudent_id) - WHERE - lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id AND - lehreinheit_id in (SELECT lehreinheit_id FROM lehre.tbl_lehreinheit - WHERE lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id - AND tbl_lehreinheit.studiensemester_kurzbz='$stsem->studiensemester_kurzbz') - AND tbl_prestudentstatus.status_kurzbz='Incoming' - AND tbl_prestudentstatus.status_kurzbz='$stsem->studiensemester_kurzbz' - GROUP BY uid - ) as anzahlincoming - FROM - lehre.tbl_lehrveranstaltung JOIN public.tbl_studiengang USING(studiengang_kz) - WHERE - tbl_lehrveranstaltung.incoming>0 AND - tbl_lehrveranstaltung.aktiv AND - tbl_lehrveranstaltung.lehre - AND tbl_lehrveranstaltung.studiengang_kz>0 AND tbl_lehrveranstaltung.studiengang_kz<10000 - AND tbl_studiengang.aktiv - "; - - echo ' - - - - - - - - - - - - - - '; - if($result = $db->db_query($qry)) - { - $i=0; - while($row = $db->db_fetch_object($result)) - { - $freieplaetze = $row->incoming - $row->anzahlincoming; - if($freieplaetze<0) - $freieplaetze=0; - - $i++; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - } - } - echo '
IDStudiengangSemesterSpracheLehrveranstaltungLehrveranstaltung EnglischLV-InfoPlätze gesamtFreie Plätze
',$row->lehrveranstaltung_id,'',$stg->kuerzel_arr[$row->studiengang_kz],'',$row->semester,'',$row->sprache,'',$row->bezeichnung,'',$row->bezeichnung_english,' - Deutsch  - Englisch - ',$row->incoming,'',$freieplaetze,'
'; -?> -
- - - - - - diff --git a/cis/private/lvplan/raumsuche.php b/cis/private/lvplan/raumsuche.php index 0cb9677d4..7be028be8 100644 --- a/cis/private/lvplan/raumsuche.php +++ b/cis/private/lvplan/raumsuche.php @@ -47,11 +47,11 @@ echo ' - - - - - + + + + +