From c3cbdd8305d2c46a6a18fc4f1fcc3a3f3f127029 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Mon, 16 Mar 2020 23:29:28 +0100 Subject: Rev: 4620 --- .../include/modules/naplo/haladasi/haladasi.php | 2 + .../www/include/modules/naplo/share/ora.php | 18 +++++-- .../lang/hu_HU/module-naplo/haladasi/haladasi.php | 3 ++ .../hu_HU/module-naplo/haladasi/hazifeladat.php | 41 +++++++++++++++ .../private/naplo/haladasi/hazifeladat-pre.php | 60 ++++++++++++++++++++++ .../policy/private/naplo/haladasi/hazifeladat.php | 11 ++++ .../www/skin/classic/module-naplo/css/naplo.css | 2 +- .../module-naplo/html/haladasi/haladasi.phtml | 12 ++++- .../module-naplo/html/haladasi/hazifeladat.phtml | 47 +++++++++++++++++ .../module-naplo/html/orarend/orarend.phtml | 5 +- .../module-naplo/javascript/naplo.jquery.min.js | 11 ++++ 11 files changed, 204 insertions(+), 8 deletions(-) create mode 100644 mayor-orig/mayor-naplo/www/lang/hu_HU/module-naplo/haladasi/hazifeladat.php create mode 100644 mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php create mode 100644 mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat.php create mode 100644 mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml (limited to 'mayor-orig/mayor-naplo/www') diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php index e5090c18..0be1c61a 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php @@ -72,10 +72,12 @@ // Csatlakozás az adatbázishoz $lr = db_connect('naplo', array('fv' => 'getHaladasi')); $q = "SELECT oraId, dt, ora, ki, kit, tankorId, teremId, ora.leiras, tipus, eredet, csoportId, feladatTipusId, + hazifeladatId, getOraTolTime(oraId) AS tolTime, getOraIgTime(oraId) AS igTime FROM ora LEFT JOIN tankorCsoport USING (tankorId) + LEFT JOIN oraHazifeladat USING (oraId) LEFT JOIN ".__INTEZMENYDBNEV.".feladatTipus USING (feladatTipusId) WHERE dt>='%s' AND dt<='%s' AND tipus NOT LIKE 'elmarad%%' $feltetel $teremFeltetel diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php index 73430f3d..7c4c4b4e 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php @@ -23,15 +23,17 @@ TRIM(CONCAT_WS(' ', t2.viseltNevElotag, t2.viseltCsaladiNev, t2.viseltUtonev)) AS kitCn, tankorNev, feladatTipusId, - munkaido + munkaido, + hazifeladatId, hazifeladatLeiras FROM `%s`.ora + LEFT JOIN `%s`.oraHazifeladat USING (oraId) LEFT JOIN ".__INTEZMENYDBNEV.".tankorSzemeszter USING (tankorId) LEFT JOIN ".__INTEZMENYDBNEV.".tanar AS t1 ON ki=t1.tanarId LEFT JOIN ".__INTEZMENYDBNEV.".tanar AS t2 ON kit=t2.tanarId LEFT JOIN ".__INTEZMENYDBNEV.".feladatTipus USING (feladatTipusId) LEFT JOIN ".__INTEZMENYDBNEV.".terem USING (teremId) WHERE oraId=%u AND (tanev=%u OR feladatTipusId IS NOT NULL)"; - $v = array(tanevDbNev(__INTEZMENY, $tanev), $oraId, $tanev); + $v = array(tanevDbNev(__INTEZMENY, $tanev),tanevDbNev(__INTEZMENY, $tanev), $oraId, $tanev); return db_query($q, array('fv' => 'getOraAdatById', 'modul' => 'naplo_intezmeny', 'result' => 'record', 'values' => $v), $olr); } else { @@ -345,7 +347,9 @@ array_unshift($v, $tolDt, $igDt, $tanarId); $RESULT = db_query($q, array('modul' => 'naplo', 'fv' => 'getTanarOrak', 'result' => 'idonly', 'values' => $v)); } else { - $q = "SELECT * FROM ora WHERE dt>='%s' and dt<='%s' AND (ki=%u OR kit=%u) $WHERE ORDER BY dt,ora"; + $q = "SELECT * FROM ora +LEFT JOIN oraHazifeladat USING (oraId) +WHERE dt>='%s' and dt<='%s' AND (ki=%u OR kit=%u) $WHERE ORDER BY dt,ora"; array_unshift($v, $tolDt, $igDt, $tanarId, $tanarId); if ($SET['result']=='assoc') $RESULT = db_query($q, array('modul' => 'naplo', 'fv' => 'getTanarOrak', 'keyfield' => 'ora', 'result' => 'assoc', 'values' => $v)); @@ -385,10 +389,14 @@ $RE = db_query($q, array('modul' => 'naplo', 'fv' => 'getOrak', 'result' => 'indexed', 'values' => $v)); } else { if ($SET['elmaradokNelkul']) - $q = "SELECT *,getOraTolTime(ora.oraId) AS tolTime,getOraIgTime(ora.oraId) AS igTime FROM ora WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count($TANKORIDK), '%u')).") + $q = "SELECT *,getOraTolTime(ora.oraId) AS tolTime,getOraIgTime(ora.oraId) AS igTime FROM ora +LEFT JOIN oraHazifeladat USING (oraId) +WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count($TANKORIDK), '%u')).") AND tipus NOT IN ('elmarad','elmarad máskor')"; else - $q = "SELECT *,getOraTolTime(ora.oraId) AS tolTime,getOraIgTime(ora.oraId) AS igTime FROM ora WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count($TANKORIDK), '%u')).")"; + $q = "SELECT *,getOraTolTime(ora.oraId) AS tolTime,getOraIgTime(ora.oraId) AS igTime FROM ora +LEFT JOIN oraHazifeladat USING (oraId) +WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count($TANKORIDK), '%u')).")"; $R = db_query($q, array('modul' => 'naplo', 'fv' => 'getOrak', 'result' => 'indexed', 'values' => $v)); $RE['tankorok']=array(); for ($i = 0; $i < count($R); $i++) { diff --git a/mayor-orig/mayor-naplo/www/lang/hu_HU/module-naplo/haladasi/haladasi.php b/mayor-orig/mayor-naplo/www/lang/hu_HU/module-naplo/haladasi/haladasi.php index 023785f5..10ba3f24 100644 --- a/mayor-orig/mayor-naplo/www/lang/hu_HU/module-naplo/haladasi/haladasi.php +++ b/mayor-orig/mayor-naplo/www/lang/hu_HU/module-naplo/haladasi/haladasi.php @@ -35,4 +35,7 @@ define('_TOROL','töröl'); define('_BEALLITASAI', 'beállításai'); + define('_HAZIFELADAT','Házi feladat'); + + ?> diff --git a/mayor-orig/mayor-naplo/www/lang/hu_HU/module-naplo/haladasi/hazifeladat.php b/mayor-orig/mayor-naplo/www/lang/hu_HU/module-naplo/haladasi/hazifeladat.php new file mode 100644 index 00000000..eea20314 --- /dev/null +++ b/mayor-orig/mayor-naplo/www/lang/hu_HU/module-naplo/haladasi/hazifeladat.php @@ -0,0 +1,41 @@ + diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php new file mode 100644 index 00000000..a4a1e696 --- /dev/null +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php @@ -0,0 +1,60 @@ +'naplo','result'=>'value','values'=>$values)); + + if ($action=='hazifeladatBeiras') { + + if ($hazifeladatId>0) { // update + $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s' WHERE hazifeladatId=%u"; + $values = array($ADAT['hazifeladatLeiras'],$ADAT['hazifeladatId']); + $r = db_query($q, array('modul'=>'naplo','result'=>'update','values'=>$values)); + } elseif ($oraId>0) { // insert + $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId) VALUES ('%s',%u)"; + $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId']); + $hazifeladatId = db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values)); + } + + } + + $q = "SELECT * FROM oraHazifeladat WHERE oraId=%u"; + $values = array($ADAT['oraId']); + $ADAT['hazifeladatAdat'] = db_query($q, array('modul'=>'naplo','result'=>'record','values'=>$values)); + + + $TOOL['vissza'] = array('tipus'=>'vissza', + 'paramName'=>'vissza', + 'icon'=>'', + 'postOverride' => array('igDt'=>$igDt,'tanarId'=>$tanarId,'page'=>'naplo','sub'=>'haladasi','f'=>'haladasi') + ); + if (isset($oraId)) $TOOL['tanarOraLapozo'] = array('tipus'=>'sor', 'oraId' => $oraId, 'post'=>array('tanarId')); + getToolParameters(); + +?> diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat.php new file mode 100644 index 00000000..f98f0079 --- /dev/null +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat.php @@ -0,0 +1,11 @@ + diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/naplo.css b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/naplo.css index 849a5afe..8f26e848 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/naplo.css +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/naplo.css @@ -214,7 +214,7 @@ /* #updateWindowSide h3:before { font-family: 'Elusive-Icons'; font-size:10px; content: "\e0a4"; padding-right:8px;font-weight:100; }*/ - .updateWindowSide button.mentes, .updateWindowSide button.torles { margin: 4px 18px; height:2em; border-radius:2px; border: solid 1px white; color:white; background-color: #ddd;} + .updateWindowSide button.mentes, .updateWindowSide button.torles { margin: 4px 18px; height:2em; border-radius:2px; border: solid 1px white; color:white; background-color: #2196f3;} .updateWindowSide button.mentes:hover { background-color: lightgreen; } .updateWindowSide button.torles:hover { background-color: red; } diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/haladasi.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/haladasi.phtml index 27eb51f1..e6377aeb 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/haladasi.phtml +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/haladasi.phtml @@ -433,6 +433,7 @@ echo ''; } echo ''."\n"; + echo ''."\n"; echo ''."\n"; // ------------------------------------------------------------------------- echo ''."\n"; @@ -485,7 +486,6 @@ echo $dOra['oraszam']; echo ''; - } else { // itt kiírhatjuk a heti terhelését //echo 'eheti:'.($ADAT['oraTerheles'][$dOra['feladatTipusId']]['db']-$SZLO[$dOra['feladatTipusId']])."/".($ADAT['oraTerheles'][$dOra['feladatTipusId']]['db']).''; //echo 'eheti:'.($SZLO['sum']-$SZLO['sum_c'])."/".($SZLO['sum']).''; @@ -514,6 +514,16 @@ if (count($_C)>0) echo ''.implode(' ',$_C).''; } } + echo ''; + if ($dOra['hazifeladatId']>0) { + echo ''; + } else { + echo ''; + } + echo ''; + + + echo ''; // ----- Leírás --------------------------------- if ($modosithatoOra) { diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml new file mode 100644 index 00000000..acf8fcae --- /dev/null +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml @@ -0,0 +1,47 @@ +'; + echo ' + fieldset.adatok { margin-bottom:1em; width:80%; margin-left:auto; margin-right:auto; border-radius: 2px; border: solid 1px #ddd;} + fieldset.adatok legend { border-radius: 2px; background-color: #ff5722; color:white; padding: 2px 4px; } + '; + echo ''; + + echo '
'._ALAPADATOK.''."\n"; + + echo superdate($ADAT['oraAdat']['dt']).' ('.$ADAT['oraAdat']['dt'].'), '.$ADAT['oraAdat']['ora'].'. '._ORA.' – '.$ADAT['oraAdat']['tankorNev'].' – '.$ADAT['oraAdat']['kiCn']; + + echo '

