diff options
Diffstat (limited to 'mayor-orig/mayor-naplo/www')
9 files changed, 138 insertions, 12 deletions
diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php index 0be1c61a..92d07ee8 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/haladasi/haladasi.php @@ -134,6 +134,7 @@ $v = array($sor['oraId']); $sor['cimke'] = db_query($q, array('fv' => 'getHaladasi/cimkek', 'modul' => 'naplo', 'result' => 'idonly', 'values' => $v), $lr); } + $ret[$sor['dt']][] = $sor; } // Nap információk lekérdezése diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php index 7c4c4b4e..602f26e1 100644 --- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php +++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/ora.php @@ -371,7 +371,7 @@ WHERE dt>='%s' and dt<='%s' AND (ki=%u OR kit=%u) $WHERE ORDER BY dt,ora"; return $RESULT; } - function getOrak($TANKORIDK, $SET=array('tolDt'=>'','igDt'=>'', 'result'=>'likeOrarend', 'elmaradokNelkul'=>false)) { + function getOrak($TANKORIDK, $SET=array('tolDt'=>'','igDt'=>'', 'result'=>'likeOrarend', 'elmaradokNelkul'=>false, 'diakId'=>null)) { /* FIGYELEM! A függvény feltételezi, hogy az átadott tankoridkben az adott intervallumon helyes adatok szerepelnek! -- problémát okozhat, ha hosszú intervallumot adunk meg!!! -- lásd FS#100 */ @@ -404,6 +404,12 @@ WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count( $_put['oo'] = false; $RE['orak'][$R[$i]['dt']][$R[$i]['ora']][$R[$i]['tankorId']] = $_put; if (!in_array($R[$i]['tankorId'],$RE['tankorok'])) $RE['tankorok'][] = intval($R[$i]['tankorId']); + if ($R[$i]['hazifeladatId']>0) { + if ($SET['diakId']>0) { + $diakHazifeladat = getDiakHazifeladatByOraIds(array($R[$i]['oraId']) , $SET['diakId']); + $RE['orak'][$R[$i]['dt']][$R[$i]['ora']][$R[$i]['tankorId']]['diakHazifeladat'] = $diakHazifeladat[$R[$i]['oraId']]; + } + } } } return $RE; @@ -641,5 +647,15 @@ WHERE dt>='%s' and dt<='%s' AND tankorId IN (".implode(',', array_fill(0, count( } } + function getDiakHazifeladatByOraIds($oraIdk,$diakId,$olr='') { + $R = array(); + if (count($oraIdk)>0 && $diakId>0) { + $q = "SELECT * FROM oraHazifeladat LEFT JOIN oraHazifeladatDiak USING (hazifeladatId) WHERE diakId=%u AND oraId IN (".implode(',',$oraIdk).")"; + $v = array($diakId); + $R = db_query($q,array('debug'=>false,'fv'=>'getDiakhazifeladatByOraIds','modul'=>'naplo','values'=>$v,'result'=>'assoc','keyfield'=>'oraId'),$olr); + } + return $R; + } + ?> 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']))); } diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css new file mode 100644 index 00000000..1cce1e3e --- /dev/null +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/hazifeladat.css @@ -0,0 +1,31 @@ + + fieldset.adatok { margin-bottom:1em; width:80%; margin-left:auto; margin-right:auto; border-radius: 2px; border: solid 1px #ddd;} + fieldset.adatok legend { border-radius: 2px; background-color: #ff5722; color:white; padding: 2px 4px; } + + fieldset.adatok.kesz legend { background-color:lightgreen} + + form button.btnHfStatusz { + background-color: #eee; + border-radius: 2px; + border: solid 1px #888; + color: #888; + padding:2px 18px 2px 4px; + } + form button.btnHfStatusz span { color:#eee; } + form button.btnHfStatusz.kesz span { color: lightgreen; } + + form button.btnHfStatusz:hover { + background-color:lightgreen; + color:black; + border-color:black; + } + form button.btnHfStatusz.kesz:hover { + background-color: orange; + } + form button.btnHfStatusz:hover span { color: white; } + + form button.btnHfStatusz.kesz:hover span { color: orange } + + table.hazifeladatDiak { margin:auto; background-color: #eee;} + table.hazifeladatDiak thead tr th { background-color: #4caf50; color:white; font-weight:normal;} + table.hazifeladatDiak tbody tr td { background-color: white; font-weight:normal; padding: 2px 4px;} diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/haladasi.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/haladasi.phtml index 3c36e9f2..e267cf27 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/haladasi.phtml +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/haladasi/haladasi.phtml @@ -528,7 +528,12 @@ } echo '<a href="'.href('index.php?page=naplo&sub=haladasi&f=hazifeladat&oraId='.$dOra['oraId'].'&hazifeladatId='.$ADAT['tankorHazifeladat'][ $dOra['oraId'] ]).'" class="onClickUpdateWindow" title="'._HAZIFELADAT.'">'; if ($dOra['hazifeladatId']>0) { - echo '<span class="icon-home-alt" style="color: #ff5722"></span>'; + if ($ADAT['diakHazifeladat'][$dOra['oraId']]['hazifeladatDiakStatus'] =='kész') { + $hfColor = 'lightgreen'; + } else { + $hfColor = '#ff5722'; + } + echo '<span class="icon-home-alt" style="color: '.$hfColor.'"></span>'; } else { echo '<span class="icon-home" style="color: #aaa"></span>'; } 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 e2b6d3ef..c5a26c13 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 @@ -2,13 +2,13 @@ function putHazifeladat($ADAT) { - echo '<style type="text/css">'; +/* echo '<style type="text/css">'; echo ' fieldset.adatok { margin-bottom:1em; width:80%; margin-left:auto; margin-right:auto; border-radius: 2px; border: solid 1px #ddd;} fieldset.adatok legend { border-radius: 2px; background-color: #ff5722; color:white; padding: 2px 4px; } '; echo '</style>'; - +*/ echo '<fieldset class="adatok"><legend>'._ALAPADATOK.'</legend>'."\n"; echo ($ADAT['oraAdat']['dt']).' ('.$ADAT['oraAdat']['dt'].'), '.$ADAT['oraAdat']['ora'].'. '._ORA.' – <span class="tankorNev" data-tankorid="'.$ADAT['oraId']['tankorId'].'">'.$ADAT['oraAdat']['tankorNev'].'</span> – '.$ADAT['oraAdat']['kiCn']; @@ -18,19 +18,33 @@ if (__DIAK===true) { + if ($ADAT['hazifeladatDiak']['hazifeladatDiakStatus']=='kész') $_class = "kesz"; + + if ($skin != 'ajax') formBegin(array('class'=>'hazifeladat')); echo '<fieldset class="adatok"><legend>'.ucfirst(_TANANYAG).'</legend>'."\n"; if ($ADAT['oraAdat']['leiras']=='') { echo '<p style="color:#aaa;">még nincs kitöltve</p>'; } else { echo '<p>'.$ADAT['oraAdat']['leiras'].'</p>'; } echo '</fieldset>'."\n"; - echo '<fieldset class="adatok"><legend>'._HAZIFELADAT.'</legend>'."\n"; + echo '<fieldset class="adatok '.$_class.'"><legend>'._HAZIFELADAT.'</legend>'."\n"; if ($ADAT['hazifeladatAdat']['hazifeladatLeiras']=='') { echo '<p style="color:#aaa;">még nincs kitöltve</p>'; } else { echo ($ADAT['hazifeladatAdat']['hazifeladatLeiras']); } echo '</fieldset>'."\n"; - + if ($ADAT['hazifeladatId']>0) { + echo '<div style="text-align:center; margin-bottom: 140px;">'; + echo '<input type="hidden" name="action" value="hazifeladatKesz">'; + if ($ADAT['hazifeladatDiak']['hazifeladatDiakStatus']=='kész') { + echo '<button type="submit" class="btnHfStatusz kesz"><span class="icon-ok-sign"></span> kész</button>'; + } else { + echo '<button type="submit" class="btnHfStatusz"><span class="icon-ok-sign"></span> késznek jelölöm</button>'; + } + echo '</div>'; + } + + echo formEnd(); } else { echo '<script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>'; if ($skin != 'ajax') formBegin(array('class'=>'hazifeladat')); @@ -79,7 +93,35 @@ echo '<input type="submit">'; echo '</fieldset>'."\n"; if ($skin != 'ajax') formEnd(); + + + if (count($ADAT['hazifeladatDiak'])>0) { + echo '<fieldset class="adatok">'; + echo '<legend>Visszajelzések</legend>'; + putHazifeladatDiak($ADAT); + echo '</fieldset>'; + } + } + } + + function putHazifeladatDiak($ADAT) { + + if (count($ADAT['hazifeladatDiak'])==0) return false; + + echo '<table class="hazifeladatDiak" cellpadding="1" cellspacing="1">'; + echo '<thead>'; + echo '<tr><th>diák</th><th>látta</th><th>státusz</th><th></th></tr>'; + echo '</thead>'; + for ($i=0; $i<count($ADAT['hazifeladatDiak']); $i++) { + $D = $ADAT['hazifeladatDiak'][$i]; + echo '<tr>'; + echo '<td class="diakNev diakAdat" data-diakid="'.$D['diakId'].'">'.$D['diakNev'].'</td>'; + echo '<td>'.$D['diakLattamDt'].'</td>'; + echo '<td>'.$D['hazifeladatDiakStatus'].'</td>'; + echo '<td>'.$D['hazifeladatDiakMegjegyzes'].'</td>'; + echo '</tr>'; } + echo '</table>'; } ?> diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/orarend/orarend.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/orarend/orarend.phtml index 0aba3072..c04cd9ec 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/orarend/orarend.phtml +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/orarend/orarend.phtml @@ -262,11 +262,12 @@ $_hianyzasClass = (is_array($_hianyzasAdat) && $_hianyzasAdat['hTipus']=='hiányzás') ? ' nemVoltBent ':''; echo '<div class="'.$_tipusClass.$_frissClass.$_oraMostVanClass.$_utolsooraClass.$_hianyzasClass.' '.$_oraAdat.'" data-oraid="'.$_ORA['oraId'].'" title="'.$_ORA['tipus'].'" >'; if (isset($_ORA['hazifeladatId'])) { - echo '<span class="icon-home-alt" title="h.f." style="color:#e91e63; padding-right:2px;"></span>'; + if ($_ORA['diakHazifeladat']['hazifeladatDiakStatus'] == 'kész') $_hfcolor = 'lightgreen'; + else $_hfcolor = '#e91e63'; + echo '<span class="icon-home-alt" title="h.f." style="color:'.$_hfcolor.'; padding-right:2px;"></span>'; } if (is_array($_hianyzasAdat)) { - echo '<span class="hianyzasTicker '.ekezettelen($_hianyzasAdat['hTipus']).' '.ekezettelen($_hianyzasAdat['statusz']).' '.ekezettelen($_hianyzasAdat['igazolas']).'">'; if ($_hianyzasAdat['hTipus']=='hiányzás') echo '<span class="icon-hearing-impaired"></span>'; @@ -336,7 +337,6 @@ if (MAYOR_SOCIAL === true) { if (in_array($_tankorTipus,array('délutáni','tanórán kívüli'))) { echo ' ¹'; } - echo '</div>'; if (count($T[$nap][$ora]['orak'])>$i+1) //echo '<hr />'; |