diff options
author | M.Gergo | 2020-04-04 12:40:03 +0200 |
---|---|---|
committer | M.Gergo | 2020-04-04 12:40:03 +0200 |
commit | 8c9ffb12892161e5a0fc12c97aa0c8d90f99eb6c (patch) | |
tree | 1bac3477a16d3aef1a98b23d3c43efcba0ee0368 /mayor-orig/mayor-naplo/www | |
parent | f140bf024b58d159d37a1cf73735cb6afa6da3f3 (diff) | |
download | mayor-8c9ffb12892161e5a0fc12c97aa0c8d90f99eb6c.tar.gz mayor-8c9ffb12892161e5a0fc12c97aa0c8d90f99eb6c.zip |
Rev: 4649rev4649
Diffstat (limited to 'mayor-orig/mayor-naplo/www')
-rw-r--r-- | mayor-orig/mayor-naplo/www/include/modules/naplo/share/oraModifier.php | 31 | ||||
-rw-r--r-- | mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/hazifeladat.phtml | 4 |
2 files changed, 31 insertions, 4 deletions
diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/oraModifier.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/oraModifier.php index 8c5bd077..625b6b13 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/oraModifier.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/oraModifier.php @@ -164,12 +164,37 @@ $diakId=__SZULODIAKID; } if ($diakId>0) { - $q = "INSERT IGNORE INTO oraHazifeladatDiak (hazifeladatId,diakId,diakLattamDt) VALUES (%u,%u,NOW())"; - $values = array($hazifeladatId, $diakId); - db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values)); + if (diakSajatHazifeladatE($hazifeladatId)) { + $q = "INSERT IGNORE INTO oraHazifeladatDiak (hazifeladatId,diakId,diakLattamDt) VALUES (%u,%u,NOW())"; + $values = array($hazifeladatId, $diakId); + db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values)); + } } } } + function diakSajatHazifeladatE($hazifeladatId) { + $sajat = false; + if (__DIAK===true && $hazifeladatId>0) { + if (defined('__USERDIAKID') && __USERDIAKID>0) { + $diakId=__USERDIAKID; + } elseif (defined('__SZULODIAKID') && __SZULODIAKID>0) { + $diakId=__SZULODIAKID; + } + if ($diakId>0) { + + $q = "SELECT tankorId,dt AS oraDt FROM oraHazifeladat LEFT JOIN ora USING (oraId) WHERE hazifeladatId=%u"; + $values = array($hazifeladatId); + $ORA = db_query($q, array('debug'=>false,'modul'=>'naplo','result'=>'record','values'=>$values)); + + $dt = $ORA['oraDt']; + $tankorId = $ORA['tankorId']; + $diakTankorIds = getTankorIdsByDiakIds(array($diakId), array('tanev' => __TANEV,'tolDt'=>$dt,'igDt'=>$dt,'felmentettekkel'=>true)); + + if (in_array($tankorId,$diakTankorIds)) $sajat = true; + } + } + return $sajat; + } ?>
\ No newline at end of file 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 index ffe8a4dd..419fbc49 100644 --- 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 @@ -221,7 +221,9 @@ echo '<style type="text/css"> $_diakId = $ADAT['hazifeladatDiak'][$i]['diakId']; if (!is_array($ADAT['nevsor']['nevek'][$_diakId])) { $EXTRA = $ADAT['hazifeladatDiak'][$i]; - $ADAT['nevsor']['nevek'][$EXTRA['diakId']] = array('diakId'=>$ADAT['hazifeladatDiak'][$i]['diakId'],'diakNev'=>$EXTRA['diakNev'],'extra'=>'add'); + if ($EXTRA['hazifeladatDiakStatus']!='') { // csak akkor rakjuk be a névsorba, ha késznek jelölte a diák + $ADAT['nevsor']['nevek'][$EXTRA['diakId']] = array('diakId'=>$ADAT['hazifeladatDiak'][$i]['diakId'],'diakNev'=>$EXTRA['diakNev'],'extra'=>'add'); + } } } |