From bc32a643f19a717603bfb209f5f4df916b749c39 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Thu, 28 May 2020 20:53:21 +0200 Subject: [PATCH] =?UTF-8?q?Pr=C3=BCfungsprotokoll:=20-=20phrases:=20multil?= =?UTF-8?q?ingual=20database=20fields=20shown=20depending=20on=20language?= =?UTF-8?q?=20(e.g.=20beurteilung,=20studiengang,...=20-=20added=20phrases?= =?UTF-8?q?=20-=20added=20timepicker=20css=20-=20if=20student=20not=20in?= =?UTF-8?q?=20condition,=20time=20can=20still=20be=20filled=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/lehre/Pruefungsprotokoll.php | 11 +- .../views/lehre/pruefungsprotokoll.php | 29 ++- public/css/lehre/pruefungsprotokoll.css | 10 +- public/js/lehre/pruefungsprotokoll.js | 73 +++--- system/phrasesupdate.php | 246 +++++++++++++++++- 5 files changed, 306 insertions(+), 63 deletions(-) diff --git a/application/controllers/lehre/Pruefungsprotokoll.php b/application/controllers/lehre/Pruefungsprotokoll.php index a88568daf..594d3a9e1 100644 --- a/application/controllers/lehre/Pruefungsprotokoll.php +++ b/application/controllers/lehre/Pruefungsprotokoll.php @@ -90,10 +90,13 @@ class Pruefungsprotokoll extends Auth_Controller else $abschlussbeurteilung = getData($abschlussbeurteilung); + $language = getUserLanguage(); + $data = array( 'abschlusspruefung' => $abschlusspruefung, 'abschlussbeurteilung' => $abschlussbeurteilung, - 'abschlusspruefung_saved' => $abschlusspruefung_saved + 'abschlusspruefung_saved' => $abschlusspruefung_saved, + 'language' => $language ); $this->load->view('lehre/pruefungsprotokoll.php', $data); @@ -127,12 +130,12 @@ class Pruefungsprotokoll extends Auth_Controller $result = $this->authlib->checkUserAuthByUsernamePassword($this->_uid, $password); if (isError($result)) { - return $this->outputJsonError('Falsches Passwort'); // exit if password is incorrect + return $this->outputJsonError($this->p->t('password', 'wrongPassword')); // exit if password is incorrect } } else { - return $this->outputJsonError('Passwort fehlt'); + return $this->outputJsonError($this->p->t('password', 'passwordMissing')); } } @@ -153,7 +156,7 @@ class Pruefungsprotokoll extends Auth_Controller } } else - $this->outputJsonError('Ungültige Parameter'); + $this->outputJsonError($this->p->t('ui', 'ungueltigeParameter')); } // ----------------------------------------------------------------------------------------------------------------- diff --git a/application/views/lehre/pruefungsprotokoll.php b/application/views/lehre/pruefungsprotokoll.php index 336741891..12024f981 100644 --- a/application/views/lehre/pruefungsprotokoll.php +++ b/application/views/lehre/pruefungsprotokoll.php @@ -11,8 +11,16 @@ $this->load->view( 'ajaxlib' => true, 'sbadmintemplate' => true, 'phrases' => array( - 'pruefungsprotokoll' => array( - 'freigegebenAm' + 'abschlusspruefung' => array( + 'freigegebenAm', + 'pruefungGespeichert', + 'pruefungSpeichernFehler', + 'abschlussbeurteilungLeer', + 'beginnzeitLeer', + 'beginnzeitFormatError', + 'endezeitLeer', + 'endezeitFormatError', + 'endezeitBeforeError' ), 'ui' => array( 'stunde', @@ -21,11 +29,12 @@ $this->load->view( ), 'customCSSs' => array( 'public/css/sbadmin2/admintemplate_contentonly.css', + 'vendor/fgelinas/timepicker/jquery.ui.timepicker.css', 'public/css/lehre/pruefungsprotokoll.css' ), 'customJSs' => array( - 'public/js/lehre/pruefungsprotokoll.js', - 'vendor/fgelinas/timepicker/jquery.ui.timepicker.js' + 'vendor/fgelinas/timepicker/jquery.ui.timepicker.js', + 'public/js/lehre/pruefungsprotokoll.js' ) ) ); @@ -44,11 +53,11 @@ $this->load->view(

studiengangstyp == 'b' ? $this->p->t('abschlusspruefung', 'abgehaltenAmBachelor') : $this->p->t('abschlusspruefung', 'abgehaltenAmMaster'); ?> - studiengangbezeichnung?>, p->t('abschlusspruefung', 'studiengangskennzahl') ?>  + studiengangbezeichnung : $abschlusspruefung->studiengangbezeichnung_englisch ?>, p->t('abschlusspruefung', 'studiengangskennzahl') ?>  studiengang_kz ?>

@@ -118,7 +127,7 @@ $this->load->view( p->t('abschlusspruefung', 'pruefungsantritt') ?> - pruefungsantritt_bezeichnung; ?> + pruefungsantritt_bezeichnung : $abschlusspruefung->pruefungsantritt_bezeichnung_english; ?> @@ -146,12 +155,12 @@ $this->load->view( p->t('abschlusspruefung', 'pruefungsgegenstand') ?> - studiengangstyp == 'b' ? $this->p->t('abschlusspruefung', 'PruefungsgegenstandBachelor') : $this->p->t('abschlusspruefung', 'PruefungsgegenstandMaster')) ?> + studiengangstyp == 'b' ? $this->p->t('abschlusspruefung', 'pruefungsgegenstandBachelor') : $this->p->t('abschlusspruefung', 'PruefungsgegenstandMaster')) ?> - p->t('global', 'notizen') ?> + p->t('global', 'notizen')); ?> @@ -172,7 +181,7 @@ $this->load->view( abschlussbeurteilung_kurzbz == $abschlusspruefung->abschlussbeurteilung_kurzbz ? " selected" : "" ?> - + diff --git a/public/css/lehre/pruefungsprotokoll.css b/public/css/lehre/pruefungsprotokoll.css index a73e67950..b5db9b0b5 100644 --- a/public/css/lehre/pruefungsprotokoll.css +++ b/public/css/lehre/pruefungsprotokoll.css @@ -1,4 +1,4 @@ -/* threshold for form full screen */ +/* threshold for full screen form */ @media (max-width:1075px) { #page-wrapper { margin-right: 0; @@ -18,6 +18,7 @@ background-color: #f5f5f5; } +/* table date and time cell widths */ .timecellwidth { width: 20%; } @@ -35,3 +36,10 @@ margin-top: 10px; margin-bottom: 10px; } + +/* timepicker */ +.ui-timepicker-table td a { + width: inherit; + line-height: 1; + text-align: center; +} diff --git a/public/js/lehre/pruefungsprotokoll.js b/public/js/lehre/pruefungsprotokoll.js index c11bc9ee7..1834737ff 100644 --- a/public/js/lehre/pruefungsprotokoll.js +++ b/public/js/lehre/pruefungsprotokoll.js @@ -16,29 +16,26 @@ $("document").ready(function() { data.password = $("#password").val(); } - if ($("#verfCheck").prop('checked')) + var checkFields = Pruefungsprotokoll.checkFields(data, $("#verfCheck").prop('checked')); + $("#protocolform td").removeClass('has-error'); + if (checkFields.length > 0) { - var checkFields = Pruefungsprotokoll.checkFields(data, $("#verfCheck").prop('checked')); - $("#protocolform td").removeClass('has-error'); - if (checkFields.length > 0) + var errortext = ''; + for (var i = 0; i < checkFields.length; i++) { - var errortext = ''; - for (var i = 0; i < checkFields.length; i++) + var error = checkFields[i]; + $.each(error, function(i, n) { - var error = checkFields[i]; - $.each(error, function(i, n) - { - console.log($("#"+i).closest('td')); - $("#"+i).closest('td').addClass('has-error'); - if (errortext !== '') - errortext += '; '; - errortext += n; - }); - } - - FHC_DialogLib.alertError(errortext); - return; + console.log($("#"+i).closest('td')); + $("#"+i).closest('td').addClass('has-error'); + if (errortext !== '') + errortext += '; '; + errortext += n; + }); } + + FHC_DialogLib.alertError(errortext); + return; } Pruefungsprotokoll.saveProtokoll($("#abschlusspruefung_id").val(),data); @@ -49,17 +46,12 @@ $("document").ready(function() { function() { // if student not mentally and physically fit (checkbox), no form entry if ($(this).prop('checked')) { - $("#abschlussbeurteilung_kurzbz, #pruefungsbeginn, #pruefungsende").prop('disabled', false); - $("#abschlussbeurteilung_kurzbz").val($("#abschlussbeurteilung_kurzbz option").first().val()); + $("#abschlussbeurteilung_kurzbz").prop('disabled', false).val($("#abschlussbeurteilung_kurzbz option").first().val()); } else { - $("#abschlussbeurteilung_kurzbz, #pruefungsbeginn, #pruefungsende").prop('disabled', true).val(null); + $("#abschlussbeurteilung_kurzbz").prop('disabled', true).val(null); } - - $("#pruefungsbeginn").val(null); - $("#pruefungsende").val(null); - } ); @@ -94,10 +86,10 @@ var Pruefungsprotokoll = { if (dataresponse.freigabedatum) { $("#saveProtocolBtn").prop("disabled", true); - $("#freigegebenText").html('  ' + FHC_PhrasesLib.t("pruefungsprotokoll", "freigegebenAm") + + $("#freigegebenText").html('  ' + FHC_PhrasesLib.t("abschlusspruefung", "freigegebenAm") + ' ' + dataresponse.freigabedatum) } - FHC_DialogLib.alertSuccess("Prüfung erfolgreich gespeichert!"); + FHC_DialogLib.alertSuccess(FHC_PhrasesLib.t("abschlusspruefung", "pruefungGespeichert")); } else if(FHC_AjaxClient.isError(data)) { @@ -105,30 +97,39 @@ var Pruefungsprotokoll = { } }, errorCallback: function() { - FHC_DialogLib.alertError("Fehler beim Speichern der Prüfung"); + FHC_DialogLib.alertError(FHC_PhrasesLib.t("abschlusspruefung", "pruefungSpeichernFehler")); }, veilTimeout: 0 } ); }, - checkFields: function(data) + checkFields: function(data, verfChecked) { var errors = []; - if (data.abschlussbeurteilung_kurzbz == "") - errors.push({"abschlussbeurteilung_kurzbz": "Abschlussbeurteilung darf nicht leer sein!"}); // TODO phrases + if (data.abschlussbeurteilung_kurzbz == "" && verfChecked) + errors.push({"abschlussbeurteilung_kurzbz": FHC_PhrasesLib.t("abschlusspruefung", "abschlussbeurteilungLeer")}); var zeitregex = /^[0-2][0-9]:[0-5][0-9]$/; if (data.uhrzeit == "") - errors.push({"pruefungsbeginn": "Beginnzeit darf nicht leer sein!"}); + { + if (verfChecked) + errors.push({"pruefungsbeginn": FHC_PhrasesLib.t("abschlusspruefung", "beginnzeitLeer")}); + } else if(!zeitregex.test(data.uhrzeit)) - errors.push({"pruefungsbeginn": "Beginnzeit muss Format Stunden:Minuten haben!"}); + errors.push({"pruefungsbeginn": FHC_PhrasesLib.t("abschlusspruefung", "beginnzeitFormatError")}); if (data.endezeit == "") - errors.push({"pruefungsende": "Endzeit darf nicht leer sein!"}); + { + if (verfChecked) + errors.push({"pruefungsende": FHC_PhrasesLib.t("abschlusspruefung", "endezeitLeer")}); + } else if(!zeitregex.test(data.endezeit)) - errors.push({"pruefungsende": "Endzeit muss Format Stunden:Minuten haben!"}); + errors.push({"pruefungsende": FHC_PhrasesLib.t("abschlusspruefung", "endezeitFormatError")}); + + if (data.uhrzeit > data.endezeit && data.endezeit != "" && data.uhrzeit != "") + errors.push({"pruefungsende": FHC_PhrasesLib.t("abschlusspruefung", "endezeitBeforeError")}); return errors; } diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9e501aaf2..944f931b9 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -4174,6 +4174,46 @@ When on hold, the date is only a reminder.', ) ) ), + array( + 'app' => 'core', + 'category' => 'password', + 'phrase' => 'wrongPassword', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Falsches Passwort', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Wrong password', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'password', + 'phrase' => 'passwordMissing', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Passwort fehlt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Password missing', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', @@ -5714,6 +5754,26 @@ When on hold, the date is only a reminder.', ) ) ), + array( + 'app' => 'lehrauftrag', + 'category' => 'ui', + 'phrase' => 'ungueltigeParameter', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ungültige Parameter', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Invalid parameters', + 'description' => 'Hours', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'table', @@ -6900,7 +6960,7 @@ When on hold, the date is only a reminder.', ), array( 'sprache' => 'English', - 'text' => 'Bachelor paper', + 'text' => 'Bachelor Paper', 'description' => '', 'insertvon' => 'system' ) @@ -7220,7 +7280,7 @@ When on hold, the date is only a reminder.', ), array( 'sprache' => 'English', - 'text' => '', + 'text' => 'Declaration of Agreement', 'description' => '', 'insertvon' => 'system' ) @@ -7448,19 +7508,19 @@ Any unusual occurrences ), array( 'sprache' => 'English', - 'text' => 'Assesment and criteria Bachelor Examination

+ 'text' => 'Assessment and criteria Bachelor Examination

', 'description' => '', 'insertvon' => 'system' ) @@ -7584,6 +7646,166 @@ Any unusual occurrences 'insertvon' => 'system' ) ) + ), + array( + 'app' => 'core', + 'category' => 'abschlusspruefung', + 'phrase' => 'pruefungGespeichert', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Prüfung erfolgreich gespeichert!', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Examination successfully saved!', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'abschlusspruefung', + 'phrase' => 'pruefungSpeichernFehler', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Fehler beim Speichern der Prüfung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Error when saving examination', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'abschlusspruefung', + 'phrase' => 'abschlussbeurteilungLeer', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Abschlussbeurteilung darf nicht leer sein!', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Assessment cannot be empty!', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'abschlusspruefung', + 'phrase' => 'beginnzeitLeer', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Beginnzeit darf nicht leer sein!', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Start time cannot be empty!', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'abschlusspruefung', + 'phrase' => 'endezeitLeer', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Endzeit darf nicht leer sein!', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'End time cannot be empty!', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'abschlusspruefung', + 'phrase' => 'beginnzeitFormatError', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Beginnzeit muss Format Stunden:Minuten haben!', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Start time must have format Hours:Minutes!', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'abschlusspruefung', + 'phrase' => 'endezeitFormatError', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Endezeit muss Format Stunden:Minuten haben!', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'End time must have format Hours:Minutes!', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'abschlusspruefung', + 'phrase' => 'endezeitBeforeError', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Endezeit darf nicht kleiner als Beginnzeit sein!', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'End time cannot be before begin time!', + 'description' => '', + 'insertvon' => 'system' + ) + ) ) );