diff options
author | M.Gergo | 2020-08-24 13:05:03 +0200 |
---|---|---|
committer | M.Gergo | 2020-08-24 13:05:03 +0200 |
commit | e22bbedcf69ea347a103d04d194136b8f3a761c8 (patch) | |
tree | 5d5653a23f1070af88f2fac633a75836e1e4bfb4 /mayor-orig/mayor-naplo | |
parent | 37d424aa0d36fdb47e931340f7920a92870e3c34 (diff) | |
download | mayor-rev4670.tar.gz mayor-rev4670.zip |
Rev: 4670rev4670
Diffstat (limited to 'mayor-orig/mayor-naplo')
7 files changed, 74 insertions, 21 deletions
diff --git a/mayor-orig/mayor-naplo/log/mayor-naplo.rev b/mayor-orig/mayor-naplo/log/mayor-naplo.rev index 1144753c..ae6d0645 100644 --- a/mayor-orig/mayor-naplo/log/mayor-naplo.rev +++ b/mayor-orig/mayor-naplo/log/mayor-naplo.rev @@ -1 +1 @@ -4668 +4670 diff --git a/mayor-orig/mayor-naplo/update/pre004669-1.sh b/mayor-orig/mayor-naplo/update/pre004669-1.sh new file mode 100644 index 00000000..4ca6ff0a --- /dev/null +++ b/mayor-orig/mayor-naplo/update/pre004669-1.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +#BASEDIR="/var/mayor" + +DIR="$BASEDIR/download/private/naplo/nyomtatas/torzslap/" +mkdir -p $DIR +chown -R www-data $DIR +echo "$DIR Kész." + +DIR="$BASEDIR/download/private/naplo/upload/" +mkdir -p $DIR +chown -R www-data $DIR +echo "$DIR Kész." diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas-pre.php index 8497ec46..fe445355 100644 --- a/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas-pre.php +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas-pre.php @@ -94,7 +94,7 @@ if ($DIAKOK[$i]['oId']!='') { $OID2ID[$DIAKOK[$i]['oId']] = intval($DIAKOK[$i]['diakId']); } else { - $ADAT['bug']['diak'][] = $DIAKOK[$i]['oId']; + $ADAT['bug']['diak'][] = $DIAKOK[$i]['oId'].serialize($DIAKOK[$i]); } } // TÁRGYAK @@ -527,7 +527,7 @@ $_D = $ADAT['ttf'][$i]; $q = "select *,tankorSzemeszter.tankorId AS tankorId from tankorSzemeszter LEFT JOIN tankor USING (tankorId) -LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<=NOW() AND (kiDt is null or kiDt>=NOW())) +LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<='2020-09-01' AND (kiDt is null or kiDt>='2020-09-01')) LEFT JOIN ".__TANEVDBNEV.".tankorCsoport ON (tankor.tankorId = tankorCsoport.tankorId) LEFT JOIN ".__TANEVDBNEV.".csoport USING (csoportId) WHERE tanev=%u AND szemeszter=%u AND targyId=%u AND oraszam=%f AND tanarId=%u @@ -551,7 +551,7 @@ GROUP BY tankor.tankorId"; // Belerakjuk azon tanköröket is, ahol vélhetően csak a csoport hozzárendelés hiányzik $q = "select *,tankorSzemeszter.tankorId AS tankorId from tankorSzemeszter LEFT JOIN tankor USING (tankorId) -LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<=NOW() AND (kiDt is null or kiDt>=NOW())) +LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<='2020-09-01' AND (kiDt is null or kiDt>='2020-09-01')) LEFT JOIN ".__TANEVDBNEV.".tankorCsoport ON (tankor.tankorId = tankorCsoport.tankorId) LEFT JOIN ".__TANEVDBNEV.".csoport USING (csoportId) WHERE tanev=%u AND szemeszter=%u AND targyId=%u AND oraszam=%f AND tanarId=%u @@ -591,7 +591,7 @@ GROUP BY tankor.tankorId"; } $q = "select *,tankorSzemeszter.tankorId AS tankorId from tankorSzemeszter LEFT JOIN tankor USING (tankorId) -LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<=NOW() AND (kiDt is null or kiDt>=NOW())) +LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<='2020-09-01' AND (kiDt is null or kiDt>='2020-09-01')) LEFT JOIN tankorOsztaly ON (tankor.tankorId = tankorOsztaly.tankorId) WHERE tanev=%u AND szemeszter=%u AND targyId=%u AND oraszam=%f @@ -611,7 +611,7 @@ GROUP BY tankor.tankorId ORDER BY tankorNev"; } else { $q = "select *,tankorSzemeszter.tankorId AS tankorId from tankorSzemeszter LEFT JOIN tankor USING (tankorId) -LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<=NOW() AND (kiDt is null or kiDt>=NOW())) +LEFT JOIN tankorTanar ON (tankorTanar.tankorId=tankor.tankorId AND beDt<='2020-09-01' AND (kiDt is null or kiDt>='2020-09-01')) WHERE tanev=%u AND szemeszter=%u AND targyId=%u AND oraszam>=%f AND tanarId IS NULL @@ -662,7 +662,7 @@ GROUP BY tankor.tankorId ORDER BY tankorNev"; // MaYoR: csoportId+targyId+tanarId => tankorId; $lr_naplo = db_connect('naplo'); - $q = "select csoportId, targyId, tanarId, tankor.tankorId FROM tankorCsoport LEFT JOIN csoport USING (csoportId) LEFT JOIN ".__INTEZMENYDBNEV.".tankor USING (tankorId) LEFT JOIN ".__INTEZMENYDBNEV.".tankorTanar ON (tankor.tankorId = tankorTanar.tankorId AND beDt>='2019-09-01' AND (kiDt IS NULL or kiDt>=NOW()))"; + $q = "select csoportId, targyId, tanarId, tankor.tankorId FROM tankorCsoport LEFT JOIN csoport USING (csoportId) LEFT JOIN ".__INTEZMENYDBNEV.".tankor USING (tankorId) LEFT JOIN ".__INTEZMENYDBNEV.".tankorTanar ON (tankor.tankorId = tankorTanar.tankorId AND beDt>='2019-09-01' AND (kiDt IS NULL or kiDt>='2020-09-01'))"; $r = db_query($q, array('fv' => 'pre', 'modul' => 'naplo', 'values' => $v, 'result'=>'indexed'),$lr_naplo); for ($i=0; $i<count($r); $i++) { $d = $r[$i]; diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas.php index 9d5fbf07..7eceb83d 100644 --- a/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas.php +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/import/tantargyFelosztas.php @@ -4,15 +4,24 @@ putTTFimport($ADAT); - if (count($ADAT['bug']['targy'])>0) + if (count($ADAT['bug']['targy'])>0) { + echo '<h1>Hibás tárgyak</h1>'; + echo '<pre>'; var_dump($ADAT['bug']['targy']); + echo '</pre>'; + } - if (count($ADAT['bug']['diak'])>0) + if (count($ADAT['bug']['diak'])>0) { + echo '<h1>Hibás diákok</h1>'; + echo '<pre>'; var_dump($ADAT['bug']['diak']); + echo '</pre>'; + } - echo 'Használt kulcs érték párok:'; - var_dump($ADAT['kulcsertektar']['osztalyjel2id']); - + echo 'Használt kulcs-érték párok (osztályJel-osztályId):'; + echo '<pre>'; + var_dump($ADAT['kulcsertektar']['osztalyjel2id']); + echo '</pre>'; diff --git a/mayor-orig/mayor-naplo/www/policy/private/naplo/intezmeny/osztaly-pre.php b/mayor-orig/mayor-naplo/www/policy/private/naplo/intezmeny/osztaly-pre.php index 5097037f..9222a0c8 100644 --- a/mayor-orig/mayor-naplo/www/policy/private/naplo/intezmeny/osztaly-pre.php +++ b/mayor-orig/mayor-naplo/www/policy/private/naplo/intezmeny/osztaly-pre.php @@ -19,7 +19,9 @@ require_once('include/modules/naplo/share/tankorDiakModifier.php'); require_once('include/modules/naplo/share/hianyzasModifier.php'); require_once('include/modules/naplo/share/jegyModifier.php'); require_once('include/modules/naplo/share/jegy.php'); +require_once('include/share/net/upload.php'); +define('FILE_UPLOAD_DIR',_DOWNLOADDIR.'/private/naplo/upload/'); if (defined('__INTEZMENY') and __INTEZMENY != '') { $ADAT['tanevek'] = getTanevek(true); @@ -40,11 +42,28 @@ else $TA = $_TANEV; /* -------- */ // Adatok frissítése adatállományból -if (__NAPLOADMIN && isset($_POST['fileName']) && $_POST['fileName'] != '') { +if (__NAPLOADMIN===true && + ( + (isset($_POST['fileName']) && $_POST['fileName'] != '') + or + (is_array($_FILES) && $_FILES['upfile']['name']!='') + ) + ) { + define('_SKIP_ON_DUP',readVariable($_POST['skipOnDup'],'bool')); + if (is_array($_FILES) && $_FILES['upfile']['name']!='') { // távoli feltöltés + try { + $_F = array('subdir'=>FILE_UPLOAD_DIR, 'filename'=>uniqid()); // move ide + $sikeresFeltoltes = mayorFileUpload($_F, false); + $fileName = FILE_UPLOAD_DIR.$_F['filename']; + } catch (Exception $e) { + dump($e); + } + } else { // helyi beolvasás + // $fileName = fileNameNormal($_POST['fileName']); + $fileName = ($_POST['fileName']); // TODO + } $mezo_elvalaszto = ' '; // "\t" -// $fileName = fileNameNormal($_POST['fileName']); - $fileName = ($_POST['fileName']); // TODO $ADATOK = array(); if (file_exists($fileName)) { diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/import/tantargyFelosztas.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/import/tantargyFelosztas.phtml index 5fe6435a..2980672b 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/import/tantargyFelosztas.phtml +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/import/tantargyFelosztas.phtml @@ -29,7 +29,8 @@ table.ttf tr.createTankor td { background-color: magenta;} table.ttf tr.done td { background-color: lightgreen;} - table.ttf tr td {padding:4px;} + table.ttf tr td {padding:4px; border-bottom: solid 1px #ccc;} + table.ttf tr td:hover {outline: solid 2px cornflowerblue;} table.ttf tr td div.tankorLista span:hover { color: white; } </style>'; @@ -104,7 +105,7 @@ echo '<option>--'.$D['action'].'--</option>'; for ($j=0; $j<count($D['displayTankor']); $j++) { $_SEL = (count($D['displayTankor'])==1 && $D['action']=='tankorHozzarendel') ? ' selected="selected" ': ''; - echo '<option value="'.$D['csoportId'].':####:'.$D['tanarId'].':####:'.$D['displayTankor'][$j]['tankorId'].':####:'.$D['oraszam'].'" '.$_SEL.'>'.$D['displayTankor'][$j]['tankorNev'].'</option>'; + echo '<option value="'.$D['csoportId'].':####:'.$D['tanarId'].':####:'.$D['displayTankor'][$j]['tankorId'].':####:'.$D['oraszam'].'" '.$_SEL.'>'.$D['displayTankor'][$j]['tankorNev'].' ('.$D['displayTankor'][$j]['tankorId'].')</option>'; } echo '</select>'; echo '<div class="tankorLista">'; @@ -124,7 +125,16 @@ echo '</div>'; // ha ezt összehasonlítom a mayorban rögzített névsorral, akkor eldönhető lehet, hogy melyik a jó választás! echo ' Új tankör:'; - echo '<input type="checkbox" name="ujTankor[]" value="'.$D['csoportId'].':####:'.$D['tanarId'].':####:'.$_osztalyok.':####:'.$D['targyId'].'.'.':####:'.$_O.':####:'.$D[1].'" />'; + if (count($_osztalyok)>0) { + echo '<input type="checkbox" name="ujTankor[]" value="'.$D['csoportId'].':####:'.$D['tanarId'].':####:'.$_osztalyok.':####:'.$D['targyId'].'.'.':####:'.$_O.':####:'.$D[1].'" />'; + } else { + echo '<select name="ujTankor[]">'; + echo '<option value=""></option>'; + foreach ($ADAT['kulcsertektar']['osztalyjel2id'] as $__osztalyJel => $__osztalyId) { // TODO osztalyJel mayorbol inkabb + echo '<option value="'.$D['csoportId'].':####:'.$D['tanarId'].':####:'.$__osztalyId.':####:'.$D['targyId'].'.'.':####:'.$_O.':####:'.$D[1].'">'.$__osztalyJel.'</option>'; + } + echo '</select>'; + } } elseif ($D['action'] == 'createTankor') { echo 'Új tankör létrehozása: <input type="text" name="ujTankor[]" value="'.$D['csoportId'].':####:'.$D['tanarId'].':####:'.$_osztalyok.':####:'.$D['targyId'].'.'.':####:'.$_O.':####:'.$D[1].'" />'; } else { diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/share/file.phtml b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/share/file.phtml index 7720f2ba..a1ac34d4 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/share/file.phtml +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/html/share/file.phtml @@ -2,7 +2,7 @@ function putFileSelectForm($dbtable, $post = array()) { - formBegin(array('class'=>'updateTable')); + formBegin(array('class'=>'updateTable', 'enctype'=>'multipart/form-data')); // A form címe if (defined('_FILESELECTTITLE')) echo '<h1>'._FILESELECTTITLE.'</h1>'; // A továbbadandó POST adatok @@ -12,8 +12,10 @@ } echo '<input type="hidden" name="dbtable" value="'.$dbtable.'">'."\n"; echo '<input type="checkbox" name="skipOnDup" value="true" /> Meglevő rekord találatkor kihagyjuk a rekord frissítést'; - echo '<label for="file">'._FILENEV.':</label>'."\n"; - echo '<input type="text" id="file" name="fileName" />'."\n"; + echo '<p><label for="file">'._FILENEV.':</label>'."\n"; + echo '<input type="text" id="file" name="fileName" /></p>'."\n"; + echo '<p>Vagy feltöltés:'; + echo '<input type="file" name="upfile" /></p>'; echo '<input type="submit" value="'._OK.'" />'."\n"; formEnd(); |