From 31bf036be3be01ef7b3bbc9dc08813f0740dab9a Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Mon, 23 Mar 2020 01:17:58 +0100 Subject: Rev: 4630 --- .../policy/private/naplo/haladasi/haladasi-pre.php | 3 ++ .../private/naplo/haladasi/hazifeladat-pre.php | 32 ++++++++++++++++++++-- .../policy/private/naplo/orarend/orarend-pre.php | 2 +- 3 files changed, 34 insertions(+), 3 deletions(-) (limited to 'mayor-orig/mayor-naplo/www/policy') diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/haladasi-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/haladasi-pre.php index 9b397670..a7c57b7f 100644 --- a/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/haladasi-pre.php +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/haladasi-pre.php @@ -361,6 +361,9 @@ if ( $skin == 'ajax' } } $ADAT['oraLatogatasok'] = getOralatogatasByOraIds($ADAT['ORAIDK']); + if (__DIAK===true && $diakId>0) { + $ADAT['diakHazifeladat'] = getDiakHazifeladatByOraIds($ADAT['ORAIDK'],$diakId); + } foreach ($ADAT['oraLatogatasok'] as $olId => $olAdat) foreach ($olAdat['tanarIds'] as $_tanarId) $ADAT['oraLatogatasok'][$olId]['tanarNevek'][] = getTanarNevById($_tanarId); // Kell a munkaterv!! Ahhoz kell(enek) az osztály(ok)! 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 index ba0a27c4..28a02d5a 100644 --- 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 @@ -23,7 +23,7 @@ $ADAT['oraId' ] = $oraId = readVariable($_POST['oraId'],'id',readVariable($_GET['oraId'],'id')); // $ADAT['hazifeladatId' ] = $hazifeladatId = readVariable($_POST['hazifeladatId'],'id', readVariable($_GET['hazifeladatId'],'id')); $ADAT['hazifeladatLeiras' ] = readVariable($_POST['hazifeladatLeiras'],'string'); - $action = readVariable($_POST['action'],'strictstring',null,array('hazifeladatBeiras')); + $action = readVariable($_POST['action'],'strictstring',null,array('hazifeladatBeiras','hazifeladatKesz')); $q = "SELECT hazifeladatId FROM oraHazifeladat WHERE oraId=%u"; $values = array($ADAT['oraId']); @@ -46,13 +46,41 @@ $leiras = readVariable($_POST['oraLeiras'],'string'); updateHaladasiNaploOra($oraId, $leiras); } + } elseif (__DIAK===true) { + if (defined('__USERDIAKID') && __USERDIAKID>0) { + $diakId=__USERDIAKID; + } elseif (defined('__SZULODIAKID') && __SZULODIAKID>0) { + $diakId=__SZULODIAKID; + } + if ($diakId>0) { + $q = "INSERT IGNORE INTO oraHazifeladatDiak (hazifeladatId,diakId,diakLattamDt) VALUES (%u,%u,NOW())"; + $values = array($ADAT['hazifeladatId'], $diakId); + db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values)); + + if ($action=='hazifeladatKesz') { + if ($diakId>0 && $ADAT['hazifeladatId']>0) { + $q = "UPDATE oraHazifeladatDiak SET hazifeladatDiakStatus=IF(hazifeladatDiakStatus='','kész','') WHERE hazifeladatId=%u AND diakId=%u"; + $values = array($ADAT['hazifeladatId'], $diakId); + db_query($q, array('modul'=>'naplo','result'=>'update','values'=>$values)); + } + } + $q = "SELECT * FROM oraHazifeladatDiak WHERE hazifeladatId=%u AND diakId=%u"; + $values = array($ADAT['hazifeladatId'],$diakId); + $ADAT['hazifeladatDiak'] = db_query($q, array('modul'=>'naplo','result'=>'record','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)); - $ADAT['oraAdat'] = getOraadatById($oraId); + if (__TANAR===true || __NAPLOADMIN===true || __VEZETOSEG===true) { + $q = "SELECT *,getNev(diakId,'diak') AS diakNev FROM oraHazifeladatDiak WHERE hazifeladatId=%u ORDER BY diakNev"; + $values = array($ADAT['hazifeladatId']); + $ADAT['hazifeladatDiak'] = db_query($q, array('debug'=>true,'modul'=>'naplo','result'=>'indexed','values'=>$values)); + } + $ADAT['oraAdat'] = getOraadatById($oraId); $TOOL['vissza'] = array('tipus'=>'vissza', 'paramName'=>'vissza', diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarend-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarend-pre.php index 6421687a..c56b6d87 100644 --- a/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarend-pre.php +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarend-pre.php @@ -191,7 +191,7 @@ if ($teremId!='') $_D = getOrakByTeremId($teremId,array('tolDt'=>$_dt,'igDt'=>$_dt,'result'=>'likeOrarend')); else - $_D = getOrak($TANKOROK['haladasi'],array('tolDt'=>$_dt,'igDt'=>$_dt,'result'=>'likeOrarend')); + $_D = getOrak($TANKOROK['haladasi'],array('tolDt'=>$_dt,'igDt'=>$_dt,'result'=>'likeOrarend','diakId'=>$diakId)); $ADAT['haladasi']['orak'][$_dt] = $_D['orak'][$_dt]; if (is_array($_D['tankorok'])) $ADAT['haladasi']['tankorok'] = array_map('intval',array_unique(array_merge($_D['tankorok'],$ADAT['haladasi']['tankorok']))); } -- cgit v1.2.3