Chore: Verschiebe Git-Repository in das Hauptverzeichnis und richte .gitignore ein
This commit is contained in:
commit
96d0545193
502 files changed
+176027
No files matched your search
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use HermannTelser\Gutachten\Utility\Helper;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class Auftraggeber
|
||||
{
|
||||
public static function select()
|
||||
{
|
||||
$_arr = DbFunction::select('tx_gutachten_auftraggeber', '*');
|
||||
|
||||
// foreach ($_arr as $key => $_auftraggeber) {
|
||||
// foreach ($_auftraggeber as $feld => $value) {
|
||||
// if ($feld == "txt") {
|
||||
// $value = str_replace('<br />', PHP_EOL, $value);
|
||||
// $value = str_replace('\t', '', $value);
|
||||
// $_arr[$key][$feld] = trim(html_entity_decode(strip_tags($value)));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return $_arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class MethodenInfo
|
||||
{
|
||||
// active projekte für user
|
||||
public static function load()
|
||||
{
|
||||
// DbFunction::$debug = 1;
|
||||
|
||||
$arr = DbFunction::select(
|
||||
'tx_gutachten_raumart',
|
||||
[
|
||||
'id',
|
||||
'raumart',
|
||||
'erklaerung',
|
||||
],
|
||||
[
|
||||
// 'isactive' => 1,
|
||||
'ORDER' => ['order' => 'ASC']
|
||||
]
|
||||
);
|
||||
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['id'] = (int) $value['id'];
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class MethodenProjekt
|
||||
{
|
||||
// active projekte für user
|
||||
public static function select()
|
||||
{
|
||||
|
||||
$tmp = DbFunction::select('tx_gutachten_aufstellung', ['id', 'titel']);
|
||||
$_aufstellung = [];
|
||||
$_aufstellung[0] = '';
|
||||
foreach ($tmp as $value) {
|
||||
$_aufstellung[$value['id']] = $value['titel'];
|
||||
}
|
||||
$projektid = GeneralUtility::_GP('id');
|
||||
|
||||
$arr = DbFunction::selectJoin(
|
||||
'tx_gutachten_raume_generell',
|
||||
['[>]tx_gutachten_raumart' => ['tx_gutachten_raume_generell.tt_raumart_id' => 'id']],
|
||||
[
|
||||
'tx_gutachten_raume_generell.id',
|
||||
'tx_gutachten_raume_generell.pid',
|
||||
'tx_gutachten_raume_generell.raum',
|
||||
'tx_gutachten_raume_generell.factor',
|
||||
'tx_gutachten_raume_generell.zunutzwert',
|
||||
'tx_gutachten_raume_generell.aufstellung_id',
|
||||
'tx_gutachten_raumart.raumart',
|
||||
'tx_gutachten_raumart.id(raumart_id)',
|
||||
],
|
||||
[
|
||||
'tx_gutachten_raume_generell.pid' => $projektid,
|
||||
]
|
||||
);
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['id'] = (int) $value['id'];
|
||||
$arr[$key]['pid'] = (int) $value['pid'];
|
||||
$arr[$key]['factor'] = (double) $value['factor'];
|
||||
$arr[$key]['raumart_id'] = (int) $value['raumart_id'];
|
||||
$arr[$key]['zunutzwert'] = (int) $value['zunutzwert'];
|
||||
$id = (int) $value['aufstellung_id'] ?? 0;
|
||||
$arr[$key]['aufstellung'] = $_aufstellung[$id];
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class Notizen
|
||||
{
|
||||
public static function notizen_projekt_laden()
|
||||
{
|
||||
$id = GeneralUtility::_GP('id');
|
||||
|
||||
$note = DbFunction::get('tx_gutachten_projekte', 'beschreibung', ['id' => $id]);
|
||||
|
||||
echo $note;
|
||||
|
||||
exit;
|
||||
|
||||
// $_projekte = Select::projekte($id);
|
||||
// echo '<div style="border: 1px solid #cccccc;">
|
||||
// <div data-dojo-type="dijit/Editor" value="'.$_projekte[0]['beschreibung'].'" name="notizen" id="notizen" data-dojo-props="onChange:function(){update_projekt_notizen(arguments[0])}"></div>
|
||||
// </div>';
|
||||
// exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class ObjektProjektByMethode
|
||||
{
|
||||
public static function select($method)
|
||||
{
|
||||
if ($method == 1) {
|
||||
$arr = DbFunction::select(
|
||||
'tx_gutachten_raume_all',
|
||||
['tt_raume_basis_id', 'geschoss'],
|
||||
[
|
||||
'AND' => [
|
||||
'pid' => DbFunction::$projektid,
|
||||
'tt_raumart_id' => 1
|
||||
],
|
||||
'GROUP' => ['tt_raume_basis_id','geschoss']
|
||||
]
|
||||
);
|
||||
$geschoss = [];
|
||||
foreach ($arr as $key => $value) {
|
||||
$geschoss[$value['tt_raume_basis_id']][] = $value['geschoss'];
|
||||
}
|
||||
}
|
||||
|
||||
// DbFunction::$debug = 1;
|
||||
$arr = DbFunction::selectJoin(
|
||||
'tx_gutachten_raume_basis',
|
||||
['[>]tx_gutachten_orientierung' => ['tx_gutachten_raume_basis.tt_orientierung_id' => 'id'],
|
||||
'[>]tx_gutachten_raume_all' => ['tx_gutachten_raume_basis.id' => 'tt_raume_basis_id'], ],
|
||||
[
|
||||
'tx_gutachten_raume_basis.id',
|
||||
'tx_gutachten_raume_basis.topNr',
|
||||
'tx_gutachten_raume_basis.typ',
|
||||
'tx_gutachten_raume_basis.GNO',
|
||||
'tx_gutachten_orientierung.orientierung',
|
||||
'tx_gutachten_raume_all.geschoss',
|
||||
],
|
||||
[
|
||||
'tx_gutachten_raume_basis.pid' => DbFunction::$projektid,
|
||||
'tx_gutachten_raume_all.tt_raumart_id' => $method,
|
||||
'GROUP' => 'tx_gutachten_raume_basis.id',
|
||||
'ORDER' => ['tx_gutachten_raume_basis.topNr' => 'ASC'],
|
||||
]
|
||||
);
|
||||
if ($method == 1) {
|
||||
foreach ($arr as $key => $value) {
|
||||
if (isset($geschoss[$value['id']])) {
|
||||
$arr[$key]['geschoss'] = implode(",", $geschoss[$value['id']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use HermannTelser\Gutachten\Utility\Helper;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class Objekte
|
||||
{
|
||||
public static function select($projektid)
|
||||
{
|
||||
// DbFunction::$debug = 1;
|
||||
|
||||
// if (!is_numeric($projektid)) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
$arr = DbFunction::selectJoin(
|
||||
'tx_gutachten_raume_all',
|
||||
['[>]tx_gutachten_raume_basis' => ['tx_gutachten_raume_all.tt_raume_basis_id' => 'id'],
|
||||
'[>]tx_gutachten_orientierung' => ['tx_gutachten_raume_basis.tt_orientierung_id' => 'id'],
|
||||
'[>]tx_gutachten_raumart' => ['tx_gutachten_raume_all.tt_raumart_id' => 'id'], ],
|
||||
[
|
||||
'tx_gutachten_raume_all.id',
|
||||
'tx_gutachten_raume_all.tt_raume_basis_id',
|
||||
'tx_gutachten_raume_all.tt_raumart_id',
|
||||
'tx_gutachten_raume_all.pid',
|
||||
'tx_gutachten_raume_all.geschoss',
|
||||
'tx_gutachten_raume_all.raum',
|
||||
'tx_gutachten_raume_all.factor',
|
||||
'tx_gutachten_raume_all.qm',
|
||||
'tx_gutachten_raume_all.NW',
|
||||
'tx_gutachten_raume_all.NWungerundet',
|
||||
'tx_gutachten_raume_all.NWm2',
|
||||
'tx_gutachten_raume_all.factor (factorBasic)',
|
||||
|
||||
'tx_gutachten_raume_basis.topNr',
|
||||
'tx_gutachten_raume_basis.GNO',
|
||||
'tx_gutachten_raume_basis.NWM1uM2',
|
||||
|
||||
'tx_gutachten_orientierung.orientierung',
|
||||
'tx_gutachten_raumart.raumart',
|
||||
],
|
||||
[
|
||||
'tx_gutachten_raume_all.pid' => $projektid,
|
||||
]
|
||||
);
|
||||
|
||||
$in_menu = [];
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['show'] = \in_array($value['tt_raume_basis_id'], $in_menu) ? 0 : 1;
|
||||
$in_menu[] = $value['tt_raume_basis_id'];
|
||||
}
|
||||
$arr = Helper::make_int($arr, ['id', 'pid', 'tt_raume_basis_id', 'tt_raumart_id', 'GNO', 'NW', 'NWM1uM2']);
|
||||
$arr = Helper::format_double($arr, ['factor', 'qm', 'NWungerundet', 'NWm2', 'factorBasic'], 2);
|
||||
|
||||
return $arr;
|
||||
|
||||
// $fields = 'a.id, a.tt_raume_basis_id, a.tt_raumart_id, a.pid, a.geschoss, a.raum, a.factor, a.qm, a.NW, a.NWungerundet, a.NWm2, a.factor AS factorBasic,b.topNr, b.GNO, b.NWM1uM2, c.orientierung, d.raumart';
|
||||
// $from = 'tx_gutachten_raume_all a, tx_gutachten_raume_basis b, tx_gutachten_orientierung c, tx_gutachten_raumart d';
|
||||
// $where = "a.pid=$projektid AND a.tt_raume_basis_id = b.id AND b.tt_orientierung_id = c.id AND a.tt_raumart_id = d.id";
|
||||
// $order = 'a.tt_raume_basis_id';
|
||||
// // echo $GLOBALS['TYPO3_DB']->SELECTquery($fields, $from, $where, "", $order);exit;
|
||||
// $arr = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $from, $where, '', $order);
|
||||
// return $arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class ObjekteExcel
|
||||
{
|
||||
public static function select($projektid)
|
||||
{
|
||||
return DbFunction::selectJoin(
|
||||
'tx_gutachten_raume_basis',
|
||||
['[>]tx_gutachten_orientierung' => ['tx_gutachten_raume_basis.tt_orientierung_id' => 'id']],
|
||||
[
|
||||
'tx_gutachten_raume_basis.id',
|
||||
'tx_gutachten_raume_basis.topNr',
|
||||
'tx_gutachten_raume_basis.GNO',
|
||||
'tx_gutachten_raume_basis.qmM1',
|
||||
'tx_gutachten_raume_basis.factor',
|
||||
'tx_gutachten_raume_basis.noDispInOrientierung (nodspl)',
|
||||
'tx_gutachten_orientierung.orientierung',
|
||||
],
|
||||
[
|
||||
'tx_gutachten_raume_basis.pid' => $projektid,
|
||||
'ORDER' => 'tx_gutachten_raume_basis.topNr',
|
||||
]
|
||||
);
|
||||
// $fields = 'a.id, a.topNr, a.GNO, a.qmM1, a.factor, a.noDispInOrientierung nodspl, b.orientierung';
|
||||
// $from = 'tx_gutachten_raume_basis a,tx_gutachten_orientierung b';
|
||||
// $where = 'a.tt_orientierung_id=b.id and a.pid = '.$projektid;
|
||||
// $order = 'topNr';
|
||||
// // echo $GLOBALS['TYPO3_DB']->SELECTquery($fields, $from, $where); exit;
|
||||
// return $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $from, $where, '', $order);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class OrientierungProjekt
|
||||
{
|
||||
// active projekte für user
|
||||
public static function select($projekt_id)
|
||||
{
|
||||
$fields = 'a.id,a.pid,a.topNr,a.typ,a.tt_orientierung_id,b.orientierung,a.noDispInOrientierung,a.a,a.b,a.c,a.d,a.e,a.f,a.g,a.h,a.i,a.j,a.k,a.l,a.m,a.n,a.o,a.p,a.q,a.r,a.s,a.t,a.u,a.summe_az,a.bewertung,a.notizen';
|
||||
$from = 'tx_gutachten_raume_basis a, tx_gutachten_orientierung b';
|
||||
$where = "a.pid=$projekt_id AND a.tt_orientierung_id=b.id";
|
||||
// echo $GLOBALS['TYPO3_DB']->SELECTquery($fields, $from, $where);exit;
|
||||
// return $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $from, $where);
|
||||
|
||||
return DbFunction::query("SELECT $fields FROM $from WHERE $where");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class Paragraph62
|
||||
{
|
||||
// active projekte für user
|
||||
public static function select($projekt_id)
|
||||
{
|
||||
// kennung kopf txt kontaktperson email telefon editor timestamp
|
||||
// DbFunction::$debug = 1;
|
||||
|
||||
return DbFunction::selectJoin(
|
||||
'tx_gutachten_raume_basis',
|
||||
['[>]tx_gutachten_orientierung' => ['tx_gutachten_raume_basis.tt_orientierung_id' => 'id'],
|
||||
'[>]tx_gutachten_raume_all' => ['tx_gutachten_raume_basis.id' => 'tt_raume_basis_id']],
|
||||
[
|
||||
// 'tx_gutachten_raume_basis.id',
|
||||
'tx_gutachten_raume_basis.topNr',
|
||||
'tx_gutachten_raume_all.geschoss',
|
||||
'tx_gutachten_orientierung.orientierung',
|
||||
'tx_gutachten_raume_basis.typ',
|
||||
// 'tx_gutachten_raume_basis.qmM1uM2bis(nzfl)',
|
||||
// 'tx_gutachten_raume_basis.noDispInOrientierung',
|
||||
// 'tx_gutachten_raume_all.qm(nzfl_apg)',
|
||||
],
|
||||
[
|
||||
'AND' => [
|
||||
'tx_gutachten_raume_all.tt_raumart_id' => [1,5,6,9],
|
||||
'tx_gutachten_raume_basis.pid' => $projekt_id
|
||||
],
|
||||
'GROUP' => ['tx_gutachten_raume_all.tt_raume_basis_id'],
|
||||
'ORDER' => ['tx_gutachten_raume_all.tt_raumart_id' => 'ASC','tx_gutachten_raume_basis.topNr' => 'ASC']
|
||||
]
|
||||
);
|
||||
|
||||
// print_r($res);
|
||||
// exit;
|
||||
// $fields = 'a.id, a.topNr, a.typ, a.qmM1uM2bis AS nzfl, a.noDispInOrientierung, b.orientierung, c.geschoss, c.qm AS nzfl_apg';
|
||||
// $from = 'tx_gutachten_raume_basis a, tx_gutachten_orientierung b, tx_gutachten_raume_all c';
|
||||
// $where = 'a.tt_orientierung_id=b.id and a.id=c.tt_raume_basis_id and c.tt_raumart_id IN (1,5,6,9) and a.pid = '.$projekt_id;
|
||||
// $group = 'c.tt_raume_basis_id';
|
||||
// $order = 'c.tt_raumart_id, a.topNr';
|
||||
// echo $GLOBALS['TYPO3_DB']->SELECTquery($fields, $from, $where, $group, $order);exit;
|
||||
// return $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $from, $where, $group, $order);
|
||||
// return DbFunction::query("SELECT $fields FROM $from WHERE $where GROUP BY $group ORDER BY $order");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class Platzhalter
|
||||
{
|
||||
public static function select($projektid)
|
||||
{
|
||||
return DbFunction::select(
|
||||
'tx_gutachten_projekteplatzhalter',
|
||||
['code', 'txt'],
|
||||
['pid' => $projektid]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use HermannTelser\Gutachten\Utility\Helper;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
***/
|
||||
|
||||
class ProjektAllgemeinAlle
|
||||
{
|
||||
public static function select()
|
||||
{
|
||||
// DbFunction::$debug = 1;
|
||||
|
||||
$projektid = GeneralUtility::_GP('id');
|
||||
$arr = DbFunction::select('tx_gutachten_allgemein', '*', ['pid' => $projektid]);
|
||||
$arr = Helper::make_int($arr, ['id','pid','uid']);
|
||||
$arr = Helper::format_double($arr, ['qm'], 2);
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Gutachten\Eid\TxGutachten;
|
||||
|
||||
class ProjektClone
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function clone()
|
||||
{
|
||||
TxGutachten::$debug = 0;
|
||||
|
||||
$userid = $GLOBALS['TSFE']->fe_user->user['uid'];
|
||||
$projekt_id = GeneralUtility::_GP('id');
|
||||
if (!is_numeric($projekt_id)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$_projekte = Select::projekte($projekt_id);
|
||||
|
||||
if (!isset($_projekte[0])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$_new_projekte = $_projekte[0];
|
||||
|
||||
unset($_new_projekte['id']);
|
||||
unset($_new_projekte['gutachter']);
|
||||
unset($_new_projekte['auftraggeber']);
|
||||
unset($_new_projekte['active']);
|
||||
$_new_projekte['uid'] = $userid;
|
||||
$_new_projekte['intname'] .= ' (Kopie)';
|
||||
$_new_projekte['beschreibung'] = 'KOPIE! '.$_new_projekte['beschreibung'];
|
||||
$_new_projekte['erstelldatum'] = time();
|
||||
$new_projekt_id = DbFunction::secureInsert('tx_gutachten_projekte', $_new_projekte);
|
||||
|
||||
$_table_to_copy = ['tx_gutachten_projekteplatzhalter', 'tx_gutachten_projektestandards', 'tx_gutachten_allgemein', 'tx_gutachten_help', 'tx_gutachten_raume_generell'];
|
||||
|
||||
foreach ($_table_to_copy as $key => $table) {
|
||||
$_data = DbFunction::select($table, '*', ['pid' => $projekt_id]);
|
||||
foreach ($_data as $key => $value) {
|
||||
unset($value['id']);
|
||||
$value['pid'] = $new_projekt_id;
|
||||
DbFunction::secureInsert($table, $value);
|
||||
}
|
||||
}
|
||||
|
||||
$_data = DbFunction::select('tx_gutachten_raume_basis', '*', ['pid' => $projekt_id]);
|
||||
$_basis_ids = [];
|
||||
foreach ($_data as $key => $value) {
|
||||
$id = $value['id'];
|
||||
unset($value['id']);
|
||||
|
||||
$value['pid'] = $new_projekt_id;
|
||||
$_basis_ids[$id] = DbFunction::secureInsert('tx_gutachten_raume_basis', $value);
|
||||
}
|
||||
|
||||
$_data = DbFunction::select('tx_gutachten_raume_all', '*', ['pid' => $projekt_id]);
|
||||
foreach ($_data as $key => $value) {
|
||||
unset($value['id']);
|
||||
$value['pid'] = $new_projekt_id;
|
||||
|
||||
$tt_raume_basis_id = $value['tt_raume_basis_id'];
|
||||
$value['tt_raume_basis_id'] = $_basis_ids[$tt_raume_basis_id];
|
||||
|
||||
DbFunction::secureInsert('tx_gutachten_raume_all', $value);
|
||||
}
|
||||
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class Projekte
|
||||
{
|
||||
public static function projekt_standards($id)
|
||||
{
|
||||
// $fields = 'a.*, b.txt textart';
|
||||
// $from = 'tx_gutachten_projektestandards a, tx_gutachten_textart b';
|
||||
// $where = "a.textart_id=b.id and a.pid=$projekt_id";
|
||||
// return $GLOBALS['TYPO3_DB']->SELECTquery($fields, $from, $where, "", "pos");
|
||||
// return $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $from, $where, '', 'pos');
|
||||
|
||||
$where = [];
|
||||
if ($id) {
|
||||
$where['tx_gutachten_projektestandards.pid'] = $id;
|
||||
}
|
||||
$join = [];
|
||||
$join['[>]tx_gutachten_textart']['tx_gutachten_projektestandards.textart_id'] = 'id';
|
||||
|
||||
$fields = [
|
||||
'tx_gutachten_projektestandards.id',
|
||||
'tx_gutachten_projektestandards.textart_id',
|
||||
'tx_gutachten_projektestandards.spalten',
|
||||
'tx_gutachten_projektestandards.fontsize',
|
||||
'tx_gutachten_projektestandards.neueseite',
|
||||
'tx_gutachten_projektestandards.kennung',
|
||||
'tx_gutachten_projektestandards.titel',
|
||||
'tx_gutachten_projektestandards.txt',
|
||||
'tx_gutachten_projektestandards.platzhalter',
|
||||
'tx_gutachten_textart.txt(textart)',
|
||||
];
|
||||
|
||||
return DbFunction::selectJoin(
|
||||
'tx_gutachten_projektestandards',
|
||||
$join,
|
||||
$fields,
|
||||
$where
|
||||
);
|
||||
}
|
||||
|
||||
public static function standards()
|
||||
{
|
||||
// $fields = 'a.*, b.txt textart';
|
||||
// $from = 'tx_gutachten_standards a, tx_gutachten_textart b';
|
||||
// $where = 'a.textart_id=b.id';
|
||||
// // return $GLOBALS['TYPO3_DB']->SELECTquery($fields, $from, $where, "", "pos");
|
||||
// return $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $from, $where, '', 'pos');
|
||||
|
||||
$join = [];
|
||||
$join['[>]tx_gutachten_textart']['tx_gutachten_standards.textart_id'] = 'id';
|
||||
|
||||
$fields = [
|
||||
'tx_gutachten_standards.id',
|
||||
'tx_gutachten_standards.textart_id',
|
||||
'tx_gutachten_standards.spalten',
|
||||
'tx_gutachten_standards.fontsize',
|
||||
'tx_gutachten_standards.neueseite',
|
||||
'tx_gutachten_standards.kennung',
|
||||
'tx_gutachten_standards.titel',
|
||||
'tx_gutachten_standards.txt',
|
||||
'tx_gutachten_standards.platzhalter',
|
||||
'tx_gutachten_textart.txt(textart)',
|
||||
];
|
||||
|
||||
return DbFunction::selectJoin(
|
||||
'tx_gutachten_standards',
|
||||
$join,
|
||||
$fields
|
||||
);
|
||||
}
|
||||
|
||||
public static function standards_alle()
|
||||
{
|
||||
$arr = self::standards();
|
||||
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['id'] = (int) $value['id'];
|
||||
$arr[$key]['pos'] = (int) $value['pos'] / 10;
|
||||
$arr[$key]['textart'] = ucwords($value['textart']);
|
||||
$arr[$key]['neueseite'] = (int) $value['neueseite'];
|
||||
$arr[$key]['all'] = \count($arr);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
***/
|
||||
|
||||
class ProjekteSetActive
|
||||
{
|
||||
public static function set()
|
||||
{
|
||||
$projectid = GeneralUtility::_GP('id');
|
||||
$userid = $GLOBALS['TSFE']->fe_user->user['uid'];
|
||||
|
||||
$has = DbFunction::has('tx_gutachten_freigabe', ['AND' => ['userid' => $userid, 'projektid' => $projectid]]);
|
||||
|
||||
if (!$has) {
|
||||
$value_array = [];
|
||||
$value_array['userid'] = $userid;
|
||||
$value_array['projektid'] = $projectid;
|
||||
|
||||
DbFunction::secureInsert('tx_gutachten_freigabe', $value_array);
|
||||
|
||||
echo 1;
|
||||
} else {
|
||||
$active = DbFunction::delete('tx_gutachten_freigabe', ['AND' => ['userid' => $userid, 'projektid' => $projectid]]);
|
||||
|
||||
echo 0;
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
***/
|
||||
|
||||
class ProjekteSetStatus
|
||||
{
|
||||
public static function set()
|
||||
{
|
||||
$id = GeneralUtility::_GP('id');
|
||||
$value = GeneralUtility::_GP('value');
|
||||
DbFunction::secureUpdate('tx_gutachten_projekte', ['value' => $value], ['id' => $id]);
|
||||
echo $value;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
***/
|
||||
|
||||
class ProjekteStammdatenEinzeln
|
||||
{
|
||||
public static function load()
|
||||
{
|
||||
$id = GeneralUtility::_GP('id');
|
||||
if (!is_numeric($id)) {
|
||||
return [];
|
||||
}
|
||||
$tmp = Select::projekte($id);
|
||||
$_projekt = $tmp[0];
|
||||
|
||||
$_gutachter = Select::select_table('tx_gutachten_gutachter', 0, 1);
|
||||
$_auftraggeber = Select::select_table('tx_gutachten_auftraggeber', 0, 1);
|
||||
|
||||
array_unshift($_auftraggeber, ['id' => 0, 'kennung' => 'Auftraggeber auswählen']);
|
||||
$auftraggeber_options = '';
|
||||
foreach ($_auftraggeber as $auftraggeber_id => $value) {
|
||||
if ($auftraggeber_id == $_projekt['auftraggeber_id']) {
|
||||
$auftraggeber_options .= '<option value="'.$auftraggeber_id.'" selected="selected"><span>'.$value['kennung'].'</span></option>';
|
||||
} else {
|
||||
$auftraggeber_options .= '<option value="'.$auftraggeber_id.'"><span>'.$value['kennung'].'</span></option>';
|
||||
}
|
||||
}
|
||||
|
||||
array_unshift($_gutachter, ['id' => 0, 'kennung' => 'Gutachter auswählen!']);
|
||||
$gutachter_options = '';
|
||||
foreach ($_gutachter as $gutachter_id => $value) {
|
||||
if ($gutachter_id == $_projekt['gutachter_id']) {
|
||||
$gutachter_options .= '<option value="'.$gutachter_id.'" selected="selected">'.$value['kennung'].'</option>';
|
||||
} else {
|
||||
$gutachter_options .= '<option value="'.$gutachter_id.'">'.$value['kennung'].'</option>';
|
||||
}
|
||||
}
|
||||
|
||||
$error_auftraggeber = 0 == $_projekt['auftraggeber_id'] ? ' error ' : '';
|
||||
$error_gutachter = 0 == $_projekt['gutachter_id'] ? ' error ' : '';
|
||||
|
||||
$myform = '
|
||||
<table class="pure-table nutzwert-table">
|
||||
<tr>
|
||||
<td class="nutzwert-td" style="height:34px;">
|
||||
<label for="projekt">ID:</label>
|
||||
</td>
|
||||
<td class="nutzwert-td">
|
||||
'.$_projekt['id'].'
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nutzwert-td" style="height:34px;">
|
||||
<label for="projekt">Name:</label>
|
||||
</td>
|
||||
<td class="nutzwert-td" style="height:34px;">
|
||||
<input type="text" class="stammdaten_cellsize" id="projekt" name="projekt" required="true" value="'.$_projekt['name'].'" data-dojo-type="dijit/form/TextBox" data-dojo-props="onChange:function(){update_projekt_item(\'name\',arguments[0])}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nutzwert-td" style="height:34px;">
|
||||
<label for="intprojekt">Interner Name:</label>
|
||||
</td>
|
||||
<td class="nutzwert-td">
|
||||
<input type="text" class="stammdaten_cellsize" id="intprojekt" name="intprojekt" required="true" value="'.$_projekt['intname'].'" data-dojo-type="dijit/form/TextBox" data-dojo-type="dijit/form/TextBox" data-dojo-props="onChange:function(){update_projekt_item(\'intname\',arguments[0])}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nutzwert-td" style="height:34px;">
|
||||
<label for="erstellung">Erstellt am:</label>
|
||||
</td>
|
||||
<td class="nutzwert-td">
|
||||
<input type="text" class="stammdaten_cellsize" id="erstellung" name="erstellung" required="true" value="'.$_projekt['erstellung'].'" data-dojo-type="dijit/form/TextBox" data-dojo-type="dijit/form/TextBox" data-dojo-props="onChange:function(){update_projekt_item(\'erstellung\',arguments[0])}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nutzwert-td" style="height:34px;">
|
||||
<label for="auftraggeber_id">Auftraggeber:</label>
|
||||
</td>
|
||||
<td class="nutzwert-td">
|
||||
<select class="stammdaten_cellsize_select '.$error_auftraggeber.'" id="auftraggeber_id" name="auftraggeber_id" data-dojo-type="dijit/form/Select" data-dojo-props="onChange:function(){update_projekt_item(\'auftraggeber_id\',arguments[0])}"/>
|
||||
'.$auftraggeber_options.'
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nutzwert-td" style="height:34px;">
|
||||
<label for="gutachter_id">Gutachter:</label>
|
||||
</td>
|
||||
<td class="nutzwert-td">
|
||||
<select class="stammdaten_cellsize_select '.$error_gutachter.'" id="gutachter_id" name="gutachter_id" data-dojo-type="dijit/form/Select" data-dojo-props="onChange:function(){update_projekt_item(\'gutachter_id\',arguments[0])}"/>
|
||||
'.$gutachter_options.'
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="nutzwert-td" style="height:34px;">
|
||||
<label for="nwbStartSeite">Nutzwerte Startseite:</label>
|
||||
</td>
|
||||
<td class="nutzwert-td">
|
||||
<input type="text" class="stammdaten_cellsize" id="nwbStartSeite" name="nwbStartSeite" required="true" value="'.$_projekt['nwbStartSeite'].'" data-dojo-type="dijit/form/TextBox" data-dojo-type="dijit/form/TextBox" data-dojo-props="onChange:function(){update_projekt_item(\'nwbStartSeite\',arguments[0])}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
';
|
||||
echo $myform;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,321 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
// composer dump-autoload -o
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class Select
|
||||
{
|
||||
public static function select_table($table, $select_id = 0, $_id_as_key = 0, $_casting = [])
|
||||
{
|
||||
if ($select_id) {
|
||||
$tmp = DbFunction::select($table, '*', ['id' => $select_id]);
|
||||
} else {
|
||||
$tmp = DbFunction::select($table, '*');
|
||||
}
|
||||
|
||||
$arr = [];
|
||||
|
||||
foreach ($tmp as $key => $value) {
|
||||
$value['id'] = (int) $value['id'];
|
||||
|
||||
foreach ($_casting as $field => $cast) {
|
||||
if ($key == $field) {
|
||||
switch ($cast) {
|
||||
case 'int':
|
||||
$value[$key] = (int) $value[$key];
|
||||
break;
|
||||
case 'double':
|
||||
$value[$key] = (float) $value[$key];
|
||||
break;
|
||||
case 'string':
|
||||
$value[$key] = (string) $value[$key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($_id_as_key) {
|
||||
$arr[$value['id']] = $value;
|
||||
} else {
|
||||
$arr[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
// $sql = "SELECT a.*, b.zunutzwert FROM tt_raume_all a, tt_raume_generell b
|
||||
// WHERE a.tt_raumart_id IN (2,8)
|
||||
// AND a.tt_raume_basis_id = $tt_raume_basis_id
|
||||
// AND a.raum=b.raum
|
||||
// AND a.pid = $pid
|
||||
// AND b.pid = $pid
|
||||
// ORDER BY a.raum";
|
||||
|
||||
|
||||
public static function orientierung_select()
|
||||
{
|
||||
$_orientierung = DbFunction::select('tx_gutachten_orientierung', ['id', 'orientierung'], ['ORDER' => 'sortierung']);
|
||||
$arr = [];
|
||||
foreach ($_orientierung as $key => $value) {
|
||||
$tmp = [];
|
||||
$tmp['id'] = $value['orientierung'];
|
||||
$tmp['orientierung'] = $value['orientierung'];
|
||||
$tmp['label'] = '<span class="dijitReset dijitMenuItem select_orientierung">'.$value['orientierung'].'</span>';
|
||||
$arr[] = $tmp;
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public static function projekte($projektid = 0)
|
||||
{
|
||||
$mode = GeneralUtility::_GP('mode');
|
||||
|
||||
$_gutachter = self::select_table('tx_gutachten_gutachter', 0, 1);
|
||||
$_auftraggeber = self::select_table('tx_gutachten_auftraggeber', 0, 1);
|
||||
$_active = self::projekte_active_user();
|
||||
|
||||
$_projekte = self::select_table('tx_gutachten_projekte', $projektid);
|
||||
|
||||
$arr = [];
|
||||
foreach ($_projekte as $key => $value) {
|
||||
$value['gutachter'] = $_gutachter[$value['gutachter_id']]['kennung'];
|
||||
$value['auftraggeber'] = $_auftraggeber[$value['auftraggeber_id']]['kennung'];
|
||||
$value['active'] = \in_array($value['id'], $_active) ? 1 : 0;
|
||||
$arr[] = $value;
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public static function aufstellung()
|
||||
{
|
||||
return self::select_table('tx_gutachten_aufstellung');
|
||||
}
|
||||
|
||||
|
||||
public static function text_art()
|
||||
{
|
||||
$result = DbFunction::select('tx_gutachten_textart', ['id', 'txt'],[ 'ORDER' => 'id']);
|
||||
$arr = [];
|
||||
$arr[0]['id'] = (int) 0;
|
||||
$arr[0]['name'] = "0 - Bitte Wählen";
|
||||
foreach ($result as $key => $value) {
|
||||
$id = (int) $value['id'];
|
||||
$arr[$id]['id'] = $id;
|
||||
$arr[$id]['name'] = $id . " - " . ucwords($value['txt']);
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public static function projekte_active_user()
|
||||
{
|
||||
return DbFunction::select('tx_gutachten_freigabe', 'projektid', ['userid' => $GLOBALS['TSFE']->fe_user->user['uid']]);
|
||||
}
|
||||
|
||||
|
||||
public static function raume_all($projektid, $tt_raume_basis_id, $tt_raumart_id, $out=0, $in=0)
|
||||
{
|
||||
/**
|
||||
* Exepiton (in/out) info in mail from 08.01.2025 from Marie
|
||||
* Fragestellung ist folgende:
|
||||
* beim WE-Objekt KIGA (Kindergarten) gibt es einen Raum „Garten-Lager EG", der nur über den Garten EG erreicht wird.
|
||||
* Der Garten ist ein Zubehör-Objekt zum KIGA (Methode 4).
|
||||
* Der Raum „Garten-Lager EG“ soll nun dem Garten zugeordnet werden (quasi als Zuschlag zum Zubehör), und darunter angeführt werden.
|
||||
* Siehe Anhang pdf auf Seite 15. (attachment in email)
|
||||
* */
|
||||
|
||||
$where = [];
|
||||
$where['AND']['pid'] = $projektid;
|
||||
$where['AND']['tt_raume_basis_id'] = $tt_raume_basis_id;
|
||||
if ($in) {
|
||||
$where['AND']['OR']['id'] = [$in];
|
||||
$where['AND']['OR']['tt_raumart_id'] = $tt_raumart_id;
|
||||
}
|
||||
else if ($out) {
|
||||
$where['AND']['tt_raumart_id'] = $tt_raumart_id;
|
||||
$where['AND']['id[!]'] = [$out];
|
||||
}
|
||||
else {
|
||||
$where['AND']['tt_raumart_id'] = $tt_raumart_id;
|
||||
}
|
||||
$where['ORDER']['raum'] = 'ASC';
|
||||
// if($in){
|
||||
// $res = DbFunction::select(
|
||||
// 'tx_gutachten_raume_all',
|
||||
// '*',
|
||||
// $where
|
||||
// );
|
||||
// print_r($res);
|
||||
// exit;
|
||||
// }
|
||||
|
||||
return DbFunction::select(
|
||||
'tx_gutachten_raume_all',
|
||||
'*',
|
||||
$where
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public static function methoden_by_raumart($raumart)
|
||||
{
|
||||
$tmp = DbFunction::select('tx_gutachten_raumart', 'id', ['raumart' => $raumart]);
|
||||
if (isset($tmp[0]['id'])) {
|
||||
return $tmp[0]['id'];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function raeume_alle_orientierung($projektid)
|
||||
{
|
||||
// DbFunction::$debug = 1;
|
||||
|
||||
$res = DbFunction::select('tx_gutachten_orientierung', ['id', 'orientierung'], ['ORDER' => 'sortierung']);
|
||||
$map = [];
|
||||
foreach ($res as $field => $value) {
|
||||
$map[$value['id']] = $value['orientierung'];
|
||||
}
|
||||
|
||||
// $basis_stellplaetze = DbFunction::select('tx_gutachten_raume_all', 'tt_raume_basis_id', ['pid' => $projektid, 'raum' => ['Stellplatz+', 'Stellplatz']]);
|
||||
$arr = DbFunction::select('tx_gutachten_raume_basis', '*', ['pid' => $projektid, 'noDispInOrientierung' => 0, 'ORDER' => 'topNr']);
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['orientierung'] = $map[$value['tt_orientierung_id']];
|
||||
}
|
||||
|
||||
// $_range = range("a","u");
|
||||
foreach ($arr as $key => $value) {
|
||||
// foreach ($_range as $k => $char) {
|
||||
// $arr[$key][$char] = (double) $value[$char];
|
||||
// }
|
||||
$arr[$key]['id'] = (int) $value['id'];
|
||||
$arr[$key]['pid'] = (int) $value['pid'];
|
||||
$arr[$key]['uid'] = (int) $value['uid'];
|
||||
$arr[$key]['GNO'] = (int) $value['GNO'];
|
||||
$arr[$key]['tt_orientierung_id'] = (int) $value['tt_orientierung_id'];
|
||||
$arr[$key]['noDispInOrientierung'] = (int) $value['noDispInOrientierung'];
|
||||
// $arr[$key]['bewertung'] = (double) $value['bewertung'];
|
||||
// $arr[$key]['factor'] = (double) $value['factor'];
|
||||
// $arr[$key]['qmM1'] = (double) $value['qmM1'];
|
||||
// $arr[$key]['qmM1uM2'] = (double) $value['qmM1uM2'];
|
||||
// $arr[$key]['qmM1uM2bis'] = (double) $value['qmM1uM2bis'];
|
||||
// $arr[$key]['NWM1uM2'] = (double) $value['NWM1uM2'];
|
||||
// $arr[$key]['qmM1uM2'] = (double) $value['qmM1uM2'];raume_all
|
||||
// $arr[$key]['summe_az'] = (double) $value['summe_az'];
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public static function raume_basis()
|
||||
{
|
||||
// $fields = ' a.id,
|
||||
// a.topNr,
|
||||
// b.geschoss,
|
||||
// a.typ,
|
||||
// 0 as nutzflaeche,
|
||||
// 0 as logia,
|
||||
// 0 as gesammtnutzflaeche,
|
||||
// '.$title_list.',
|
||||
// a.summe_az,
|
||||
// a.bewertung';
|
||||
//
|
||||
// $from = 'tx_gutachten_raume_basis a, tx_gutachten_raume_all b';
|
||||
// $where = 'b.tt_raume_basis_id = a.id';
|
||||
// $where .= " and a.noDispInOrientierung=0 and b.tt_raumart_id = 1 and a.pid = $projektid";
|
||||
|
||||
$_fields = [
|
||||
'tx_gutachten_raume_basis.id',
|
||||
'tx_gutachten_raume_basis.topNr',
|
||||
'tx_gutachten_raume_basis.typ',
|
||||
'tx_gutachten_raume_basis.summe_az',
|
||||
'tx_gutachten_raume_basis.bewertung',
|
||||
'tx_gutachten_raume_all.geschoss',
|
||||
];
|
||||
|
||||
$_titles = DbFunction::select('tx_gutachten_help', 'colid', ['pid' => $projektid]);
|
||||
foreach ($_titles as $key => $colid) {
|
||||
$_fields[] = 'tx_gutachten_raume_basis.'.$colid;
|
||||
}
|
||||
|
||||
$arr = DbFunction::selectJoin(
|
||||
'tx_gutachten_raume_basis',
|
||||
['[>]tx_gutachten_raume_all' => ['tx_gutachten_raume_basis.id' => 'tt_raume_basis_id']],
|
||||
$_fields,
|
||||
[
|
||||
'tx_gutachten_raume_basis.pid' => 17,
|
||||
'GROUP' => 'tx_gutachten_raume_basis.id',
|
||||
'ORDER' => ['tx_gutachten_raume_basis.topNr' => 'DESC'],
|
||||
]
|
||||
);
|
||||
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['nutzflaeche'] = 0;
|
||||
$arr[$key]['logia'] = 0;
|
||||
$arr[$key]['gesammtnutzflaeche'] = 0;
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public static function orientierung_typen_column_einzel()
|
||||
{
|
||||
$projektid = GeneralUtility::_GP('id');
|
||||
|
||||
if (!is_numeric($projektid)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$arr = DbFunction::select('tx_gutachten_help', ['id', 'colid', 'coltitel'], ['pid' => $projektid, 'ORDER' => 'colid']);
|
||||
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['id'] = (int) $value['id'];
|
||||
$arr[$key]['pos'] = (int) $key + 1;
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
public static function platzhalter($projektid)
|
||||
{
|
||||
$arr = Projekte::projekt_standards($projektid);
|
||||
|
||||
$_platzhalter = [];
|
||||
foreach ($arr as $key => $value) {
|
||||
preg_match_all('/###(.*)###/U', $value['txt'], $pat_array);
|
||||
$_platzhalter = array_merge($_platzhalter, $pat_array[0]);
|
||||
}
|
||||
$_platzhalter = array_unique($_platzhalter);
|
||||
|
||||
DbFunction::delete('tx_gutachten_projekteplatzhalter', ['AND' => ['pid' => $projektid, 'code[!]' => $_platzhalter]]);
|
||||
|
||||
foreach ($_platzhalter as $key => $code) {
|
||||
$arr = DbFunction::select('tx_gutachten_projekteplatzhalter', ['id', 'code', 'txt'], ['AND' => ['pid' => $projektid, 'code' => $code]]);
|
||||
if (0 == \count($arr)) {
|
||||
$_value_array = [];
|
||||
$_value_array['code'] = $code;
|
||||
$_value_array['pid'] = $projektid;
|
||||
DbFunction::secureInsert('tx_gutachten_projekteplatzhalter', $_value_array);
|
||||
} elseif (\count($arr) > 1) {
|
||||
foreach ($arr as $key => $value) {
|
||||
if ($key > 0) {
|
||||
DbFunction::delete('tx_gutachten_projekteplatzhalter', ['id' => $value['id']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$arr = DbFunction::select('tx_gutachten_projekteplatzhalter', ['id', 'code', 'txt'], ['AND' => ['pid' => $projektid, 'code' => $_platzhalter]]);
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['code'] = html_entity_decode($value['code']);
|
||||
$arr[$key]['txt'] = html_entity_decode($value['txt']);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class Standards
|
||||
{
|
||||
public static function projekt_standards($id)
|
||||
{
|
||||
// $fields = 'a.*, b.txt textart';
|
||||
// $from = 'tx_gutachten_projektestandards a, tx_gutachten_textart b';
|
||||
// $where = "a.textart_id=b.id and a.pid=$projekt_id";
|
||||
// return $GLOBALS['TYPO3_DB']->SELECTquery($fields, $from, $where, "", "pos");
|
||||
// return $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $from, $where, '', 'pos');
|
||||
|
||||
$where = ['ORDER' => 'pos'];
|
||||
if ($id) {
|
||||
$where['tx_gutachten_projektestandards.pid'] = $id;
|
||||
}
|
||||
$join = [];
|
||||
$join['[>]tx_gutachten_textart']['tx_gutachten_projektestandards.textart_id'] = 'id';
|
||||
|
||||
$fields = [
|
||||
'tx_gutachten_projektestandards.id',
|
||||
'tx_gutachten_projektestandards.pos',
|
||||
'tx_gutachten_projektestandards.textart_id',
|
||||
'tx_gutachten_projektestandards.spalten',
|
||||
'tx_gutachten_projektestandards.fontsize',
|
||||
'tx_gutachten_projektestandards.neueseite',
|
||||
'tx_gutachten_projektestandards.kennung',
|
||||
'tx_gutachten_projektestandards.titel',
|
||||
'tx_gutachten_projektestandards.txt',
|
||||
'tx_gutachten_projektestandards.platzhalter',
|
||||
'tx_gutachten_textart.txt(textart)',
|
||||
];
|
||||
|
||||
return DbFunction::selectJoin(
|
||||
'tx_gutachten_projektestandards',
|
||||
$join,
|
||||
$fields,
|
||||
$where
|
||||
);
|
||||
}
|
||||
|
||||
public static function standards()
|
||||
{
|
||||
// $fields = 'a.*, b.txt textart';
|
||||
// $from = 'tx_gutachten_standards a, tx_gutachten_textart b';
|
||||
// $where = 'a.textart_id=b.id';
|
||||
// // return $GLOBALS['TYPO3_DB']->SELECTquery($fields, $from, $where, "", "pos");
|
||||
// return $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($fields, $from, $where, '', 'pos');
|
||||
|
||||
$join = [];
|
||||
$join['[>]tx_gutachten_textart']['tx_gutachten_standards.textart_id'] = 'id';
|
||||
|
||||
$fields = [
|
||||
'tx_gutachten_standards.id',
|
||||
'tx_gutachten_standards.textart_id',
|
||||
'tx_gutachten_standards.spalten',
|
||||
'tx_gutachten_standards.fontsize',
|
||||
'tx_gutachten_standards.neueseite',
|
||||
'tx_gutachten_standards.kennung',
|
||||
'tx_gutachten_standards.titel',
|
||||
'tx_gutachten_standards.txt',
|
||||
'tx_gutachten_standards.platzhalter',
|
||||
'tx_gutachten_textart.txt(textart)',
|
||||
];
|
||||
|
||||
return DbFunction::selectJoin(
|
||||
'tx_gutachten_standards',
|
||||
$join,
|
||||
$fields,
|
||||
['ORDER' => 'pos']
|
||||
);
|
||||
}
|
||||
|
||||
public static function standards_alle()
|
||||
{
|
||||
$arr = self::standards();
|
||||
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['id'] = (int) $value['id'];
|
||||
$arr[$key]['pos'] = (int) $key;
|
||||
$arr[$key]['textart'] = ucwords($value['textart']);
|
||||
$arr[$key]['neueseite'] = (int) $value['neueseite'];
|
||||
$arr[$key]['all'] = \count($arr);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class StandardsAdd
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function add($projektid)
|
||||
{
|
||||
|
||||
// DbFunction::$debug = 1;
|
||||
|
||||
if (!is_numeric($projektid)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$_value_array = [];
|
||||
$_value_array['pid'] = $projektid;
|
||||
$_value_array['pos'] = 3000;
|
||||
$_value_array['kennung'] = "FEHLT!";
|
||||
$_value_array['titel'] = "FEHLT!";
|
||||
DbFunction::secureInsert('tx_gutachten_projektestandards', $_value_array);
|
||||
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
|
||||
class StandardsEinzeln
|
||||
{
|
||||
/**
|
||||
* @param mixed $id
|
||||
* @param mixed $projektid
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function load($projektid)
|
||||
{
|
||||
DbFunction::$debug = 0;
|
||||
|
||||
$arr = DbFunction::select('tx_gutachten_projektestandards', '*', ['pid' => $projektid, 'ORDER' => 'pos']);
|
||||
|
||||
if (0 == \count($arr)) {
|
||||
$arr = Standards::standards();
|
||||
|
||||
foreach ($arr as $key => $value) {
|
||||
unset($value['id']);
|
||||
unset($value['textart']);
|
||||
$value['pid'] = $projektid;
|
||||
$value_array = [];
|
||||
$value_array = $value;
|
||||
|
||||
DbFunction::secureInsert('tx_gutachten_projektestandards', $value_array);
|
||||
}
|
||||
|
||||
$arr = DbFunction::select('tx_gutachten_projektestandards', '*', ['pid' => $projektid, 'ORDER' => 'pos']);
|
||||
}
|
||||
|
||||
$sum = \count($arr);
|
||||
$value_array = [];
|
||||
foreach ($arr as $key => $value) {
|
||||
$arr[$key]['all'] = $sum;
|
||||
$arr[$key]['id'] = (int) $value['id'];
|
||||
if ($value['pos'] == 0) {
|
||||
$value_array['pos'] = $key+1;
|
||||
DbFunction::secureUpdate('tx_gutachten_projektestandards', $value_array, ['id' => $value['id']]);
|
||||
$arr[$key]['pos'] = (int) $key+1;;
|
||||
} else {
|
||||
$arr[$key]['pos'] = (int) $value['pos'];
|
||||
}
|
||||
$arr[$key]['hat_platzhalter'] = false !== strpos($value['txt'], '###') ? 1 : 0;
|
||||
$arr[$key]['neueseite'] = (int) $value['neueseite'];
|
||||
$arr[$key]['textart'] = ucwords($value['textart']);
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use HermannTelser\Gutachten\DB\DbFunction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class StandardsMove
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function move()
|
||||
{
|
||||
$id = GeneralUtility::_GP('id');
|
||||
if (!is_numeric($id)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$pid = GeneralUtility::_GP('pid');
|
||||
if (!is_numeric($pid)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$dir = GeneralUtility::_GP('move');
|
||||
if (!\in_array($dir, ['first', 'up', 'down', 'last'])) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$arr = DbFunction::select('tx_gutachten_projektestandards', '*', ['pid' => $pid, 'ORDER' => 'pos']);
|
||||
|
||||
$order = [];
|
||||
foreach ($arr as $key => $value) {
|
||||
$k = $value['pos'] * 10;
|
||||
|
||||
if ($value['id'] == $id) {
|
||||
switch ($dir) {
|
||||
case 'first':
|
||||
$k = 0;
|
||||
break;
|
||||
case 'up':
|
||||
$k -= 15;
|
||||
break;
|
||||
case 'down':
|
||||
$k += 15;
|
||||
break;
|
||||
case 'last':
|
||||
$k = 3000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$order[$k] = $value;
|
||||
}
|
||||
ksort($order);
|
||||
|
||||
$i = 1;
|
||||
$update_array = [];
|
||||
foreach ($order as $key => $value) {
|
||||
$value_array['pos'] = $i;
|
||||
DbFunction::secureUpdate('tx_gutachten_projektestandards', $value_array, ['id' => $value['id']]);
|
||||
++$i;
|
||||
}
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Gutachten\DB\Select;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "NuhOdds Comparatore" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* (c) 2019 Hermann Telser <hermann.telser@gmail.com>, NUH-Odds GmbH
|
||||
*
|
||||
***/
|
||||
|
||||
class _SelectController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$arr = [];
|
||||
$projektid = GeneralUtility::_GP('id');
|
||||
switch (GeneralUtility::_GP('action')) {
|
||||
case 'orientierung_alle':
|
||||
$arr = Select::select_table('tx_gutachten_orientierung');
|
||||
break;
|
||||
case 'gutachter_alle':
|
||||
$arr = Select::select_table('tx_gutachten_gutachter');
|
||||
break;
|
||||
case 'load_methoden_projekt':
|
||||
$arr = MethodenProjekt::select();
|
||||
break;
|
||||
case 'load_methoden':
|
||||
$arr = MethodenInfo::load();
|
||||
break;
|
||||
case 'p_allgemeine_alle':
|
||||
$arr = ProjektAllgemeinAlle::select();
|
||||
break;
|
||||
case 'auftraggeber_alle':
|
||||
$arr = Auftraggeber::select();
|
||||
break;
|
||||
case 'textart_alle':
|
||||
$arr = Select::text_art();
|
||||
break;
|
||||
case 'standards_alle':
|
||||
$arr = Standards::standards_alle();
|
||||
break;
|
||||
case 'standards_einzeln':
|
||||
$arr = StandardsEinzeln::load($projektid);
|
||||
break;
|
||||
case 'standards_add':
|
||||
StandardsAdd::add($projektid);
|
||||
break;
|
||||
case 'move_position':
|
||||
StandardsMove::move();
|
||||
break;
|
||||
case 'load_orientation_for_select':
|
||||
$arr = Select::orientierung_select();
|
||||
break;
|
||||
case 'orientierung_typen_colums_einzel':
|
||||
$arr = Select::orientierung_typen_column_einzel();
|
||||
break;
|
||||
case 'orientierung_typen_einzel':
|
||||
$arr = Select::raeume_alle_orientierung($projektid);
|
||||
break;
|
||||
case 'projekte_alle':
|
||||
$arr = Select::projekte();
|
||||
break;
|
||||
case 'aufstellung_alle':
|
||||
$arr = Select::aufstellung();
|
||||
break;
|
||||
case 'p_objekte_alle':
|
||||
$arr = Objekte::select($projektid);
|
||||
break;
|
||||
case 'p_notizen_alle':
|
||||
Notizen::notizen_projekt_laden();
|
||||
break;
|
||||
case 'projekte_basis_stammdaten':
|
||||
ProjekteStammdatenEinzeln::load();
|
||||
break;
|
||||
case 'projekt_status':
|
||||
ProjekteSetStatus::set();
|
||||
break;
|
||||
case 'projekt_active':
|
||||
ProjekteSetActive::set();
|
||||
break;
|
||||
case 'projekt_clone':
|
||||
ProjektClone::clone();
|
||||
break;
|
||||
case 'load_methoden_for_select':
|
||||
$arr = Select::select_table('tx_gutachten_raumart');
|
||||
break;
|
||||
case 'platzhalter_einzeln':
|
||||
$arr = Select::platzhalter($projektid);
|
||||
break;
|
||||
case 'load_aufstellung':
|
||||
$arr = Select::aufstellung();
|
||||
break;
|
||||
default:
|
||||
Message::error(
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
'no controller switch defined'
|
||||
);
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($arr);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user