From 3a1c1811413c635c5ee6e40cb7d497de7313dbe1 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Thu, 28 Oct 2021 15:10:04 +0200 Subject: Rev: 4820 --- .../mayor-naplo/www/include/modules/naplo/base/rights.php | 4 ++-- .../mayor-naplo/www/include/modules/naplo/share/diak.php | 13 ++++++++++--- .../mayor-naplo/www/include/modules/naplo/share/hirnok.php | 13 +++++++++---- 3 files changed, 21 insertions(+), 9 deletions(-) (limited to 'mayor-orig/mayor-naplo/www/include') diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/base/rights.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/base/rights.php index 53eb1ed5..e5653309 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/base/rights.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/base/rights.php @@ -62,7 +62,7 @@ function initTanev($intezmeny, $tanev) { - global $MYSQL_DATA, $_TANEV; + global $MYSQL_DATA, $_TANEV, $policy; $MYSQL_DATA['naplo'] = $MYSQL_DATA['naplo_base']; $MYSQL_DATA['naplo']['db']= tanevDbNev($intezmeny, $tanev); @@ -85,7 +85,7 @@ if (__FOLYO_TANEV === true) if (__MUNKATERV_OK && __ORAREND_OK && __TANKOROK_OK) checkNaplo(date('Y-m-d')); else { - if (MAYOR_SOCIAL!==true) $_SESSION['alert'][]= 'info:checkNaploFailed:Tanév:'.($_TANEV['tanev']).':Részletek '.((__MUNKATERV_OK)?'munkaterv ok':'#chknaplo1 nincs munkaterv!').':'.((__ORAREND_OK)?'órarend ok':'#chknaplo2 nincs órarend!').':'.((__TANKOROK_OK)?'órarend-tankörök ok':'#chknaplo3 órarendi óra tankör összerendezési hiány!'); + if (MAYOR_SOCIAL!==true && $policy==='private') $_SESSION['alert'][]= 'info:checkNaploFailed:Tanév:'.($_TANEV['tanev']).':Részletek '.((__MUNKATERV_OK)?'munkaterv ok':'#chknaplo1 nincs munkaterv!').':'.((__ORAREND_OK)?'órarend ok':'#chknaplo2 nincs órarend!').':'.((__TANKOROK_OK)?'órarend-tankörök ok':'#chknaplo3 órarendi óra tankör összerendezési hiány!'); } } } diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/diak.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/diak.php index 25ac8d8a..b98dbcb5 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/diak.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/diak.php @@ -434,7 +434,7 @@ $q = "SELECT diak.*, TRIM(CONCAT_WS(' ',viseltNevElotag, ViseltCsaladiNev, viseltUtoNev)) AS diakNev, TIMESTAMPDIFF(YEAR, diak.szuletesiIdo, CURDATE()) AS diakEletkor, dj.dt AS jogviszonyDt, dj.statusz AS jogviszonyStatusz FROM ".__INTEZMENYDBNEV.".diak LEFT JOIN ".__INTEZMENYDBNEV.".diakJogviszony AS dj ON diak.diakId=dj.diakId AND dj.dt=(SELECT MAX(dt) FROM ".__INTEZMENYDBNEV.".diakJogviszony WHERE dt<=CURDATE() AND diakId=dj.diakId) - WHERE diak.diakId IN (".implode(',', array_fill(0, count($diakIds), '%u')).")"; + WHERE diak.diakId IN (".implode(',', array_fill(0, count($diakIds), '%u')).") ORDER BY diakNev"; $r = db_query($q, array('fv' => 'getDiakAdatById', 'modul' => 'naplo_intezmeny', 'result' => $result, 'keyfield'=>$SET['keyfield'],'values' => $diakIds), $lr); @@ -444,15 +444,22 @@ function getDiakBySzulDt($md) { + + $lr = db_connect('naplo_intezmeny'); if ($md == '') $md = date('m-d'); - $q = "SELECT diakId FROM diak WHERE szuletesiIdo like '%%-%s' AND jogviszonyVege is NULL"; // credits: Neumayer Béla - $diakIds = db_query($q, array('fv' => 'getDiakBySzulDt', 'modul' => 'naplo_intezmeny', 'result' => 'idonly', 'values' => array($md))); + $q = "SELECT diakId FROM diak WHERE szuletesiIdo like '%s' AND jogviszonyVege is NULL"; // credits: Neumayer Béla + $diakIds = db_query($q, array('lr'=>$lr,'fv' => 'getDiakBySzulDt', 'modul' => 'naplo_intezmeny', 'result' => 'idonly', 'values' => array('____-'.$md))); if (count($diakIds)>0) { $RET['diak'] = getDiakAdatById($diakIds); + for ($i=0; $i0)) { if (defined('__USERTANARID') && is_numeric(__USERTANARID)) { + $q = "SELECT COUNT(*) AS dbBeirtOra FROM ora WHERE ki=".__USERTANARID." AND dt <= CURDATE() AND (leiras!='')"; + $dbBeirtOra = db_query($q, array('fv' => 'getBeirasiAdatok', 'modul' => 'naplo', 'result' => 'value')); $q = "SELECT COUNT(*) FROM ora WHERE ki=".__USERTANARID." AND dt <= CURDATE() AND (leiras IS NULL OR leiras='')"; $r = db_query($q, array('fv' => 'getBeirasiAdatok', 'modul' => 'naplo', 'result' => 'value')); - $R[mktime()][] = array( - 'hirnokTipus'=>'haladasiBeiratlan', - 'db'=>$r - ); + if ($dbBeirtOra>0) { // csak ha van mar egy beirt oraja legalabb + $R[mktime()][] = array( + 'hirnokTipus'=>'haladasiBeiratlan', + 'db'=>$r, + 'dbBeirtOra'=>$dbBeirtOra + ); + } $q = "select * from idoszak where NOW() BETWEEN tolDt AND igDt ORDER BY tolDt"; $r = db_query($q, array('fv' => 'getIdoszakAktiv', 'modul' => 'naplo_intezmeny', 'result' => 'indexed')); for ($i=0; $i