diff --git a/application/config/abgabe.php b/application/config/abgabe.php index 90aedbd8b..e1cdfbfa7 100644 --- a/application/config/abgabe.php +++ b/application/config/abgabe.php @@ -38,8 +38,19 @@ $config['SIGNATUR_CHECK_PAABGABETYPEN'] = ['end']; // to be used as "https://moodle.technikum-wien.at/course/view.php?idnumber=dl{$stg_kz}" for stg specific moodle routing $config['STG_MOODLE_LINK'] = 'https://moodle.technikum-wien.at/course/view.php?idnumber=dl'; +// TODO: check if these links change if the file changes and how to better retrieve the link? +$config['SIGNATUR_INFO_LINK_GERMAN'] = 'https://cis.technikum-wien.at/cms/dms.php?id=214779'; +$config['SIGNATUR_INFO_LINK_ENGLISH'] = 'https://cis.technikum-wien.at/cms/dms.php?id=264256'; $config['ASSISTENZ_SAMMELMAIL_BUTTON_STUDENT'] = true; $config['ASSISTENZ_SAMMELMAIL_BUTTON_BETREUER'] = true; $config['BETREUER_SAMMELMAIL_BUTTON_STUDENT'] = true; + +$config['MULTIEDIT_TABLE'] = true; + +$config['STUDENT_EDIT_PROJEKTARBEIT_TITLE'] = true; + +$config['CONFETTI_ON_ENDUPLOAD'] = true; + + diff --git a/application/controllers/api/frontend/v1/Abgabe.php b/application/controllers/api/frontend/v1/Abgabe.php index 0db99469c..faffa97f2 100644 --- a/application/controllers/api/frontend/v1/Abgabe.php +++ b/application/controllers/api/frontend/v1/Abgabe.php @@ -93,6 +93,7 @@ class Abgabe extends FHCAPI_Controller $ASSISTENZ_SAMMELMAIL_BUTTON_STUDENT = $this->config->item('ASSISTENZ_SAMMELMAIL_BUTTON_STUDENT'); $ASSISTENZ_SAMMELMAIL_BUTTON_BETREUER = $this->config->item('ASSISTENZ_SAMMELMAIL_BUTTON_BETREUER'); $BETREUER_SAMMELMAIL_BUTTON_STUDENT = $this->config->item('BETREUER_SAMMELMAIL_BUTTON_STUDENT'); + $MULTIEDIT_TABLE = $this->config->item('MULTIEDIT_TABLE'); $ret = array( 'old_abgabe_beurteilung_link' => $old_abgabe_beurteilung_link, @@ -100,7 +101,7 @@ class Abgabe extends FHCAPI_Controller 'abgabetypenBetreuer' => $abgabetypenBetreuer, 'ASSISTENZ_SAMMELMAIL_BUTTON_STUDENT' => $ASSISTENZ_SAMMELMAIL_BUTTON_STUDENT, 'ASSISTENZ_SAMMELMAIL_BUTTON_BETREUER' => $ASSISTENZ_SAMMELMAIL_BUTTON_BETREUER, - 'BETREUER_SAMMELMAIL_BUTTON_STUDENT' => $BETREUER_SAMMELMAIL_BUTTON_STUDENT, + 'MULTIEDIT_TABLE' => $MULTIEDIT_TABLE, ); $this->terminateWithSuccess($ret); @@ -110,10 +111,18 @@ class Abgabe extends FHCAPI_Controller * loads config related to abgabetool for students to avoid handing out links reserved for employees */ public function getConfigStudent() { - $moodle_link =$this->config->item('STG_MOODLE_LINK'); - + $moodle_link = $this->config->item('STG_MOODLE_LINK'); + $title_edit_allowed = $this->config->item('STUDENT_EDIT_PROJEKTARBEIT_TITLE'); + $confetti_on_endupload = $this->config->item('CONFETTI_ON_ENDUPLOAD'); + $siginfolink_german = $this->config->item('SIGNATUR_INFO_LINK_GERMAN'); + $siginfolink_english = $this->config->item('SIGNATUR_INFO_LINK_ENGLISH'); + $ret = array( 'moodle_link' => $moodle_link, + 'title_edit_allowed' => $title_edit_allowed, + 'confetti_on_endupload' => $confetti_on_endupload, + 'siginfolink_german' => $siginfolink_german, + 'siginfolink_english' => $siginfolink_english ); $this->terminateWithSuccess($ret); @@ -459,6 +468,10 @@ class Abgabe extends FHCAPI_Controller */ public function postStudentProjektarbeitTitel() { + if(!$this->config->item('STUDENT_EDIT_PROJEKTARBEIT_TITLE')) { + $this->terminateWithError($this->p->t('global', 'c4studentEditNotAllowed'), 'general'); + }; + $projektarbeit_id = $this->input->post('projektarbeit_id'); $titel = $this->input->post('titel'); @@ -467,6 +480,23 @@ class Abgabe extends FHCAPI_Controller $this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general'); } + // strip all HTML tags to prevent XSS in mail bodies, table views and Projektarbeitsbenotung + $titel = trim(strip_tags($titel)); + if ($titel === '') { + $this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general'); + } + + // Reject emojis and pictographs + // allows foreign letters, math symbols, accents, and standard punctuation. + $emojiPattern = '/[\x{1F300}-\x{1F5FF}\x{1F600}-\x{1F64F}\x{1F680}-\x{1F6FF}\x{1F900}-\x{1FAFF}\x{23E9}-\x{23EF}\x{2b50}\x{2700}-\x{27BF}]/u'; + + // i would like this much more but our server does not recognize this utf-8 character range this way, so hexcodes it is +// if (preg_match('/\p{Extended_Pictographic}/u', $titel)) { + if (preg_match($emojiPattern, $titel)) { + + $this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general'); + } + $this->checkProjektarbeitForFinishedStatus($projektarbeit_id); $this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel'); @@ -484,6 +514,8 @@ class Abgabe extends FHCAPI_Controller $this->terminateWithError($this->p->t('abgabetool', 'c4noZuordnungBetreuerStudent'), 'general'); } + + $result = $this->ProjektarbeitModel->load($projektarbeit_id); $data = getData($result); @@ -492,7 +524,7 @@ class Abgabe extends FHCAPI_Controller $result = $this->ProjektarbeitModel->update( $projektarbeit_id, array( - 'titel' => trim($titel), + 'titel' => $titel, 'updatevon' => getAuthUID(), 'updateamum' => date('Y-m-d H:i:s') ) @@ -504,7 +536,7 @@ class Abgabe extends FHCAPI_Controller 'titelUpdate', array( 'projektarbeit_id' => $projektarbeit_id, - 'titel' => trim($titel), + 'titel' => $titel, 'updatevon' => getAuthUID(), 'updateamum' => date('Y-m-d H:i:s') ), @@ -514,13 +546,14 @@ class Abgabe extends FHCAPI_Controller $this->sendTitelChangedEmail( $projektarbeit_id, - trim($titel), + $titel, $oldTitle, $assignedStudentUid ); $result = $this->ProjektarbeitModel->load($projektarbeit_id); - $this->terminateWithSuccess($result); + $titel = hasData($result) ? getData($result)[0]->titel : $titel; + $this->terminateWithSuccess($titel); } /** @@ -1533,7 +1566,7 @@ class Abgabe extends FHCAPI_Controller }; Events::trigger('projektarbeit_is_current', $projektarbeit_id, $returnFunc); if(!$projektarbeitIsCurrent) { - $this->terminateWithError($this->p->t('abgabetool','c4fehlerAktualitaetProjektarbeit'), 'general'); + $this->terminateWithError($this->p->t('abgabetool','c4fehlerAktualitaetProjektarbeitv2'), 'general'); } // Link to Abgabetool @@ -1739,7 +1772,7 @@ class Abgabe extends FHCAPI_Controller $data = getData($res)[0]; if($data->note !== NULL) { // hardcode this error msg cause phrasen arent reliable and people keep bugging why the cant edit old entries they definitely shouldnt update - $message = $this->p->t('abgabetool','c4fehlerAktualitaetProjektarbeit'); + $message = $this->p->t('abgabetool','c4fehlerAktualitaetProjektarbeitv2'); if(strpos($message, "<<") === 0) { // phrase could not be loaded $this->terminateWithError('Die Projektarbeit wurde bereits benotet, Sie dürfen deshalb keine weiteren Termine anlegen oder bearbeiten.', 'general'); } else { @@ -1748,4 +1781,4 @@ class Abgabe extends FHCAPI_Controller } } -} \ No newline at end of file +} diff --git a/application/controllers/api/frontend/v1/stv/Projektarbeit.php b/application/controllers/api/frontend/v1/stv/Projektarbeit.php index 8740ef3d6..1f1035c98 100644 --- a/application/controllers/api/frontend/v1/stv/Projektarbeit.php +++ b/application/controllers/api/frontend/v1/stv/Projektarbeit.php @@ -90,6 +90,15 @@ class Projektarbeit extends FHCAPI_Controller if (!isset($projektarbeit_id) || !is_numeric($projektarbeit_id)) return $this->terminateWithError('Projektarbeit Id missing', self::ERROR_TYPE_GENERAL); + $result = $this->fetchProjektarbeitByID($projektarbeit_id); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess(current($data)); + } + + private function fetchProjektarbeitById($projektarbeit_id) { + $this->ProjektarbeitModel->resetQuery(); $this->ProjektarbeitModel->addSelect( 'lehre.tbl_projektarbeit.projektarbeit_id, titel, titel_english, themenbereich, projekttyp_kurzbz, lehrveranstaltung_id, lehreinheit_id, firma_id, beginn, ende, gesperrtbis, note, final, freigegeben, tbl_projektarbeit.anmerkung, fa.name AS firma_name' @@ -97,13 +106,10 @@ class Projektarbeit extends FHCAPI_Controller $this->ProjektarbeitModel->addJoin('lehre.tbl_lehreinheit le', 'lehreinheit_id'); $this->ProjektarbeitModel->addJoin('lehre.tbl_lehrveranstaltung lv', 'lehrveranstaltung_id'); $this->ProjektarbeitModel->addJoin('public.tbl_firma fa', 'firma_id', 'LEFT'); - $result = $this->ProjektarbeitModel->loadWhere( + return $this->ProjektarbeitModel->loadWhere( array('projektarbeit_id' => $projektarbeit_id) ); - $data = $this->getDataOrTerminateWithError($result); - - $this->terminateWithSuccess(current($data)); } /** @@ -132,7 +138,8 @@ class Projektarbeit extends FHCAPI_Controller ); $data = $this->getDataOrTerminateWithError($result); - + $data = $this->getDataOrTerminateWithError($this->fetchProjektarbeitById($data)); + $this->terminateWithSuccess($data); } diff --git a/application/controllers/jobs/AbgabetoolJob.php b/application/controllers/jobs/AbgabetoolJob.php index b81053032..2e5c4d7b9 100644 --- a/application/controllers/jobs/AbgabetoolJob.php +++ b/application/controllers/jobs/AbgabetoolJob.php @@ -358,7 +358,8 @@ class AbgabetoolJob extends JOB_Controller foreach($assistenzMap as $assistenz_person_id => $tupelArr) { $abgabenString = '
'; - + $hasContent = false; + foreach($tupelArr as $tupel) { $projektarbeit_id = $tupel[0]; $assistenzRow = $tupel[1]; @@ -377,6 +378,7 @@ class AbgabetoolJob extends JOB_Controller if(count($relevantAbgaben) == 0) { continue; } + $hasContent = true; // Format the Student Name $s = $relevantAbgaben[0]; @@ -447,7 +449,12 @@ class AbgabetoolJob extends JOB_Controller } $abgabenString .= '
'; - + + // skip send entirely + if (!$hasContent) { + continue; + } + // done with building the change list, now send it $assistenzRow = $tupelArr[0][1]; $anrede = $assistenzRow->anrede; diff --git a/application/views/Cis/Abgabetool.php b/application/views/Cis/Abgabetool.php index a0621b1f9..469bc8110 100644 --- a/application/views/Cis/Abgabetool.php +++ b/application/views/Cis/Abgabetool.php @@ -38,7 +38,7 @@ $includesArray = array( $this->load->view('templates/FHC-Header', $includesArray); ?> -
+
uid= student_uid_prop="" stg_kz_prop="" diff --git a/public/css/Studentenverwaltung.css b/public/css/Studentenverwaltung.css index fb56ec75c..86e3d6be3 100644 --- a/public/css/Studentenverwaltung.css +++ b/public/css/Studentenverwaltung.css @@ -277,3 +277,7 @@ html.fs_huge { } */ /* slim ende */ + +.fhc-xxl-modal { + min-width: 80vw; +} \ No newline at end of file diff --git a/public/css/components/abgabetool/abgabe.css b/public/css/components/abgabetool/abgabe.css index 12e0e82ee..78a04e114 100644 --- a/public/css/components/abgabetool/abgabe.css +++ b/public/css/components/abgabetool/abgabe.css @@ -347,3 +347,52 @@ } +/*confetti celebration on endupload - impossible to miss*/ +#confetti-container { + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + pointer-events: none; + z-index: 9999; + overflow: hidden; +} + +.confetti-piece { + position: absolute; + opacity: 0; + will-change: top, transform, opacity; +} + +/* Background Rain */ +@keyframes fallAndSpin { + 0% { + top: var(--start-y); + transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg); + opacity: 1; + } + 100% { + top: 105vh; + transform: translate3d(var(--drift), 0, 0) rotateX(720deg) rotateY(360deg); + opacity: 0.3; + } +} + +/* Corner Cannons*/ +@keyframes cannonBlast { + 0% { + transform: translate3d(0, 0, 0) scale(0.3) rotate(0deg); + opacity: 1; + animation-timing-function: cubic-bezier(0.1, 0.8, 0.2, 1); + } + 30% { + transform: translate3d(var(--blast-x), var(--blast-y), 0) scale(1.2) rotate(270deg); + opacity: 1; + animation-timing-function: linear; + } + 100% { + transform: translate3d(calc(var(--blast-x) * 1.4), 15vh, 0) scale(0.4) rotate(630deg); + opacity: 0; + } +} diff --git a/public/js/apps/Abgabetool/Abgabetool.js b/public/js/apps/Abgabetool/Abgabetool.js index 83233ba22..748f10159 100644 --- a/public/js/apps/Abgabetool/Abgabetool.js +++ b/public/js/apps/Abgabetool/Abgabetool.js @@ -25,9 +25,6 @@ const app = Vue.createApp({ }, computed: { - viewData() { - return { uid: this.uid} - }, student_uid_computed() { return this.student_uid ?? this.uid }, @@ -55,10 +52,10 @@ const app = Vue.createApp({ }, template: ` ` }); diff --git a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js index abd647af2..fb564ad98 100644 --- a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js +++ b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js @@ -625,6 +625,7 @@ export const AbgabeMitarbeiterDetail = { dialogClass="bordered-modal modal-lg" :backdrop="true" @hideBsModal="showAutomagicModalPhrase=false;" + bodyClass="px-4 py-4" > @@ -947,7 +945,8 @@ export const AbgabeMitarbeiterDetail = { + dialogClass="bordered-modal modal-lg" + bodyClass="px-4 py-4">