diff options
Diffstat (limited to 'mayor-orig/mayor-naplo/www/include/modules')
-rw-r--r-- | mayor-orig/mayor-naplo/www/include/modules/naplo/share/hirnok.php | 31 | ||||
-rw-r--r-- | mayor-orig/mayor-naplo/www/include/modules/naplo/uzeno/uzeno.php | 11 |
2 files changed, 37 insertions, 5 deletions
diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/hirnok.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/hirnok.php index 0607670f..4aee93d5 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/hirnok.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/hirnok.php @@ -309,7 +309,7 @@ global $SZEMESZTER; $values = array(_USERACCOUNT,_POLICY); } } else { - $q = "SELECT naploTipus,naploId FROM hirnokFeliratkozas WHERE userAccount='%s' AND policy='%s'"; + $q = "SELECT naploTipus,naploId,email FROM hirnokFeliratkozas WHERE userAccount='%s' AND policy='%s'"; $values = array(_USERACCOUNT,_POLICY); } $r = db_query($q, array('modul'=>'naplo_intezmeny','result'=>'indexed','values'=>$values)); @@ -324,6 +324,35 @@ global $SZEMESZTER; return $result; } + function getHirnokEmail() {return getFutarEmail;} + function getFutarEmail() { + + if ( _POLICY=='parent' && defined('__PARENTDIAKID') ) { + $naploId = __USERDIAKID; + $naploTipus='diak'; + $q = "SELECT email FROM `szulo` WHERE szuloId=%u"; + $values = array(__USERSZULOID); + $email = db_query($q, array('modul'=>'naplo_intezmeny','result'=>'record','values'=>$values)); + } elseif (__DIAK===true) { + $naploId = __USERDIAKID; + $naploTipus='diak'; + $q = "SELECT email FROM `diak` WHERE diakId=%u"; + $values = array($naploId); + $email = db_query($q, array('modul'=>'naplo_intezmeny','result'=>'record','values'=>$values)); + } elseif (__TANAR ===true) { // tanár nézet + $naploId = __USERTANARID; + $naploTipus='tanar'; + $q = "SELECT email FROM `tanar` WHERE tanarId=%u"; + $values = array($naploId); + $email = db_query($q, array('modul'=>'naplo_intezmeny','result'=>'record','values'=>$values)); + } else return false; + + $q = "SELECT email FROM `hirnokFeliratkozas` WHERE userAccount='%s' AND policy='%s' AND naploTipus='%s' AND naploId=%u"; + $values = array(_USERACCOUNT,_POLICY,$naploTipus,$naploId); + $futarEmail = db_query($q, array('modul'=>'naplo_intezmeny','result'=>'record','values'=>$values)); + return array('futar'=>$futarEmail,'hirnok'=>$futarEmail,'naplo'=>$email); + } + function addHirnokFeliratkozas($ADAT) { if (intval($ADAT['naploId'])==0) return false; diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/uzeno/uzeno.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/uzeno/uzeno.php index 71df3eae..de157fa3 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/uzeno/uzeno.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/uzeno/uzeno.php @@ -44,10 +44,13 @@ function getUzenoUzenetek($SET=array('tanev'=>__TANEV,'count'=>false,'filter'=>array(),'ignoreAdmin'=>false,'filterFlag'=>array(),'limits'=>array(),'order'=>'DESC')) { - $__SZEREP = __SZEREP; // cronból is szeretnénk használni - - if (__SZEREP=='') return array(); - + if (_RUNLEVEL==='cron') { + $__SZEREP = $SET['szerep']; + if ($__SZEREP=='') return array(); + } else { + $__SZEREP = __SZEREP; // cronból is szeretnénk használni + if (__SZEREP=='') return array(); + } $feladoId = setUzenoFeladoId(); $TIPUSOK = initUzenoTipusok(array('csakId'=>true,'result'=>'idonly','tanev'=>$SET['tanev'],'forRead'=>true)); |