From 4d85d42a79a30f30def7ef694420922527bd34af Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 15 Feb 2023 14:50:12 +0100 Subject: [PATCH] - gebiet zeit hinzufuegen fixed - stammdaten abbrechen button fixed --- public/js/infocenter/stammdaten.js | 33 +++++++++---- vilesci/stammdaten/auswertung_fhtw.php | 64 +++++++++++++------------- 2 files changed, 56 insertions(+), 41 deletions(-) diff --git a/public/js/infocenter/stammdaten.js b/public/js/infocenter/stammdaten.js index eca8dae46..d83690b04 100644 --- a/public/js/infocenter/stammdaten.js +++ b/public/js/infocenter/stammdaten.js @@ -96,6 +96,8 @@ var Stammdaten = { $(this).parent('div').children('div').show(); $(this).remove(); }); + + Stammdaten._setReadOnly(true); }, _show: function() @@ -142,11 +144,7 @@ var Stammdaten = { }); }); - var stammdatenform = $('.stammdaten_form'); - - stammdatenform.find('select').attr('disabled', false); - $('.editActionStammdaten').show(); - $('.editStammdaten').hide(); + Stammdaten._setReadOnly(false); }, _updated: function() @@ -186,10 +184,25 @@ var Stammdaten = { $(this).remove(); }); - var stammdatenform = $('.stammdaten_form'); - stammdatenform.find('select').attr('disabled', true); - - $('.editActionStammdaten').hide(); - $('.editStammdaten').show(); + Stammdaten._setReadOnly(true); }, + + _setReadOnly: function(readonly) + { + var stammdatenform = $('.stammdaten_form'); + + stammdatenform.find('select').attr('disabled', readonly); + + if (readonly === true) + { + $('.editActionStammdaten').hide(); + $('.editStammdaten').show(); + } + else + { + $('.editActionStammdaten').show(); + $('.editStammdaten').hide(); + } + + } } \ No newline at end of file diff --git a/vilesci/stammdaten/auswertung_fhtw.php b/vilesci/stammdaten/auswertung_fhtw.php index 016bbe602..e5975b651 100644 --- a/vilesci/stammdaten/auswertung_fhtw.php +++ b/vilesci/stammdaten/auswertung_fhtw.php @@ -519,8 +519,8 @@ if ($rtprueflingEntSperren) } // Ajax-Request um einen Prüfling Zeit für ein bestimmtes Gebiet hinzuzufügen -$prueflingAddTime = filter_input(INPUT_POST, 'prueflingAddTime', FILTER_VALIDATE_BOOLEAN); -if ($prueflingAddTime) +$prestudentAddTime = filter_input(INPUT_POST, 'prestudentAddTime', FILTER_VALIDATE_BOOLEAN); +if ($prestudentAddTime) { if (!$rechte->isBerechtigt('lehre/reihungstestAufsicht', null, 'su')) { @@ -531,7 +531,7 @@ if ($prueflingAddTime) exit(); } - if (isset($_POST['pruefling_id']) && is_numeric($_POST['pruefling_id']) + if (isset($_POST['prestudent_id']) && is_numeric($_POST['prestudent_id']) && isset($_POST['gebiet']) && is_numeric($_POST['gebiet']) && isset($_POST['time']) && is_numeric($_POST['time'])) { @@ -552,14 +552,19 @@ if ($prueflingAddTime) ELSE (endtime + (" .$db->db_add_param($_POST['time']) . " * interval '1 minute')) END - WHERE prueflingfrage_id IN - ( - SELECT prueflingfrage_id - FROM testtool.tbl_pruefling - JOIN testtool.tbl_pruefling_frage USING (pruefling_id) - JOIN testtool.tbl_frage ON tbl_pruefling_frage.frage_id = tbl_frage.frage_id - WHERE pruefling_id = ". $db->db_add_param($_POST['pruefling_id']) . " AND gebiet_id = ". $db->db_add_param($_POST['gebiet']) ." - )"; + WHERE prueflingfrage_id IN + ( + SELECT prueflingfrage_id + FROM testtool.tbl_pruefling + JOIN testtool.tbl_pruefling_frage USING (pruefling_id) + JOIN testtool.tbl_frage ON tbl_pruefling_frage.frage_id = tbl_frage.frage_id + JOIN tbl_prestudent ps on tbl_pruefling.prestudent_id = ps.prestudent_id + JOIN tbl_prestudent pss USING (person_id) + WHERE pss.prestudent_id = ". $db->db_add_param($_POST['prestudent_id']) . " + AND gebiet_id = ". $db->db_add_param($_POST['gebiet']) ." + AND (extract(day FROM begintime) = extract(day FROM CURRENT_DATE) OR begintime IS NULL) + )"; + if ($result = $db->db_query($qry)) { @@ -2486,14 +2491,14 @@ else }); } } - function prueflingAddTime(pruefling_id, gebiet) + function prestudentAddTime(prestudent_id, gebiet) { - var min = $("#prueflingAddTime_" + pruefling_id + "_gebiet_" + gebiet).val(); + var min = $("#prestudentAddTime_" + prestudent_id + "_gebiet_" + gebiet).val(); data = { - pruefling_id: pruefling_id, + prestudent_id: prestudent_id, gebiet: gebiet, time: min, - prueflingAddTime: true + prestudentAddTime: true }; $.ajax({ @@ -3372,25 +3377,22 @@ else echo '' . ($erg->gebiet[$gbt->gebiet_id]->prozent != '' ? number_format($erg->gebiet[$gbt->gebiet_id]->prozent, 2, ',', ' ') . ' %' : '') . ''; echo ''; - if (!is_null($erg->pruefling_id)) + $time = strtotime($gbt->zeit); + $minutes = date('i', $time); + echo ''; - - for ($i = 2; $i <= 10; $i = $i +2) - { - if ($i < $minutes) - echo ''; - } - - echo ''; - - echo ' - + if ($i < $minutes) + echo ''; + } + + echo ''; + + echo ' + '; - } echo ''; } else