aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/mayor-naplo
diff options
context:
space:
mode:
Diffstat (limited to 'mayor-orig/mayor-naplo')
-rw-r--r--mayor-orig/mayor-naplo/install/module-naplo/mysql/intezmeny.sql90
-rw-r--r--mayor-orig/mayor-naplo/log/mayor-naplo.rev2
-rw-r--r--mayor-orig/mayor-naplo/www/include/modules/naplo/share/zaradek.php1
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/admin/kretaZarojegyImport-pre.php136
-rw-r--r--mayor-orig/mayor-naplo/www/policy/private/naplo/admin/kretaZarojegyImport.php9
-rw-r--r--mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/admin/kretaZarojegyImport.phtml48
-rw-r--r--mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/base.phtml2
7 files changed, 196 insertions, 92 deletions
diff --git a/mayor-orig/mayor-naplo/install/module-naplo/mysql/intezmeny.sql b/mayor-orig/mayor-naplo/install/module-naplo/mysql/intezmeny.sql
index 5947c72f..f05feeed 100644
--- a/mayor-orig/mayor-naplo/install/module-naplo/mysql/intezmeny.sql
+++ b/mayor-orig/mayor-naplo/install/module-naplo/mysql/intezmeny.sql
@@ -716,21 +716,6 @@ CREATE TABLE `kepzesOsztaly` (
CONSTRAINT `kepzesOsztaly_ibfk_2` FOREIGN KEY (`osztalyId`) REFERENCES `osztaly` (`osztalyId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--- DROP in rev. 3562
--- CREATE TABLE `kepzesTargyOraszam` (
--- `kepzesId` smallint(5) unsigned NOT NULL,
--- `evfolyam` tinyint(3) unsigned NOT NULL,
--- `targyId` smallint(5) unsigned NOT NULL,
--- `oraszam` decimal(4,2) unsigned DEFAULT NULL,
--- `kovetelmeny` enum('aláírás','vizsga','jegy') DEFAULT NULL,
--- `jelenlet` enum('kötelező','nem kötelező') DEFAULT NULL,
--- PRIMARY KEY (`kepzesId`,`evfolyam`,`targyId`),
--- KEY `kepzesTargyOraszam_FKIndex1` (`kepzesId`),
--- KEY `kepzesTargyOraszam_FKIndex2` (`targyId`),
--- CONSTRAINT `kepzesTargyOraszam_ibfk_1` FOREIGN KEY (`kepzesId`) REFERENCES `kepzes` (`kepzesId`) ON DELETE CASCADE ON UPDATE CASCADE,
--- CONSTRAINT `kepzesTargyOraszam_ibfk_2` FOREIGN KEY (`targyId`) REFERENCES `targy` (`targyId`) ON DELETE NO ACTION ON UPDATE NO ACTION
--- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
CREATE TABLE `tanmenet` (
`tanmenetId` int(10) unsigned NOT NULL auto_increment,
`targyId` smallint(5) unsigned NOT NULL,
@@ -1034,78 +1019,3 @@ CREATE TABLE `diakNyelvvizsga` (
END; //
DELIMITER ; //
--- DELIMITER //
--- DROP FUNCTION IF EXISTS diakTorzslapszam //
--- CREATE function diakTorzslapszam ( thisDiakId INT, thisOsztalyId INT ) returns INT
--- READS SQL DATA
--- BEGIN
--- DECLARE i,d,n01,n02,n03,n04,n05,n06,n07,n08,n09,n10,n11,n12,n13 INT; -- for loop
--- DECLARE error,inKezdoTanev,inVegzoTanev INT;
--- DECLARE cur1
--- CURSOR FOR
--- SELECT diakId,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev,thisOsztalyId),99) as ns01,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+1,thisOsztalyId),99) as ns02,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+2,thisOsztalyId),99) as ns03,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+3,thisOsztalyId),99) as ns04,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+4,thisOsztalyId),99) as ns05,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+5,thisOsztalyId),99) as ns06,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+6,thisOsztalyId),99) as ns07,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+7,thisOsztalyId),99) as ns08,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+8,thisOsztalyId),99) as ns09,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+9,thisOsztalyId),99) as ns10,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+10,thisOsztalyId),99) as ns11,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+11,thisOsztalyId),99) as ns12,
--- ifnull(diakNaploSorszam(diakId,inKezdoTanev+12,thisOsztalyId),99) as ns13
--- FROM osztalyDiak
--- WHERE osztalyId=thisOsztalyId
--- ORDER BY ns01, ns02, ns03, ns04, ns05, ns06, ns07, ns08, ns09, ns10, ns11, ns12, ns13;
--- DECLARE CONTINUE HANDLER FOR NOT FOUND SET error := 1; -- Ne csináljon semmit, menjen tovább...
--- SELECT kezdoTanev FROM osztaly WHERE osztalyId=thisOsztalyId INTO inKezdoTanev;
--- SET i := 1;
--- OPEN cur1;
--- lo: LOOP
--- FETCH cur1 INTO d, n01, n02, n03, n04, n05, n06, n07, n08, n09, n10, n11, n12, n13;
--- IF d = thisDiakId THEN
--- LEAVE lo;
--- END IF;
--- SET i := i+1;
--- END LOOP;
--- CLOSE cur1;
---
--- return i;
--- END; //
--- DELIMITER ; //
-
--- -- Egy újabb próbálkozás...
--- DELIMITER //
--- DROP FUNCTION IF EXISTS diakTorzslapszam //
--- CREATE function diakTorzslapszam ( thisDiakId INT, thisOsztalyId INT ) returns INT
--- READS SQL DATA
--- BEGIN
---
--- DECLARE ret INT;
--- set @oszt=0;
--- set @sz=0;
--- -- set @ret = (
--- select sorsz from (
--- select
--- @sz:=if(@osz=osztalyId,@sz:=@sz+1,1) as sorsz,
--- @oszt:=osztalyId as o,
--- osztalyId, diakId, sort, diakNev
--- from (
--- select
--- osztalyId, diakId,
--- if (month(min(beDt))>8 or month(min(beDt))<6 or (month(min(beDt))=6 and day(min(beDt))<16), min(beDt), date_format(min(beDt),'%Y-09-01')) as sort,
--- concat_ws(' ',viseltNevElotag, viseltCsaladinev, viseltUtonev) as diakNev
--- from osztalyDiak left join diak using (diakId)
--- group by osztalyId, diakId
--- order by osztalyId, sort, diakNev
--- ) as t
--- ) as k
--- where osztalyId=thisOsztalyId and diakId=thisDiakId into ret;
---
--- return ret;
--- END; //
--- DELIMITER ; //
-
diff --git a/mayor-orig/mayor-naplo/log/mayor-naplo.rev b/mayor-orig/mayor-naplo/log/mayor-naplo.rev
index 391392cb..d006b5a6 100644
--- a/mayor-orig/mayor-naplo/log/mayor-naplo.rev
+++ b/mayor-orig/mayor-naplo/log/mayor-naplo.rev
@@ -1 +1 @@
-4509
+4519
diff --git a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/zaradek.php b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/zaradek.php
index edc432b4..ecbabce6 100644
--- a/mayor-orig/mayor-naplo/www/include/modules/naplo/share/zaradek.php
+++ b/mayor-orig/mayor-naplo/www/include/modules/naplo/share/zaradek.php
@@ -476,6 +476,7 @@ $ZaradekIndex = array(
'következő évfolyamba léphet' => 20, // %évfolyam betűvel%
'tanulmányait befejezte, következő évfolyamon folytathatja' => 21, // %évfolyam%
'tanulmányait befejezte' => 102,
+ 'érettségi vizsgát tehet' => 61,
'szakképző évfolyamba léphet' => 38, // %szakképesítés%
// mulasztás - de vizsgázat
'mulasztás miatt osztályozóvizsga' => 19,
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/admin/kretaZarojegyImport-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/admin/kretaZarojegyImport-pre.php
new file mode 100644
index 00000000..7660b7ae
--- /dev/null
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/admin/kretaZarojegyImport-pre.php
@@ -0,0 +1,136 @@
+<?php
+
+// FIGYELEM!!! AZONOS OSZLOPTÁRGYNEVEKNÉL NEM VÁRT MUKODÉS LÉPHET FEL
+// -- TODO oszlopindex szinkronizálás!
+
+ if (_RIGHTS_OK !== true) die();
+ if (__NAPLOADMIN!==true) {
+
+ $_SESSION['alert'][] = 'page:insufficient_access';
+
+ }
+
+ require_once('include/modules/naplo/share/intezmenyek.php');
+ require_once('include/modules/naplo/share/tanar.php');
+ require_once('include/modules/naplo/share/file.php');
+ require_once('include/modules/naplo/share/ora.php');
+
+ global $_TANEV;
+
+ $ADAT['osztalyId'] = $osztalyId = readVariable($_POST['osztalyId'],'id');
+ $MODIFYSQL = readVariable($_POST['MODIFYSQL'],'bool');
+
+if ($osztalyId>0) {
+
+ $ADAT['osztalyAdat'] = getOsztalyAdat($osztalyId);
+
+ ini_set('max_execution_time', 120);
+
+ $lr_intezmeny = db_connect('naplo_intezmeny');
+ $lr_naplo = db_connect('naplo');
+
+ $q = "select getNev(diakId,'diak') COLLATE utf8_hungarian_ci AS diakNev,diakId,statusz,oId from ".__INTEZMENYDBNEV.".diak WHERE statusz!='jogviszonya lezárva' ORDER BY diakNev";
+ $v = array();
+ $DIAKNEV2diakId = db_query($q, array('debug'=>false,'modul'=>'naplo','values'=>$v,'result'=>'multiassoc','keyfield'=>'diakNev'),$lr_naplo);
+
+ $q = "select targyNev COLLATE utf8_hungarian_ci AS targyNev, targyId, targyJelleg, zaroKovetelmeny, mkId, munkakozosseg.leiras AS mkNev FROM ".__INTEZMENYDBNEV.".targy LEFT JOIN ".__INTEZMENYDBNEV.".munkakozosseg USING (mkId) WHERE zaroKovetelmeny IN ('jegy','magatartás','szorgalom','féljegy') ORDER BY targyNev";
+ $v = array();
+ $TARGYNEV2targyId = db_query($q, array('debug'=>false,'modul'=>'naplo','values'=>$v,'result'=>'multiassoc','keyfield'=>'targyNev'),$lr_naplo);
+ $file = fopen("/tmp/kretaZarojegyImport.tsv.tsv","r");
+
+ $nofrow=0;
+ if ($file!==false)
+ while(! feof($file)) {
+ $nofrow++;
+ $line = (chop(fgets($file))); // no trim!
+ $record = explode("\t",$line);
+ dump($record);
+
+ if ($nofrow==1) {
+
+ } elseif($nofrow==2) {
+ for($i=0; $i<count($record); $i++) {
+ $oszlopIndex = $i;
+ $ADAT['oszlop2targyId'][$oszlopIndex] = null;
+ $_targyOszlopNev = kisbetus($record[$i]);
+ if ($_targyOszlopNev!='' && count($TARGYNEV2targyId[$_targyOszlopNev])>=1) {
+ $ADAT['targyMatrix'][$_targyOszlopNev] = $TARGYNEV2targyId[$_targyOszlopNev] ;
+ if (count($TARGYNEV2targyId[$_targyOszlopNev])==1) {
+ $ADAT['oszlop2targyId'][$oszlopIndex] = $TARGYNEV2targyId[$_targyOszlopNev][0]['targyId'];
+ } else {
+ $_tmp = readVariable($_POST['oszlop_'.($oszlopIndex)],'id');
+ if (is_numeric($_tmp) && $_tmp>0) {
+ $ADAT['oszlop2targyId'][$oszlopIndex] = $_tmp;
+ } else {
+ // $ADAT['oszlop2targyId'][$oszlopIndex] = 10000+$oszlopIndex;
+ }
+ }
+ } else {
+ $ADAT['targyMatrix'][$_targyOszlopNev] = '';
+ $_SESSION['alert'][] = 'info:none:'.serialize(1);
+ $ADAT['hiba'][] = ($record[$i]);
+ }
+ }
+ } else {
+
+ $D = array();
+ $D['diakNev'] = $record[0];
+ if (count($DIAKNEV2diakId[$D['diakNev']])!=1) {
+ $_SESSION['alert'][] = 'info:dup_or_none:'.serialize($D['diakNev']).':'.serialize($DIAKNEV2diakId[$D['diakNev']]);
+ $ADAT['hiba'][] = $D;
+ continue;;
+ } else {
+ $D['diakId'] = $DIAKNEV2diakId[$D['diakNev']][0]['diakId'];
+ $D['oId'] = $DIAKNEV2diakId[$D['diakNev']][0]['oId'];
+ }
+ for($i=0; $i<count($record); $i++) {
+ $oszlopIndex = $i;
+ if (intval($ADAT['oszlop2targyId'][$oszlopIndex])==0 || intval($record[$i])==0)
+ continue;;
+
+ $D['targyId'] = intval($ADAT['oszlop2targyId'][$oszlopIndex]);
+ $D['evfolyam'] = $ADAT['osztalyAdat']['evfolyam'];
+ $D['evfolyamJel'] = $ADAT['osztalyAdat']['evfolyamJel'];
+ $D['felev'] = 2; // TODO!
+ $D['hivatalosDt'] = $_TANEV['zarasDt'];
+ $D['jegy'] = intval($record[$i]);
+ $D['jegyTipus'] = 'jegy';
+ //dump($ADAT['osztalyAdat']['evfolyamJel']);
+ $q = "SELECT count(*) AS db FROM zaroJegy WHERE diakId=%u AND targyId=%u AND evfolyamJel='%s' AND felev=%u";
+ $v = array($D['diakId'],
+ $D['targyId'],
+ $D['evfolyamJel'],
+ $D['felev']);
+ $result = db_query($q, array('fv'=>'kretaImport','values'=>$v,'result'=>'value'),$lr_intezmeny);
+ if ($result==0) {
+ $q = "INSERT INTO zaroJegy (diakId,targyId,evfolyam,evfolyamJel,felev,jegy,jegyTipus,modositasDt,hivatalosDt)
+ VALUES (%u,%u,'%s','%s',%u,'%s','%s',NOW(),'%s')";
+ $v = array($D['diakId'],
+ $D['targyId'],
+ $D['evfolyam'],
+ $D['evfolyamJel'],
+ $D['felev'],
+ $D['jegy'],
+ $D['jegyTipus'],
+ $D['hivatalosDt']);
+ if ($MODIFYSQL===true) db_query($q, array('fv'=>'kretaImport','values'=>$v),$lr_intezmeny);
+ dump($v);
+ dump($q);
+ }
+
+ }
+ } // nofrow else
+ } // while
+
+ fclose($file);
+ db_close($lr);
+
+}
+
+
+
+
+ $TOOL['osztalySelect'] = array('tipus'=>'cella');
+ getToolParameters();
+
+?> \ No newline at end of file
diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/admin/kretaZarojegyImport.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/admin/kretaZarojegyImport.php
new file mode 100644
index 00000000..1769a3e4
--- /dev/null
+++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/admin/kretaZarojegyImport.php
@@ -0,0 +1,9 @@
+<?php
+
+ global $ADAT;
+
+ putKretaZarojegyImport($ADAT);
+
+
+
+?> \ No newline at end of file
diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/admin/kretaZarojegyImport.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/admin/kretaZarojegyImport.phtml
new file mode 100644
index 00000000..ed4c0e69
--- /dev/null
+++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/admin/kretaZarojegyImport.phtml
@@ -0,0 +1,48 @@
+<?php
+
+ function putKretaZarojegyImport($ADAT) {
+
+ if ($ADAT['osztalyId']==0) {
+ echo '<h1 style="text-align: center">Először válassz osztályt!</h1>';
+ return;
+ } else {
+ echo '<h1 style="text-align: center">Évfolyamjel: '.$ADAT['osztalyAdat']['evfolyamJel'].'</h1>';
+ }
+
+ $oszlopIndex = 0;
+ if (count($ADAT['targyMatrix'])>0) {
+ formBegin();
+ echo '<table style="margin-left:40px;">';
+ foreach ($ADAT['targyMatrix'] as $targyOszlopNev => $targyAdat) {
+ echo '<tr><td>'.($oszlopIndex).'</td><td>'.$targyOszlopNev.'</td>';
+ echo '<td>';
+ if (!is_array($targyAdat)) {
+ echo '-';
+ } elseif (count($targyAdat)==1) {
+ echo $targyAdat[0]['targyNev']; // kovetelmeny, munkakozosseg
+ echo ' ('.$targyAdat[0]['targyId'].')'; // kovetelmeny, munkakozosseg
+ echo '<input type="hidden" name="oszlop_'.intval($oszlopIndex).'" value="'.$targyAdat[0]['targyId'].'" />';
+ } else {
+ echo '<select name="oszlop_'.$oszlopIndex.'">';
+ echo '<option value="">Válassz!</option>';
+ for ($i=0; $i<count($targyAdat); $i++) {
+ $_SEL = ($_POST['oszlop_'.($oszlopIndex)] == $targyAdat[$i]['targyId']) ? ' selected="selected" ':'';
+ echo '<option value="'.$targyAdat[$i]['targyId'].'" '.$_SEL.'>'.$targyAdat[$i]['targyNev'].' - '.$targyAdat[$i]['targyJelleg'].' ('.$targyAdat[$i]['mkNev'].' munkaközösség) '.$targyAdat[$i]['zaroKovetelmeny'].' ('.$targyAdat[$i]['targyId'].')</option>';
+ }
+ echo '</select>';
+ }
+ echo '</td>';
+ echo '</tr>';
+ $oszlopIndex++;
+ }
+ echo '</table>';
+ echo '<input type="hidden" name="osztalyId" value="'.intval($ADAT['osztalyId']).'" />';
+ echo '<input type="checkbox" name="MODIFYSQL" value="1" />';
+ echo '<input type="submit" />';
+ formEnd();
+ }
+ // dump($ADAT['oszlop2targyId']);
+
+
+ }
+?> \ No newline at end of file
diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/base.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/base.phtml
index 4753fbf4..3a67bf6c 100644
--- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/base.phtml
+++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/base.phtml
@@ -47,7 +47,7 @@
echo '<td class="toolBarTitle" id="toolBarTitle" colspan="3">';
if (defined('__PAGETITLE')) echo __PAGETITLE.'<br/>';
- else echo 'MaYoR eleketronikus napló'.'<br/>';
+ else echo 'MaYoR elektronikus napló'.'<br/>';
echo '<a href="'.href('index.php?page=naplo&sub=intezmeny&f=valtas').'">';
if (defined('__TELEPHELYID')) echo '<span id="toolBarIntezmeny" title="TelephelyId:".'.__TELEPHELYID.'>'.__INTEZMENY .', ' . __TANEV.'/'.(__TANEV+1).'</span>';
else echo '<span id="toolBarIntezmeny">'.__INTEZMENY . '/' . __TANEV.'</span>';