aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/mayor-naplo/www/policy
diff options
context:
space:
mode:
Diffstat (limited to 'mayor-orig/mayor-naplo/www/policy')
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/haladasi/hazifeladat-pre.php28
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/orarend/orarend-pre.php7
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/tools/getOraAdat-pre.php3
3 files changed, 27 insertions, 11 deletions
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 931b7dcd..ac911f8b 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
@@ -53,21 +53,32 @@
$values = array($ADAT['oraId']);
$ADAT['hazifeladatId'] = $hazifeladatId = db_query($q, array('modul'=>'naplo','result'=>'value','values'=>$values));
$ADAT['oraAdat'] = getOraadatById($oraId);
+ $ADAT['oraAdat']['oraBeirhato'] = oraBeirhato($ADAT['oraAdat']['oraId']);
$ADAT['nevsor'] = getTankorDiakjaiByInterval($ADAT['oraAdat']['tankorId'], __TANEV, $ADAT['oraAdat']['dt'], $ADAT['oraAdat']['dt']);
-
+ $ADAT['kovetkezoOraAdat'] = getKovetkezoOraAdatByOraId($ADAT['oraAdat']['oraId']);
if (__TANAR===true && $action=='hazifeladatBeiras') {
+ $hazifeladatHataridoDt = readVariable($_POST['hazifeladatHataridoDt'],'datetime',null);
$hazifeladatFeltoltesEngedely = readVariable($_POST['hazifeladatFeltoltesEngedely'],'id',0);
if ($hazifeladatId>0) { // update
- $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s',hazifeladatFeltoltesEngedely=%u WHERE hazifeladatId=%u";
- $values = array($ADAT['hazifeladatLeiras'],$hazifeladatFeltoltesEngedely,$ADAT['hazifeladatId']);
- $r = db_query($q, array('modul'=>'naplo','result'=>'update','values'=>$values));
+ if (is_null($hazifeladatHataridoDt)) {
+ $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s',hazifeladatFeltoltesEngedely=%u WHERE hazifeladatId=%u";
+ $values = array($ADAT['hazifeladatLeiras'],$hazifeladatFeltoltesEngedely,$ADAT['hazifeladatId']);
+ } else {
+ $q = "UPDATE oraHazifeladat set hazifeladatLeiras='%s',hazifeladatFeltoltesEngedely=%u,hazifeladatHataridoDt='%s' WHERE hazifeladatId=%u";
+ $values = array($ADAT['hazifeladatLeiras'],$hazifeladatFeltoltesEngedely,$hazifeladatHataridoDt,$ADAT['hazifeladatId']);
+ }
+ $r = db_query($q, array('debug'=>false,'modul'=>'naplo','result'=>'update','values'=>$values));
} elseif ($oraId>0) { // insert
- $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId,hazifeladatFeltoltesEngedely) VALUES ('%s',%u,%u)";
- $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId'],$hazifeladatFeltoltesEngedely);
+ if (is_null($hazifeladatHataridoDt)) {
+ $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId,hazifeladatFeltoltesEngedely) VALUES ('%s',%u,%u)";
+ $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId'],$hazifeladatFeltoltesEngedely);
+ } else {
+ $q = "INSERT IGNORE INTO oraHazifeladat (hazifeladatLeiras,oraId,hazifeladatFeltoltesEngedely,hazifeladatHataridoDt) VALUES ('%s',%u,%u,'%s')";
+ $values = array($ADAT['hazifeladatLeiras'],$ADAT['oraId'],$hazifeladatFeltoltesEngedely,$hazifeladatHataridoDt);
+ }
$hazifeladatId = db_query($q, array('modul'=>'naplo','result'=>'insert','values'=>$values));
-
}
- if ($oraId>0 && strtotime(date('Y-m-d'))>=strtotime($ADAT['oraAdat']['dt'])) {
+ if ($oraId>0 && $ADAT['oraAdat']['oraBeirhato']===true ) {
$leiras = readVariable($_POST['oraLeiras'],'string');
updateHaladasiNaploOra($oraId, $leiras);
}
@@ -170,6 +181,7 @@
$ADAT['hazifeladatDiak'] = db_query($q, array('debug'=>false,'modul'=>'naplo','result'=>'indexed','values'=>$values));
}
$ADAT['oraAdat'] = getOraadatById($oraId);
+ $ADAT['oraAdat']['oraBeirhato'] = oraBeirhato($ADAT['oraAdat']['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 c56b6d87..262ff572 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
@@ -235,7 +235,14 @@
$_napok = getNapok(array('tolDt'=>$tolDt,'igDt'=>$igDt));
for ($i=0; $i<count($_napok); $i++) {
+ $_dt = $_napok[$i];
$ADAT['napok'][($i+1)] = getNapAdat($_napok[$i]);
+ if ($diakId>0) {
+ $lr = db_connect('naplo');
+ $_HF = getDiakHazifeladatByHatarido($diakId,array('hazifeladatHataridoDt'=>$_dt),$lr);
+ if (is_array($_HF) && count($_HF)>0) $ADAT['hazifeladat'][$_dt] = $_HF;
+ db_close($lr);
+ }
}
if (_POLICY!='public' && is_array($TANKOROK)) {
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/tools/getOraAdat-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/tools/getOraAdat-pre.php
index 1596e591..064bc796 100644
--- a/mayor-orig/mayor-naplo/www/policy/private/naplo/tools/getOraAdat-pre.php
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/tools/getOraAdat-pre.php
@@ -27,13 +27,10 @@
$leiras = readVariable($_POST['leiras'], 'string');
updateHaladasiNaploOra($oraId,$leiras);
}
-
$_JSON['oraAdat'] = $ORAADAT = getOraAdatById($oraId);
-
if ($ORAADAT['hazifeladatId']>0) {
oraHazifeladatDiakLatta($ORAADAT['hazifeladatId']); // log: diakLattamDt
}
-
if ($dolgozatBeirhato === true && $action=='dolgozatBeiras') {
$dolgozatId = ujDolgozat('',$ORAADAT['tankorId']);
dolgozatModositas($dolgozatId,'',$ORAADAT['dt']);