aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/www/policy/private/naplo/tanmenet
diff options
context:
space:
mode:
authorM.Gergo2018-07-06 11:14:41 +0200
committerM.Gergo2018-07-06 11:14:41 +0200
commit43de9af71f7f4ca5731b94a06d688ae8412ba427 (patch)
tree54835de1dfcda504c02da261f0dc26885aed2e89 /mayor-orig/www/policy/private/naplo/tanmenet
parent50310b0e4513ee3fcce67351ae61e8fff851130e (diff)
downloadmayor-43de9af71f7f4ca5731b94a06d688ae8412ba427.tar.gz
mayor-43de9af71f7f4ca5731b94a06d688ae8412ba427.zip
2018/Feb/28 -i állapot hozzáadva, mint a módosítások kiindulási állapota
Diffstat (limited to 'mayor-orig/www/policy/private/naplo/tanmenet')
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenet-pre.php5
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenet.php0
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenetInfo-pre.php35
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenetInfo.php15
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenetJovahagyas-pre.php88
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenetJovahagyas.php9
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenetLeadas-pre.php51
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenetLeadas.php9
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenetModositas-pre.php83
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenetModositas.php9
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenetTankor-pre.php95
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/tanmenetTankor.php11
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/ujTanmenet-pre.php72
-rw-r--r--mayor-orig/www/policy/private/naplo/tanmenet/ujTanmenet.php8
14 files changed, 490 insertions, 0 deletions
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenet-pre.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenet-pre.php
new file mode 100644
index 00000000..58d44e40
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenet-pre.php
@@ -0,0 +1,5 @@
+<?php
+
+ header('Location: '.location('index.php?page=naplo&sub=tanmenet&f=tanmenetTankor'));
+
+?>
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenet.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenet.php
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenet.php
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetInfo-pre.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetInfo-pre.php
new file mode 100644
index 00000000..a60e71d0
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetInfo-pre.php
@@ -0,0 +1,35 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+ if (!__DIAK && !__TITKARSAG && !__TANAR && !__NAPLOADMIN && !__VEZETOSEG) $_SESSION['alert'][] = 'page:insufficient_access';
+
+ require_once('include/modules/naplo/share/tanar.php');
+ require_once('include/modules/naplo/share/tankor.php');
+ require_once('include/modules/naplo/share/targy.php');
+ require_once('include/modules/naplo/share/tanmenet.php');
+ require_once('include/share/date/names.php');
+
+ $ADAT['tanmenetId'] = $tanmenetId = readVariable($_POST['tanmenetId'], 'id', readVariable($_GET['tanmenetId'], 'id'));
+ if (isset($tanmenetId)) {
+
+ $ADAT['tanmenetAdat'] = getTanmenetAdat($tanmenetId);
+ $ADAT['tanarId'] = $tanarId = $ADAT['tanmenetAdat']['tanarId'];
+ $ADAT['targyId'] = $targyId = $ADAT['tanmenetAdat']['targyId'];
+
+ } else {
+ $ADAT['tanarId'] = $tanarId = readVariable($_POST['tanarId'], 'id', (!isset($_POST['targyId'])&&__TANAR)?__USERTANARID:null);
+ $ADAT['targyId'] = $targyId = readVariable($_POST['targyId'], 'id');
+ }
+
+ $TOOL['tanarSelect'] = array('tipus'=>'cella', 'paramName'=>'tanarId', 'post'=>array('targyId'));
+ $TOOL['targySelect'] = array('tipus'=>'cella', 'paramName'=>'targyId', 'post'=>array('tanarId'));
+ if (isset($tanarId) || isset($targyId)) {
+ $TOOL['tanmenetSelect'] = array('tipus'=>'sor', 'paramName'=>'tanmenetId', 'post'=>array('tanarId','targyId'));
+ $TOOL['oldalFlipper'] = array('tipus' => 'cella', 'url' => array('index.php?page=naplo&sub=tanmenet&f=tanmenetModositas'),
+ 'titleConst' => array('_MODOSITAS'), 'post' => array('tanarId','targyId'),
+ 'paramName'=>'tanmenetId');
+ }
+ getToolParameters();
+
+
+?>
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetInfo.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetInfo.php
new file mode 100644
index 00000000..9d2b70e0
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetInfo.php
@@ -0,0 +1,15 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+
+ global $ADAT;
+
+ if (isset($ADAT['tanmenetId'])) putTanmenetInfo($ADAT);
+ else {
+ if ($skin != 'ajax') formBegin(array('class'=>"tanmenet"));
+ echo '<input type="hidden" name="tanmenetId" id="informTanmenetId" value="" />'."\n";
+ echo '<p class="kiemelt">Nincs tanmenet megadva!</p>';
+ if ($skin != 'ajax') formEnd();
+ }
+
+?>
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetJovahagyas-pre.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetJovahagyas-pre.php
new file mode 100644
index 00000000..d173ab93
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetJovahagyas-pre.php
@@ -0,0 +1,88 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+ if (!__TANAR && !__NAPLOADMIN && !__VEZETOSEG) $_SESSION['alert'][] = 'page:insufficient_access';
+
+
+ require_once('include/modules/naplo/share/tanar.php');
+ require_once('include/modules/naplo/share/tankor.php');
+ require_once('include/modules/naplo/share/targy.php');
+ require_once('include/modules/naplo/share/tanmenet.php');
+ require_once('include/modules/naplo/share/munkakozosseg.php');
+
+
+ if (__TANAR) $ADAT['vezetettMkIds'] = getVezetettMunkakozossegByTanarId(__USERTANARID);
+ if (!is_array($ADAT['vezetettMkIds'])) $ADAT['vezetettMkIds'] = array();
+
+ $mkId = readVariable($_POST['mkId'], 'id');
+ if ($mkId == '' && count($ADAT['vezetettMkIds'])>0) $mkId = $ADAT['vezetettMkIds'][0];
+ $ADAT['mkId'] = $mkId;
+
+ if ($mkId != 0) {
+
+
+ $ADAT['tanarok'] = getTanarok(array('mkId'=>$mkId, 'tanev'=>__TANEV, 'result'=>'assoc'));
+ $ADAT['tanarIds'] = array_keys($ADAT['tanarok']);
+ $ADAT['tanarId'] = $tanarId = readVariable($_POST['tanarId'], 'id', null, $ADAT['tanarIds']);
+ $Filter = array();
+ if ($tanarId != '') {
+ $tTankorIds = getTankorByTanarId($tanarId, __TANEV, array('csakId'=>true));
+ if (is_array($tTankorIds) && count($tTankorIds) > 0) $Filter[] = 'tankor.tankorId IN ('.implode(',',$tTankorIds).')';
+ }
+ $ADAT['osztalyId'] = $osztalyId = readVariable($_POST['osztalyId'], 'id', null);
+ if ($osztalyId != '') {
+ $oTankorIds = getTankorByOsztalyId($osztalyId, __TANEV, array('csakId'=>true));
+ if (is_array($oTankorIds) && count($oTankorIds) > 0) $Filter[] = 'tankor.tankorId IN ('.implode(',',$oTankorIds).')';
+
+ }
+ define('__JOVAHAGYHAT', __VEZETOSEG || __NAPLOADMIN || in_array($mkId, $ADAT['vezetettMkIds']));
+ $ADAT['tankorok'] = getTankorByMkId($mkId, __TANEV, array('csakId'=>false, 'filter'=>$Filter));
+ $ADAT['tankorIds'] = array();
+ foreach ($ADAT['tankorok'] as $tAdat) {
+ $ADAT['tankorIds'][] = $tAdat['tankorId'];
+ }
+ if (count($ADAT['tankorIds']) > 0) {
+ $ADAT['tankorTanmenet'] = getTanmenetByTankorIds($ADAT['tankorIds']);
+ $ADAT['tanmenetAdat'] = $tanmenetIds = array();
+ foreach ($ADAT['tankorTanmenet'] as $tankorId => $tanmenetId) {
+ if (!in_array($tanmenetId, $tanmenetIds)) $tanmenetIds[] = $tanmenetId;
+ }
+ foreach ($tanmenetIds as $tanmenetId) $ADAT['tanmenetAdat'][$tanmenetId] = getTanmenetAdat($tanmenetId);
+ } // vannak tankorok
+
+
+ if ($action == 'tanmenetModositas' && __JOVAHAGYHAT) {
+
+ $tanmenetId = readVariable($_POST['tanmenetId'], 'id');
+ $statusz = readVariable($_POST['statusz'], 'enum', array('új','kész','jóváhagyott','publikus'));
+ if ($tanmenetId != '' && $statusz != '') {
+ $D = array(
+ 'tanmenetNev' => $ADAT['tanmenetAdat'][$tanmenetId]['tanmenetNev'],
+ 'oraszam' => $ADAT['tanmenetAdat'][$tanmenetId]['oraszam'],
+ 'evfolyamJel' => $ADAT['tanmenetAdat'][$tanmenetId]['evfolyamJel'],
+ 'tanmenetId' => $tanmenetId,
+ 'ujStatusz' => $statusz
+ );
+ if (tanmenetAdatModositas($D)) $ADAT['tanmenetAdat'][$tanmenetId]['statusz'] = $statusz;
+ }
+ }
+
+ } // van mkId
+
+ $TOOL['munkakozossegSelect'] = array('tipus'=>'cella', 'paramName'=>'mkId', 'post'=>array('tanarId','osztalyId'));
+ if ($mkId != '') {
+ $TOOL['tanarSelect'] = array('tipus'=>'cella', 'paramName'=>'tanarId', 'mkId'=>$mkId, 'post'=>array('mkId','osztalyId'));
+ $TOOL['osztalySelect'] = array('tipus'=>'cella', 'paramName'=>'osztalyId', 'mkId'=>$mkId, 'post'=>array('mkId','tanarId'));
+ }
+/*
+ $TOOL['targySelect'] = array('tipus'=>'cella', 'paramName'=>'targyId', 'post'=>array());
+ if (isset($tanarId) || isset($targyId)) {
+ $TOOL['tanmenetSelect'] = array('tipus'=>'cella', 'paramName'=>'tanmenetId', 'post'=>array('tanarId','targyId'));
+ $TOOL['oldalFlipper'] = array('tipus' => 'cella', 'url' => array('index.php?page=naplo&sub=tanmenet&f=tanmenetModositas'),
+ 'titleConst' => array('_MODOSITAS'), 'post' => array('tanarId','targyId'),
+ 'paramName'=>'tanmenetId');
+ }
+*/
+ getToolParameters();
+
+?> \ No newline at end of file
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetJovahagyas.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetJovahagyas.php
new file mode 100644
index 00000000..f0a92c71
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetJovahagyas.php
@@ -0,0 +1,9 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+
+ global $ADAT;
+
+ putTanmenetJovahagyas($ADAT);
+
+?> \ No newline at end of file
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetLeadas-pre.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetLeadas-pre.php
new file mode 100644
index 00000000..a71c14b0
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetLeadas-pre.php
@@ -0,0 +1,51 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+ if (!__NAPLOADMIN && !__VEZETOSEG) $_SESSION['alert'][] = 'page:insufficient_access';
+
+ require_once('include/modules/naplo/share/tanar.php');
+ require_once('include/modules/naplo/share/tankor.php');
+ require_once('include/modules/naplo/share/targy.php');
+ require_once('include/modules/naplo/share/szemeszter.php');
+ require_once('include/modules/naplo/share/tanmenet.php');
+// require_once('include/share/date/names.php');
+
+ $tanev = $ADAT['tanev'] = readVariable($_POST['tanev'], 'numeric unsigned', defined('__TANEV')?__TANEV:null);
+ $ADAT['idoszak'] = getIdoszakByTanev(array('tanev' => $ADAT['tanev'], 'tipus' => array('tanmenet leadás'), 'tolDt' => date('Y-m-d'), 'igDt' => date('Y-m-d')));
+ define('__TANMENETLEADASIDOSZAK',(count($ADAT['idoszak']) > 0));
+ if (!__TANMENETLEADASIDOSZAK) $_SESSION['alert'][] = 'info:nincs_tanmenetleadas_idoszak:tanev='.$ADAT['tanev'];
+ else $_SESSION['alert'][] = 'info:tanmenetleadas_idoszak_vege:'.substr($ADAT['idoszak'][0]['igDt'],0,10);
+
+ $ADAT['tanarok'] = getTanarok(array('tanev' => $tanev));
+
+ $ADAT['tankorIds'] = array();
+ for ($i = 0; $i < count($ADAT['tanarok']); $i++) {
+ $tanarId = $ADAT['tanarok'][$i]['tanarId'];
+ $ADAT['tanarok'][$i]['tankorIds'] = getTankorByTanarId($tanarId, __TANEV, array('csakId' => true));
+ $ADAT['tankorIds'] = array_unique(array_merge($ADAT['tankorIds'], $ADAT['tanarok'][$i]['tankorIds']));
+ }
+ $ADAT['tankorok'] = getTankorAdatByIds($ADAT['tankorIds'], array('tanev' => __TANEV, 'dt' => $_TANEV['kezdesDt']));
+ $ADAT['tankorTanmenet'] = getTanmenetByTankorIds($ADAT['tankorIds'], array('tanev' => $ADAT['tanev']));
+ $ADAT['tanmenetek'] = getTanmenetek();
+
+//echo '<pre>'; var_dump($ADAT['tanmenetek']); echo '<pre>';
+ // Melyik tanárnak hány "leadott jóváhagyott" / "leadott, nem jóváhagyott" / "nem leadott" tanmenet-tankör hozzárendelése van?
+ for ($i = 0; $i < count($ADAT['tanarok']); $i++) {
+ $tanarId = $ADAT['tanarok'][$i]['tanarId'];
+ foreach ($ADAT['tanarok'][$i]['tankorIds'] as $tankorId) {
+ if (isset($ADAT['tankorTanmenet'][$tankorId])) {
+ $tanmenetId = $ADAT['tankorTanmenet'][$tankorId];
+ if (
+ $ADAT['tanmenetek'][$tanmenetId]['statusz'] == 'jóváhagyott'
+ || $ADAT['tanmenetek'][$tanmenetId]['statusz'] == 'publikus'
+ ) $ADAT['tanarok'][$i]['db']['jóváhagyott']++;
+ elseif ($ADAT['tanmenetek'][$tanmenetId]['statusz'] == 'kész') $ADAT['tanarok'][$i]['db']['kész']++;
+ else $ADAT['tanarok'][$i]['db']['új']++;
+// if ($ADAT['tanmenetek'][$tanmenetId]['jovahagyva']) $ADAT['tanarok'][$i]['db']['jovahagyva']++;
+// else $ADAT['tanarok'][$i]['db']['nincs jovahagyva']++;
+ } else {
+ $ADAT['tanarok'][$i]['db']['hiányzik']++;
+ }
+ }
+ }
+?>
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetLeadas.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetLeadas.php
new file mode 100644
index 00000000..12e8e920
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetLeadas.php
@@ -0,0 +1,9 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+
+ global $ADAT;
+
+ putTanmenetLeadas($ADAT);
+
+?>
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetModositas-pre.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetModositas-pre.php
new file mode 100644
index 00000000..0afd8498
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetModositas-pre.php
@@ -0,0 +1,83 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+ if (!__TANAR && !__NAPLOADMIN && !__VEZETOSEG) $_SESSION['alert'][] = 'page:insufficient_access';
+
+ require_once('include/modules/naplo/share/tanar.php');
+ require_once('include/modules/naplo/share/tankor.php');
+ require_once('include/modules/naplo/share/targy.php');
+ require_once('include/modules/naplo/share/tanmenet.php');
+ require_once('include/modules/naplo/share/munkakozosseg.php');
+ require_once('include/share/date/names.php');
+
+ $ADAT['tanarId'] = $tanarId = readVariable($_POST['tanarId'], 'id', __TANAR?__USERTANARID:null);
+ $ADAT['targyId'] = $targyId = readVariable($_POST['targyId'], 'id');
+
+ $ADAT['tanmenetId'] = $tanmenetId = readVariable($_POST['tanmenetId'], 'id', readVAriable($_GET['tanmenetId'], 'id'));
+ if (isset($tanmenetId)) {
+
+ $ADAT['evfolyamJelek'] = getEvfolyamJelek(array('result'=>'idonly'));
+ $ADAT['tanmenetAdat'] = getTanmenetAdat($tanmenetId);
+ $ADAT['mkAdat'] = getMunkakozossegByTargyId($ADAT['tanmenetAdat']['targyId']);
+ $ADAT['tanarId'] = $tanarId = $ADAT['tanmenetAdat']['tanarId'];
+ $ADAT['targyId'] = $targyId = $ADAT['tanmenetAdat']['targyId'];
+ define('__KESZITO', (__USERTANARID == $ADAT['tanmenetAdat']['tanarId']));
+ define('__MKVEZETO', (__USERTANARID == $ADAT['mkAdat']['mkVezId']));
+ define('__MODOSITHAT',
+ __NAPLOADMIN // admin bármikor
+ || (
+ (__VEZETOSEG || __KESZITO || __MKVEZETO) // vezetőségi tag, mk.vez és a létrehozó szaktanár...
+ && ($ADAT['tanmenetAdat']['statusz'] == 'új' || $ADAT['tanmenetAdat']['statusz'] == 'kész') // ... ha még nincs jóváhagyva
+ )
+ );
+ if (__NAPLOADMIN || __VEZETOSEG || __MKVEZETO) $ADAT['statusz'] = array('új','kész','jóváhagyott','publikus','elavult');
+ elseif (__KESZITO) {
+ if (in_array($ADAT['tanmenetAdat']['statusz'], array('új','kész'))) { $ADAT['statusz'] = array('új','kész'); }
+ else { $ADAT['statusz'] = array('jóváhagyott','publikus'); }
+ } else $ADAT['statusz'] = array();
+
+ if ($action != '') {
+ if (__MODOSITHAT && $action == 'tanmenetTemakorModositas') {
+ $ADAT['temakor']['oraszam'] = readVariable($_POST['oraszam'], 'numeric unsigned');
+ $ADAT['temakor']['temakorMegnevezes'] = readVariable($_POST['temakorMegnevezes'], 'string', '');
+ tanmenetTemakorModositas($ADAT);
+ $ADAT['tanmenetAdat'] = getTanmenetAdat($tanmenetId);
+ } elseif ($action == 'tanmenetAdatModositas') {
+ if ((__NAPLOADMIN === true || __KESZITO) && readVariable($_POST['tanmenetTorol'],'numeric unsigned') == 1) {
+ if (tanmenetTorol($tanmenetId)===false) {
+ $_SESSION['alert'][] = 'info:error:hiba a tanmenet törlésekor';
+ } else {
+ $_SESSION['alert'][] = 'info:success';
+ unset ($ADAT);
+ unset($tanmenetId);
+ }
+ } else {
+ if (__MODOSITHAT) { // Az óraszám és évfolyam-jel is változtatható
+ $DAT['oraszam'] = readVariable($_POST['oraszam'], 'numeric unsigned');
+ $DAT['evfolyamJel'] = readVariable($_POST['evfolyamJel'], 'numeric unsigned');
+ } else { // csak a tanmenet neve és státusza változtatható
+ $DAT = $ADAT['tanmenetAdat'];
+ }
+ $DAT['tanmenetId'] = $tanmenetId;
+ $DAT['tanmenetNev'] = readVariable($_POST['tanmenetNev'], 'string');
+ $DAT['ujStatusz'] = readVariable($_POST['statusz'], 'enum', $ADAT['tanmenetAdat']['statusz'], $ADAT['statusz']);
+ tanmenetAdatModositas($DAT);
+ $ADAT['tanmenetAdat'] = getTanmenetAdat($tanmenetId);
+ }
+ }
+ }
+ }
+
+
+ $TOOL['tanarSelect'] = array('tipus'=>'cella', 'paramName'=>'tanarId', 'post'=>array());
+ $TOOL['targySelect'] = array('tipus'=>'cella', 'paramName'=>'targyId', 'post'=>array());
+ if (isset($tanarId) || isset($targyId) || isset($tanmenetId)) {
+ $TOOL['tanmenetSelect'] = array('tipus'=>'sor', 'paramName'=>'tanmenetId', 'post'=>array('tanarId','targyId'));
+ $TOOL['oldalFlipper'] = array('tipus' => 'cella', 'url' => array('index.php?page=naplo&sub=tanmenet&f=tanmenetInfo'),
+ 'titleConst' => array('_MUTAT'), 'post' => array('tanmenetId','tanarId','targyId'),
+ 'paramName'=>'tanmenetId');
+ }
+ getToolParameters();
+
+
+?>
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetModositas.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetModositas.php
new file mode 100644
index 00000000..e741e222
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetModositas.php
@@ -0,0 +1,9 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+
+ global $ADAT;
+
+ if (isset($ADAT['tanmenetId'])) putTanmenetModositasForm($ADAT);
+
+?>
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetTankor-pre.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetTankor-pre.php
new file mode 100644
index 00000000..74ca1a6e
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetTankor-pre.php
@@ -0,0 +1,95 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+ if (!__TANAR && !__VEZETOSEG && !__NAPLOADMIN) $_SESSION['alert'][] = 'page:insufficient_access';
+
+ require_once('include/modules/naplo/share/tanar.php');
+ require_once('include/modules/naplo/share/szemeszter.php');
+// require_once('include/modules/naplo/share/osztaly.php');
+ require_once('include/modules/naplo/share/tankor.php');
+// require_once('include/modules/naplo/share/munkakozosseg.php');
+ require_once('include/modules/naplo/share/targy.php');
+ require_once('include/modules/naplo/share/tanmenet.php');
+
+ $ADAT['tanev'] = __TANEV;
+ $ADAT['tanarId'] = $tanarId = readVariable($_POST['tanarId'], 'id', readVariable($_GET['tanarId'], 'id', __TANAR?__USERTANARID:null));
+
+ if (isset($tanarId)) {
+ $ADAT['tankorIds'] = getTankorByTanarId($tanarId, __TANEV, array('csakId' => true));
+ $ADAT['tankorok'] = getTankorAdatByIds($ADAT['tankorIds'], array('tanev' => __TANEV, 'dt' => $_TANEV['kezdesDt']));
+ $ADAT['tankorTanmenet'] = getTanmenetByTankorIds($ADAT['tankorIds'], array('tanev' => $ADAT['tanev']));
+ $tanmenetAdat = $ADAT['tanmenetek'] = array();
+ if (is_array($ADAT['tankorok']))
+ foreach ($ADAT['tankorok'] as $tankorId => $tAdat) {
+ if (!is_array($ADAT['tanmenetek'][ $tAdat['targyId'] ])) {
+ $ADAT['tanmenetek'][ $tAdat['targyId'] ] = getTanmenetByTargyId($tAdat['targyId'], array('result'=>'assoc'));
+ if (is_array($ADAT['tanmenetek'][ $tAdat['targyId'] ]))
+ foreach ($ADAT['tanmenetek'][ $tAdat['targyId'] ] as $tanmenetId => $tanAdat) {
+ // Mikor módosítható az adott tanmenet?
+ $ADAT['tanmenetek'][ $tAdat['targyId'] ][ $tanmenetId ]['modosithato'] = (
+ __NAPLOADMIN // admin bármikor
+ || (
+ (__VEZETOSEG || __USERTANARID == $tanAdat['tanarId']) // vezetőségi tag és a létrehozó szaktanár...
+ && ($tanAdat['statusz'] == 'új' || $tanAdat['statusz'] == 'kész') // ... ha még nincs jóváhagyva
+ )
+
+ );
+ $ADAT['tanmenetAdat'][$tanmenetId] = $tanAdat;
+ }
+ }
+ }
+
+//echo '<pre>'; var_dump($ADAT['tanmenetek']); echo '</pre>';
+
+ $ADAT['idoszak'] = getIdoszakByTanev(array('tanev' => $ADAT['tanev'], 'tipus' => array('tanmenet leadás'), 'tolDt' => date('Y-m-d'), 'igDt' => date('Y-m-d')));
+ define('__TANMENETLEADASIDOSZAK',(count($ADAT['idoszak']) > 0));
+ if (!__TANMENETLEADASIDOSZAK) $_SESSION['alert'][] = 'info:nincs_tanmenetleadas_idoszak:tanev='.$ADAT['tanev'];
+ define('__MODOSITHAT',
+ __NAPLOADMIN // admin bármikor
+ || __VEZETOSEG || __USERTANARID == $ADAT['tanarId'] // vezetőség és szaktanár is bármikor
+// || (
+// (__VEZETOSEG || __USERTANARID == $ADAT['tanarId']) // vezetőségi tag és a létrehozó szaktanár...
+// && __TANMENETLEADASIDOSZAK // megfelelő időszakban vagyunk
+// )
+ );
+
+
+ if (__MODOSITHAT===true && $action == 'hozzarendeles') {
+ if (isset($_POST['masolas'])) $action = 'masolas';
+ elseif (isset($_POST['uj'])) $action = 'uj';
+ elseif (isset($_POST['modosit'])) $action = 'modosit';
+ elseif (isset($_POST['info'])) $action = 'info';
+ } else {
+ $action = '';
+ }
+ $ADAT['tankorId'] = readVariable($_POST['tankorId'], 'id');
+
+ if (__MODOSITHAT === true) {
+ if ($action == 'hozzarendeles') {
+ $ADAT['tanmenetId'] = readVariable($_POST['tanmenetId'], 'id');
+ tankorTanmenetHozzarendeles($ADAT);
+ $ADAT['tankorTanmenet'][$ADAT['tankorId']] = $ADAT['tanmenetId'];
+ } elseif (__TANAR && $action == 'uj') {
+ header('Location: '.location('index.php?page=naplo&sub=tanmenet&f=ujTanmenet&tankorId='.$ADAT['tankorId']));
+ } elseif (__TANAR && $action == 'masolas') {
+ $eredetiTanmenetId = readVariable($_POST['tanmenetId'], 'id');
+ if (isset($eredetiTanmenetId)) {
+ $ADAT['tanmenetId'] = tanmenetDuplikalas($eredetiTanmenetId, __USERTANARID);
+ tankorTanmenetHozzarendeles($ADAT);
+ header('Location: '.location('index.php?page=naplo&sub=tanmenet&f=tanmenetModositas&tanmenetId='.$ADAT['tanmenetId']));
+ }
+ } elseif ($action == 'modosit') {
+ $ADAT['tanmenetId'] = readVariable($_POST['tanmenetId'], 'id');
+ if (isset($ADAT['tanmenetId'])) header('Location: '.location('index.php?page=naplo&sub=tanmenet&f=tanmenetModositas&tanmenetId='.$ADAT['tanmenetId']));
+ } elseif ($action == 'info') {
+ $ADAT['tanmenetId'] = readVariable($_POST['tanmenetId'], 'id');
+ if (isset($ADAT['tanmenetId'])) header('Location: '.location('index.php?page=naplo&sub=tanmenet&f=tanmenetInfo&tanmenetId='.$ADAT['tanmenetId']));
+ }
+ }
+ }
+
+
+ $TOOL['tanarSelect'] = array('tipus'=>'cella', 'paramName'=>'tanarId', 'post'=>array());
+// $TOOL['osztalySelect']= array('tipus'=>'cella', 'paramName'=>'osztalyId', 'post'=>array());
+ getToolParameters();
+?>
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetTankor.php b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetTankor.php
new file mode 100644
index 00000000..814e624d
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/tanmenetTankor.php
@@ -0,0 +1,11 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+
+ global $ADAT;
+
+ if (isset($ADAT['tanarId'])) {
+ putTankorLista($ADAT);
+ }
+
+?>
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/ujTanmenet-pre.php b/mayor-orig/www/policy/private/naplo/tanmenet/ujTanmenet-pre.php
new file mode 100644
index 00000000..e0d2402d
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/ujTanmenet-pre.php
@@ -0,0 +1,72 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+ if (!__TANAR) $_SESSION['alert'][] = 'page:insufficient_access';
+
+ require_once('include/modules/naplo/share/tanar.php');
+ require_once('include/modules/naplo/share/osztaly.php');
+ require_once('include/modules/naplo/share/tankor.php');
+ require_once('include/modules/naplo/share/munkakozosseg.php');
+ require_once('include/modules/naplo/share/targy.php');
+ require_once('include/modules/naplo/share/tanmenet.php');
+
+ $ADAT['evfolyamJelek'] = getEvfolyamJelek();
+ $ADAT['tanarId'] = __USERTANARID;
+ $ADAT['munkakozosseg'] = getMunkakozossegByTanarId($ADAT['tanarId'], array('result' => 'indexed'));
+ $ADAT['mkIds'] = $ADAT['targyIds'] = $ADAT['targy'] = array();
+ foreach ($ADAT['munkakozosseg'] as $key => $mkAdat) {
+ $tmp = getTargyakByMkId($mkAdat['munkakozossegId'], array('result' => 'indexed'));
+ $ADAT['mkIds'][] = $mkAdat['munkakozossegId'];
+ $ADAT['targy'] = array_merge($ADAT['targy'], $tmp);
+ }
+ for ($i = 0; $i < count($ADAT['targy']); $i++) $ADAT['targyIds'][] = $ADAT['targy'][$i]['targyId'];
+
+ // tanév - alapértelmezetten a __TANEV
+ $ADAT['tanev'] = readVariable($_POST['tanev'], 'numeric unsigned', is_numeric(__TANEV)?__TANEV:null);
+
+ // Egy tankörhöz rendelendő új tanmenethez
+ $ADAT['tankorId'] = $tankorId = readVariable($_POST['tankorId'],'id', readVariable($_GET['tankorId'], 'id'));
+
+ // tankör --> tárgy --> munkaközösség
+ if (isset($tankorId)) {
+ $TA = getTankorAdat($tankorId);
+ $ADAT['tankorAdat'] = $TA[$tankorId][0];
+ $ADAT['tankorAdat']['osztalyIds'] = getTankorOsztalyaiByTanev($tankorId, $ADAT['tanev']);
+ $evf = array();
+ foreach ($ADAT['tankorAdat']['osztalyIds'] as $osztalyId) $evf[] = getEvfolyamJel($osztalyId, $ADAT['tanev']);
+ $ADAT['tankorAdat']['evfolyamJel'] = $evf[0];
+ }
+
+ // Munkaközösség és tankör
+ $mkId = readVariable($_POST['mkId'], 'id', null, $ADAT['mkIds']);
+ $ADAT['targyId'] = $targyId = readVariable($_POST['targyId'], 'id', $ADAT['tankorAdat']['targyId'], $ADAT['targyIds']);
+ if (isset($tankorId) && $targyId != $ADAT['tankorAdat']['targyId']) unset($tankorId);
+
+ $ADAT['evfolyamJel'] = $evfolyamJel = readVariable($_POST['evfolyamJel'], 'enum', $ADAT['tankorAdat']['evfolyamJel']);
+ if (isset($targyId) && isset($evfolyamJel)) {
+ $ADAT['targyAdat'] = getTargyById($targyId);
+ // Itt lekérdezhetnénk az eddigi ilyen tanmenetek listáját - megjelenítés céljából
+ $ADAT['tanmenetek'] = getTanmenetByTargyId($targyId);
+//echo '<pre>'; var_dump($ADAT['tanmenetek']); echo '</pre>';
+ }
+
+ if ($action == 'ujTanmenet') {
+ $ADAT['tanmenetNev'] = readVariable($_POST['tanmenetNev'], 'string', $evfolyamJel.'. '.$ADAT['targyAdat']['targyNev'].' ('.$ADAT['targyAdat']['targyJelleg'].')');
+ $ADAT['oraszam'] = readVariable($_POST['oraszam'], 'numeric unsigned');
+ $ADAT['tanmenetId'] = $tanmenetId = ujTanmenet($ADAT);
+ if (isset($tankorId)) {
+ // itt kellene hozzárendelni a tankorhoz?
+ tankorTanmenetHozzarendeles($ADAT);
+ }
+ if ($tanmenetId) header('Location: '.location('index.php?page=naplo&sub=tanmenet&f=tanmenetModositas&tanmenetId='.$tanmenetId));
+ }
+
+ // $TOOL['tanevSelect'] = array('tipus' => 'cella', 'paramName' => 'tanev', 'post' => array('tankorId','targyId','evfolyamJel'));
+ $TOOL['munkakozossegSelect'] = array('tipus'=>'cella','paramName' => 'mkId', 'munkakozossegek' => $ADAT['munkakozosseg'], 'post'=>array('tankorId','evfolyamJel'));
+ if (isset($mkId)) $TOOL['targySelect'] = array('tipus'=>'cella', 'mkId' => $mkId, 'post'=>array('mkId', 'tankorId','evfolyamJel'));
+ else $TOOL['targySelect'] = array('tipus'=>'cella', 'mkId' => $mkId, 'targyak' => $ADAT['targy'], 'post'=>array('mkId', 'tankorId','evfolyamJel'));
+ $TOOL['evfolyamJelSelect'] = array('tipus'=>'cella', 'paramName' => 'evfolyamJel', 'paramDesc'=>'evfolyamJel','adatok' => $ADAT['evfolyamJelek'],'post'=>array('targyId', 'tankorId'));
+ getToolParameters();
+
+
+?>
diff --git a/mayor-orig/www/policy/private/naplo/tanmenet/ujTanmenet.php b/mayor-orig/www/policy/private/naplo/tanmenet/ujTanmenet.php
new file mode 100644
index 00000000..f304c404
--- /dev/null
+++ b/mayor-orig/www/policy/private/naplo/tanmenet/ujTanmenet.php
@@ -0,0 +1,8 @@
+<?php
+
+ if (_RIGHTS_OK !== true) die();
+
+ global $ADAT;
+
+ if (isset($ADAT['targyId']) && isset($ADAT['evfolyamJel'])) putUjTanevForm($ADAT);
+?>