diff options
author | M.Gergo | 2019-04-14 12:15:49 +0200 |
---|---|---|
committer | M.Gergo | 2019-04-14 12:15:49 +0200 |
commit | 2982e19bfc1c79aa84ad93654a12dee8d61c0e27 (patch) | |
tree | 2a34e0d277e37c0f3d35c4d58c464f9e3030782a /mayor-orig/mayor-naplo | |
parent | 78d4c90716008073d654b7c8d311f67367ee3c88 (diff) | |
download | mayor-2982e19bfc1c79aa84ad93654a12dee8d61c0e27.tar.gz mayor-2982e19bfc1c79aa84ad93654a12dee8d61c0e27.zip |
Rev: 4508
Diffstat (limited to 'mayor-orig/mayor-naplo')
7 files changed, 70 insertions, 2 deletions
diff --git a/mayor-orig/mayor-naplo/log/mayor-naplo.rev b/mayor-orig/mayor-naplo/log/mayor-naplo.rev index 1d0d39c1..7553ea5e 100644 --- a/mayor-orig/mayor-naplo/log/mayor-naplo.rev +++ b/mayor-orig/mayor-naplo/log/mayor-naplo.rev @@ -1 +1 @@ -4506 +4508 diff --git a/mayor-orig/mayor-naplo/update/pre004506-1.sh b/mayor-orig/mayor-naplo/update/pre004506-1.sh new file mode 100644 index 00000000..254d141d --- /dev/null +++ b/mayor-orig/mayor-naplo/update/pre004506-1.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +DIR="$BASEDIR/download/private/naplo/haladasi/haladasi" +mkdir -p $DIR +chown -R www-data $DIR + +echo " Kész." + + 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 391ef7c8..7b890fad 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 @@ -152,4 +152,21 @@ return $RESULT; } + function exportTankorHaladasi($file, $ADAT) { + + + $EXPORT = array(array('Óraszám','Téma')); + foreach ($ADAT['haladasi'] as $dt => $nAdat) { + foreach ($nAdat as $index => $oAdat) { + if ($oAdat['oraszam'] != '') + $EXPORT[] = array($oAdat['oraszam'], $oAdat['leiras']); + } + } + if ($ADAT['formatum'] == 'xml') return generateXLS("$file.${ADAT['formatum']}", $EXPORT, 'haladási napló'); + elseif ($ADAT['formatum'] == 'csv') return generateCSV("$file.${ADAT['formatum']}", $EXPORT, 'haladási napló'); + elseif ($ADAT['formatum'] == 'ods') return generateODS("$file.${ADAT['formatum']}", $EXPORT, 'haladási naplo'); + else return false; + + } + ?> 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 f6a59939..460e4ec9 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 @@ -17,6 +17,7 @@ require_once('include/modules/naplo/share/tanmenet.php'); require_once('include/modules/naplo/share/hetes.php'); require_once('include/modules/naplo/share/helyettesitesModifier.php'); + require_once('include/modules/naplo/share/file.php'); require_once('include/share/date/names.php'); @@ -247,6 +248,16 @@ if ( $skin == 'ajax' // for ($i=0; $i<count($_NAPOK); $i++) { // checkNaplo($_NAPOK[$i]); // } + } elseif ($action == 'haladasiExport') { + $ADAT['formatum'] = readVariable($_POST['formatum'], 'enum', 'ods', array('csv','ods','xml')); + $orderBy = array('dt','ora'); + if ($ADAT['formatum'] == 'xml') $ADAT['mime'] = 'application/vnd.ms-excel'; + $file = $tankorId; + $Tankorok = getTankorById($tankorId, __TANEV); // felül kell írnunk + $ADAT['haladasi'] = getHaladasi($Tankorok, $ADAT['munkaterv'], $orderBy, $csakUres); + if (exportTankorHaladasi($file, $ADAT)) + header('Location: '.location('index.php?page=session&f=download&download=true&dir=naplo/haladasi/haladasi&file='.$file.'.'.$ADAT['formatum'].'&mimetype='.$ADAT['mime'])); + } } diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/haladasi.css b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/haladasi.css index 4eae0808..f3899611 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/haladasi.css +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/css/haladasi/haladasi.css @@ -295,6 +295,18 @@ table.haladasiBejegyzesek tbody tr td.ora a.tankorStat {display:none;} table.haladasiBejegyzesek tbody tr:hover td.ora a.tankorStat { display:inline;} + form.exportForm { text-align: right; width:95%; } + form.exportForm input{ + cursor: pointer; + border: solid 1px #888; + color: #888; + background-color: #eee; + border-radius: 4px; + padding: 2px 4px; + opacity: 0.9; + } + form.exportForm input:hover { color:black; border-color: black; background-color: white; opacity: 1; } + form.exportForm input:active { background-color: cornflowerblue; color:white; } } @media print { table.haladasiBejegyzesek thead tr th { border-bottom: solid 1px black;} 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 11c42ede..0638edf6 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 @@ -1,6 +1,17 @@ <?php global $SZLO; + function putExportForm($ADAT) { + $tankorId = $ADAT['tankorId']; + + formBegin(array('action'=>href('index.php?page=naplo&sub=haladasi&f=haladasi'), 'name'=>'haladasiExport', 'class'=>'exportForm')); + echo '<input type="hidden" name="action" value="haladasiExport" />'."\n"; + echo '<input type="hidden" name="tankorId" value="'.$tankorId.'" />'."\n"; + echo '<input type="hidden" name="formatum" value="xml" />'."\n"; + echo '<input type="submit" name="Export" value="Export"/>'."\n"; + formEnd(); + } + function putHaladasiBejegyzesek($ADAT) { global $_TANEV,$SZLO; @@ -19,6 +30,8 @@ if ($tankorId!='') $AKTIV_TH['tankor'] = true; + if ($tankorId!='') putExportForm($ADAT); + $FORM = array('action'=>href('index.php?page=naplo&sub=haladasi&f=haladasi'), 'name'=>'haladasiOrabeiras', 'class'=>'onChangeRequest'); formBegin($FORM); echo '<input type="hidden" name="igDt" value="'._SHOW_DAYS_TO.'" />'."\n"; diff --git a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/haladasi/haladasi.jquery.min.js b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/haladasi/haladasi.jquery.min.js index 578a6f0e..68881382 100644 --- a/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/haladasi/haladasi.jquery.min.js +++ b/mayor-orig/mayor-naplo/www/skin/classic/module-naplo/javascript/haladasi/haladasi.jquery.min.js @@ -26,6 +26,12 @@ $(function() { /* onload */ if (x.hasClass('gomb DOA')) x.prop('disabled', false); }); + $('.exportForm').click(function(event) { + $('table.haladasiBejegyzesek input[type="text"].data').prop('readonly',true); + $('table.haladasiBejegyzesek input[type="text"].data').prop('disabled',true); + $('table.haladasiBejegyzesek input[type="submit"].gomb').prop('readonly',true); + $('table.haladasiBejegyzesek input[type="submit"].gomb').prop('disabled',true); + }); /* $('body').change(function(event) { var x = $(event.target); // itt kezelhetnénk a haladasi tankorvaltasbol adodo dolgot @@ -49,7 +55,7 @@ $(function() { /* onload */ }); processJSON = function(json) { - console.log(json.toDo); + // console.log(json.toDo); var elementId = "#ORAID_"+json.oraId.toString(); if (json.toDo=='oraElmarad') { |