'.$ADAT['oraAdat']['leiras'].'

'; + + echo '
'."\n"; + + if (__DIAK===true) { + + echo '
'._HAZIFELADAT.''."\n"; + echo ($ADAT['hazifeladatAdat']['hazifeladatLeiras']); + echo '
'."\n"; + + } else { + echo ''; + if ($skin != 'ajax') formBegin(array('class'=>'hazifeladat')); + echo ''; + echo ''; + echo ''; + + echo '
'._HAZIFELADAT.''."\n"; + echo ''; + echo " + "; + echo ''; + echo '
'."\n"; + if ($skin != 'ajax') formEnd(); + } + } + +?> diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/orarend/orarend.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/orarend/orarend.phtml index f8b8d393..0aba3072 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/orarend/orarend.phtml +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/orarend/orarend.phtml @@ -234,7 +234,6 @@ // $het = $_T['het']; $_ORA = $ADAT['haladasi']['orak'][$dt][$ora][$_T['tankorId']]; - $_valosTeremId = (is_null($_ORA['teremId']))? $_T['teremId']:$_ORA['teremId']; $_tankorTipus = $ADAT['tankorok'][$_T['tankorId']][0]['tankorTipus']; @@ -262,8 +261,12 @@ $_hianyzasAdat = $ADAT['hianyzas'][$_ORA['oraId']][0]; $_hianyzasClass = (is_array($_hianyzasAdat) && $_hianyzasAdat['hTipus']=='hiányzás') ? ' nemVoltBent ':''; echo '
'; + if (isset($_ORA['hazifeladatId'])) { + echo ''; + } if (is_array($_hianyzasAdat)) { + echo ''; if ($_hianyzasAdat['hTipus']=='hiányzás') echo ''; diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/naplo.jquery.min.js b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/naplo.jquery.min.js index c57e142e..251155a1 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/naplo.jquery.min.js +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/naplo.jquery.min.js @@ -698,6 +698,7 @@ processJSONOraAdat = function(adat) { content += '
'; content += ''; content += ''; + content += ''; content += '
'; content += '

A haladási óra adatai

'; @@ -731,6 +732,16 @@ processJSONOraAdat = function(adat) { if (adat['dolgozatBeirhato']) { content += adat['dolgozatForm']; } + + + content += '

Házi feladat '; + content += ''; + content += '

'; + if (adat['oraAdat']['hazifeladatId']>0) { + content += '
'; + content += adat['oraAdat']['hazifeladatLeiras']; + content += '
'; + } if (adat['elozoOrak']!=undefined && adat['elozoOrak'].length>0) { content += '

Előző órák

'; content += '