first commit
This commit is contained in:
commit
e81864e683
2984 files changed
+267797
No files matched your search
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Backend;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
|
||||
/**
|
||||
* Generate additional label for category records
|
||||
* including the title of the parent category
|
||||
*
|
||||
* @$parameters array $params
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
* \TYPO3\CMS\Core\Utility\DebugUtility::debug($wettbewerbeid);
|
||||
*
|
||||
*/
|
||||
class FixUser
|
||||
{
|
||||
public function set()
|
||||
{
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('fe_users');
|
||||
$statement = $queryBuilder
|
||||
->select('*')
|
||||
->from('fe_users')
|
||||
->where(
|
||||
$queryBuilder->expr()->neq('date_of_birth', (int) 0)
|
||||
)->execute()
|
||||
->fetchAll();
|
||||
|
||||
foreach ($statement as $key => $row) {
|
||||
$queryBuilder
|
||||
->update('fe_users')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid', (int) $row['uid'])
|
||||
)
|
||||
->set('tx_extbase_type', (string) 'Tx_Zuladungsliste_Architekten')
|
||||
->set('vereidigung', (string) date("Y-m-d", $row['date_of_birth']))
|
||||
->set('name', (string) $row['first_name'] . " " . $row['last_name'])
|
||||
->set('date_of_birth', (int) 0)
|
||||
->execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
+218
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Backend;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use HermannTelser\Zuladungsliste\Backend\FixUser;
|
||||
|
||||
/**
|
||||
* Generate additional label for category records
|
||||
* including the title of the parent category
|
||||
*
|
||||
* @$parameters array $params
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
* \TYPO3\CMS\Core\Utility\DebugUtility::debug($wettbewerbeid);
|
||||
*
|
||||
*/
|
||||
class Labels
|
||||
{
|
||||
public function loadKriterien(&$parameters, $parentObject)
|
||||
{
|
||||
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($parameters['table'], $parameters['row']['uid']);
|
||||
$newTitle = $record['bezeichnung'];
|
||||
|
||||
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('tx_zuladungsliste_domain_model_sektionstage', $record['sektinstagid'], "rwcode,bezeichnung,stichtag,kammernid");
|
||||
$parameters['title'] = $record['rwcode'] . ': ' . $newTitle;
|
||||
// $parameters['title'] = $record['rwcode'] . ': ' . $newTitle . ' (' . $record['bezeichnung'] . ' vom ' . date("d. M. y", strtotime($record['stichtag'])) . ')';
|
||||
}
|
||||
|
||||
public function loadSektionstag(&$parameters, $parentObject)
|
||||
{
|
||||
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($parameters['table'], $parameters['row']['uid']);
|
||||
$newTitle = $record['bezeichnung'];
|
||||
$newTitle .= ' (vom ' . date("d. M. y", strtotime($record['stichtag'])) . ')';
|
||||
$parameters['title'] = $newTitle;
|
||||
}
|
||||
|
||||
public function loadArchitekten(&$parameters, $parentObject)
|
||||
{
|
||||
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($parameters['table'], $parameters['row']['uid']);
|
||||
|
||||
$uid = $parameters["row"]['uid'];
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_konto_aufloesung_mm');
|
||||
$count = $queryBuilder
|
||||
->count('uid')
|
||||
->from('tx_zuladungsliste_konto_aufloesung_mm')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid_empfaenger', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))
|
||||
)->execute()
|
||||
->fetchColumn(0);
|
||||
|
||||
$company = $record['company']!=" " ? $record['company'] : '';
|
||||
if ($count) {
|
||||
$parameters['title'] = $company . ' [EMPFÄNGER]';
|
||||
} elseif ($record["kontoaufloesung_active"]>0) {
|
||||
$parameters['title'] = $company . "\n [".$record["kontoaufloesung_active"]." AUFGELÖST]";
|
||||
} else {
|
||||
$parameters['title'] = $company;
|
||||
}
|
||||
|
||||
FixUser::set();
|
||||
}
|
||||
|
||||
public function loadKriterienPunkte(&$parameters)
|
||||
{
|
||||
$kriterien_label = '';
|
||||
if (isset($parameters['options']['tx_zuladungsliste_punkte_kriterien_mm']) && is_array($parameters['options']['tx_zuladungsliste_punkte_kriterien_mm'])) {
|
||||
$kriterien_id = $parameters['row']['uid_kriterien'];
|
||||
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('tx_zuladungsliste_domain_model_kriterien', $kriterien_id);
|
||||
$kriterien_label = $record['bezeichnung'];
|
||||
|
||||
$punkte_id = $parameters['row']['uid_punkte'][0];
|
||||
$item = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('tx_zuladungsliste_domain_model_punkte', $punkte_id);
|
||||
$kriterien_label .= '<br><b>' . $item['bezeichnung'] . '</b>';
|
||||
|
||||
//\TYPO3\CMS\Core\Utility\DebugUtility::debug($parameters['row']['uid_punkte'][0]);
|
||||
|
||||
if ($parameters['row']['punkte']==1) {
|
||||
$kriterien_label .= '<br><span style="color:#3399ff; font-weight:bold;">' . $parameters['row']['punkte'] . ' Punkt';
|
||||
} else {
|
||||
$kriterien_label .= '<br><span style="color:#3399ff; font-weight:bold;">' . $parameters['row']['punkte'] . ' Punkte';
|
||||
}
|
||||
} else {
|
||||
$kriterien_label = '[Fehler!]';
|
||||
}
|
||||
$parameters['title'] = $kriterien_label;
|
||||
}
|
||||
|
||||
public function loadPunkteVerteilungs(&$parameters)
|
||||
{
|
||||
$parameters['title'] = "ERROR";
|
||||
if (isset($parameters['options']['tx_zuladungsliste_konto_aufloesung_mm']) && is_array($parameters['options']['tx_zuladungsliste_konto_aufloesung_mm'])) {
|
||||
$uid_empfaenger = $parameters['row']['uid_empfaenger'][0];
|
||||
|
||||
//\TYPO3\CMS\Core\Utility\DebugUtility::debug($uid_empfaenger);
|
||||
|
||||
$prozente = $parameters['row']['prozente'];
|
||||
|
||||
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('fe_users', $uid_empfaenger);
|
||||
|
||||
$colorclass = "zuladungsliste-kammern-".$record["kammernid"];
|
||||
|
||||
$parameters['title'] = '<span class="'.$colorclass.'">' . $record['name'];
|
||||
$parameters['title'] .= " <b>(" .$prozente. "%) </b></span>";
|
||||
}
|
||||
}
|
||||
|
||||
public function loadWettbewerbArchitekten(&$parameters)
|
||||
{
|
||||
if (isset($parameters['options']['tx_zuladungsliste_wettbewerbe_architekten_mm']) && is_array($parameters['options']['tx_zuladungsliste_wettbewerbe_architekten_mm'])) {
|
||||
if (is_array($parameters['row']['uid_wettbewerbe'])) {
|
||||
$wettbewerbe_id = (int)$parameters['row']['uid_wettbewerbe'][0];
|
||||
} else {
|
||||
$wettbewerbe_id = (int)$parameters['row']['uid_wettbewerbe'];
|
||||
}
|
||||
|
||||
if (is_array($parameters['row']['tstamp_zuordnung'])) {
|
||||
$tstamp_zuordnung = (int)$parameters['row']['tstamp_zuordnung'][0];
|
||||
} else {
|
||||
$tstamp_zuordnung =(int)$parameters['row']['tstamp_zuordnung'];
|
||||
}
|
||||
|
||||
if (is_array($parameters['row']['tstamp_aktivierung'])) {
|
||||
$tstamp_aktivierung = (int)$parameters['row']['tstamp_aktivierung'][0];
|
||||
} else {
|
||||
$tstamp_aktivierung = (int)$parameters['row']['tstamp_aktivierung'];
|
||||
}
|
||||
|
||||
|
||||
if (is_array($parameters['row']['uid_user'])) {
|
||||
$user_id = (int)$parameters['row']['uid_user'][0];
|
||||
} else {
|
||||
$user_id = (int)$parameters['row']['uid_user'];
|
||||
}
|
||||
|
||||
if (is_array($parameters['row']['uid_punkte'])) {
|
||||
$punkte_id = (int)$parameters['row']['uid_punkte'][0];
|
||||
} else {
|
||||
$punkte_id = (int)$parameters['row']['uid_punkte'];
|
||||
}
|
||||
|
||||
// echo json_encode($parameters);
|
||||
|
||||
// \TYPO3\CMS\Core\Utility\DebugUtility::debug(implode(", ",array_keys($parameters["row"])));
|
||||
// \TYPO3\CMS\Core\Utility\DebugUtility::debug(implode(", ",$parameters["row"]));
|
||||
// \TYPO3\CMS\Core\Utility\DebugUtility::debug($parameters["row"]["uid_user"],"uid_user 1: ");
|
||||
// \TYPO3\CMS\Core\Utility\DebugUtility::debug($user_id,"uid_user 2: ");
|
||||
// \TYPO3\CMS\Core\Utility\DebugUtility::debug(implode(", ",array_keys($parameters["options"])));
|
||||
// \TYPO3\CMS\Core\Utility\DebugUtility::debug($wettbewerbe_id,$punkte_id);
|
||||
|
||||
if (isset($wettbewerbe_id)) {
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe');
|
||||
$record = $queryBuilder
|
||||
->select('kriteriumid', 'wettbewerb')
|
||||
->from('tx_zuladungsliste_domain_model_wettbewerbe')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($wettbewerbe_id, \PDO::PARAM_INT))
|
||||
)->execute();
|
||||
|
||||
while ($row = $record->fetch()) {
|
||||
$kriterien_id = $row['kriteriumid'];
|
||||
$wettbewerb_label = $row['wettbewerb'];
|
||||
}
|
||||
|
||||
// \TYPO3\CMS\Core\Utility\DebugUtility::debug($record);
|
||||
// return;
|
||||
// $record = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows("kriteriumid,wettbewerb", "tx_zuladungsliste_domain_model_wettbewerbe", "uid=$wettbewerbe_id");
|
||||
|
||||
|
||||
$parameters['row']['uid'] = strpos($parameters['row']['uid'], "NEW")!==false ? "Neuer Eintrag Bitte Sichern" : $parameters['row']['uid'];
|
||||
|
||||
if ($user_id) {
|
||||
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('fe_users', $user_id);
|
||||
$wettbewerb_label .= '</b><br><span style="color:#3399ff; font-weight:bold;">' . $record['company'] . '</span>';
|
||||
}
|
||||
if ($punkte_id) {
|
||||
$tstamp_zuordnung = $tstamp_zuordnung ? date("d. M. Y", $tstamp_zuordnung) : " ";
|
||||
$tstamp_aktivierung = $tstamp_aktivierung ? date("d. M. Y", $tstamp_aktivierung) : " ";
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_punkte');
|
||||
$record = $queryBuilder
|
||||
->select('tx_zuladungsliste_domain_model_punkte.bezeichnung', 'k.uid', 'k.punkte')
|
||||
->from('tx_zuladungsliste_domain_model_punkte')
|
||||
->join(
|
||||
'tx_zuladungsliste_domain_model_punkte',
|
||||
'tx_zuladungsliste_punkte_kriterien_mm',
|
||||
'k',
|
||||
$queryBuilder->expr()->eq('k.uid_punkte', $queryBuilder->quoteIdentifier('tx_zuladungsliste_domain_model_punkte.uid'))
|
||||
)
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('k.uid_kriterien', $queryBuilder->createNamedParameter($kriterien_id, \PDO::PARAM_INT)),
|
||||
$queryBuilder->expr()->eq('k.uid_punkte', $queryBuilder->createNamedParameter($punkte_id, \PDO::PARAM_INT))
|
||||
)
|
||||
->execute();
|
||||
|
||||
while ($row = $record->fetch()) {
|
||||
$punkte = $row['punkte']==0 ? "Keine " : $row['punkte'];
|
||||
$bezeichnung = $row['bezeichnung'];
|
||||
}
|
||||
|
||||
$wettbewerb_label .= '</b><br><span style="color:#800; font-weight:bold;">' . $bezeichnung .' (' . $punkte;
|
||||
$wettbewerb_label .= $punkte==1 ? ' Punkt)</span>' : ' Punkte)</span>';
|
||||
|
||||
if ($punkte!=0) {
|
||||
$wettbewerb_label .= '<br><span class="be_punktestatus"><span>Zugeordnet am:</span>' . $tstamp_zuordnung .'</span>';
|
||||
$wettbewerb_label .= '<br><span class="be_punktestatus"><span>Freigeschaltet am:</span>' . $tstamp_aktivierung .'</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$wettbewerb_label = '[Fehler!]';
|
||||
}
|
||||
|
||||
$parameters['title'] = '<b>' . $wettbewerb_label . '</b><br><span style="color:#3399ff; font-weight:bold;">' . $kriterium_label . '</span>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Backend;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
|
||||
/**
|
||||
* Generate additional label for category records
|
||||
* including the title of the parent category
|
||||
*
|
||||
* @$parameters array $params
|
||||
* @return void
|
||||
*
|
||||
*
|
||||
* \TYPO3\CMS\Core\Utility\DebugUtility::debug($wettbewerbeid);
|
||||
*
|
||||
*/
|
||||
class Selecting
|
||||
{
|
||||
public function loadPunkte(&$parameters)
|
||||
{
|
||||
if (isset($parameters['row']['uid_wettbewerbe'][0])) {
|
||||
$wettbewerbe_id = isset($parameters['row']['uid_wettbewerbe'][0]) ? $parameters['row']['uid_wettbewerbe'][0] : $parameters['row']['uid_wettbewerbe'];
|
||||
}
|
||||
|
||||
if ($wettbewerbe_id!=0) {
|
||||
$parameters["items"][] = array('Bitte zuordnen','');
|
||||
|
||||
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('tx_zuladungsliste_domain_model_wettbewerbe', $wettbewerbe_id);
|
||||
$kriterien_id = $record['kriteriumid'];
|
||||
|
||||
if ($kriterien_id!=0) {
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_punkte');
|
||||
|
||||
$resource = $queryBuilder
|
||||
->select('tx_zuladungsliste_domain_model_punkte.bezeichnung', 'tx_zuladungsliste_domain_model_punkte.uid', 'k.punkte')
|
||||
->from('tx_zuladungsliste_domain_model_punkte')
|
||||
->join(
|
||||
'tx_zuladungsliste_domain_model_punkte',
|
||||
'tx_zuladungsliste_punkte_kriterien_mm',
|
||||
'k',
|
||||
$queryBuilder->expr()->eq('k.uid_punkte', $queryBuilder->quoteIdentifier('tx_zuladungsliste_domain_model_punkte.uid'))
|
||||
)
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('k.uid_kriterien', $queryBuilder->createNamedParameter($kriterien_id, \PDO::PARAM_INT))
|
||||
)
|
||||
->orderBy('tx_zuladungsliste_domain_model_punkte.sorting')
|
||||
->execute()
|
||||
->fetchAll();
|
||||
|
||||
foreach ($resource as $key => $row) {
|
||||
if ($row['punkte']==0) {
|
||||
$parameters["items"][] = array($row['bezeichnung'].' (Keine Punkte Zugeordnet)', $row['uid']);
|
||||
} else {
|
||||
$parameters["items"][] = array($row['bezeichnung'].' ('.$row['punkte'].' Punkte)', $row['uid']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$parameters["items"][] = array('Punkte für Kriterium fehlen','');
|
||||
}
|
||||
} else {
|
||||
$parameters["items"][] = array('Wettbewerb auswählen und speichern','');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 Architekten
|
||||
{
|
||||
/**
|
||||
* @param mixed $uid
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function load($uid = 0)
|
||||
{
|
||||
|
||||
// _Berechnung::$debug = 1;
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(__FILE__, __LINE__, 'Load Architekten');
|
||||
}
|
||||
|
||||
// 2 usergroup => Ordentliche Registrierung zur Zuladungsliste
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('fe_users');
|
||||
$queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
$queryBuilder
|
||||
->select('uid', 'disable', 'email', 'name', 'last_name', 'company', 'vereidigung', 'frauenfoerderpunkt', 'solidaritaetserklaerung', 'extrasperrung', 'kontoaufloesung', 'kontoaufloesung_active', 'wettbewerbe', 'kammernid', 'kammermitgliedsnummer', 'gender', 'date_of_birth')
|
||||
->from('fe_users')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('kammernid', (int) _Berechnung::$_config['kammernid']),
|
||||
$queryBuilder->expr()->eq('pid', (int) _Berechnung::$_config['pid']),
|
||||
$queryBuilder->expr()->eq('usergroup', (int) _Berechnung::$_config['usergroup'])
|
||||
);
|
||||
if (0 != $uid) {
|
||||
$queryBuilder->andWhere($queryBuilder->expr()->eq('uid', (int) $uid));
|
||||
}
|
||||
if (0 != _Berechnung::$_config['berechne_bis']) {
|
||||
$date = date('Y-m-d', _Berechnung::$_config['berechne_bis']);
|
||||
$queryBuilder->andWhere("vereidigung < '".$date."'");
|
||||
}
|
||||
|
||||
$statement = $queryBuilder->execute()->fetchAll();
|
||||
if (_Berechnung::$debug) {
|
||||
Message::note($queryBuilder->getSQL());
|
||||
}
|
||||
|
||||
// print_r($statement);
|
||||
// exit;
|
||||
|
||||
_Berechnung::$_data['architekten'] = $statement;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 AufloesungPunkteVerteilung
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function manage()
|
||||
{
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(__FILE__, __LINE__, 'Manage Auflösung Punkte Verteilung');
|
||||
}
|
||||
|
||||
// 2 usergroup => Ordentliche Registrierung zur Zuladungsliste
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_konto_aufloesung_mm');
|
||||
$statement = $queryBuilder
|
||||
->select('uid_geber', ' uid_empfaenger', ' prozente')
|
||||
->from('tx_zuladungsliste_konto_aufloesung_mm')
|
||||
->where(
|
||||
$queryBuilder->expr()->gt('prozente', (int) 0)
|
||||
)->execute()->fetchAll();
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::note($queryBuilder->getSQL());
|
||||
}
|
||||
|
||||
$verteiler_arr = [];
|
||||
foreach ($statement as $key => $value) {
|
||||
$uid = $value['uid_geber'];
|
||||
$verteiler_arr[$uid][] = $value;
|
||||
}
|
||||
|
||||
foreach ($verteiler_arr as $uid_geber => $empfaener_arr) {
|
||||
$frauenpunkt_abgezogen = '';
|
||||
|
||||
foreach (_Berechnung::$_data['liste'] as $key => $_value_liste) {
|
||||
if ($_value_liste['user_id'] == $uid_geber) {
|
||||
$geber_punkte = $_value_liste['punkte'];
|
||||
if ($geber_punkte > 0) {
|
||||
$geber_company = $_value_liste['company'];
|
||||
_Berechnung::$_data['liste'][$key]['company'] .= ' ( Kontoauflösung '._Berechnung::$_data['liste'][$key]['kontoaufloesung_active'].')';
|
||||
_Berechnung::$_data['liste'][$key]['punkte'] = 0;
|
||||
_Berechnung::$_data['liste'][$key]['nominiert'] = 0;
|
||||
_Berechnung::$_data['liste'][$key]['auswertung']['wettbewerbe']['punkte'] = 0;
|
||||
_Berechnung::$_data['liste'][$key]['auswertung']['neueinsteigerpunkt']['punkte'] = 0;
|
||||
if (1 == _Berechnung::$_data['liste'][$key]['auswertung']['frauenfoerderpunkt']['punkte']) {
|
||||
$frauenpunkt_abgezogen = ', Frauenförderpunkt wurde abgezogen';
|
||||
--$geber_punkte;
|
||||
}
|
||||
_Berechnung::$_data['liste'][$key]['auswertung']['frauenfoerderpunkt']['punkte'] = 0;
|
||||
|
||||
foreach ($empfaener_arr as $key => $_empfaenger) {
|
||||
$uid_empfaenger = $_empfaenger['uid_empfaenger'];
|
||||
$prozente = $_empfaenger['prozente'];
|
||||
|
||||
// SET EMPFÄNGER
|
||||
foreach (_Berechnung::$_data['liste'] as $key => $value) {
|
||||
if ($value['user_id'] == $uid_empfaenger) {
|
||||
$punkte_empf_anteil = round($geber_punkte * ($prozente / 100), 2);
|
||||
|
||||
_Berechnung::$_data['liste'][$key]['punkte'] = _Berechnung::$_data['liste'][$key]['punkte'] + $punkte_empf_anteil;
|
||||
_Berechnung::$_data['liste'][$key]['istempfaenger'] = '1';
|
||||
|
||||
_Berechnung::$_data['liste'][$key]['auswertung']['wettbewerbe']['punkte'] += $punkte_empf_anteil;
|
||||
_Berechnung::$_data['liste'][$key]['auswertung']['wettbewerbe'][] = [
|
||||
'wettbewerb' => "$prozente% von Kontoauflösung".$frauenpunkt_abgezogen,
|
||||
'verfahrensid' => '',
|
||||
'verfahrensort' => '',
|
||||
'entscheidungstermin' => '',
|
||||
'mit_sperrung' => '',
|
||||
'punkte' => $punkte_empf_anteil,
|
||||
'bezeichnung' => '',
|
||||
'bezeichnung_punkte' => '',
|
||||
'regelwerk' => '',
|
||||
'monate_seit_entscheidungstermin' => '',
|
||||
'punkte_aktive' => '',
|
||||
'gueltig_bis' => '',
|
||||
'von_transfer' => $geber_company,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Frontend\Utility\EidUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 Erfolgspunkte
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function load_user($_liste, $user_objekt)
|
||||
{
|
||||
// _Berechnung::$debug = 1;
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
"Erfolgspunkte"
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset(_Berechnung::$_data['sektionstage'])) {
|
||||
Sektionstage::load();
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe');
|
||||
$queryBuilder
|
||||
->select(
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe.wettbewerb',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe.verfahrensid',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe.verfahrensort',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe.entscheidungstermin',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe.abgabetermin',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe.sperre_deaktiviert',
|
||||
'b.ladung_durch_auslober',
|
||||
'c.punkte',
|
||||
'd.sperrung AS mit_sperrung',
|
||||
'd.bezeichnung',
|
||||
'e.bezeichnung AS bezeichnung_punkte'
|
||||
)
|
||||
->from('tx_zuladungsliste_domain_model_wettbewerbe')
|
||||
->leftJoin(
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe',
|
||||
'tx_zuladungsliste_wettbewerbe_architekten_mm',
|
||||
'b',
|
||||
$queryBuilder->expr()->eq(
|
||||
'b.uid_wettbewerbe',
|
||||
$queryBuilder->quoteIdentifier('tx_zuladungsliste_domain_model_wettbewerbe.uid')
|
||||
)
|
||||
)
|
||||
->leftJoin(
|
||||
'b',
|
||||
'tx_zuladungsliste_punkte_kriterien_mm',
|
||||
'c',
|
||||
$queryBuilder->expr()->eq(
|
||||
'c.uid_punkte',
|
||||
$queryBuilder->quoteIdentifier('b.uid_punkte')
|
||||
)
|
||||
)->leftJoin(
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe',
|
||||
'tx_zuladungsliste_domain_model_kriterien',
|
||||
'd',
|
||||
$queryBuilder->expr()->eq(
|
||||
'd.uid',
|
||||
$queryBuilder->quoteIdentifier('tx_zuladungsliste_domain_model_wettbewerbe.kriteriumid')
|
||||
)
|
||||
)->leftJoin(
|
||||
'c',
|
||||
'tx_zuladungsliste_domain_model_punkte',
|
||||
'e',
|
||||
$queryBuilder->expr()->eq(
|
||||
'e.uid',
|
||||
$queryBuilder->quoteIdentifier('c.uid_punkte')
|
||||
)
|
||||
)
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('c.uid_kriterien', 'tx_zuladungsliste_domain_model_wettbewerbe.kriteriumid'),
|
||||
$queryBuilder->expr()->eq('b.tstamp_ablehnen', 0),
|
||||
$queryBuilder->expr()->gt('b.tstamp_aktivierung', 0),
|
||||
$queryBuilder->expr()->eq('b.uid_user', (int)$user_objekt['uid'])
|
||||
)
|
||||
->groupBy('tx_zuladungsliste_domain_model_wettbewerbe.verfahrensid')
|
||||
->orderBy('tx_zuladungsliste_domain_model_wettbewerbe.entscheidungstermin');
|
||||
|
||||
|
||||
if (_Berechnung::$_config['berechne_bis'] != 0) {
|
||||
$date = date("Y-m-d", _Berechnung::$_config['berechne_bis']);
|
||||
$queryBuilder->andWhere("b.tstamp_aktivierung <= ". _Berechnung::$_config['berechne_bis']);
|
||||
$queryBuilder->andWhere("tx_zuladungsliste_domain_model_wettbewerbe.entscheidungstermin < '". $date ."'");
|
||||
}
|
||||
|
||||
$statement = $queryBuilder->execute()->fetchAll();
|
||||
if (_Berechnung::$debug) {
|
||||
Message::note($queryBuilder->getSQL());
|
||||
}
|
||||
|
||||
$_liste["gesperrt_bis"] = 0;
|
||||
$_liste["kommentar"] = 0;
|
||||
$_liste["gesperrt"] = 0;
|
||||
$_liste["nominiert"] = 1;
|
||||
|
||||
$_return_sort = [];
|
||||
foreach ($statement as $key => $row) {
|
||||
if ((int)$row["entscheidungstermin"]>0) {
|
||||
$entscheidungstermin = strtotime($row["entscheidungstermin"]);
|
||||
$datetime2 = new \DateTime($row["entscheidungstermin"]);
|
||||
} else {
|
||||
$entscheidungstermin = strtotime($row["abgabetermin"]);
|
||||
$datetime2 = new \DateTime($row["abgabetermin"]);
|
||||
}
|
||||
|
||||
$_sektionstag = Sektionstage::filter($entscheidungstermin);
|
||||
|
||||
$datetime1 = new \DateTime();
|
||||
if (_Berechnung::$_config['berechne_bis'] != 0) {
|
||||
$datetime1->setTimestamp(_Berechnung::$_config['berechne_bis']);
|
||||
}
|
||||
$interval = $datetime1->diff($datetime2);
|
||||
$monate_seit_entscheidungstermin = $interval->m + ($interval->y * 12);
|
||||
|
||||
$row["regelwerk"] = $_sektionstag["bezeichnung"];
|
||||
$row["monate_seit_entscheidungstermin"] = $monate_seit_entscheidungstermin;
|
||||
|
||||
// PUNKTE GÜLTIGKEIT
|
||||
$row["punkte_aktive"] = $monate_seit_entscheidungstermin<=$_sektionstag["punktezeit"] ? 1 : 0;
|
||||
|
||||
if ($row["punkte_aktive"] == 1) {
|
||||
$_liste["punkte"] = $_liste["punkte"] + $row["punkte"];
|
||||
}
|
||||
|
||||
$datetime3 = clone $datetime2;
|
||||
$datetime3->modify("+".$_sektionstag["punktezeit"]." months");
|
||||
$row["gueltig_bis"] = date("d.m.Y", $datetime3->format("U"));
|
||||
$row["wettbewerb_sort"] = $datetime3->format("U");
|
||||
|
||||
// SPERRZEIT
|
||||
if ($row["mit_sperrung"] and $row["sperre_deaktiviert"]==0) {
|
||||
if ($row['ladung_durch_auslober'] == 1) {
|
||||
// Active Sperrzeit wird auf 9 Monate verkürzt
|
||||
$_sektionstag["sperrzeit"] = 9;
|
||||
}
|
||||
$row["sperrung_aktive"] = $monate_seit_entscheidungstermin<=$_sektionstag["sperrzeit"] ? 1 : 0;
|
||||
$datetime2->modify("+".$_sektionstag["sperrzeit"]." months");
|
||||
$row["gesperrt_bis"] = date("d.m.Y", $datetime2->format("U"));
|
||||
|
||||
$_liste['controll']['gesperrt_bis'] = $row["gesperrt_bis"];
|
||||
$_liste['controll']['sperrung_aktive'] = $datetime2->format("U");
|
||||
$_liste['controll']['berechne_bis'] = _Berechnung::$_config['berechne_bis'];
|
||||
|
||||
// salam 28.0.42022
|
||||
$sperreZeitLimit = (_Berechnung::$_config['berechne_bis']!= 0) ? _Berechnung::$_config['berechne_bis'] : time();
|
||||
|
||||
if ($row["sperrung_aktive"] and $datetime2->format("U") > $sperreZeitLimit) {
|
||||
$_liste["gesperrt_bis"] = $row["gesperrt_bis"];
|
||||
if ($row['ladung_durch_auslober'] == 1) {
|
||||
$_liste["kommentar"] = $row["wettbewerb"]. ' (Ladung durch Auslober/in, Sperrzeit wird auf 9 Monate verkürzt)';
|
||||
} else {
|
||||
$_liste["kommentar"] = $row["wettbewerb"];
|
||||
}
|
||||
$_liste["gesperrt"] = 1;
|
||||
$_liste["nominiert"] = 0;
|
||||
}
|
||||
}
|
||||
$_return_sort[] = $row;
|
||||
}
|
||||
|
||||
|
||||
if ($_return_sort) {
|
||||
$wettbewerb_sort = array_column($_return_sort, 'wettbewerb_sort');
|
||||
array_multisort($wettbewerb_sort, SORT_ASC, $_return_sort);
|
||||
}
|
||||
|
||||
// WETTBEWERBE ERFOLGSPUNKTE
|
||||
$_liste["auswertung"]["wettbewerbe"] = $_return_sort;
|
||||
|
||||
return $_liste;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 Frauen
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function load($_liste, $user_objekt)
|
||||
{
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(__file__, __line__, "Load Frauen Förderungs Punkt");
|
||||
}
|
||||
|
||||
// FRAUEN FÖRDERUNGS PUNKT
|
||||
// $_liste["auswertung"]["frauenfoerderpunkt"] = Frauen::load($_liste, $user_objekt, $_liste["punkte"]);
|
||||
// $_liste["punkte"] += $_liste["auswertung"]["frauenfoerderpunkt"]["punkte"];
|
||||
|
||||
|
||||
|
||||
if ($user_objekt["frauenfoerderpunkt"]==0) {
|
||||
$_liste["auswertung"]["frauenfoerderpunkt"]['punkte'] = 0;
|
||||
$_liste["auswertung"]["frauenfoerderpunkt"]['kommentar'] = "Kein Anspruch";
|
||||
return $_liste;
|
||||
} else {
|
||||
// Frauenförderung ohne Punkte immer Gültig
|
||||
if ($_liste["punkte"] > 0) {
|
||||
$_liste["auswertung"]["frauenfoerderpunkt"]['punkte'] = 1;
|
||||
$_liste["auswertung"]["frauenfoerderpunkt"]['kommentar'] = "Punktestand > 0; Punkt gültig";
|
||||
$_liste["punkte"]++;
|
||||
return $_liste;
|
||||
}
|
||||
|
||||
$vereidigung = strtotime($user_objekt["vereidigung"]);
|
||||
$sektionstag = Sektionstage::filter("pruefePunkteverfallFrauenFoerderungsPunkt", $vereidigung);
|
||||
|
||||
$frauenfoerderung_monate = $sektionstag["frauenfoerderung"];
|
||||
|
||||
$datetime1 = new \DateTime();
|
||||
if (_Berechnung::$_config['berechne_bis'] != 0) {
|
||||
$datetime1->setTimestamp(_Berechnung::$_config['berechne_bis']);
|
||||
}
|
||||
$datetime2 = new \DateTime($user_objekt["vereidigung"]);
|
||||
|
||||
$interval = $datetime1->diff($datetime2);
|
||||
$monate_seit_vereidigung = $interval->m + ($interval->y * 12);
|
||||
|
||||
if ($monate_seit_vereidigung < $frauenfoerderung_monate) {
|
||||
$monate = $frauenfoerderung_monate-$monate_seit_vereidigung;
|
||||
|
||||
$_liste["auswertung"]["frauenfoerderpunkt"]['punkte'] = 1;
|
||||
$_liste["auswertung"]["frauenfoerderpunkt"]['kommentar'] = "Frauenförderung ohne Punkte noch $monate Monate gültig";
|
||||
$_liste["punkte"]++;
|
||||
} else {
|
||||
$_liste["auswertung"]["frauenfoerderpunkt"]['punkte'] = 0;
|
||||
$_liste["auswertung"]["frauenfoerderpunkt"]['kommentar'] = "Keine Einreichungen, Zeitspanne seit Vereidigung größer als 5 Jahre, Punkt ist verfallen";
|
||||
}
|
||||
|
||||
return $_liste;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 Neueinsteiger
|
||||
{
|
||||
/**
|
||||
* @param mixed $_liste
|
||||
* @param mixed $user_objekt
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function load($_liste, $user_objekt)
|
||||
{
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(__FILE__, __LINE__, 'Load NeueinsteigerPunkt');
|
||||
}
|
||||
|
||||
if ('0000-00-00' == $user_objekt['vereidigung']) {
|
||||
$_liste['auswertung']['neueinsteigerpunkt']['punkte'] = 0;
|
||||
$_liste['auswertung']['neueinsteigerpunkt']['kommentar'] = 'Kein Vereidigungsdatum verfügbar';
|
||||
|
||||
return $_liste;
|
||||
}
|
||||
|
||||
$vereidigung = strtotime($user_objekt['vereidigung']);
|
||||
$_sektionstag = Sektionstage::filter($vereidigung);
|
||||
|
||||
$datetime1 = new \DateTime();
|
||||
if (0 != _Berechnung::$_config['berechne_bis']) {
|
||||
$datetime1->setTimestamp(_Berechnung::$_config['berechne_bis']);
|
||||
}
|
||||
$datetime2 = new \DateTime($user_objekt['vereidigung']);
|
||||
|
||||
$interval = $datetime1->diff($datetime2);
|
||||
$monate_seit_vereidigung = $interval->m + ($interval->y * 12);
|
||||
|
||||
if ($monate_seit_vereidigung > $_sektionstag['neueinsteiger']) {
|
||||
$_liste['auswertung']['neueinsteigerpunkt']['punkte'] = 0;
|
||||
$_liste['auswertung']['neueinsteigerpunkt']['kommentar'] = 'Neueinsteigerpunkt ist verfallen. Vereidigung '.$user_objekt['vereidigung'];
|
||||
|
||||
return $_liste;
|
||||
}
|
||||
|
||||
$jahre_seit_vereidigung = $interval->y;
|
||||
|
||||
if ($jahre_seit_vereidigung < 5) {
|
||||
$neueinsteigerpunkt = 5 - $jahre_seit_vereidigung;
|
||||
$datetime2->modify('+5 year');
|
||||
|
||||
$_liste['auswertung']['neueinsteigerpunkt']['punkte'] = $neueinsteigerpunkt;
|
||||
$_liste['punkte'] = $_liste['punkte'] + $neueinsteigerpunkt;
|
||||
$_liste['auswertung']['neueinsteigerpunkt']['kommentar'] = 'Neueinsteigerpunkt Vereidigung '.$user_objekt['vereidigung'];
|
||||
$_liste['auswertung']['neueinsteigerpunkt']['gueltig_bis'] = $datetime2->format('Y-m-d');
|
||||
} else {
|
||||
$_liste['auswertung']['neueinsteigerpunkt']['punkte'] = 0;
|
||||
$_liste['auswertung']['neueinsteigerpunkt']['kommentar'] = 'Neueinsteigerpunkt ist verfallen. Vereidigung '.$user_objekt['vereidigung'];
|
||||
}
|
||||
|
||||
return $_liste;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 PunkteKriterien
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function load()
|
||||
{
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(__FILE__, __LINE__, 'Load Punkte Kriterien');
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_punkte_kriterien_mm');
|
||||
$queryBuilder
|
||||
->select(
|
||||
'tx_zuladungsliste_punkte_kriterien_mm.uid',
|
||||
'tx_zuladungsliste_punkte_kriterien_mm.uid_punkte',
|
||||
'tx_zuladungsliste_punkte_kriterien_mm.uid_kriterien',
|
||||
'tx_zuladungsliste_punkte_kriterien_mm.punkte',
|
||||
'a.bezeichnung AS bezeichnung_punkte',
|
||||
'b.bezeichnung AS bezeichnung_kritierien'
|
||||
)->from('tx_zuladungsliste_punkte_kriterien_mm')
|
||||
->join(
|
||||
'tx_zuladungsliste_punkte_kriterien_mm',
|
||||
'tx_zuladungsliste_domain_model_punkte',
|
||||
'a',
|
||||
$queryBuilder->expr()->eq('a.uid', $queryBuilder->quoteIdentifier('tx_zuladungsliste_punkte_kriterien_mm.uid_punkte'))
|
||||
)
|
||||
->join(
|
||||
'tx_zuladungsliste_punkte_kriterien_mm',
|
||||
'tx_zuladungsliste_domain_model_kriterien',
|
||||
'b',
|
||||
$queryBuilder->expr()->eq('b.uid', $queryBuilder->quoteIdentifier('tx_zuladungsliste_punkte_kriterien_mm.uid_kriterien'))
|
||||
);
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::note($queryBuilder->getSQL());
|
||||
}
|
||||
$tmp = $queryBuilder->execute()->fetchAll();
|
||||
$return = [];
|
||||
foreach ($tmp as $key => $value)
|
||||
{
|
||||
$return[$value['uid_punkte']] = $value;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 Sektionstage
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function load()
|
||||
{
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(__file__, __line__, "Lade Sektionstage");
|
||||
}
|
||||
|
||||
// 2 usergroup => Ordentliche Registrierung zur Zuladungsliste
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_sektionstage');
|
||||
$statement = $queryBuilder
|
||||
->select("bezeichnung", "stichtag", "sperrzeit", "sperrzeitstart", "punktezeit", "punktezeitstart", "neueinsteiger", "neueinsteigerstart", "frauenfoerderung", "frauenfoerderungstart", "frauenfoerderungsonderstart", "kammernid")
|
||||
->from('tx_zuladungsliste_domain_model_sektionstage')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('kammernid', (int)_Berechnung::$_config['kammernid'])
|
||||
);
|
||||
|
||||
if (_Berechnung::$_config['berechne_bis'] != 0) {
|
||||
$date = date("Y-m-d", _Berechnung::$_config['berechne_bis']);
|
||||
$queryBuilder->andWhere("stichtag < '". $date ."'");
|
||||
}
|
||||
|
||||
$statement = $queryBuilder->execute()->fetchAll();
|
||||
if (_Berechnung::$debug) {
|
||||
Message::note($queryBuilder->getSQL());
|
||||
}
|
||||
|
||||
$_arr = [];
|
||||
foreach ($statement as $key => $value) {
|
||||
$stichtag= strtotime(trim($value['stichtag']));
|
||||
$_arr[$stichtag] = $value;
|
||||
}
|
||||
ksort($_arr);
|
||||
_Berechnung::$_data['sektionstage'] = $_arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function filter($stichtag)
|
||||
{
|
||||
$_stichtagdetails = [];
|
||||
$entscheidungstermin = 0;
|
||||
foreach (_Berechnung::$_data['sektionstage'] as $stichtag => $_stichtagdetails) {
|
||||
if ($entscheidungstermin >= $stichtag) {
|
||||
return $_stichtagdetails;
|
||||
}
|
||||
}
|
||||
return array_shift(array_slice(_Berechnung::$_data['sektionstage'], 0, 1));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 Solidaritaetserklaerung
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function filter($_liste, $user_objekt)
|
||||
{
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(__file__, __line__, "Filter Solidaritaetserklaerung");
|
||||
}
|
||||
// Datum Start SOLIDARITÄTSERKLÄRUNG ab 15. Juni "2021"
|
||||
if (_Berechnung::$_config['berechne_bis'] == 0 or _Berechnung::$_config['berechne_bis'] > mktime(0, 0, 0, 6, 15, 2021)) {
|
||||
if ($user_objekt["solidaritaetserklaerung"]==0) {
|
||||
$_liste["auswertung"]["solidaritaetserklaerung"]["kommentar"] = "Solidaritätserklärung nicht zugestimmt";
|
||||
$_liste["auswertung"]["solidaritaetserklaerung"]["punkte"] = 0;
|
||||
} else {
|
||||
$_liste["auswertung"]["solidaritaetserklaerung"]["kommentar"] = "Solidaritätserklärung zugestimmt";
|
||||
$_liste["auswertung"]["solidaritaetserklaerung"]["punkte"] = 1;
|
||||
$_liste["punkte"]++;
|
||||
}
|
||||
}
|
||||
return $_liste;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 Sondersperrungen
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function load()
|
||||
{
|
||||
// _Berechnung::$debug = 1;
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
"Load ListeBerechnung"
|
||||
);
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_extrasperrung');
|
||||
$statement = $queryBuilder
|
||||
->select('tx_zuladungsliste_domain_model_extrasperrung.begruendung', 'tx_zuladungsliste_domain_model_extrasperrung.sperrzeitbis', 'b.uid_user', 'c.company')
|
||||
->from('tx_zuladungsliste_domain_model_extrasperrung')
|
||||
->join(
|
||||
'tx_zuladungsliste_domain_model_extrasperrung',
|
||||
'tx_zuladungsliste_extrasperrung_user_mm',
|
||||
'b',
|
||||
$queryBuilder->expr()->eq('b.uid_extrasperrung', $queryBuilder->quoteIdentifier('tx_zuladungsliste_domain_model_extrasperrung.uid'))
|
||||
)
|
||||
->join(
|
||||
'b',
|
||||
'fe_users',
|
||||
'c',
|
||||
$queryBuilder->expr()->eq('c.uid', $queryBuilder->quoteIdentifier('b.uid_user'))
|
||||
)
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('c.kammernid', _Berechnung::$_config['kammernid'])
|
||||
)->execute()->fetchAll();
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::note($queryBuilder->getSQL());
|
||||
}
|
||||
|
||||
$_sondersperrungen = [];
|
||||
foreach ($statement as $key => $value) {
|
||||
$uid_user = $value['uid_user'];
|
||||
$value['sperrzeitbis_timestamp'] = strtotime($value['sperrzeitbis']);
|
||||
$_sondersperrungen[$uid_user][] = $value;
|
||||
}
|
||||
|
||||
_Berechnung::$_data['sondersperrungen'] = $_sondersperrungen;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function filter($_liste, $user_objekt)
|
||||
{
|
||||
|
||||
$_liste["auswertung"]["sondersperrungen"]["gesperrt"]=0;
|
||||
$_liste["auswertung"]["sondersperrungen"]["gesperrt_bis"]=0;
|
||||
$user_id = $user_objekt["uid"];
|
||||
if (isset(_Berechnung::$_data['sondersperrungen'][$user_id])) {
|
||||
foreach (_Berechnung::$_data['sondersperrungen'][$user_id] as $key => $value_sperrung) {
|
||||
if (_Berechnung::$_config['berechne_bis'] < $value_sperrung["sperrzeitbis_timestamp"]) {
|
||||
$return["gesperrt_bis"] = $value_sperrung["sperrzeitbis_timestamp"];
|
||||
}
|
||||
$_liste["auswertung"]["sondersperrungen"]["gesperrt"] = 1;
|
||||
$_liste["auswertung"]["sondersperrungen"]["gesperrt_bis"] = $value_sperrung["sperrzeitbis"];
|
||||
$_liste["auswertung"]["sondersperrungen"]["kommentar"] = $value_sperrung["begruendung"];
|
||||
|
||||
$_liste["gesperrt_bis"] = $value_sperrung["sperrzeitbis"];
|
||||
$_liste["nominiert"] = 0;
|
||||
}
|
||||
}
|
||||
return $_liste;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 WettbewerbeArchitekten
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function load()
|
||||
{
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(__FILE__, __LINE__, 'Load Wettbewerbe Architekten');
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_wettbewerbe_architekten_mm');
|
||||
$queryBuilder
|
||||
->select(
|
||||
'tx_zuladungsliste_wettbewerbe_architekten_mm.uid AS uid_wettarch',
|
||||
'tx_zuladungsliste_wettbewerbe_architekten_mm.uid_wettbewerbe',
|
||||
'tx_zuladungsliste_wettbewerbe_architekten_mm.uid_user',
|
||||
'tx_zuladungsliste_wettbewerbe_architekten_mm.uid_punkte',
|
||||
'tx_zuladungsliste_wettbewerbe_architekten_mm.tstamp_zuordnung',
|
||||
'tx_zuladungsliste_wettbewerbe_architekten_mm.tstamp_aktivierung',
|
||||
'tx_zuladungsliste_wettbewerbe_architekten_mm.tstamp_ablehnen',
|
||||
'a.wettbewerb',
|
||||
'a.bundesland',
|
||||
'a.entscheidungstermin',
|
||||
'a.abgabetermin'
|
||||
)
|
||||
->from('tx_zuladungsliste_wettbewerbe_architekten_mm')
|
||||
->join(
|
||||
'tx_zuladungsliste_wettbewerbe_architekten_mm',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe',
|
||||
'a',
|
||||
$queryBuilder->expr()->eq('a.uid', $queryBuilder->quoteIdentifier('tx_zuladungsliste_wettbewerbe_architekten_mm.uid_wettbewerbe'))
|
||||
)->where(
|
||||
$queryBuilder->expr()->gt('tx_zuladungsliste_wettbewerbe_architekten_mm.uid_punkte', 0)
|
||||
);
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::note($queryBuilder->getSQL());
|
||||
}
|
||||
return $queryBuilder->execute()->fetchAll();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Berechnung;
|
||||
|
||||
set_time_limit(0);
|
||||
ini_set('max_execution_time', '600'); //600 seconds = 10 minutes
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Frontend\Utility\EidUtility;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use HermannTelser\Zuladungsliste\Kammer\KammerById;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 _Berechnung
|
||||
{
|
||||
public static $_return = [];
|
||||
public static $_data = [];
|
||||
public static $_config = [];
|
||||
public static $debug = 0;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __construct($berechne_bis = 0)
|
||||
{
|
||||
self::$debug = 0;
|
||||
|
||||
self::$_data = [];
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
self::$_config['pid'] = 41; // Ordner ID der gültigen Architeken
|
||||
self::$_config['kammernid'] = 1; // Kammer ID is fixed to Steiermarkfor now
|
||||
self::$_config['userid'] = $user['uid'];
|
||||
self::$_config['usergroup'] = 2; // 2 => Ordentliche Registrierung zur Zuladungsliste
|
||||
self::$_config['liste_start'] = mktime(0, 0, 0, 7, 15, 2017); // 15 July 2017 12:00:00 AM CEST
|
||||
|
||||
if ($berechne_bis) {
|
||||
self::$_config['berechne_bis'] = $berechne_bis;
|
||||
} else {
|
||||
self::$_config['berechne_bis'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function berechnen()
|
||||
{
|
||||
self::$_data = [];
|
||||
|
||||
Sondersperrungen::load();
|
||||
|
||||
// controllo = 0 => all
|
||||
$architekt_uid = 0;
|
||||
|
||||
Architekten::load($architekt_uid);
|
||||
|
||||
// print_r(self::$_data['architekten']);
|
||||
// exit;
|
||||
|
||||
Sektionstage::load();
|
||||
|
||||
foreach (self::$_data['architekten'] as $key => $user_objekt) {
|
||||
$_liste = [];
|
||||
$_liste["id"] = $user_objekt["uid"];
|
||||
$_liste["disable"] = $user_objekt["disable"];
|
||||
$_liste["user_id"] = $user_objekt["uid"];
|
||||
$_liste["company"] = $user_objekt["company"];
|
||||
$_liste["name"] = $user_objekt["name"];
|
||||
// $_liste["last_name"] = $user_objekt["last_name"];
|
||||
// $_liste["vereidigung"] = $user_objekt["vereidigung"];
|
||||
$_liste["kontoaufloesung"] = $user_objekt["kontoaufloesung"];
|
||||
$_liste["kontoaufloesung_active"] = $user_objekt["kontoaufloesung_active"];
|
||||
// $_liste["nameorder"] = $_liste["last_name"]!="" ? $_liste["last_name"] : $_liste["company"];
|
||||
|
||||
$_liste["punkte"] = 0;
|
||||
$_liste["auswertung"] = [];
|
||||
|
||||
|
||||
// WETTBEWERBE ERFOLGSPUNKTE
|
||||
$_liste = Erfolgspunkte::load_user($_liste, $user_objekt);
|
||||
|
||||
// SONDER SPERRUNGEN
|
||||
$_liste = Sondersperrungen::filter($_liste, $user_objekt);
|
||||
|
||||
|
||||
// NEUEINSTEIGERPUNKT
|
||||
$_liste = Neueinsteiger::load($_liste, $user_objekt);
|
||||
|
||||
|
||||
// FRAUEN FÖRDERUNGS PUNKT
|
||||
$_liste = Frauen::load($_liste, $user_objekt);
|
||||
|
||||
|
||||
|
||||
// SOLIDARITÄTSERKLÄRUNG
|
||||
$_liste = Solidaritaetserklaerung::filter($_liste, $user_objekt);
|
||||
|
||||
|
||||
$_liste["aeltestes_entscheidungs_datum"] = isset($_liste["auswertung"]["wettbewerbe"][0]) ? $_liste["auswertung"]["wettbewerbe"][0]["entscheidungstermin"] : 0;
|
||||
|
||||
if ($user_objekt["vereidigung"]!="0000-00-00") {
|
||||
$vereidigung = strtotime($user_objekt["vereidigung"]);
|
||||
}
|
||||
if ($_liste["aeltestes_entscheidungs_datum"]!=0) {
|
||||
$aeltestes_entscheidungs_datum = strtotime($_liste["aeltestes_entscheidungs_datum"]);
|
||||
}
|
||||
|
||||
if ($_liste["punkte"]==0) {
|
||||
$_liste["nominiert"] = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($_liste["punkte"]==0) {
|
||||
$_liste["sortdatum"] = 100000000;
|
||||
} elseif (isset($vereidigung) and isset($aeltestes_entscheidungs_datum)) {
|
||||
$_liste["sortdatum"] = $aeltestes_entscheidungs_datum<$vereidigung ? $aeltestes_entscheidungs_datum : $vereidigung;
|
||||
} elseif (isset($vereidigung)) {
|
||||
$_liste["sortdatum"] = $vereidigung;
|
||||
} elseif (isset($aeltestes_entscheidungs_datum)) {
|
||||
$_liste["sortdatum"] = $aeltestes_entscheidungs_datum;
|
||||
} else {
|
||||
$_liste["sortdatum"] = 100000000;
|
||||
}
|
||||
|
||||
// if($user_objekt["uid"]==$architekt_uid){
|
||||
// print_r($_liste['punkte']);
|
||||
// exit;
|
||||
// }
|
||||
|
||||
self::$_data['liste'][] = $_liste;
|
||||
}
|
||||
|
||||
// $tmp = self::$_data['liste'];
|
||||
// print_r($tmp);
|
||||
// exit;
|
||||
|
||||
AufloesungPunkteVerteilung::manage();
|
||||
// print_r(self::$_data['liste']);
|
||||
// exit;
|
||||
/***
|
||||
Reihung der Liste absolut
|
||||
a) Punktezahl
|
||||
b) bei Gleichstand: Ältestes in der Wertung befindliche Zuerkennungs-, Entscheidungs- oder Vereidigungsdatum geht vor
|
||||
c) falls immer noch Gleichstand: Reihung alphabetisch nach Nach- bzw. Firmennamen
|
||||
*/
|
||||
|
||||
$punkte = array_column(self::$_data['liste'], 'punkte');
|
||||
$sortdatum = array_column(self::$_data['liste'], 'sortdatum');
|
||||
$nameorder = array_column(self::$_data['liste'], 'company');
|
||||
foreach ($nameorder as $key => $value)
|
||||
{
|
||||
$nameorder[$key] = strtolower($value);
|
||||
}
|
||||
array_multisort($punkte, SORT_NUMERIC, SORT_DESC, $sortdatum, SORT_NUMERIC, SORT_DESC, $nameorder, SORT_ASC, SORT_STRING, self::$_data['liste']);
|
||||
|
||||
// print_r(self::$_data['liste']);
|
||||
// exit;
|
||||
|
||||
/***
|
||||
Reihung für Nominierung Wie Reihung absolut, aber ohne Zählung von gesperrten Teilnehmern (Sperre bei WB-Teilnahme an geladenen WB, aber nicht nur durch Nominierung aus der Liste(!), dzt. 18 Monate)
|
||||
Nominierung Herangezogen wird die Nominierungsreihung.
|
||||
1 Nominierung: Nr. 1 der Nominierungsreihung
|
||||
2 Nominierungen: Nr. 1 und die Nr. des Absolutwerts der Hälfte des Maximalwerts der Nominierungsreihung (z.B. 35 in der Nominierungswertung, gezogen wird Nr. 1 und Nr. 17)
|
||||
3 Nominierungen: Nr. 1, die Nr. des Absolutwerts von 2/3 des Maximalwerts der Nominierungsreihung, die Nr. des Absolutwerts von 1/3 des Maximalwerts der Nominierungsreihung (z.B. 35 in der Nominierungswertung, gezogen wird Nr. 1, Nr. 11, Nr. 23)
|
||||
ab 4 Nominierungen: Die ersten 3 Nominierungen wie oben, nächste ist die Nr. 2, nächste die dem Absolutwert von 2/3 des Maximalwerts der Nominierungreihung folgende Zahl (z.B. bei obigem Beispiel, aber 5 aus 35: Nr. 1,2,11,12,23)
|
||||
*/
|
||||
//print_r($data);
|
||||
//exit;
|
||||
|
||||
$arr = [];
|
||||
$pos=1;
|
||||
$rang=1;
|
||||
foreach (self::$_data['liste'] as $key => $value) {
|
||||
if ($value["disable"] == 0) {
|
||||
$value["rang"] = $rang;
|
||||
$rang++;
|
||||
|
||||
$sperre_wettbewerbe = $value["auswertung"]["wettbewerbe"]["gesperrt_bis"];
|
||||
$sperre_sondersperrungen = $value["auswertung"]["sondersperrungen"]["gesperrt_bis"];
|
||||
|
||||
$sperre_wettbewerbe = str_replace(". ", "-", $sperre_wettbewerbe);
|
||||
if (strtotime($sperre_wettbewerbe) > self::$_config['berechne_bis']) {
|
||||
$value["gesperrt_bis"] = $sperre_wettbewerbe;
|
||||
}
|
||||
if (strtotime($sperre_sondersperrungen) > self::$_config['berechne_bis']) {
|
||||
$value["gesperrt_bis"] = $sperre_sondersperrungen;
|
||||
}
|
||||
|
||||
$value["punkte"] = (float)$value["punkte"];
|
||||
if ($value["nominiert"] == 1 and $value["punkte"] > 0) {
|
||||
$value["pos"] = $pos;
|
||||
$pos++;
|
||||
} else {
|
||||
$value["pos"] = 0;
|
||||
}
|
||||
// unset($value["auswertung"]);
|
||||
unset($value["nameorder"]);
|
||||
unset($value["aeltestes_entscheidungs_datum"]);
|
||||
unset($value["last_name"]);
|
||||
unset($value["vereidigung"]);
|
||||
|
||||
$arr[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$eins = $pos;
|
||||
$zwei = floor($pos/2);
|
||||
$drei = floor($pos/3);
|
||||
$vier = floor($pos/4);
|
||||
$fuenf = floor($pos/5);
|
||||
$sechs = floor($pos/6);
|
||||
|
||||
// echo "\neins: " . $eins;
|
||||
// echo "\nzwei: " . $zwei;
|
||||
// echo "\ndrei: " . $drei;
|
||||
// echo "\nvier: " . $vier;
|
||||
// echo "\nfünf: " . $fuenf;
|
||||
// echo "\nsechs: " . $sechs;
|
||||
|
||||
self::$_data['liste']=[];
|
||||
foreach ($arr as $key => $value) {
|
||||
$pos = $value["pos"];
|
||||
if ($pos==1) {
|
||||
$value["n1"] = 1;
|
||||
$value["n2"] = 1;
|
||||
$value["n3"] = 1;
|
||||
$value["n4"] = 1;
|
||||
$value["n5"] = 1;
|
||||
$value["n6"] = 1;
|
||||
} elseif ($pos>1) {
|
||||
$value["n2"] = ($pos==$zwei) ? 1 : 0;
|
||||
$value["n3"] = ($pos==$drei || $pos==$drei*2) ? 1 : 0;
|
||||
$value["n4"] = ($pos==2 || $pos==$drei || $pos==$drei*2) ? 1 : 0;
|
||||
$value["n5"] = ($pos==2 || $pos==$drei || $pos==$drei+1 || $pos==$drei*2) ? 1 : 0;
|
||||
$value["n6"] = ($pos==2 || $pos==$drei || $pos==$drei+1 || $pos==$drei*2 || $pos==$drei*2+1) ? 1 : 0;
|
||||
// $value["n4"] = $pos==$vier || $pos==$vier*2 || $pos==$vier*3?1:0;
|
||||
// $value["n5"] = $pos==$fuenf || $pos==$fuenf*2 || $pos==$fuenf*3 || $pos==$fuenf*4?1:0;
|
||||
}
|
||||
|
||||
if ($pos==2) {
|
||||
$value["e1"] = 1;
|
||||
$value["e2"] = 1;
|
||||
$value["e3"] = 1;
|
||||
}
|
||||
if ($pos==3) {
|
||||
$value["e4"] = 1;
|
||||
$value["e5"] = 1;
|
||||
$value["e6"] = 1;
|
||||
} elseif ($pos>3) {
|
||||
$value["e2"] = ($pos==$zwei+1) ? 1 : 0;
|
||||
$value["e3"] = ($pos==$drei+1 || $pos==$drei*2+1) ? 1 : 0;
|
||||
$value["e4"] = ($pos==4 || $pos==$drei+1 || $pos==$drei*2+1) ? 1 : 0;
|
||||
$value["e5"] = ($pos==4 || $pos==$drei+2 || $pos==$drei+3 || $pos==$drei*2+1) ? 1 : 0;
|
||||
$value["e6"] = ($pos==4 || $pos==$drei+2 || $pos==$drei+3 || $pos==$drei*2+2 || $pos==$drei*2+3) ? 1 : 0;
|
||||
// e6 condition needs controll todo
|
||||
}
|
||||
self::$_data['liste'][] = $value;
|
||||
|
||||
}
|
||||
|
||||
// print_r(self::$_data['liste']);
|
||||
// exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Bootstrap;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 KammerById
|
||||
{
|
||||
/**
|
||||
* @param mixed $kammerid
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function load($kammerid = 0)
|
||||
{
|
||||
if ($kammerid == 0) {
|
||||
Message::warning(__file__, __line__, "KammerID fehlt");
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_zuladungsliste_domain_model_kammern')->createQueryBuilder();
|
||||
$statement = $queryBuilder->select('bezeichnung')->from('tx_zuladungsliste_domain_model_kammern')
|
||||
->where($queryBuilder->expr()->in('uid', $kammerid))
|
||||
->execute();
|
||||
while ($row = $statement->fetch()) {
|
||||
return $row['bezeichnung'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Bootstrap;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 HermannTelser\Zuladungsliste\Utilities\Resources;
|
||||
|
||||
class UserSettings
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function load()
|
||||
{
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
|
||||
if ($user['gender'] == 0) {
|
||||
$gender = 'Herr';
|
||||
} elseif ($user['gender'] == 1) {
|
||||
$gender = 'Frau';
|
||||
} else {
|
||||
$gender = '';
|
||||
}
|
||||
|
||||
_Berechnung::$_return = [
|
||||
['key' => 'userid', 'value' => $user['uid']],
|
||||
['key' => 'isadmin', 'value' => self::is_admin($user['usergroup'])],
|
||||
['key' => 'usergroup', 'value' => $user['usergroup']],
|
||||
['key' => 'gender', 'value' => $gender],
|
||||
['key' => 'username', 'value' => $user['username']],
|
||||
['key' => 'fullname', 'value' => $user['title'] . " " . $user['first_name'] . " " . $user['last_name']],
|
||||
['key' => 'company', 'value' => $user['company']],
|
||||
['key' => 'email', 'value' => $user['email']],
|
||||
['key' => 'inliste', 'value' => $user['inliste']],
|
||||
['key' => 'vereidigung', 'value' => $user['vereidigung']],
|
||||
['key' => 'frauenfoerderpunkt', 'value' => $user['frauenfoerderpunkt']],
|
||||
['key' => 'kammernid', 'value' => $user['kammernid']],
|
||||
['key' => 'kammermitgliedsnummer', 'value' => $user['kammermitgliedsnummer']],
|
||||
['key' => 'kammer', 'value' => KammerById::load($user['kammernid'])],
|
||||
['key' => 'displaymenu', 'value' => Resources::displaymenu()],
|
||||
['key' => 'sperren', 'value' => Resources::sperren()],
|
||||
['key' => 'years', 'value' => Resources::years()],
|
||||
['key' => 'next', 'value' => Resources::next()],
|
||||
['key' => 'bundeslaender', 'value' => Resources::bundeslaender()]];
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_admin($str)
|
||||
{
|
||||
$_arr = \explode(",", $str);
|
||||
foreach ($_arr as $key => $value) {
|
||||
if($value == '3') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Bootstrap;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use HermannTelser\Zuladungsliste\Liste\ArchiveMenu;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
|
||||
class _BootstrapController
|
||||
{
|
||||
public function __construct($xaction)
|
||||
{
|
||||
switch ($xaction) {
|
||||
case 'administrator':
|
||||
UserSettings::load();
|
||||
break;
|
||||
case 'start_liste':
|
||||
UserSettings::load();
|
||||
break;
|
||||
case 'load_archive_menu':
|
||||
ArchiveMenu::load();
|
||||
break;
|
||||
default:
|
||||
Message::error(__FILE__, __LINE__, "no xaction switch defined");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Controller;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Test case for class HermannTelser\Zuladungsliste\Controller\ExtrasperrungController.
|
||||
*
|
||||
* @author Hermann Telser <hermann.telser@gmail.com>
|
||||
*/
|
||||
class AdministrationController extends \TYPO3\CMS\Core\Tests\UnitTestCase
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Controller;
|
||||
|
||||
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Test case for class HermannTelser\Zuladungsliste\Controller\KriterienController.
|
||||
*
|
||||
* @author Hermann Telser <hermann.telser@gmail.com>
|
||||
*/
|
||||
class ArchitektenController extends ActionController
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \HermannTelser\Zuladungsliste\Controller\KriterienController
|
||||
*/
|
||||
protected $subject = NULL;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->subject = $this->getMock('HermannTelser\Zuladungsliste\Controller\KriterienController', array('redirect', 'forward', 'addFlashMessage'), array(), '', FALSE);
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
unset($this->subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function listActionFetchesAllKriteriensFromRepositoryAndAssignsThemToView()
|
||||
{
|
||||
$allKriteriens = $this->getMock('TYPO3\CMS\Extbase\Persistence\ObjectStorage', array(), array(), '', FALSE);
|
||||
$kriterienRepository = $this->getMock('HermannTelser\Zuladungsliste\Domain\Repository\KriterienRepository', array('findAll'), array(), '', FALSE);
|
||||
$kriterienRepository->expects($this->once())->method('findAll')->will($this->returnValue($allKriteriens));
|
||||
$this->inject($this->subject, 'kriterienRepository', $kriterienRepository);
|
||||
$view = $this->getMock('TYPO3\CMS\Extbase\Mvc\View\ViewInterface');
|
||||
$view->expects($this->once())->method('assign')->with('kriteriens', $allKriteriens);
|
||||
$this->inject($this->subject, 'view', $view);
|
||||
$this->subject->listAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function showActionAssignsTheGivenKriterienToView()
|
||||
{
|
||||
$kriterien = new \HermannTelser\Zuladungsliste\Domain\Model\Kriterien();
|
||||
$view = $this->getMock('TYPO3\CMS\Extbase\Mvc\View\ViewInterface');
|
||||
$this->inject($this->subject, 'view', $view);
|
||||
$view->expects($this->once())->method('assign')->with('kriterien', $kriterien);
|
||||
$this->subject->showAction($kriterien);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function createActionAddsTheGivenKriterienToKriterienRepository()
|
||||
{
|
||||
$kriterien = new \HermannTelser\Zuladungsliste\Domain\Model\Kriterien();
|
||||
$kriterienRepository = $this->getMock('HermannTelser\Zuladungsliste\Domain\Repository\KriterienRepository', array('add'), array(), '', FALSE);
|
||||
$kriterienRepository->expects($this->once())->method('add')->with($kriterien);
|
||||
$this->inject($this->subject, 'kriterienRepository', $kriterienRepository);
|
||||
$this->subject->createAction($kriterien);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function editActionAssignsTheGivenKriterienToView()
|
||||
{
|
||||
$kriterien = new \HermannTelser\Zuladungsliste\Domain\Model\Kriterien();
|
||||
$view = $this->getMock('TYPO3\CMS\Extbase\Mvc\View\ViewInterface');
|
||||
$this->inject($this->subject, 'view', $view);
|
||||
$view->expects($this->once())->method('assign')->with('kriterien', $kriterien);
|
||||
$this->subject->editAction($kriterien);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function updateActionUpdatesTheGivenKriterienInKriterienRepository()
|
||||
{
|
||||
$kriterien = new \HermannTelser\Zuladungsliste\Domain\Model\Kriterien();
|
||||
$kriterienRepository = $this->getMock('HermannTelser\Zuladungsliste\Domain\Repository\KriterienRepository', array('update'), array(), '', FALSE);
|
||||
$kriterienRepository->expects($this->once())->method('update')->with($kriterien);
|
||||
$this->inject($this->subject, 'kriterienRepository', $kriterienRepository);
|
||||
$this->subject->updateAction($kriterien);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function deleteActionRemovesTheGivenKriterienFromKriterienRepository()
|
||||
{
|
||||
$kriterien = new \HermannTelser\Zuladungsliste\Domain\Model\Kriterien();
|
||||
$kriterienRepository = $this->getMock('HermannTelser\Zuladungsliste\Domain\Repository\KriterienRepository', array('remove'), array(), '', FALSE);
|
||||
$kriterienRepository->expects($this->once())->method('remove')->with($kriterien);
|
||||
$this->inject($this->subject, 'kriterienRepository', $kriterienRepository);
|
||||
$this->subject->deleteAction($kriterien);
|
||||
}
|
||||
|
||||
/**
|
||||
* action list
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function listAction()
|
||||
{
|
||||
// $architektens = $this->architektenRepository->findAll();
|
||||
// $this->view->assign('architektens', $architektens);
|
||||
}
|
||||
|
||||
/**
|
||||
* action
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function Action()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Controller;
|
||||
|
||||
use In2code\Femanager\Controller\EditController as FemanagerEditController;
|
||||
|
||||
class EditController extends FemanagerEditController
|
||||
{
|
||||
/**
|
||||
* action update
|
||||
*
|
||||
* @param HermannTelser\Zuladungsliste\Domain\Model\User $user
|
||||
* @TYPO3\CMS\Extbase\Annotation\Validate("In2code\Femanager\Domain\Validator\ServersideValidator", param="user")
|
||||
* @TYPO3\CMS\Extbase\Annotation\Validate("In2code\Femanager\Domain\Validator\PasswordValidator", param="user")
|
||||
*/
|
||||
public function updateAction($user): void
|
||||
{
|
||||
parent::updateAction($user);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Controller;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Test case for class HermannTelser\Zuladungsliste\Controller\WettbewerbeController.
|
||||
*
|
||||
* @author Hermann Telser <hermann.telser@gmail.com>
|
||||
*/
|
||||
class ExtrasperrungController extends \TYPO3\CMS\Core\Tests\UnitTestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \HermannTelser\Zuladungsliste\Controller\WettbewerbeController
|
||||
*/
|
||||
protected $subject = NULL;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->subject = $this->getMock('HermannTelser\Zuladungsliste\Controller\WettbewerbeController', array('redirect', 'forward', 'addFlashMessage'), array(), '', FALSE);
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
unset($this->subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function listActionFetchesAllWettbewerbesFromRepositoryAndAssignsThemToView()
|
||||
{
|
||||
$allWettbewerbes = $this->getMock('TYPO3\CMS\Extbase\Persistence\ObjectStorage', array(), array(), '', FALSE);
|
||||
$wettbewerbeRepository = $this->getMock('HermannTelser\Zuladungsliste\Domain\Repository\WettbewerbeRepository', array('findAll'), array(), '', FALSE);
|
||||
$wettbewerbeRepository->expects($this->once())->method('findAll')->will($this->returnValue($allWettbewerbes));
|
||||
$this->inject($this->subject, 'wettbewerbeRepository', $wettbewerbeRepository);
|
||||
$view = $this->getMock('TYPO3\CMS\Extbase\Mvc\View\ViewInterface');
|
||||
$view->expects($this->once())->method('assign')->with('wettbewerbes', $allWettbewerbes);
|
||||
$this->inject($this->subject, 'view', $view);
|
||||
$this->subject->listAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function showActionAssignsTheGivenWettbewerbeToView()
|
||||
{
|
||||
$wettbewerbe = new \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe();
|
||||
$view = $this->getMock('TYPO3\CMS\Extbase\Mvc\View\ViewInterface');
|
||||
$this->inject($this->subject, 'view', $view);
|
||||
$view->expects($this->once())->method('assign')->with('wettbewerbe', $wettbewerbe);
|
||||
$this->subject->showAction($wettbewerbe);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function createActionAddsTheGivenWettbewerbeToWettbewerbeRepository()
|
||||
{
|
||||
$wettbewerbe = new \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe();
|
||||
$wettbewerbeRepository = $this->getMock('HermannTelser\Zuladungsliste\Domain\Repository\WettbewerbeRepository', array('add'), array(), '', FALSE);
|
||||
$wettbewerbeRepository->expects($this->once())->method('add')->with($wettbewerbe);
|
||||
$this->inject($this->subject, 'wettbewerbeRepository', $wettbewerbeRepository);
|
||||
$this->subject->createAction($wettbewerbe);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function editActionAssignsTheGivenWettbewerbeToView()
|
||||
{
|
||||
$wettbewerbe = new \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe();
|
||||
$view = $this->getMock('TYPO3\CMS\Extbase\Mvc\View\ViewInterface');
|
||||
$this->inject($this->subject, 'view', $view);
|
||||
$view->expects($this->once())->method('assign')->with('wettbewerbe', $wettbewerbe);
|
||||
$this->subject->editAction($wettbewerbe);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function updateActionUpdatesTheGivenWettbewerbeInWettbewerbeRepository()
|
||||
{
|
||||
$wettbewerbe = new \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe();
|
||||
$wettbewerbeRepository = $this->getMock('HermannTelser\Zuladungsliste\Domain\Repository\WettbewerbeRepository', array('update'), array(), '', FALSE);
|
||||
$wettbewerbeRepository->expects($this->once())->method('update')->with($wettbewerbe);
|
||||
$this->inject($this->subject, 'wettbewerbeRepository', $wettbewerbeRepository);
|
||||
$this->subject->updateAction($wettbewerbe);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function deleteActionRemovesTheGivenWettbewerbeFromWettbewerbeRepository()
|
||||
{
|
||||
$wettbewerbe = new \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe();
|
||||
$wettbewerbeRepository = $this->getMock('HermannTelser\Zuladungsliste\Domain\Repository\WettbewerbeRepository', array('remove'), array(), '', FALSE);
|
||||
$wettbewerbeRepository->expects($this->once())->method('remove')->with($wettbewerbe);
|
||||
$this->inject($this->subject, 'wettbewerbeRepository', $wettbewerbeRepository);
|
||||
$this->subject->deleteAction($wettbewerbe);
|
||||
}
|
||||
|
||||
/**
|
||||
* action
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function Action()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Controller;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Test case for class HermannTelser\Zuladungsliste\Controller\ExtrasperrungController.
|
||||
*
|
||||
* @author Hermann Telser <hermann.telser@gmail.com>
|
||||
*/
|
||||
class KriterienController extends \TYPO3\CMS\Core\Tests\UnitTestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \HermannTelser\Zuladungsliste\Controller\ExtrasperrungController
|
||||
*/
|
||||
protected $subject = NULL;
|
||||
|
||||
/**
|
||||
* kriterienRepository
|
||||
*
|
||||
* @var \HermannTelser\Zuladungsliste\Domain\Repository\KriterienRepository
|
||||
* @TYPO3CMSExtbaseAnnotationInject
|
||||
*/
|
||||
protected $kriterienRepository = NULL;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->subject = $this->getMock('HermannTelser\Zuladungsliste\Controller\ExtrasperrungController', array('redirect', 'forward', 'addFlashMessage'), array(), '', FALSE);
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
unset($this->subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* action list
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function listAction()
|
||||
{
|
||||
$kriteriens = $this->kriterienRepository->findAll();
|
||||
$this->view->assign('kriteriens', $kriteriens);
|
||||
}
|
||||
|
||||
/**
|
||||
* action show
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien
|
||||
* @return void
|
||||
*/
|
||||
public function showAction(\HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien)
|
||||
{
|
||||
$this->view->assign('kriterien', $kriterien);
|
||||
}
|
||||
|
||||
/**
|
||||
* action new
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function newAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* action create
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kriterien $newKriterien
|
||||
* @return void
|
||||
*/
|
||||
public function createAction(\HermannTelser\Zuladungsliste\Domain\Model\Kriterien $newKriterien)
|
||||
{
|
||||
$this->addFlashMessage('The object was created. Please be aware that this action is publicly accessible unless you implement an access check. See http://wiki.typo3.org/T3Doc/Extension_Builder/Using_the_Extension_Builder#1._Model_the_domain', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
|
||||
$this->kriterienRepository->add($newKriterien);
|
||||
$this->redirect('list');
|
||||
}
|
||||
|
||||
/**
|
||||
* action edit
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien
|
||||
* @TYPO3CMS\Extbase\Annotation\IgnoreValidation $kriterien
|
||||
* @return void
|
||||
*/
|
||||
public function editAction(\HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien)
|
||||
{
|
||||
$this->view->assign('kriterien', $kriterien);
|
||||
}
|
||||
|
||||
/**
|
||||
* action update
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien
|
||||
* @return void
|
||||
*/
|
||||
public function updateAction(\HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien)
|
||||
{
|
||||
$this->addFlashMessage('The object was updated. Please be aware that this action is publicly accessible unless you implement an access check. See http://wiki.typo3.org/T3Doc/Extension_Builder/Using_the_Extension_Builder#1._Model_the_domain', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
|
||||
$this->kriterienRepository->update($kriterien);
|
||||
$this->redirect('list');
|
||||
}
|
||||
|
||||
/**
|
||||
* action delete
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien
|
||||
* @return void
|
||||
*/
|
||||
public function deleteAction(\HermannTelser\Zuladungsliste\Domain\Model\Kriterien $kriterien)
|
||||
{
|
||||
$this->addFlashMessage('The object was deleted. Please be aware that this action is publicly accessible unless you implement an access check. See http://wiki.typo3.org/T3Doc/Extension_Builder/Using_the_Extension_Builder#1._Model_the_domain', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
|
||||
$this->kriterienRepository->remove($kriterien);
|
||||
$this->redirect('list');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Controller;
|
||||
|
||||
use In2code\Femanager\Controller\NewController as FemanagerNewController;
|
||||
|
||||
class NewController extends FemanagerNewController
|
||||
{
|
||||
/**
|
||||
* action create
|
||||
*
|
||||
* @param HermannTelser\Zuladungsliste\Domain\Model\User $user
|
||||
* @TYPO3\CMS\Extbase\Annotation\Validate("In2code\Femanager\Domain\Validator\ServersideValidator", param="user")
|
||||
* @TYPO3\CMS\Extbase\Annotation\Validate("In2code\Femanager\Domain\Validator\PasswordValidator", param="user")
|
||||
*/
|
||||
public function createAction($user): void
|
||||
{
|
||||
parent::createAction($user);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Controller;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Extbase\Annotation\Inject;
|
||||
|
||||
/**
|
||||
* Test case for class \HermannTelser\Zuladungsliste\Domain\Model\Architekten.
|
||||
*
|
||||
* @copyright Copyright belongs to the respective authors
|
||||
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
|
||||
* @author Hermann Telser <hermann.telser@gmail.com>
|
||||
*/
|
||||
class WettbewerbeController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \HermannTelser\Zuladungsliste\Domain\Model\Architekten
|
||||
*/
|
||||
protected $subject = NULL;
|
||||
|
||||
/**
|
||||
* wettbewerbeRepository
|
||||
*
|
||||
* @var \HermannTelser\Zuladungsliste\Domain\Repository\WettbewerbeRepository
|
||||
* @TYPO3\CMS\Extbase\Annotation\Inject
|
||||
*/
|
||||
protected $wettbewerbeRepository = NULL;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->subject = new \HermannTelser\Zuladungsliste\Domain\Model\Architekten();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
unset($this->subject);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function getInlisteReturnsInitialValueForBool()
|
||||
{
|
||||
$this->assertSame(FALSE, $this->subject->getInliste());
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function setInlisteForBoolSetsInliste()
|
||||
{
|
||||
$this->subject->setInliste(TRUE);
|
||||
$this->assertAttributeEquals(TRUE, 'inliste', $this->subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function getVereidigungReturnsInitialValueForDateTime()
|
||||
{
|
||||
$this->assertEquals(NULL, $this->subject->getVereidigung());
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function setVereidigungForDateTimeSetsVereidigung()
|
||||
{
|
||||
$dateTimeFixture = new \DateTime();
|
||||
$this->subject->setVereidigung($dateTimeFixture);
|
||||
$this->assertAttributeEquals($dateTimeFixture, 'vereidigung', $this->subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function getGeburtsdatumReturnsInitialValueForDateTime()
|
||||
{
|
||||
$this->assertEquals(NULL, $this->subject->getGeburtsdatum());
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function setGeburtsdatumForDateTimeSetsGeburtsdatum()
|
||||
{
|
||||
$dateTimeFixture = new \DateTime();
|
||||
$this->subject->setGeburtsdatum($dateTimeFixture);
|
||||
$this->assertAttributeEquals($dateTimeFixture, 'geburtsdatum', $this->subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function getfrauenfoerderpunktReturnsInitialValueForBool()
|
||||
{
|
||||
$this->assertSame(FALSE, $this->subject->getfrauenfoerderpunkt());
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function setfrauenfoerderpunktForBoolSetsfrauenfoerderpunkt()
|
||||
{
|
||||
$this->subject->setfrauenfoerderpunkt(TRUE);
|
||||
$this->assertAttributeEquals(TRUE, 'frauenfoerderpunkt', $this->subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* action list
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function listAction()
|
||||
{
|
||||
$wettbewerbes = $this->wettbewerbeRepository->findAll();
|
||||
$this->view->assign('wettbewerbes', $wettbewerbes);
|
||||
}
|
||||
|
||||
/**
|
||||
* action show
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe
|
||||
* @return void
|
||||
*/
|
||||
public function showAction(\HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe)
|
||||
{
|
||||
$this->view->assign('wettbewerbe', $wettbewerbe);
|
||||
}
|
||||
|
||||
/**
|
||||
* action new
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function newAction()
|
||||
{
|
||||
//// top.TYPO3.Backend.NavigationContainer.PageTree.select(38);
|
||||
echo '<script>
|
||||
if (top && top.TYPO3.Backend.NavigationContainer.PageTree) {
|
||||
top.TYPO3.ModuleMenu.App.showModule("web_list");
|
||||
}
|
||||
window.open("http://'.$_SERVER["SERVER_NAME"].'/index.php?id=34","_blank");
|
||||
</script>';
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* action create
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $newWettbewerbe
|
||||
* @return void
|
||||
*/
|
||||
public function createAction(\HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $newWettbewerbe)
|
||||
{
|
||||
$this->addFlashMessage('The object was created. Please be aware that this action is publicly accessible unless you implement an access check. See http://wiki.typo3.org/T3Doc/Extension_Builder/Using_the_Extension_Builder#1._Model_the_domain', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
|
||||
$this->wettbewerbeRepository->add($newWettbewerbe);
|
||||
$this->redirect('list');
|
||||
}
|
||||
|
||||
/**
|
||||
* action edit
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe
|
||||
* @TYPO3\CMS\Extbase\Annotation\IgnoreValidation $wettbewerbe
|
||||
* @return void
|
||||
*/
|
||||
public function editAction(\HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe)
|
||||
{
|
||||
$this->view->assign('wettbewerbe', $wettbewerbe);
|
||||
}
|
||||
|
||||
/**
|
||||
* action update
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe
|
||||
* @return void
|
||||
*/
|
||||
public function updateAction(\HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe)
|
||||
{
|
||||
$this->addFlashMessage('The object was updated. Please be aware that this action is publicly accessible unless you implement an access check. See http://wiki.typo3.org/T3Doc/Extension_Builder/Using_the_Extension_Builder#1._Model_the_domain', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
|
||||
$this->wettbewerbeRepository->update($wettbewerbe);
|
||||
$this->redirect('list');
|
||||
}
|
||||
|
||||
/**
|
||||
* action delete
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe
|
||||
* @return void
|
||||
*/
|
||||
public function deleteAction(\HermannTelser\Zuladungsliste\Domain\Model\Wettbewerbe $wettbewerbe)
|
||||
{
|
||||
$this->addFlashMessage('The object was deleted. Please be aware that this action is publicly accessible unless you implement an access check. See http://wiki.typo3.org/T3Doc/Extension_Builder/Using_the_Extension_Builder#1._Model_the_domain', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
|
||||
$this->wettbewerbeRepository->remove($wettbewerbe);
|
||||
$this->redirect('list');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Architeckten model extends FrondenUser model
|
||||
*/
|
||||
class Architekten extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
|
||||
{
|
||||
|
||||
/**
|
||||
* kammermitgliedsnummer
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $kammermitgliedsnummer;
|
||||
|
||||
/**
|
||||
* inliste
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $inliste = false;
|
||||
|
||||
/**
|
||||
* vereidigung
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $vereidigung = null;
|
||||
|
||||
/**
|
||||
* geburtsdatum
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $geburtsdatum = null;
|
||||
|
||||
/**
|
||||
* frauenfoerderpunkt
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $frauenfoerderpunkt = false;
|
||||
|
||||
/**
|
||||
* Returns the kammermitgliedsnummer
|
||||
*
|
||||
* @return string $kammermitgliedsnummer
|
||||
*/
|
||||
public function getKammermitgliedsnummer() {
|
||||
return $this->kammermitgliedsnummer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the kammermitgliedsnummer
|
||||
*
|
||||
* @param string $kammermitgliedsnummer
|
||||
* @return void
|
||||
*/
|
||||
public function setKammermitgliedsnummer($kammermitgliedsnummer) {
|
||||
$this->kammermitgliedsnummer = $kammermitgliedsnummer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the inliste
|
||||
*
|
||||
* @return bool $inliste
|
||||
*/
|
||||
public function getInliste()
|
||||
{
|
||||
return $this->inliste;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the inliste
|
||||
*
|
||||
* @param bool $inliste
|
||||
* @return void
|
||||
*/
|
||||
public function setInliste($inliste)
|
||||
{
|
||||
$this->inliste = $inliste;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the boolean state of inliste
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isInliste()
|
||||
{
|
||||
return $this->inliste;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the vereidigung
|
||||
*
|
||||
* @return \DateTime $vereidigung
|
||||
*/
|
||||
public function getVereidigung()
|
||||
{
|
||||
return $this->vereidigung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the vereidigung
|
||||
*
|
||||
* @param \DateTime $vereidigung
|
||||
* @return void
|
||||
*/
|
||||
public function setVereidigung(\DateTime $vereidigung)
|
||||
{
|
||||
$this->vereidigung = $vereidigung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the geburtsdatum
|
||||
*
|
||||
* @return \DateTime $geburtsdatum
|
||||
*/
|
||||
public function getGeburtsdatum()
|
||||
{
|
||||
return $this->geburtsdatum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the geburtsdatum
|
||||
*
|
||||
* @param \DateTime $geburtsdatum
|
||||
* @return void
|
||||
*/
|
||||
public function setGeburtsdatum(\DateTime $geburtsdatum)
|
||||
{
|
||||
$this->geburtsdatum = $geburtsdatum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the frauenfoerderpunkt
|
||||
*
|
||||
* @return bool $frauenfoerderpunkt
|
||||
*/
|
||||
public function getfrauenfoerderpunkt()
|
||||
{
|
||||
return $this->frauenfoerderpunkt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the frauenfoerderpunkt
|
||||
*
|
||||
* @param bool $frauenfoerderpunkt
|
||||
* @return void
|
||||
*/
|
||||
public function setfrauenfoerderpunkt($frauenfoerderpunkt)
|
||||
{
|
||||
$this->frauenfoerderpunkt = $frauenfoerderpunkt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the boolean state of frauenfoerderpunkt
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isfrauenfoerderpunkt()
|
||||
{
|
||||
return $this->frauenfoerderpunkt;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Extrasperrung
|
||||
*/
|
||||
class Extrasperrung extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* begruendung
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $begruendung = '';
|
||||
|
||||
/**
|
||||
* sperrzeitbis
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $sperrzeitbis = null;
|
||||
|
||||
/**
|
||||
* extrasperrungUser
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<>
|
||||
*/
|
||||
protected $extrasperrungUser = null;
|
||||
|
||||
/**
|
||||
* Returns the begruendung
|
||||
*
|
||||
* @return string $begruendung
|
||||
*/
|
||||
public function getBegruendung()
|
||||
{
|
||||
return $this->begruendung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the begruendung
|
||||
*
|
||||
* @param string $begruendung
|
||||
* @return void
|
||||
*/
|
||||
public function setBegruendung($begruendung)
|
||||
{
|
||||
$this->begruendung = $begruendung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sperrzeitbis
|
||||
*
|
||||
* @return \DateTime $sperrzeitbis
|
||||
*/
|
||||
public function getSperrzeitbis()
|
||||
{
|
||||
return $this->sperrzeitbis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sperrzeitbis
|
||||
*
|
||||
* @param \DateTime $sperrzeitbis
|
||||
* @return void
|
||||
*/
|
||||
public function setSperrzeitbis(\DateTime $sperrzeitbis)
|
||||
{
|
||||
$this->sperrzeitbis = $sperrzeitbis;
|
||||
}
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//Do not remove the next line: It would break the functionality
|
||||
$this->initStorageObjects();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes all ObjectStorage properties
|
||||
* Do not modify this method!
|
||||
* It will be rewritten on each save in the extension builder
|
||||
* You may modify the constructor of this class instead
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function initStorageObjects()
|
||||
{
|
||||
$this->extrasperrungUser = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Kammern
|
||||
*/
|
||||
class Kammern extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* bezeichnung
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $bezeichnung = '';
|
||||
|
||||
/**
|
||||
* Returns the bezeichnung
|
||||
*
|
||||
* @return string $bezeichnung
|
||||
*/
|
||||
public function getBezeichnung()
|
||||
{
|
||||
return $this->bezeichnung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bezeichnung
|
||||
*
|
||||
* @param string $bezeichnung
|
||||
* @return void
|
||||
*/
|
||||
public function setBezeichnung($bezeichnung)
|
||||
{
|
||||
$this->bezeichnung = $bezeichnung;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Wetbewerbsarten mit Bewertung
|
||||
*/
|
||||
class Kriterien extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* bezeichnung
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $bezeichnung = '';
|
||||
|
||||
/**
|
||||
* preisartid
|
||||
*
|
||||
* @var \HermannTelser\Zuladungsliste\Domain\Model\Preisart
|
||||
*/
|
||||
protected $preisartid = null;
|
||||
|
||||
/**
|
||||
* sektinstagid
|
||||
*
|
||||
* @var \HermannTelser\Zuladungsliste\Domain\Model\Sektionstage
|
||||
*/
|
||||
protected $sektinstagid = null;
|
||||
|
||||
/**
|
||||
* Returns the bezeichnung
|
||||
*
|
||||
* @return string $bezeichnung
|
||||
*/
|
||||
public function getBezeichnung()
|
||||
{
|
||||
return $this->bezeichnung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bezeichnung
|
||||
*
|
||||
* @param string $bezeichnung
|
||||
* @return void
|
||||
*/
|
||||
public function setBezeichnung($bezeichnung)
|
||||
{
|
||||
$this->bezeichnung = $bezeichnung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the preisartid
|
||||
*
|
||||
* @return \HermannTelser\Zuladungsliste\Domain\Model\Preisart $preisartid
|
||||
*/
|
||||
public function getPreisartid()
|
||||
{
|
||||
return $this->preisartid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the preisartid
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Preisart $preisartid
|
||||
* @return void
|
||||
*/
|
||||
public function setPreisartid(\HermannTelser\Zuladungsliste\Domain\Model\Preisart $preisartid)
|
||||
{
|
||||
$this->preisartid = $preisartid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sektinstagid
|
||||
*
|
||||
* @return \HermannTelser\Zuladungsliste\Domain\Model\Sektionstage $sektinstagid
|
||||
*/
|
||||
public function getSektinstagid()
|
||||
{
|
||||
return $this->sektinstagid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sektinstagid
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Sektionstage $sektinstagid
|
||||
* @return void
|
||||
*/
|
||||
public function setSektinstagid(\HermannTelser\Zuladungsliste\Domain\Model\Sektionstage $sektinstagid)
|
||||
{
|
||||
$this->sektinstagid = $sektinstagid;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Preisart
|
||||
*/
|
||||
class Preisart extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* preisart
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $preisart = '';
|
||||
|
||||
/**
|
||||
* Returns the preisart
|
||||
*
|
||||
* @return string $preisart
|
||||
*/
|
||||
public function getPreisart()
|
||||
{
|
||||
return $this->preisart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the preisart
|
||||
*
|
||||
* @param string $preisart
|
||||
* @return void
|
||||
*/
|
||||
public function setPreisart($preisart)
|
||||
{
|
||||
$this->preisart = $preisart;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Punkte
|
||||
*/
|
||||
class Punkte extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* bezeichnung
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $bezeichnung = '';
|
||||
|
||||
/**
|
||||
* Returns the bezeichnung
|
||||
*
|
||||
* @return string $bezeichnung
|
||||
*/
|
||||
public function getBezeichnung()
|
||||
{
|
||||
return $this->bezeichnung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bezeichnung
|
||||
*
|
||||
* @param string $bezeichnung
|
||||
* @return void
|
||||
*/
|
||||
public function setBezeichnung($bezeichnung)
|
||||
{
|
||||
$this->bezeichnung = $bezeichnung;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,371 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Sektionstage
|
||||
*/
|
||||
class Sektionstage extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* bezeichnung
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $bezeichnung = '';
|
||||
|
||||
/**
|
||||
* stichtag
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $stichtag = null;
|
||||
|
||||
/**
|
||||
* sperrzeit
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $sperrzeit = 0;
|
||||
|
||||
/**
|
||||
* sperrzeitstart
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $sperrzeitstart = null;
|
||||
|
||||
/**
|
||||
* punktezeit
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $punktezeit = 0;
|
||||
|
||||
/**
|
||||
* punktezeitstart
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $punktezeitstart = null;
|
||||
|
||||
/**
|
||||
* neueinsteiger
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $neueinsteiger = 0;
|
||||
|
||||
/**
|
||||
* neueinsteigerstart
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $neueinsteigerstart = null;
|
||||
|
||||
/**
|
||||
* frauenfoerderung
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $frauenfoerderung = 0;
|
||||
|
||||
/**
|
||||
* frauenfoerderungstart
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $frauenfoerderungstart = null;
|
||||
|
||||
/**
|
||||
* frauenfoerderungsonderstart
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $frauenfoerderungsonderstart = null;
|
||||
|
||||
/**
|
||||
* kammernid
|
||||
*
|
||||
* @var \HermannTelser\Zuladungsliste\Domain\Model\Kammern
|
||||
*/
|
||||
protected $kammernid = null;
|
||||
|
||||
/**
|
||||
* Returns the bezeichnung
|
||||
*
|
||||
* @return string $bezeichnung
|
||||
*/
|
||||
public function getBezeichnung()
|
||||
{
|
||||
return $this->bezeichnung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bezeichnung
|
||||
*
|
||||
* @param string $bezeichnung
|
||||
* @return void
|
||||
*/
|
||||
public function setBezeichnung($bezeichnung)
|
||||
{
|
||||
$this->bezeichnung = $bezeichnung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the stichtag
|
||||
*
|
||||
* @return \DateTime $stichtag
|
||||
*/
|
||||
public function getStichtag()
|
||||
{
|
||||
return $this->stichtag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the stichtag
|
||||
*
|
||||
* @param \DateTime $stichtag
|
||||
* @return void
|
||||
*/
|
||||
public function setStichtag(\DateTime $stichtag)
|
||||
{
|
||||
$this->stichtag = $stichtag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sperrzeit
|
||||
*
|
||||
* @return int $sperrzeit
|
||||
*/
|
||||
public function getSperrzeit()
|
||||
{
|
||||
return $this->sperrzeit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sperrzeit
|
||||
*
|
||||
* @param int $sperrzeit
|
||||
* @return void
|
||||
*/
|
||||
public function setSperrzeit($sperrzeit)
|
||||
{
|
||||
$this->sperrzeit = $sperrzeit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sperrzeitstart
|
||||
*
|
||||
* @return \DateTime $sperrzeitstart
|
||||
*/
|
||||
public function getSperrzeitstart()
|
||||
{
|
||||
return $this->sperrzeitstart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sperrzeitstart
|
||||
*
|
||||
* @param \DateTime $sperrzeitstart
|
||||
* @return void
|
||||
*/
|
||||
public function setSperrzeitstart(\DateTime $sperrzeitstart)
|
||||
{
|
||||
$this->sperrzeitstart = $sperrzeitstart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the punktezeit
|
||||
*
|
||||
* @return int $punktezeit
|
||||
*/
|
||||
public function getPunktezeit()
|
||||
{
|
||||
return $this->punktezeit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the punktezeit
|
||||
*
|
||||
* @param int $punktezeit
|
||||
* @return void
|
||||
*/
|
||||
public function setPunktezeit($punktezeit)
|
||||
{
|
||||
$this->punktezeit = $punktezeit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the punktezeitstart
|
||||
*
|
||||
* @return \DateTime $punktezeitstart
|
||||
*/
|
||||
public function getPunktezeitstart()
|
||||
{
|
||||
return $this->punktezeitstart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the punktezeitstart
|
||||
*
|
||||
* @param \DateTime $punktezeitstart
|
||||
* @return void
|
||||
*/
|
||||
public function setPunktezeitstart(\DateTime $punktezeitstart)
|
||||
{
|
||||
$this->punktezeitstart = $punktezeitstart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the neueinsteiger
|
||||
*
|
||||
* @return int $neueinsteiger
|
||||
*/
|
||||
public function getNeueinsteiger()
|
||||
{
|
||||
return $this->neueinsteiger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the neueinsteiger
|
||||
*
|
||||
* @param int $neueinsteiger
|
||||
* @return void
|
||||
*/
|
||||
public function setNeueinsteiger($neueinsteiger)
|
||||
{
|
||||
$this->neueinsteiger = $neueinsteiger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the neueinsteigerstart
|
||||
*
|
||||
* @return \DateTime $neueinsteigerstart
|
||||
*/
|
||||
public function getNeueinsteigerstart()
|
||||
{
|
||||
return $this->neueinsteigerstart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the neueinsteigerstart
|
||||
*
|
||||
* @param \DateTime $neueinsteigerstart
|
||||
* @return void
|
||||
*/
|
||||
public function setNeueinsteigerstart(\DateTime $neueinsteigerstart)
|
||||
{
|
||||
$this->neueinsteigerstart = $neueinsteigerstart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the frauenfoerderung
|
||||
*
|
||||
* @return int $frauenfoerderung
|
||||
*/
|
||||
public function getFrauenfoerderung()
|
||||
{
|
||||
return $this->frauenfoerderung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the frauenfoerderung
|
||||
*
|
||||
* @param int $frauenfoerderung
|
||||
* @return void
|
||||
*/
|
||||
public function setFrauenfoerderung($frauenfoerderung)
|
||||
{
|
||||
$this->frauenfoerderung = $frauenfoerderung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the frauenfoerderungstart
|
||||
*
|
||||
* @return \DateTime $frauenfoerderungstart
|
||||
*/
|
||||
public function getFrauenfoerderungstart()
|
||||
{
|
||||
return $this->frauenfoerderungstart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the frauenfoerderungstart
|
||||
*
|
||||
* @param \DateTime $frauenfoerderungstart
|
||||
* @return void
|
||||
*/
|
||||
public function setFrauenfoerderungstart(\DateTime $frauenfoerderungstart)
|
||||
{
|
||||
$this->frauenfoerderungstart = $frauenfoerderungstart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the frauenfoerderungsonderstart
|
||||
*
|
||||
* @return \DateTime $frauenfoerderungsonderstart
|
||||
*/
|
||||
public function getFrauenfoerderungsonderstart()
|
||||
{
|
||||
return $this->frauenfoerderungsonderstart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the frauenfoerderungsonderstart
|
||||
*
|
||||
* @param \DateTime $frauenfoerderungsonderstart
|
||||
* @return void
|
||||
*/
|
||||
public function setFrauenfoerderungsonderstart(\DateTime $frauenfoerderungsonderstart)
|
||||
{
|
||||
$this->frauenfoerderungsonderstart = $frauenfoerderungsonderstart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the kammernid
|
||||
*
|
||||
* @return \HermannTelser\Zuladungsliste\Domain\Model\Kammern kammernid
|
||||
*/
|
||||
public function getKammernid()
|
||||
{
|
||||
return $this->kammernid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the kammernid
|
||||
*
|
||||
* @param \HermannTelser\Zuladungsliste\Domain\Model\Kammern $kammernid
|
||||
* @return void
|
||||
*/
|
||||
public function setKammernid(\HermannTelser\Zuladungsliste\Domain\Model\Kammern $kammernid)
|
||||
{
|
||||
$this->kammernid = $kammernid;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Model;
|
||||
|
||||
class User extends \In2code\Femanager\Domain\Model\User
|
||||
{
|
||||
/**
|
||||
* kammermitgliedsnummer
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $kammermitgliedsnummer;
|
||||
|
||||
/**
|
||||
* frauenfoerderpunkt
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $frauenfoerderpunkt;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the kammermitgliedsnummer
|
||||
*
|
||||
* @return string $kammermitgliedsnummer
|
||||
*/
|
||||
public function getKammermitgliedsnummer()
|
||||
{
|
||||
return $this->kammermitgliedsnummer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the kammermitgliedsnummer
|
||||
*
|
||||
* @param string $kammermitgliedsnummer
|
||||
* @return void
|
||||
*/
|
||||
public function setKammermitgliedsnummer($kammermitgliedsnummer)
|
||||
{
|
||||
$this->kammermitgliedsnummer = $kammermitgliedsnummer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return \bool
|
||||
*/
|
||||
public function getFrauenfoerderpunkt()
|
||||
{
|
||||
return $this->frauenfoerderpunkt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the frauenfoerderpunkt
|
||||
*
|
||||
* @param bool $frauenfoerderpunkt
|
||||
* @return void
|
||||
*/
|
||||
public function setFrauenfoerderpunkt($frauenfoerderpunkt)
|
||||
{
|
||||
$this->frauenfoerderpunkt = $frauenfoerderpunkt;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,355 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Wettbewerbe und Preise
|
||||
*/
|
||||
class Wettbewerbe extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* wettbewerb
|
||||
*
|
||||
* @var string
|
||||
* @TYPO3\CMS\Extbase\Annotation\Validate NotEmpty
|
||||
*/
|
||||
protected $wettbewerb = '';
|
||||
|
||||
/**
|
||||
* beschreibung
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $beschreibung = '';
|
||||
|
||||
/**
|
||||
* registrierung
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $registrierung = '';
|
||||
|
||||
/**
|
||||
* verfahrensort
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $verfahrensort = '';
|
||||
|
||||
/**
|
||||
* bundesland
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $bundesland = '';
|
||||
|
||||
/**
|
||||
* abgabetermin
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $abgabetermin = null;
|
||||
|
||||
/**
|
||||
* kammerbeschluss
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $kammerbeschluss = null;
|
||||
|
||||
/**
|
||||
* entscheidungstermin
|
||||
*
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $entscheidungstermin = null;
|
||||
|
||||
/**
|
||||
* sperrung
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $sperrung = false;
|
||||
|
||||
/**
|
||||
* aufgabenstellung
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $aufgabenstellung = '';
|
||||
|
||||
/**
|
||||
* wettbewerbUser
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\HermannTelser\Zuladungsliste\Domain\Model\Architekten>
|
||||
*/
|
||||
protected $wettbewerbUser = null;
|
||||
|
||||
/**
|
||||
* Returns the wettbewerb
|
||||
*
|
||||
* @return string $wettbewerb
|
||||
*/
|
||||
public function getWettbewerb()
|
||||
{
|
||||
return $this->wettbewerb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the wettbewerb
|
||||
*
|
||||
* @param string $wettbewerb
|
||||
* @return void
|
||||
*/
|
||||
public function setWettbewerb($wettbewerb)
|
||||
{
|
||||
$this->wettbewerb = $wettbewerb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the beschreibung
|
||||
*
|
||||
* @return string $beschreibung
|
||||
*/
|
||||
public function getBeschreibung()
|
||||
{
|
||||
return $this->beschreibung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the beschreibung
|
||||
*
|
||||
* @param string $beschreibung
|
||||
* @return void
|
||||
*/
|
||||
public function setBeschreibung($beschreibung)
|
||||
{
|
||||
$this->beschreibung = $beschreibung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the registrierung
|
||||
*
|
||||
* @return string $registrierung
|
||||
*/
|
||||
public function getRegistrierung()
|
||||
{
|
||||
return $this->registrierung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the registrierung
|
||||
*
|
||||
* @param string $registrierung
|
||||
* @return void
|
||||
*/
|
||||
public function setRegistrierung($registrierung)
|
||||
{
|
||||
$this->registrierung = $registrierung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the verfahrensort
|
||||
*
|
||||
* @return string $verfahrensort
|
||||
*/
|
||||
public function getVerfahrensort()
|
||||
{
|
||||
return $this->verfahrensort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the verfahrensort
|
||||
*
|
||||
* @param string $verfahrensort
|
||||
* @return void
|
||||
*/
|
||||
public function setVerfahrensort($verfahrensort)
|
||||
{
|
||||
$this->verfahrensort = $verfahrensort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bundesland
|
||||
*
|
||||
* @return string $bundesland
|
||||
*/
|
||||
public function getBundesland()
|
||||
{
|
||||
return $this->bundesland;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bundesland
|
||||
*
|
||||
* @param string $bundesland
|
||||
* @return void
|
||||
*/
|
||||
public function setBundesland($bundesland)
|
||||
{
|
||||
$this->bundesland = $bundesland;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the abgabetermin
|
||||
*
|
||||
* @return \DateTime $abgabetermin
|
||||
*/
|
||||
public function getAbgabetermin()
|
||||
{
|
||||
return $this->abgabetermin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the abgabetermin
|
||||
*
|
||||
* @param \DateTime $abgabetermin
|
||||
* @return void
|
||||
*/
|
||||
public function setAbgabetermin(\DateTime $abgabetermin)
|
||||
{
|
||||
$this->abgabetermin = $abgabetermin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the kammerbeschluss
|
||||
*
|
||||
* @return \DateTime $kammerbeschluss
|
||||
*/
|
||||
public function getKammerbeschluss()
|
||||
{
|
||||
return $this->kammerbeschluss;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the kammerbeschluss
|
||||
*
|
||||
* @param \DateTime $kammerbeschluss
|
||||
* @return void
|
||||
*/
|
||||
public function setKammerbeschluss(\DateTime $kammerbeschluss)
|
||||
{
|
||||
$this->kammerbeschluss = $kammerbeschluss;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the entscheidungstermin
|
||||
*
|
||||
* @return \DateTime $entscheidungstermin
|
||||
*/
|
||||
public function getEntscheidungstermin()
|
||||
{
|
||||
return $this->entscheidungstermin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the entscheidungstermin
|
||||
*
|
||||
* @param \DateTime $entscheidungstermin
|
||||
* @return void
|
||||
*/
|
||||
public function setEntscheidungstermin(\DateTime $entscheidungstermin)
|
||||
{
|
||||
$this->entscheidungstermin = $entscheidungstermin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sperrung
|
||||
*
|
||||
* @return bool $sperrung
|
||||
*/
|
||||
public function getSperrung()
|
||||
{
|
||||
return $this->sperrung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sperrung
|
||||
*
|
||||
* @param bool $sperrung
|
||||
* @return void
|
||||
*/
|
||||
public function setSperrung($sperrung)
|
||||
{
|
||||
$this->sperrung = $sperrung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the boolean state of sperrung
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSperrung()
|
||||
{
|
||||
return $this->sperrung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the aufgabenstellung
|
||||
*
|
||||
* @return string $aufgabenstellung
|
||||
*/
|
||||
public function getAufgabenstellung()
|
||||
{
|
||||
return $this->aufgabenstellung;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the aufgabenstellung
|
||||
*
|
||||
* @param string $aufgabenstellung
|
||||
* @return void
|
||||
*/
|
||||
public function setAufgabenstellung($aufgabenstellung)
|
||||
{
|
||||
$this->aufgabenstellung = $aufgabenstellung;
|
||||
}
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//Do not remove the next line: It would break the functionality
|
||||
$this->initStorageObjects();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes all ObjectStorage properties
|
||||
* Do not modify this method!
|
||||
* It will be rewritten on each save in the extension builder
|
||||
* You may modify the constructor of this class instead
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function initStorageObjects()
|
||||
{
|
||||
$this->wettbewerbUser = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* The repository for Architektens
|
||||
*/
|
||||
class ArchitektenRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Hermann Telser <hermann.telser@gmail.com>, Hermann Telser
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* The repository for Kriteriens
|
||||
*/
|
||||
class KriterienRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace HermannTelser\Zuladungsliste\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* The repository for Wettbewerbes
|
||||
*/
|
||||
class WettbewerbeRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Download;
|
||||
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Core\Environment;
|
||||
|
||||
class PdfEinreichung
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function download()
|
||||
{
|
||||
|
||||
$pdfname = GeneralUtility::_GP("pdf");
|
||||
$userid = GeneralUtility::_GP("userid");
|
||||
$file = Environment::getPublicPath() . "/uploads/tx_zuladungsliste/" . $userid . "/" . $pdfname;
|
||||
|
||||
echo $file;
|
||||
|
||||
if(file_exists($file)) {
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename='.basename($file));
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
ob_clean();
|
||||
flush();
|
||||
readfile($file);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Download;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\Sektionstage;
|
||||
use HermannTelser\Zuladungsliste\Liste\ListeTree;
|
||||
use Mpdf;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class PdfListe
|
||||
{
|
||||
public static $Mpdf;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function download()
|
||||
{
|
||||
$berechnene = new _Berechnung();
|
||||
Sektionstage::load();
|
||||
|
||||
$pdf_archive_id = GeneralUtility::_GP('pdf_archive_id');
|
||||
$extPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('zuladungsliste');
|
||||
|
||||
if ($pdf_archive_id) {
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_archive_admin');
|
||||
$statement = $queryBuilder
|
||||
->select('liste', 'crdate')
|
||||
->from('tx_zuladungsliste_archive_admin')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid', (int) $pdf_archive_id)
|
||||
)
|
||||
->execute()->fetchAll();
|
||||
$_liste = json_decode($statement[0]['liste'], true);
|
||||
$timestamp = $statement[0]['crdate'];
|
||||
$timestamp_formattet = (strftime('%A %d. %B %Y', $statement[0]['crdate']));
|
||||
$timestamp_titel = (strftime('%d. %b. %Y', $statement[0]['crdate']));
|
||||
} else {
|
||||
$berechnene::berechnen();
|
||||
ListeTree::set_dijit();
|
||||
$_liste = $berechnene::$_return;
|
||||
$timestamp = time();
|
||||
$timestamp_formattet = strftime('%A %d. %B %Y', time());
|
||||
$timestamp_titel = strftime('%d. %b. %Y', time());
|
||||
}
|
||||
|
||||
self::$Mpdf = new \Mpdf\Mpdf([
|
||||
'mode' => 'utf-8',
|
||||
'format' => 'A4-P',
|
||||
'margin_left' => 7,
|
||||
'margin_right' => 7,
|
||||
'margin_top' => 12,
|
||||
'margin_bottom' => 12,
|
||||
'margin_header' => 0,
|
||||
'margin_footer' => 0,
|
||||
]);
|
||||
self::$Mpdf->SetTitle("ZL vom " . $timestamp_titel);
|
||||
$stylesheet = file_get_contents($extPath.'Classes/Download/style.css');
|
||||
self::$Mpdf->WriteHTML($stylesheet, \Mpdf\HTMLParserMode::HEADER_CSS);
|
||||
|
||||
// logo
|
||||
$html = '<div>';
|
||||
$image = $extPath.'Resources/Public/Images/ztkammer-logo.png';
|
||||
$html .= '<img src="'.$image.'" style="width:60mm; height:auto">';
|
||||
|
||||
// header
|
||||
$html .= '<div class="liste-titel">Zuladungsliste Wettbewerbe Steiermark</div>';
|
||||
|
||||
// sub header
|
||||
$sektionstag = Sektionstage::filter($timestamp);
|
||||
$html .= '<p>Stand '.$timestamp_formattet.', auf Basis des Sektionstages vom '.$sektionstag['stichtag'].', '.$sektionstag['bezeichnung'].'</p>';
|
||||
|
||||
// tabelle
|
||||
$html .= '<table class="pure-table pure-table-striped liste">';
|
||||
$html .= '<tr><th>Rang</th><th>Pos</th><th>Büro</th><th>Punkte</th><th>Sperrung bis</th><tr>';
|
||||
foreach ($_liste as $key => $value) {
|
||||
if (isset($value['user_id'])) {
|
||||
if (0 == $value['pos']) {
|
||||
$value['pos'] = '';
|
||||
$color = "rot";
|
||||
} else {
|
||||
$value['gesperrt_bis'] = 'Frei';
|
||||
$color = "gruen";
|
||||
}
|
||||
|
||||
$html .= '<tr>';
|
||||
$html .= "<td class=\"center\">".$value['rang'].'</td>';
|
||||
$html .= "<td class=\"center \">".$value['pos'].'</td>';
|
||||
$html .= "<td>".$value['company'].'</td>';
|
||||
$html .= "<td class=\"center\">".number_format($value['punkte'], 2).'</td>';
|
||||
$html .= "<td class=\"center $color\">".$value['gesperrt_bis'].'</td>';
|
||||
$html .= '</tr>';
|
||||
}
|
||||
}
|
||||
$html .= '</table>';
|
||||
|
||||
self::$Mpdf->WriteHTML($html, \Mpdf\HTMLParserMode::HTML_BODY);
|
||||
|
||||
self::$Mpdf->Output('Standard.pdf', Mpdf\Output\Destination::INLINE);
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Download;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
|
||||
class _DownloadController
|
||||
{
|
||||
public function __construct($xaction)
|
||||
{
|
||||
switch ($xaction) {
|
||||
case 'download_pdf':
|
||||
PdfListe::download();
|
||||
break;
|
||||
case 'download_einreichung':
|
||||
PdfEinreichung::download();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
font-size: 0.9em;
|
||||
line-height: 1.1em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.liste-titel {
|
||||
font-family: sans-serif;
|
||||
padding: 15mm 0 0;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin: 1em auto;
|
||||
}
|
||||
|
||||
.rot {
|
||||
color: #800;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.filter {
|
||||
background-color: #eee;
|
||||
border: 1px solid #cbcbcb;
|
||||
padding: 0.5rem 1rem;
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
|
||||
/* PURE TABLES START */
|
||||
.pure-table {
|
||||
/* Remove spacing between table cells (from Normalize.css) */
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
empty-cells: show;
|
||||
border: 1px solid #cbcbcb;
|
||||
}
|
||||
|
||||
.pure-table td,
|
||||
.pure-table th,
|
||||
.pure-table-noborder td,
|
||||
.pure-table-noborder th {
|
||||
border-left: 1px solid #cbcbcb;
|
||||
border-bottom: 1px solid #cbcbcb;
|
||||
/* inner column border */
|
||||
border-width: 0 0 1px 1px;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
/*to make ths where the title is really long work*/
|
||||
padding: .7em 1em;
|
||||
/* cell padding */
|
||||
}
|
||||
|
||||
.pure-table td {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pure-table-odd td {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
/* nth-child selector for modern browsers */
|
||||
.pure-table-striped tr:nth-child(2n-1) td {
|
||||
background-color: #eee;
|
||||
border-bottom: 1px solid #cbcbcb;
|
||||
}
|
||||
|
||||
/* BORDERED TABLES */
|
||||
.pure-table-bordered td {
|
||||
border-bottom: 1px solid #cbcbcb;
|
||||
}
|
||||
|
||||
.pure-table-bordered tbody>tr:last-child>td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
/* HORIZONTAL BORDERED TABLES */
|
||||
.pure-table-horizontal td,
|
||||
.pure-table-horizontal th {
|
||||
border-width: 0 0 1px 0;
|
||||
border-bottom: 1px solid #cbcbcb;
|
||||
}
|
||||
|
||||
.pure-table-horizontal tbody>tr:last-child>td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
line-height: 18pt;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.liste-titel {
|
||||
font-family: sans-serif;
|
||||
padding: 15mm 0 0;
|
||||
font-size: 1.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.liste {
|
||||
width: 100%;
|
||||
font-size: .9em;
|
||||
margin-top: 15mm;
|
||||
}
|
||||
|
||||
.rot {
|
||||
color: #800;
|
||||
}
|
||||
|
||||
.gruen {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* PURE TABLES START */
|
||||
.pure-table {
|
||||
/* Remove spacing between table cells (from Normalize.css) */
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
empty-cells: show;
|
||||
border: 1px solid #cbcbcb;
|
||||
}
|
||||
|
||||
.pure-table-noborder {
|
||||
/* Remove spacing between table cells (from Normalize.css) */
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
empty-cells: show;
|
||||
}
|
||||
|
||||
.pure-table caption {
|
||||
color: #000;
|
||||
font: italic 85%/1 arial, sans-serif;
|
||||
padding: 1em 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pure-table td,
|
||||
.pure-table th,
|
||||
.pure-table-noborder td,
|
||||
.pure-table-noborder th {
|
||||
border-left: 1px solid #cbcbcb;
|
||||
border-bottom: 1px solid #cbcbcb;
|
||||
/* inner column border */
|
||||
border-width: 0 0 1px 1px;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
/*to make ths where the title is really long work*/
|
||||
padding: .7em 1em;
|
||||
/* cell padding */
|
||||
}
|
||||
|
||||
.pure-table thead {
|
||||
background-color: #e0e0e0;
|
||||
color: #000;
|
||||
text-align: left;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
/*
|
||||
striping:
|
||||
even - #fff (white)
|
||||
odd - #f2f2f2 (light gray)
|
||||
*/
|
||||
.pure-table td {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.pure-table-odd td {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
/* nth-child selector for modern browsers */
|
||||
.pure-table-striped tr:nth-child(2n-1) td {
|
||||
background-color: #f2f2f2;
|
||||
border-bottom: 1px solid #cbcbcb;
|
||||
}
|
||||
|
||||
/* BORDERED TABLES */
|
||||
.pure-table-bordered td {
|
||||
border-bottom: 1px solid #cbcbcb;
|
||||
}
|
||||
|
||||
.pure-table-bordered tbody>tr:last-child>td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
/* HORIZONTAL BORDERED TABLES */
|
||||
.pure-table-horizontal td,
|
||||
.pure-table-horizontal th {
|
||||
border-width: 0 0 1px 0;
|
||||
border-bottom: 1px solid #cbcbcb;
|
||||
}
|
||||
|
||||
.pure-table-horizontal tbody>tr:last-child>td {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Einreichen;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class EinreichungenUser
|
||||
{
|
||||
public static function laden()
|
||||
{
|
||||
// lösche Einreichung
|
||||
$uid = GeneralUtility::_GP('uid');
|
||||
if (!is_numeric($uid)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen');
|
||||
$queryBuilder
|
||||
->update('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid', (int) $uid)
|
||||
)
|
||||
->set('tstamp', time())
|
||||
->set('deleted', (int) 1)
|
||||
->execute();
|
||||
|
||||
echo $queryBuilder->getSQL();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Einreichen;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class EinreichungenUser
|
||||
{
|
||||
public static function laden()
|
||||
{
|
||||
// EIGEREICHTE PROJEKT
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen');
|
||||
// $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
$queryBuilder
|
||||
->select('uid', 'crdate', 'wettbewerb', 'beschreibung', 'entscheidungstermin', 'verfahrensort', 'bundesland', 'dokument_orig_name', 'aufgenommen', 'abgelehnt', 'begruendung')
|
||||
->from('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen')
|
||||
->where($queryBuilder->expr()->eq('cruser_id', $user['uid']))
|
||||
->orderBy('aufgenommen');
|
||||
$statement = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
$arr = array();
|
||||
foreach ($statement as $key => $value) {
|
||||
$value["status"] = 0;
|
||||
if($value["aufgenommen"] > 0){
|
||||
$value["status"] = 1;
|
||||
}
|
||||
else if ($value["abgelehnt"] > 0){
|
||||
$value["status"] = 2;
|
||||
}
|
||||
$arr[] = $value;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($arr);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Einreichen;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class _EinreichenController
|
||||
{
|
||||
public function __construct($xaction)
|
||||
{
|
||||
switch ($xaction) {
|
||||
case 'lade_einreichungen':
|
||||
return EinreichungenUser::laden();
|
||||
break;
|
||||
default:
|
||||
Message::error(__FILE__, __LINE__, 'no xaction switch defined');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Liste;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class Archive
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function load($archive_id)
|
||||
{
|
||||
// Ajax::$debug = 1;
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
'Load Liste Archive'
|
||||
);
|
||||
}
|
||||
$queryBuilder = GeneralUtility::makeInstance(
|
||||
ConnectionPool::class
|
||||
)->getQueryBuilderForTable('tx_zuladungsliste_archive_admin');
|
||||
$statement = $queryBuilder
|
||||
->select('liste')
|
||||
->from('tx_zuladungsliste_archive_admin')
|
||||
->where($queryBuilder->expr()->eq('uid', (int) $archive_id))
|
||||
->addOrderBy('uid', 'DESC')
|
||||
->execute()
|
||||
->fetchAll();
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo $statement[0]['liste'];
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Liste;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 ArchiveMenu
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function load()
|
||||
{
|
||||
$queryBuilder = GeneralUtility::makeInstance(
|
||||
ConnectionPool::class
|
||||
)->getQueryBuilderForTable('tx_zuladungsliste_archive_admin');
|
||||
$statement = $queryBuilder
|
||||
->select('uid', 'crdate')
|
||||
->from('tx_zuladungsliste_archive_admin')
|
||||
->addOrderBy('uid', 'DESC')
|
||||
->execute();
|
||||
|
||||
$tmp=[];
|
||||
foreach ($statement as $key => $value) {
|
||||
$year = date("Y", $value["crdate"]);
|
||||
$tmp[$year][] = $value;
|
||||
}
|
||||
_Berechnung::$_return = [];
|
||||
foreach ($tmp as $year => $value) {
|
||||
$t = array();
|
||||
$t["year"] = $year;
|
||||
foreach ($value as $key => $val) {
|
||||
$t2 = array();
|
||||
$t2["id"] = $val["uid"];
|
||||
$t2["titel"] = strftime("%e. %b. %G", $val["crdate"]);
|
||||
$t["subdata"][] = $t2;
|
||||
}
|
||||
_Berechnung::$_return[] = $t;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Liste;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Resources;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class EinreichungenAdmin
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function disable()
|
||||
{
|
||||
// EINGEREICHTE PROJEKT DELETE
|
||||
$uid = preg_replace("'\D'", "", $_GET['uid']);
|
||||
if (!is_numeric($uid)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen');
|
||||
$queryBuilder
|
||||
->update('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid', (int) $uid),
|
||||
$queryBuilder->expr()->eq('aufgenommen', 0),
|
||||
$queryBuilder->expr()->eq('abgelehnt', 0)
|
||||
)->set('deleted', '1')->execute();
|
||||
// echo $queryBuilder->getSQL();
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function update()
|
||||
{
|
||||
// EINGEREICHTE PROJEKT UPDATE
|
||||
$uid = preg_replace("'\D'", "", $_GET['uid']);
|
||||
if (!is_numeric($uid)) {
|
||||
exit;
|
||||
}
|
||||
$field = preg_replace("'\W'", "", $_GET['field']);
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen');
|
||||
if ($field=="aufgenommen") {
|
||||
$queryBuilder
|
||||
->update('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen')
|
||||
->where($queryBuilder->expr()->eq('uid', (int) $uid))
|
||||
->set('aufgenommen', (int) time())
|
||||
->set('abgelehnt', 0)
|
||||
->execute();
|
||||
} elseif ($field=="abgelehnt") {
|
||||
$queryBuilder
|
||||
->update('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen')
|
||||
->where($queryBuilder->expr()->eq('uid', (int) $uid))
|
||||
->set('aufgenommen', 0)
|
||||
->set('abgelehnt', (int) time())
|
||||
->execute();
|
||||
}
|
||||
|
||||
// echo $queryBuilder->getSQL();
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function load()
|
||||
{
|
||||
// EINGEREICHTE PROJEKT LOAD
|
||||
|
||||
// _Berechnung::$debug = 1;
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
'Load ListeBerechnung'
|
||||
);
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen');
|
||||
$statement = $queryBuilder
|
||||
->select(
|
||||
'a.company',
|
||||
'a.name',
|
||||
'a.uid AS user_uid',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.uid',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.crdate',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.wettbewerb',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.beschreibung',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.entscheidungstermin',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.verfahrensort',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.bundesland',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.dokument_orig_name',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.aufgenommen',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.abgelehnt',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.begruendung'
|
||||
)
|
||||
->from('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen')
|
||||
->join(
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe_einreichungen',
|
||||
'fe_users',
|
||||
'a',
|
||||
$queryBuilder->expr()->eq('a.uid', $queryBuilder->quoteIdentifier('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.cruser_id'))
|
||||
)
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('a.deleted', (int) 0),
|
||||
$queryBuilder->expr()->eq('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen.deleted', (int) 0)
|
||||
)->execute()->fetchAll();
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::note($queryBuilder->getSQL());
|
||||
}
|
||||
|
||||
$bundeslaender_map = array_flip(Resources::bundeslaender());
|
||||
|
||||
|
||||
$_return = [];
|
||||
foreach ($statement as $key => $value) {
|
||||
$value['id'] = (int) $value['uid'];
|
||||
unset($value['uid']);
|
||||
$value['aufgenommen'] = (int) $value['aufgenommen'];
|
||||
$value['abgelehnt'] = (int) $value['abgelehnt'];
|
||||
$value['year'] = (int) substr($value['entscheidungstermin'], 0, 4);
|
||||
$value['bundeslandid'] = $bundeslaender_map[$value['bundesland']];
|
||||
|
||||
$value['status'] = 1;
|
||||
if ($value['abgelehnt'] > 0) {
|
||||
$value['status'] = 3;
|
||||
} elseif ($value['aufgenommen'] > 0) {
|
||||
$value['status'] = 2;
|
||||
}
|
||||
|
||||
$_return[] = $value;
|
||||
}
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($_return);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Liste;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\Architekten;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\PunkteKriterien;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\WettbewerbeArchitekten;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Resources;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/*
|
||||
ORIGINAL QUERY
|
||||
$fields = "wamm.uid id,
|
||||
fe.company,fe.name,
|
||||
wb.wettbewerb,
|
||||
wb.bundesland,
|
||||
EXTRACT(YEAR FROM wb.entscheidungstermin) entyear,
|
||||
EXTRACT(YEAR FROM wb.abgabetermin) abgyear,
|
||||
pu.bezeichnung pname,
|
||||
pkmm.punkte,
|
||||
wamm.tstamp_zuordnung,
|
||||
wamm.tstamp_aktivierung,
|
||||
wamm.tstamp_ablehnen";
|
||||
$from = "tx_zuladungsliste_wettbewerbe_architekten_mm wamm,
|
||||
fe_users fe,
|
||||
tx_zuladungsliste_domain_model_wettbewerbe wb,
|
||||
tx_zuladungsliste_punkte_kriterien_mm pkmm,
|
||||
tx_zuladungsliste_domain_model_punkte pu";
|
||||
$where = "wamm.uid_user=fe.uid AND
|
||||
wamm.uid_wettbewerbe=wb.uid AND
|
||||
wb.kriteriumid=pkmm.uid_kriterien AND
|
||||
wamm.uid_punkte=pu.uid AND
|
||||
pkmm.uid_punkte = wamm.uid_punkte";
|
||||
*/
|
||||
|
||||
class Freischaltungen
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function aktivieren()
|
||||
{
|
||||
// _Berechnung::$debug = 1;
|
||||
|
||||
$uid_wettarch = GeneralUtility::_GP('uid_wettarch');
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_wettbewerbe_architekten_mm');
|
||||
$queryBuilder->update('tx_zuladungsliste_wettbewerbe_architekten_mm')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid', (int) $uid_wettarch)
|
||||
)
|
||||
->set('tstamp', (int) time())
|
||||
->set('tstamp_aktivierung', (int) time())
|
||||
->set('tstamp_ablehnen', 0)
|
||||
->execute();
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::note($queryBuilder->getSQL());
|
||||
}
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public static function ablehnen()
|
||||
{
|
||||
// _Berechnung::$debug = 1;
|
||||
|
||||
$uid_wettarch = GeneralUtility::_GP('uid_wettarch');
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_wettbewerbe_architekten_mm');
|
||||
$queryBuilder->update('tx_zuladungsliste_wettbewerbe_architekten_mm')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid', (int) $uid_wettarch)
|
||||
)
|
||||
->set('tstamp', (int)time())
|
||||
->set('tstamp_aktivierung', 0)
|
||||
->set('tstamp_ablehnen', (int)time())
|
||||
->execute();
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::note($queryBuilder->getSQL());
|
||||
}
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function load()
|
||||
{
|
||||
|
||||
$webvalue = GeneralUtility::_GP('value');
|
||||
$webkey = GeneralUtility::_GP('key');
|
||||
|
||||
new _Berechnung();
|
||||
|
||||
_Berechnung::$debug = 0;
|
||||
|
||||
if (_Berechnung::$debug) {
|
||||
Message::debug(
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
'Load Liste Freischaltungen'
|
||||
);
|
||||
}
|
||||
Architekten::load();
|
||||
$Architekten = [];
|
||||
foreach (_Berechnung::$_data['architekten'] as $key => $_row) {
|
||||
$Architekten[$_row['uid']] = $_row;
|
||||
}
|
||||
$PunkteKriterien = PunkteKriterien::load();
|
||||
$WettbewerbeArchitekten = WettbewerbeArchitekten::load();
|
||||
|
||||
$_data = [];
|
||||
foreach ($WettbewerbeArchitekten as $key => $_row) {
|
||||
$uid_user = $_row['uid_user'];
|
||||
if (isset($Architekten[$uid_user])) {
|
||||
$_row = array_merge($_row, $Architekten[$uid_user]);
|
||||
|
||||
$uid_punkte = $_row['uid_punkte'];
|
||||
if (!$PunkteKriterien[$uid_punkte]) {
|
||||
print_r($_row);
|
||||
exit;
|
||||
}
|
||||
$_row = array_merge($_row, $PunkteKriterien[$uid_punkte]);
|
||||
$_data[] = $_row;
|
||||
}
|
||||
}
|
||||
|
||||
$bundeslaender_map = array_flip(Resources::bundeslaender());
|
||||
|
||||
_Berechnung::$_return = [];
|
||||
foreach ($_data as $key => $_row) {
|
||||
$_row['id'] = $key;
|
||||
$entyear = (int) substr($_row['entscheidungstermin'], 0, 4);
|
||||
$abgyear = (int) substr($_row['abgabetermin'], 0, 4);
|
||||
if ($entyear) {
|
||||
$_row['jahr'] = $entyear;
|
||||
} elseif ($abgyear) {
|
||||
$_row['jahr'] = $abgyear;
|
||||
} else {
|
||||
$_row['jahr'] = 'fehlt!';
|
||||
}
|
||||
// anstehend
|
||||
$_row['status'] = 0;
|
||||
if (0 != $_row['tstamp_zuordnung'] and 0 == $_row['tstamp_aktivierung'] and 0 == $_row['tstamp_ablehnen']) {
|
||||
$_row['status'] = 1;
|
||||
}
|
||||
// freie
|
||||
if (0 != $_row['tstamp_aktivierung']) {
|
||||
$_row['status'] = 2;
|
||||
}
|
||||
// freie
|
||||
if (0 != $_row['tstamp_ablehnen']) {
|
||||
$_row['status'] = 3;
|
||||
}
|
||||
$_row['bundeslandid'] = $bundeslaender_map[$_row['bundesland']];
|
||||
if ('jahr' == $webkey) {
|
||||
if ($_row['jahr'] == $webvalue) {
|
||||
_Berechnung::$_return[] = $_row;
|
||||
}
|
||||
} else {
|
||||
_Berechnung::$_return[] = $_row;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Liste;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" 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 ListeAdmin
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function load()
|
||||
{
|
||||
$archive_id = GeneralUtility::_GP('archive_id');
|
||||
|
||||
if ($archive_id) {
|
||||
Archive::load($archive_id);
|
||||
}
|
||||
|
||||
$berechnen = new _Berechnung();
|
||||
$berechnen::berechnen();
|
||||
ListeTree::set_dijit();
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(_Berechnung::$_return);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Liste;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
|
||||
class ListeTree
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function set_dijit()
|
||||
{
|
||||
_Berechnung::$_return = [];
|
||||
$i=1;
|
||||
foreach (_Berechnung::$_data['liste'] as $key => $value) {
|
||||
//if($value["user_id"]==140){
|
||||
// print_r($value);
|
||||
// _Berechnung::$_return = array();
|
||||
//}
|
||||
$wettbewerbe = $value["auswertung"]["wettbewerbe"];
|
||||
$neueinsteigerpunkt = $value["auswertung"]["neueinsteigerpunkt"];
|
||||
$frauenfoerderpunkt = $value["auswertung"]["frauenfoerderpunkt"];
|
||||
$solidaritaetserklaerung = $value["auswertung"]["solidaritaetserklaerung"];
|
||||
$sondersperrungen = $value["auswertung"]["sondersperrungen"];
|
||||
unset($value["auswertung"]);
|
||||
$value["id"] = (int)$i;
|
||||
$value["hasChildren"] = (int)1;
|
||||
$value["parent"] = null;
|
||||
$value["punkte"] = (float)$value["punkte"];
|
||||
$value["sortdatum"] = (int)$value["sortdatum"];
|
||||
_Berechnung::$_return[] = $value;
|
||||
$i++;
|
||||
|
||||
// neueinsteigerpunkt
|
||||
if ($neueinsteigerpunkt) {
|
||||
$tmp = [];
|
||||
$tmp["id"] = (int)$i;
|
||||
$i++;
|
||||
$tmp["company"] = '<span class="vfid"> </span>Neueinsteigerpunkt<span class="floatright">'.$neueinsteigerpunkt["kommentar"].'</span>';
|
||||
$tmp["hasChildren"] = (int)0;
|
||||
$tmp["parent"] = (int)$value["id"];
|
||||
$tmp["punkte"] = (float)$neueinsteigerpunkt["punkte"];
|
||||
$tmp["nominiert"] = (int)2;
|
||||
$tmp["type"] = "neueinsteiger";
|
||||
$tmp["gesperrt_bis"] = '';
|
||||
_Berechnung::$_return[] = $tmp;
|
||||
}
|
||||
// frauenfoerderpunkt
|
||||
if ($frauenfoerderpunkt) {
|
||||
$tmp = [];
|
||||
$tmp["id"] = (int)$i;
|
||||
$i++;
|
||||
$tmp["company"] = '<span class="vfid"> </span>Frauenförderpunkt<span class="floatright">'.$frauenfoerderpunkt["kommentar"].'</span>';
|
||||
$tmp["hasChildren"] = (int)0;
|
||||
$tmp["parent"] = (int)$value["id"];
|
||||
$tmp["punkte"] = (float)$frauenfoerderpunkt["punkte"];
|
||||
$tmp["nominiert"] = (int)2;
|
||||
$tmp["type"] = "frauenfoerderpunkt";
|
||||
$tmp["gesperrt_bis"] = '';
|
||||
_Berechnung::$_return[] = $tmp;
|
||||
}
|
||||
|
||||
// solidaritaetserklaerung
|
||||
if ($solidaritaetserklaerung) {
|
||||
$tmp = [];
|
||||
$tmp["id"] = (int)$i;
|
||||
$i++;
|
||||
$tmp["company"] = '<span class="vfid"> </span>Solidaritätserklärung<span class="floatright">'.$solidaritaetserklaerung["kommentar"].'</span>';
|
||||
$tmp["hasChildren"] = (int)0;
|
||||
$tmp["parent"] = (int)$value["id"];
|
||||
$tmp["punkte"] = (float)$solidaritaetserklaerung["punkte"];
|
||||
$tmp["nominiert"] = (int)2;
|
||||
$tmp["type"] = "solidaritaetserklaerung";
|
||||
$tmp["gesperrt_bis"] = '';
|
||||
_Berechnung::$_return[] = $tmp;
|
||||
}
|
||||
|
||||
// sondersperrungen
|
||||
if (isset($sondersperrungen["data"])) {
|
||||
foreach ($sondersperrungen["data"] as $key => $sperre) {
|
||||
$tmp = [];
|
||||
$tmp["id"] = (int)$i;
|
||||
$i++;
|
||||
$tmp["company"] = '<span class="vfid20"> </span>Sondersperrung: '.$sperre["begruendung"].'<span class="floatright rot" style="margin-right:125px">Sperre bis: '.$sperre["sperrzeitbis"].'</span>';
|
||||
$tmp["hasChildren"] = (int)0;
|
||||
$tmp["parent"] = (int)$value["id"];
|
||||
$tmp["punkte"] = 0;
|
||||
$tmp["nominiert"] = (int)2;
|
||||
$tmp["type"] = "sondersperrung";
|
||||
_Berechnung::$_return[] = $tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$wettbewerbe = array_reverse($wettbewerbe);
|
||||
foreach ($wettbewerbe as $key => $value2) {
|
||||
if (is_array($value2)) {
|
||||
/***
|
||||
[wettbewerb] => Bebauung Conrad v. Hötzendorfstr./Fröhlichgasse Graz
|
||||
[verfahrensid] => 1628
|
||||
[verfahrensort] => Graz
|
||||
[entscheidungstermin] => 0000-00-00
|
||||
[punkte] => 1.00
|
||||
[bezeichnung] => Regional beschränkt offener WB (1- oder mehrstufig) - Zulassungsgebiet Befugnis AT oder Stmk./Ktn.
|
||||
[regelwerk] => Regelwerk V1 02/2016
|
||||
[monate_seit_entscheidungstermin] => 24208
|
||||
[punkte_aktive] => 0
|
||||
[gueltig_bis] => 30. Nov. 0004.
|
||||
[sperrung_aktive] => 0
|
||||
[gesperrt_bis] => 30. May. 0001.
|
||||
*/
|
||||
// print_r($value2);
|
||||
// exit;
|
||||
$tmp = [];
|
||||
$tmp["id"] = (int)$i;
|
||||
$i++;
|
||||
$tmp["info"] = $value2["bezeichnung"] . '<div class="spacer"></div>' . $value2["bezeichnung_punkte"];
|
||||
|
||||
|
||||
if ($value2["mit_sperrung"]==0) {
|
||||
$tmp["info"] .= '<div class="spacer"></div>Preis ohne Sperrung';
|
||||
} elseif (isset($value2["sperre_deaktiviert"]) and $value2["sperre_deaktiviert"]==1) {
|
||||
$tmp["info"] .= '<div class="spacer"></div>Wettbewerb mit Sperrung, Sperrung deaktiviert';
|
||||
} else {
|
||||
$tmp["info"] .= '<div class="spacer"></div>Wettbewerb mit Sperrung';
|
||||
}
|
||||
|
||||
$tmp["company"] = '<span class="vfid">'.$value2["verfahrensid"].'</span>';
|
||||
|
||||
if ($value2["mit_sperrung"]==1) {
|
||||
$tmp["company"] .= ' <span class="geladen">Geladen</span>';
|
||||
}
|
||||
|
||||
$tmp["company"] .= $value2["wettbewerb"];
|
||||
|
||||
$tmp["gesperrt_bis"] = '';
|
||||
if (isset($value2["sperrung_aktive"]) and $value2["sperrung_aktive"]==1) {
|
||||
$tmp["gesperrt_bis"] = $value2["gesperrt_bis"];
|
||||
}
|
||||
|
||||
// $tmp["company"] .= '<span class="floatright">';
|
||||
// if (isset($value2["sperrung_aktive"]) and $value2["sperrung_aktive"]==1) {
|
||||
// $tmp["company"] .= '<span class="rot">Sperrung bis: '.$value2["gesperrt_bis"].'</span>';
|
||||
// }
|
||||
//
|
||||
// if (isset($value2["von_transfer"])) {
|
||||
// $tmp["company"] .= $value2["von_transfer"];
|
||||
// $tmp["info"] = "";
|
||||
// } else {
|
||||
// $tmp["company"] .= '<span class="width125">Gültig bis:</span>';
|
||||
// }
|
||||
// $tmp["company"] .= '</span>';
|
||||
|
||||
$tmp["hasChildren"] = (int)0;
|
||||
$tmp["parent"] = (int)$value["id"];
|
||||
$tmp["punkte"] = (float)$value2["punkte"];
|
||||
if ((float)$value2["punkte"]) {
|
||||
$tmp["valid"] = $value2["gueltig_bis"];
|
||||
}
|
||||
$tmp["nominiert"] = (int)2;
|
||||
// $tmp["sortdatum"] = (int)$value2["sortdatum"]+$key;
|
||||
$tmp["punkte_aktive"] = $value2["punkte_aktive"];
|
||||
$tmp["geladen"] = $value2["mit_sperrung"];
|
||||
$tmp["type"] = "wettbewerb";
|
||||
_Berechnung::$_return[] = $tmp;
|
||||
}
|
||||
}
|
||||
//if($value["user_id"]==140){
|
||||
// print_r(_Berechnung::$_return);
|
||||
// exit;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Liste;
|
||||
|
||||
use Doctrine\DBAL\DBALException;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
use ForceUTF8\Encoding;
|
||||
|
||||
class Recalculate
|
||||
{
|
||||
public static function run()
|
||||
{
|
||||
// Message::note("recalculaton admin & user");
|
||||
// exit;
|
||||
|
||||
$berechnen = new _Berechnung();
|
||||
$berechnen::$debug = 0;
|
||||
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_zuladungsliste_archive_admin');
|
||||
$connection->truncate('tx_zuladungsliste_archive_admin');
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_zuladungsliste_archive_user');
|
||||
$connection->truncate('tx_zuladungsliste_archive_user');
|
||||
|
||||
$month = 6;
|
||||
$timestamp = 0;
|
||||
while ($timestamp < time()) {
|
||||
++$month;
|
||||
// fixed to 15
|
||||
$timestamp = mktime(0, 0, 0, $month, 15, 2017);
|
||||
// $timestamp = mktime(0, 0, 0, 4, 15, 2022);
|
||||
|
||||
if ($timestamp >= time()) {
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
|
||||
$berechnen::$_config['berechne_bis'] = $timestamp;
|
||||
$berechnen::berechnen();
|
||||
ListeTree::set_dijit();
|
||||
|
||||
// print_r($berechnen::$_data['liste']);
|
||||
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_archive_admin');
|
||||
$connection
|
||||
->insert('tx_zuladungsliste_archive_admin')
|
||||
->values([
|
||||
'tstamp' => time(),
|
||||
'crdate' => $timestamp,
|
||||
'liste' => json_encode(Encoding::fixUTF8($berechnen::$_return)),
|
||||
])
|
||||
->execute();
|
||||
$uid_archive_admin = $connection->getConnection()->lastInsertId();
|
||||
|
||||
|
||||
$userid = 0;
|
||||
$user_arr = [];
|
||||
foreach ($berechnen::$_return as $key => $value) {
|
||||
if ($value["hasChildren"]==1) {
|
||||
$insert_array = [];
|
||||
$insert_array["tstamp"] = $timestamp;
|
||||
$insert_array["crdate"] = $timestamp;
|
||||
$insert_array["user_id"] = $value["user_id"];
|
||||
$insert_array["archive_admin_uid"] = $uid_archive_admin;
|
||||
$insert_array["company"] = $value["company"];
|
||||
$insert_array["name"] = $value["name"];
|
||||
$insert_array["punkte"] = $value["punkte"];
|
||||
$insert_array["nominiert"] = $value["nominiert"];
|
||||
$insert_array["rang"] = $value["rang"];
|
||||
$insert_array["pos"] = $value["pos"];
|
||||
|
||||
$userid = $value["id"];
|
||||
$user_arr[$userid]["user"] = $insert_array;
|
||||
} else {
|
||||
$user_arr[$userid]["data"][] = $value;
|
||||
}
|
||||
}
|
||||
foreach ($user_arr as $key => $value) {
|
||||
$insert_array = [];
|
||||
$insert_array = $value["user"];
|
||||
$insert_array["auswertung"] = json_encode(Encoding::fixUTF8($value["data"]));
|
||||
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_archive_user');
|
||||
$connection
|
||||
->insert('tx_zuladungsliste_archive_user')
|
||||
->values($insert_array)
|
||||
->execute();
|
||||
}
|
||||
}
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Liste;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class _ListeController
|
||||
{
|
||||
public function __construct($xaction)
|
||||
{
|
||||
switch ($xaction) {
|
||||
case 'load_liste_admin':
|
||||
ListeAdmin::load();
|
||||
break;
|
||||
case 'load_freischaltungen':
|
||||
Freischaltungen::load();
|
||||
break;
|
||||
case 'freischaltung_aktivieren':
|
||||
Freischaltungen::aktivieren();
|
||||
break;
|
||||
case 'freischaltung_ablehnen':
|
||||
Freischaltungen::ablehnen();
|
||||
break;
|
||||
case "load_einreichungen":
|
||||
EinreichungenAdmin::load();
|
||||
break;
|
||||
case "disable_einreichung":
|
||||
EinreichungenAdmin::disable();
|
||||
break;
|
||||
case "update_einreichung":
|
||||
EinreichungenAdmin::update();
|
||||
break;
|
||||
case 'liste_alles_neu':
|
||||
Recalculate::run();
|
||||
break;
|
||||
case 'cron_latest':
|
||||
// https://zuladungsliste.nuhodds.com/app/administration?zlcontroller=liste_controller&xaction=liste_alles_neu
|
||||
break;
|
||||
default:
|
||||
Message::error(__FILE__, __LINE__, 'no xaction switch defined');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Middleware;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
use HermannTelser\Zuladungsliste\Bootstrap\_BootstrapController;
|
||||
use HermannTelser\Zuladungsliste\Download\_DownloadController;
|
||||
use HermannTelser\Zuladungsliste\Liste\_ListeController;
|
||||
use HermannTelser\Zuladungsliste\Zuteilungen\_ZuteilungenController;
|
||||
use HermannTelser\Zuladungsliste\Zuladungsliste\_ZuladungslisteController;
|
||||
use HermannTelser\Zuladungsliste\PunkteZuweisung\_PunkteZuweisungController;
|
||||
use HermannTelser\Zuladungsliste\Einreichen\_EinreichenController;
|
||||
use HermannTelser\Zuladungsliste\User\_UserController;
|
||||
use HermannTelser\Zuladungsliste\Upload\_UploadController;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
use TYPO3\CMS\Core\Http\JsonResponse;
|
||||
|
||||
define("WETTBEWERBE_PID", 38);
|
||||
setlocale(LC_TIME, 'de_DE.UTF8');
|
||||
|
||||
class Ajax implements MiddlewareInterface
|
||||
{
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
$response = $handler->handle($request);
|
||||
if (!isset($request->getQueryParams()['zlcontroller'])) {
|
||||
return $response;
|
||||
}
|
||||
$xaction = $request->getQueryParams()['xaction'];
|
||||
|
||||
// $user = $GLOBALS['TSFE']->fe_user->user;
|
||||
$zlcontroller = $request->getQueryParams()['zlcontroller'];
|
||||
switch ($zlcontroller) {
|
||||
case 'bootstrap_controller':
|
||||
new _BootstrapController($xaction);
|
||||
break;
|
||||
case 'liste_controller':
|
||||
new _ListeController($xaction);
|
||||
break;
|
||||
case 'download_controller':
|
||||
new _DownloadController($xaction);
|
||||
break;
|
||||
case 'zuteilungen_controller':
|
||||
new _ZuteilungenController($xaction);
|
||||
break;
|
||||
case 'zuladungsliste_controller':
|
||||
new _ZuladungslisteController($xaction);
|
||||
break;
|
||||
case 'punktezuweisung_controller':
|
||||
new _PunkteZuweisungController($xaction);
|
||||
break;
|
||||
case 'einreichen_controller':
|
||||
new _EinreichenController($xaction);
|
||||
break;
|
||||
case 'user_controller':
|
||||
new _UserController($xaction);
|
||||
break;
|
||||
case 'upload_controller':
|
||||
new _UploadController($xaction);
|
||||
break;
|
||||
default:
|
||||
_Berechnung::$_return = ['error' => __FILE__.': call \''.$zlcontroller.'\' not implemented'];
|
||||
break;
|
||||
}
|
||||
|
||||
return new JsonResponse(_Berechnung::$_return);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\PunkteZuweisung;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Resources;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*¨
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class Preise
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function laden()
|
||||
{
|
||||
$kriteriumid = GeneralUtility::_GP('kriteriumid');
|
||||
$wettbewerbid = GeneralUtility::_GP('wettbewerbid');
|
||||
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
|
||||
// $punktestatus = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows("uid_punkte, tstamp_zuordnung, tstamp_aktivierung", "tx_zuladungsliste_wettbewerbe_architekten_mm",
|
||||
// "uid_wettbewerbe=$wettbewerb_id AND uid_user=$user_id AND uid_punkte>0", "", "", "", "uid_punkte");
|
||||
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_wettbewerbe_architekten_mm');
|
||||
$queryBuilder
|
||||
->select('uid_punkte', 'tstamp_zuordnung', 'tstamp_aktivierung')
|
||||
->from('tx_zuladungsliste_wettbewerbe_architekten_mm')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid_user', (int) $user['uid']),
|
||||
$queryBuilder->expr()->gt('uid_punkte', 0),
|
||||
$queryBuilder->expr()->eq('uid_wettbewerbe', (int) $wettbewerbid)
|
||||
)
|
||||
->orderBy('uid_punkte');
|
||||
$res = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
$punktestatus = [];
|
||||
$closed=false;
|
||||
foreach ($res as $key => $value) {
|
||||
$punktestatus[$value['uid_punkte']] = $value;
|
||||
if ($value["tstamp_aktivierung"]>0) {
|
||||
$closed=true;
|
||||
}
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_punkte');
|
||||
$queryBuilder
|
||||
->select(
|
||||
'tx_zuladungsliste_domain_model_punkte.uid',
|
||||
'tx_zuladungsliste_domain_model_punkte.bezeichnung',
|
||||
'b.sorting',
|
||||
'b.punkte',
|
||||
'b.uid_punkte'
|
||||
)
|
||||
->from('tx_zuladungsliste_domain_model_punkte')
|
||||
->leftJoin(
|
||||
'tx_zuladungsliste_domain_model_punkte',
|
||||
'tx_zuladungsliste_punkte_kriterien_mm',
|
||||
'b',
|
||||
$queryBuilder->expr()->eq(
|
||||
'b.uid_punkte',
|
||||
$queryBuilder->quoteIdentifier('tx_zuladungsliste_domain_model_punkte.uid')
|
||||
)
|
||||
)
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('b.uid_kriterien', (int) $kriteriumid)
|
||||
);
|
||||
$_punkte_kriterien = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
// echo $queryBuilder->getSQL();
|
||||
$_return = [];
|
||||
foreach ($_punkte_kriterien as $key => $value) {
|
||||
$value["sorting"] = (int)$value["sorting"];
|
||||
$value["status"] = 0;
|
||||
$value["tstamp_zuordnung"] = "";
|
||||
$value["tstamp_aktivierung"] = "";
|
||||
|
||||
$punkteId = $value["uid_punkte"];
|
||||
if (isset($punktestatus[$punkteId])) {
|
||||
$tmp = $punktestatus[$punkteId];
|
||||
|
||||
if ($tmp["tstamp_zuordnung"]>0) {
|
||||
$value["tstamp_zuordnung"] = date("d. M. Y", $tmp["tstamp_zuordnung"]);
|
||||
$value["status"] = 1;
|
||||
}
|
||||
if ($tmp["tstamp_aktivierung"]>0) {
|
||||
$value["tstamp_aktivierung"] = date("d. M. Y", $tmp["tstamp_aktivierung"]);
|
||||
}
|
||||
}
|
||||
if ($closed) {
|
||||
$value["status"] = 2;
|
||||
}
|
||||
$_return[] = $value;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($_return);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\PunkteZuweisung;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Resources;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*¨
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class PunkteZuweisen
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function setzen()
|
||||
{
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
|
||||
$debug = 1;
|
||||
|
||||
$kriteriumid = GeneralUtility::_GP('kriteriumid');
|
||||
$wettbewerbid = GeneralUtility::_GP('wettbewerbid');
|
||||
|
||||
$arr = json_decode(GeneralUtility::_GP('data'), true);
|
||||
$zuweisung_uid_punkte = (int) $arr["uid_punkte"];
|
||||
|
||||
if (!is_numeric($zuweisung_uid_punkte)) {
|
||||
if ($debug) {
|
||||
Message::note("zuweisung_uid_punkte fehlt");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
if (!is_numeric($kriteriumid)) {
|
||||
if ($debug) {
|
||||
Message::note("kriteriumid fehlt");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
if (!is_numeric($wettbewerbid)) {
|
||||
if ($debug) {
|
||||
Message::note("wettbewerbid fehlt");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_wettbewerbe_architekten_mm');
|
||||
$queryBuilder
|
||||
->select('uid', 'uid_wettbewerbe', 'uid_user', 'uid_punkte', 'sorting', 'tstamp', 'crdate', 'tstamp_zuordnung', 'tstamp_aktivierung')
|
||||
->from('tx_zuladungsliste_wettbewerbe_architekten_mm')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid_user', (int) $user['uid']),
|
||||
$queryBuilder->expr()->eq('uid_wettbewerbe', (int) $wettbewerbid)
|
||||
)
|
||||
->orderBy('uid_punkte');
|
||||
$active_punkte = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
// echo $queryBuilder->getSQL();
|
||||
//
|
||||
// print_r($active_punkte);
|
||||
//
|
||||
// exit;
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_punkte');
|
||||
$queryBuilder
|
||||
->select(
|
||||
'tx_zuladungsliste_domain_model_punkte.uid',
|
||||
'tx_zuladungsliste_domain_model_punkte.bezeichnung',
|
||||
'b.sorting',
|
||||
'b.punkte',
|
||||
'b.uid_punkte'
|
||||
)
|
||||
->from('tx_zuladungsliste_domain_model_punkte')
|
||||
->leftJoin(
|
||||
'tx_zuladungsliste_domain_model_punkte',
|
||||
'tx_zuladungsliste_punkte_kriterien_mm',
|
||||
'b',
|
||||
$queryBuilder->expr()->eq(
|
||||
'b.uid_punkte',
|
||||
$queryBuilder->quoteIdentifier('tx_zuladungsliste_domain_model_punkte.uid')
|
||||
)
|
||||
)
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('b.uid_kriterien', (int) $kriteriumid)
|
||||
);
|
||||
$kriterien = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
//Kontrolle if uid_punkte existiert in den kriterien für diesen wettbewerb
|
||||
$stopping = true;
|
||||
foreach ($kriterien as $key => $value) {
|
||||
if ($value["uid_punkte"] == $zuweisung_uid_punkte) {
|
||||
$stopping = false;
|
||||
}
|
||||
}
|
||||
if ($stopping) {
|
||||
if ($debug) {
|
||||
Message::note("uid_punkte existiert nicht in den kriterien für diesen wettbewerb");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
if (count($active_punkte)) {
|
||||
if ($active_punkte[0]["uid_punkte"]==$zuweisung_uid_punkte) {
|
||||
|
||||
// PUNKTE ZUWEISUNG VOM BENUTZER GELÖSCHT
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_wettbewerbe_architekten_mm');
|
||||
$queryBuilder
|
||||
->delete('tx_zuladungsliste_wettbewerbe_architekten_mm')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid_user', (int) $user['uid']),
|
||||
$queryBuilder->expr()->eq('uid_wettbewerbe', (int) $wettbewerbid)
|
||||
)
|
||||
->execute();
|
||||
} else {
|
||||
|
||||
// UPDATE PUNKTE
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_wettbewerbe_architekten_mm');
|
||||
$queryBuilder->update('tx_zuladungsliste_wettbewerbe_architekten_mm')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid_user', (int) $user['uid']),
|
||||
$queryBuilder->expr()->eq('uid_wettbewerbe', (int) $wettbewerbid)
|
||||
)
|
||||
->set('tstamp', (int) time())
|
||||
->set('tstamp_zuordnung', (int) time())
|
||||
->set('uid_punkte', (int) $zuweisung_uid_punkte)
|
||||
->execute();
|
||||
}
|
||||
} else {
|
||||
|
||||
// PUNKTE NEU ZUGETEILT
|
||||
|
||||
$insertArray = array();
|
||||
$insertArray['crdate'] = time();
|
||||
$insertArray['pid'] = WETTBEWERBE_PID;
|
||||
$insertArray['tstamp_zuordnung'] = time();
|
||||
$insertArray['uid_punkte'] = $zuweisung_uid_punkte;
|
||||
$insertArray['uid_wettbewerbe'] = $wettbewerbid;
|
||||
$insertArray['uid_user'] = $user['uid'];
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_wettbewerbe_architekten_mm');
|
||||
$queryBuilder
|
||||
->insert('tx_zuladungsliste_wettbewerbe_architekten_mm')
|
||||
->values($insertArray)
|
||||
->execute();
|
||||
}
|
||||
|
||||
// echo $queryBuilder->getSQL();
|
||||
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\PunkteZuweisung;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
// use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Resources;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*¨
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class PunkteZuweisungen
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function laden()
|
||||
{
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe');
|
||||
// $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
$queryBuilder
|
||||
->select('uid', 'wettbewerb', 'bundesland', 'kriteriumid', 'entscheidungstermin', 'abgabetermin')
|
||||
->from('tx_zuladungsliste_domain_model_wettbewerbe');
|
||||
$_wettbewerbe = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_wettbewerbe_architekten_mm');
|
||||
// $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
$queryBuilder
|
||||
->select('uid_wettbewerbe', 'tstamp_zuordnung', 'tstamp_aktivierung')
|
||||
->from('tx_zuladungsliste_wettbewerbe_architekten_mm')
|
||||
->where($queryBuilder->expr()->eq('uid_user', (int) $user['uid']));
|
||||
$res = $queryBuilder->execute()->fetchAll();
|
||||
$punktestatus = [];
|
||||
foreach ($res as $key => $value) {
|
||||
$punktestatus[$value['uid_wettbewerbe']] = $value;
|
||||
}
|
||||
|
||||
$bundeslaender = Resources::bundeslaender();
|
||||
$bundeslaender = array_flip($bundeslaender);
|
||||
|
||||
$_return = [];
|
||||
foreach ($_wettbewerbe as $key => $value) {
|
||||
$value["bundeslandid"] = $bundeslaender[$value["bundesland"]];
|
||||
$year = date('Y', strtotime($value["entscheidungstermin"]));
|
||||
|
||||
if (strtotime($value["entscheidungstermin"]) > 0) {
|
||||
$value["jahr"] = (int) $year;
|
||||
} else {
|
||||
$value["jahr"] = (int) date('Y', strtotime($value["abgabetermin"]));
|
||||
}
|
||||
|
||||
unset($value["entscheidungstermin"]);
|
||||
unset($value["abgabetermin"]);
|
||||
|
||||
$wettbewerbeId = $value["uid"];
|
||||
|
||||
$value["status"] = 0;
|
||||
if (isset($punktestatus[$wettbewerbeId])) {
|
||||
$tmp = $punktestatus[$wettbewerbeId];
|
||||
|
||||
if ($tmp["tstamp_zuordnung"]>0) {
|
||||
$value["status"] = 1;
|
||||
}
|
||||
|
||||
if ($tmp["tstamp_aktivierung"]>0) {
|
||||
$value["status"] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
$_return[] = $value;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($_return);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\PunkteZuweisung;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use ForceUTF8\Encoding;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class _PunkteZuweisungController
|
||||
{
|
||||
public function __construct($xaction)
|
||||
{
|
||||
switch ($xaction) {
|
||||
case 'lade_punktezuweisungen':
|
||||
PunkteZuweisungen::laden();
|
||||
break;
|
||||
case 'lade_preise':
|
||||
Preise::laden();
|
||||
break;
|
||||
case 'setze_punktezuweisungen':
|
||||
PunkteZuweisen::setzen();
|
||||
break;
|
||||
default:
|
||||
Message::error(__FILE__, __LINE__, 'no xaction switch defined');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Scheduler;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Scheduler\Task\AbstractTask;
|
||||
use HermannTelser\Zuladungsliste\Liste\Recalculate;
|
||||
|
||||
|
||||
class CronTask extends AbstractTask {
|
||||
public function execute() {
|
||||
$businessLogic = GeneralUtility::makeInstance(Recalculate::class);
|
||||
$businessLogic->run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Upload;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Core\Environment;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class Upload
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function einreichen()
|
||||
{
|
||||
/*** UPLOAD FILE start ***/
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
$user_id = $user['uid'];
|
||||
$upload_dir = Environment::getPublicPath() . "/uploads/tx_zuladungsliste/$user_id";
|
||||
if (!is_dir($upload_dir)) {
|
||||
GeneralUtility::mkdir($upload_dir);
|
||||
}
|
||||
$insert_array = [];
|
||||
$insert_array['dokument_orig_name'] = "";
|
||||
$insert_array['dokument_size'] = "";
|
||||
$insert_array['dokument_type'] = "";
|
||||
if (isset($_FILES['uploadedfile'])) {
|
||||
$dokument_size = $_FILES['uploadedfile']['size'];
|
||||
$dokument_orig_name = $_FILES['uploadedfile']['name'];
|
||||
$dokument_orig_type = $_FILES['uploadedfile']['type'];
|
||||
move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $upload_dir . '/' . $dokument_orig_name);
|
||||
}
|
||||
foreach ($_POST as $nm => $val) {
|
||||
$postdata[$nm] = $val; // array for html
|
||||
}
|
||||
$data = ["Bitte Wählen","Burgenland","Kärnten","Niederösterreich","Oberösterreich","Salzburg","Steiermark","Tirol","Vorarlberg","Wien"];
|
||||
$insert_array = [];
|
||||
$insert_array['crdate'] = time();
|
||||
$insert_array['tstamp'] = time();
|
||||
$insert_array['cruser_id'] = $user_id;
|
||||
$insert_array['wettbewerb'] = htmlspecialchars($postdata['formwettbewerb']);
|
||||
$insert_array['beschreibung'] = htmlspecialchars($postdata["formbeschreibung"]);
|
||||
$insert_array['entscheidungstermin'] = htmlspecialchars($postdata["formentscheidungstermin"]);
|
||||
$insert_array['verfahrensort'] = htmlspecialchars($postdata["formverfahrensort"]);
|
||||
$insert_array['bundesland'] = $data[$postdata["formbundesland"]];
|
||||
$insert_array['dokument_orig_name'] = $dokument_orig_name;
|
||||
$insert_array['dokument_size'] = round($dokument_size/1024, 2) . "k";
|
||||
$insert_array['dokument_type'] = "pdf";
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen');
|
||||
$queryBuilder
|
||||
->insert('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen')
|
||||
->values($insert_array)
|
||||
->execute();
|
||||
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function aktualisieren()
|
||||
{
|
||||
/*** UPLOAD FILE start ***/
|
||||
$uid = GeneralUtility::_GP("uid");
|
||||
if (!is_numeric($uid)) {
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
$user_id = $user['uid'];
|
||||
$upload_dir = Environment::getPublicPath() . "/uploads/tx_zuladungsliste/$user_id";
|
||||
if (!is_dir($upload_dir)) {
|
||||
GeneralUtility::mkdir($upload_dir);
|
||||
}
|
||||
if (isset($_FILES['uploadedfile'])) {
|
||||
$dokument_size = $_FILES['uploadedfile']['size'];
|
||||
$dokument_orig_name = $_FILES['uploadedfile']['name'];
|
||||
$dokument_orig_type = $_FILES['uploadedfile']['type'];
|
||||
move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $upload_dir . '/' . $dokument_orig_name);
|
||||
}
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen');
|
||||
$queryBuilder
|
||||
->update('tx_zuladungsliste_domain_model_wettbewerbe_einreichungen')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('uid', (int) $uid)
|
||||
)
|
||||
->set('tstamp', time())
|
||||
->set('dokument_orig_name', (string) $dokument_orig_name)
|
||||
->set('dokument_size', (string) round($dokument_size/1024, 2) . "k")
|
||||
->execute();
|
||||
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Upload;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class _UploadController
|
||||
{
|
||||
public function __construct($xaction)
|
||||
{
|
||||
switch ($xaction) {
|
||||
case 'dokument_einreichen':
|
||||
Upload::einreichen();
|
||||
break;
|
||||
case 'dokument_aktualisieren':
|
||||
Upload::aktualisieren();
|
||||
break;
|
||||
default:
|
||||
Message::error(__FILE__, __LINE__, 'no xaction switch defined');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\User;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class UserKonto
|
||||
{
|
||||
|
||||
public static function sichern(){
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
$data = GeneralUtility::_GP('data');
|
||||
$data = json_decode($data, true);
|
||||
|
||||
$update_array = [];
|
||||
foreach ($data as $key => $value)
|
||||
{
|
||||
switch ($value["fieldname"]) {
|
||||
case "address":
|
||||
$update_array["address"] = $value["value"];
|
||||
break;
|
||||
case "zip":
|
||||
$update_array["zip"] = $value["value"];
|
||||
break;
|
||||
case "city":
|
||||
$update_array["city"] = $value["value"];
|
||||
break;
|
||||
case "title":
|
||||
$update_array["title"] = $value["value"];
|
||||
break;
|
||||
case "first_name":
|
||||
$update_array["first_name"] = $value["value"];
|
||||
break;
|
||||
case "last_name":
|
||||
$update_array["last_name"] = $value["value"];
|
||||
break;
|
||||
case "telephone":
|
||||
$update_array["telephone"] = $value["value"];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
|
||||
if(\count($update_array) == 7){
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('fe_users');
|
||||
$queryBuilder->update('fe_users')
|
||||
->where($queryBuilder->expr()->eq('uid', (int) $user['uid']))
|
||||
->set('address', (string) $update_array['address'])
|
||||
->set('zip', (string) $update_array['zip'])
|
||||
->set('city', (string) $update_array['city'])
|
||||
->set('title', (string) $update_array['title'])
|
||||
->set('first_name', (string) $update_array['first_name'])
|
||||
->set('last_name', (string) $update_array['last_name'])
|
||||
->set('telephone', (string) $update_array['telephone'])
|
||||
->execute();
|
||||
}
|
||||
// echo $queryBuilder->getSQL();
|
||||
|
||||
echo 1;
|
||||
exit;
|
||||
}
|
||||
|
||||
public static function laden()
|
||||
{
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
|
||||
$return = [];
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 0;
|
||||
$tmp['editable'] = 0;
|
||||
$tmp['title'] = 1;
|
||||
$tmp['beschreibung'] = "Architektur";
|
||||
$tmp['value'] = 'Büro';
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 1;
|
||||
$tmp['editable'] = 0;
|
||||
$tmp['fieldname'] = 'company';
|
||||
$tmp['beschreibung'] = "Büroname:";
|
||||
$tmp['value'] = $user['company'];
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 2;
|
||||
$tmp['editable'] = 0;
|
||||
$tmp['fieldname'] = 'email';
|
||||
$tmp['beschreibung'] = "E-Mail:";
|
||||
$tmp['value'] = $user['email'];
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 3;
|
||||
$tmp['editable'] = 1;
|
||||
$tmp['fieldname'] = 'address';
|
||||
$tmp['beschreibung'] = "Büroanschrift:";
|
||||
$tmp['value'] = $user['address'];
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 4;
|
||||
$tmp['editable'] = 1;
|
||||
$tmp['fieldname'] = 'zip';
|
||||
$tmp['beschreibung'] = "PLZ:";
|
||||
$tmp['value'] = $user['zip'];
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 5;
|
||||
$tmp['editable'] = 1;
|
||||
$tmp['fieldname'] = 'city';
|
||||
$tmp['beschreibung'] = "Ort:";
|
||||
$tmp['value'] = $user['city'];
|
||||
$return[] = $tmp;
|
||||
|
||||
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 6;
|
||||
$tmp['editable'] = 0;
|
||||
$tmp['title'] = 1;
|
||||
$tmp['beschreibung'] = "Verantwortliche";
|
||||
$tmp['value'] = 'Person';
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 7;
|
||||
$tmp['editable'] = 1;
|
||||
$tmp['fieldname'] = 'title';
|
||||
$tmp['beschreibung'] = "Titel:";
|
||||
$tmp['value'] = $user['title'];
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 8;
|
||||
$tmp['editable'] = 1;
|
||||
$tmp['fieldname'] = 'first_name';
|
||||
$tmp['beschreibung'] = "Vorname:";
|
||||
$tmp['value'] = $user['first_name'];
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 9;
|
||||
$tmp['editable'] = 1;
|
||||
$tmp['fieldname'] = 'last_name';
|
||||
$tmp['beschreibung'] = "Nachname:";
|
||||
$tmp['value'] = $user['last_name'];
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 10;
|
||||
$tmp['editable'] = 0;
|
||||
$tmp['fieldname'] = 'vereidigung';
|
||||
$tmp['beschreibung'] = "Tag der Vereidigung:";
|
||||
$tmp['value'] = $user['vereidigung'];
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 11;
|
||||
$tmp['editable'] = 0;
|
||||
$tmp['fieldname'] = 'kammermitgliedsnummer';
|
||||
$tmp['beschreibung'] = "Mitgliedsnummer:";
|
||||
$tmp['value'] = $user['kammermitgliedsnummer'];
|
||||
$return[] = $tmp;
|
||||
|
||||
$tmp = [];
|
||||
$tmp['id'] = 12;
|
||||
$tmp['editable'] = 1;
|
||||
$tmp['fieldname'] = 'telephone';
|
||||
$tmp['beschreibung'] = "Telefon:";
|
||||
$tmp['value'] = $user['telephone'];
|
||||
$return[] = $tmp;
|
||||
|
||||
$return = json_encode($return);
|
||||
header('Content-Type: application/json');
|
||||
echo $return;
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\User;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class _UserController
|
||||
{
|
||||
public function __construct($xaction)
|
||||
{
|
||||
switch ($xaction) {
|
||||
case 'lade_konto':
|
||||
return UserKonto::laden();
|
||||
break;
|
||||
case 'sichern_konto':
|
||||
return UserKonto::sichern();
|
||||
break;
|
||||
default:
|
||||
Message::error(__FILE__, __LINE__, 'no xaction switch defined');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Utilities;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Utility\PathUtility;
|
||||
|
||||
/**
|
||||
* Class FileUtility
|
||||
*/
|
||||
class FileUtility extends AbstractUtility
|
||||
{
|
||||
/**
|
||||
* @param string $path Absolute path
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function createFolderIfNotExists(string $path)
|
||||
{
|
||||
if (!is_dir($path) && !GeneralUtility::mkdir($path)) {
|
||||
throw new \UnexpectedValueException(
|
||||
'Folder ' . self::getRelativeFolderFromAbsolutePath($path) . ' does not exists and can not be created!',
|
||||
1516373962125
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get relative path from absolute path, but don't touch if it's already a relative path
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
*/
|
||||
public static function getRelativeFolderFromAbsolutePath(string $path): string
|
||||
{
|
||||
if (PathUtility::isAbsolutePath($path)) {
|
||||
$path = PathUtility::getRelativePathTo($path);
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Utilities;
|
||||
|
||||
class Message
|
||||
{
|
||||
public static function error($filename, $linenumber, $message)
|
||||
{
|
||||
die(PHP_EOL.PHP_EOL.
|
||||
'-----------------------------------------------------------'.PHP_EOL.
|
||||
'DOKUMENT: '.$filename.PHP_EOL.
|
||||
'ZEILE: '.$linenumber.PHP_EOL.
|
||||
'FEHLER: '.$message.PHP_EOL.
|
||||
"\nVerarbeitung gestoppt !".PHP_EOL.
|
||||
'-----------------------------------------------------------'.PHP_EOL.
|
||||
PHP_EOL);
|
||||
}
|
||||
|
||||
public static function debug($filename, $linenumber, $message)
|
||||
{
|
||||
echo PHP_EOL.
|
||||
'-----------------------------------------------------------'.PHP_EOL.
|
||||
'file: '.$filename.PHP_EOL.
|
||||
'line: '.$linenumber.PHP_EOL.
|
||||
'note: '.$message.PHP_EOL.
|
||||
'-----------------------------------------------------------'.PHP_EOL.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function note($message)
|
||||
{
|
||||
echo PHP_EOL.
|
||||
'-----------------------------------------------------------'.PHP_EOL.PHP_EOL.
|
||||
$message.PHP_EOL.PHP_EOL.
|
||||
'-----------------------------------------------------------'.PHP_EOL.PHP_EOL;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Utilities;
|
||||
|
||||
class Resources
|
||||
{
|
||||
public static function displaymenu()
|
||||
{
|
||||
return [
|
||||
['label' => 'Begründungen', 'id' => 'begruendung', 'ckecked' => false],
|
||||
['label' => 'Titel', 'id' => 'titel', 'ckecked' => false],
|
||||
['label' => 'Name', 'id' => 'name', 'ckecked' => true],
|
||||
['label' => 'Geburtsdatum', 'id' => 'geburtsdatum', 'ckecked' => true],
|
||||
['label' => 'Vereidigung', 'id' => 'vereidigung', 'ckecked' => true],
|
||||
['label' => 'Ältest Projekt in Wertung', 'id' => 'aeltesterEntscheidungstermin', 'ckecked' => false],
|
||||
['label' => 'Punkte', 'id' => 'punkte', 'ckecked' => true],
|
||||
['label' => 'Sperre', 'id' => 'sperre', 'ckecked' => true],
|
||||
['label' => 'Id', 'id' => 'id', 'ckecked' => false]
|
||||
];
|
||||
}
|
||||
|
||||
public static function sperren()
|
||||
{
|
||||
return [
|
||||
['id' => '1', 'label' => 'Default', 'value' => '0', 'selected' => true],
|
||||
['id' => '2', 'label' => '3 Monare', 'value' => '3'],
|
||||
['id' => '3', 'label' => '4 Monare', 'value' => '4'],
|
||||
['id' => '4', 'label' => '5 Monare', 'value' => '5'],
|
||||
['id' => '5', 'label' => '6 Monare', 'value' => '6'],
|
||||
['id' => '6', 'label' => '8 Monare', 'value' => '8'],
|
||||
['id' => '7', 'label' => '10 Monare', 'value' => '10'],
|
||||
['id' => '8', 'label' => '12 Monare', 'value' => '12'],
|
||||
['id' => '9', 'label' => '18 Monare', 'value' => '18'],
|
||||
['id' => '10', 'label' => '24 Monare', 'value' => '24'],
|
||||
];
|
||||
}
|
||||
|
||||
public static function bundeslaender()
|
||||
{
|
||||
return [
|
||||
'Burgenland',
|
||||
'Kärnten',
|
||||
'Niederösterreich',
|
||||
'Oberösterreich',
|
||||
'Salzburg',
|
||||
'Steiermark',
|
||||
'Tirol',
|
||||
'Vorarlberg',
|
||||
'Wien'
|
||||
];
|
||||
}
|
||||
|
||||
public static function years()
|
||||
{
|
||||
$arr = range(2012, date('Y'));
|
||||
rsort($arr);
|
||||
return $arr;
|
||||
}
|
||||
|
||||
|
||||
public static function next()
|
||||
{
|
||||
return[
|
||||
['id' => '1', 'label' => 'Nächste(r)'],
|
||||
['id' => '2', 'label' => 'Nächsten Zwei'] ,
|
||||
['id' => '3', 'label' => 'Nächsten Drei'] ,
|
||||
['id' => '4', 'label' => 'Nächsten Vier'] ,
|
||||
['id' => '5', 'label' => 'Nächsten Fünf'] ,
|
||||
['id' => '6', 'label' => 'Nächsten Sechs']
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Zuladungsliste;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class PositionArchitekt
|
||||
{
|
||||
public static function laden()
|
||||
{
|
||||
//LOAD POSITION TREE Menu
|
||||
// echo $GLOBALS['TYPO3_DB']->SELECTquery("uid, tstamp, punkte, rang, nominiert", "tx_zuladungsliste_archive_user", "user_id=$user_id AND hidden=0", "", "tstamp DESC");
|
||||
// exit;
|
||||
$uid = preg_replace("'\D'", "", $_GET['uid']);
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_archive_user');
|
||||
$queryBuilder
|
||||
->select('auswertung')
|
||||
->from('tx_zuladungsliste_archive_user')
|
||||
->where($queryBuilder->expr()->eq('uid', (int) $uid));
|
||||
$tmp = $queryBuilder->execute()->fetchAll();
|
||||
// echo $queryBuilder->getSQL();
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo $tmp[0]["auswertung"];
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Zuladungsliste;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
// class PositionArchitekt
|
||||
// {
|
||||
// public static function laden()
|
||||
// {
|
||||
// //LOAD POSITION TREE Menu
|
||||
// // echo $GLOBALS['TYPO3_DB']->SELECTquery("uid, tstamp, punkte, rang, nominiert", "tx_zuladungsliste_archive_user", "user_id=$user_id AND hidden=0", "", "tstamp DESC");
|
||||
// // exit;
|
||||
// $uid = preg_replace("'\D'", "", $_GET['uid']);
|
||||
// $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_archive_user');
|
||||
// $queryBuilder
|
||||
// ->select('auswertung')
|
||||
// ->from('tx_zuladungsliste_archive_user')
|
||||
// ->where($queryBuilder->expr()->eq('uid', (int) $uid));
|
||||
// $tmp = $queryBuilder->execute()->fetchAll();
|
||||
// // echo $queryBuilder->getSQL();
|
||||
//
|
||||
// // ----------
|
||||
//
|
||||
// $arr2 = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows("uid id, wettbewerb, kriteriumid, bundesland, EXTRACT(YEAR FROM entscheidungstermin) entyear, EXTRACT(YEAR FROM abgabetermin) abgyear", "tx_zuladungsliste_domain_model_wettbewerbe", "deleted=0 AND hidden=0");
|
||||
//
|
||||
// $punktestatus = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows("uid_wettbewerbe, tstamp_zuordnung, tstamp_aktivierung", "tx_zuladungsliste_wettbewerbe_architekten_mm", "uid_user=$user_id AND uid_punkte>0", "", "", "", "uid_wettbewerbe");
|
||||
//
|
||||
// $arr = array();
|
||||
// foreach ($arr2 as $key => $value) {
|
||||
// $value["status"] = 0;
|
||||
//
|
||||
// if ($value["entyear"]!=0) {
|
||||
// $value["jahr"] = $value["entyear"];
|
||||
// } else {
|
||||
// $value["jahr"] = $value["abgyear"];
|
||||
// }
|
||||
// unset($value["entyear"]);
|
||||
// unset($value["abgyear"]);
|
||||
//
|
||||
// $wettbewerbeId = $value["id"];
|
||||
// if (isset($punktestatus[$wettbewerbeId])) {
|
||||
// $tmp = $punktestatus[$wettbewerbeId];
|
||||
//
|
||||
// if ($tmp["tstamp_zuordnung"]>0) {
|
||||
// $value["status"] = 1;
|
||||
// }
|
||||
//
|
||||
// if ($tmp["tstamp_aktivierung"]>0) {
|
||||
// $value["status"] = 2;
|
||||
// }
|
||||
// }
|
||||
// $arr[] = $value;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// header('Content-Type: application/json');
|
||||
// echo $tmp[0]["auswertung"];
|
||||
// exit();
|
||||
// }
|
||||
// }
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Zuladungsliste;
|
||||
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class TreemenuPosition
|
||||
{
|
||||
public static function laden()
|
||||
{
|
||||
//LOAD POSITION TREE Menu
|
||||
// echo $GLOBALS['TYPO3_DB']->SELECTquery("uid, tstamp, punkte, rang, nominiert", "tx_zuladungsliste_archive_user", "user_id=$user_id AND hidden=0", "", "tstamp DESC");
|
||||
// exit;
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('fe_users');
|
||||
// $queryBuilder
|
||||
// ->getRestrictions()
|
||||
// ->removeByType(StartTimeRestriction::class)
|
||||
// ->removeByType(EndTimeRestriction::class);
|
||||
// $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
$queryBuilder
|
||||
->select('uid', 'tstamp', 'punkte', 'rang', 'nominiert')
|
||||
->from('tx_zuladungsliste_archive_user')
|
||||
->where(
|
||||
$queryBuilder->expr()->eq('user_id', (int) $user['uid']),
|
||||
)->orderBy('tstamp', 'DESC');
|
||||
$tmp = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
// echo $queryBuilder->getSQL();
|
||||
// debug($queryBuilder->getSQL());
|
||||
|
||||
// $tmp = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid, tstamp, punkte, rang, nominiert', 'tx_zuladungsliste_archive_user', "user_id=$user_id AND hidden=0", '', 'tstamp DESC');
|
||||
$arr = [];
|
||||
$i = 1;
|
||||
$tmp2 = [];
|
||||
$p_year = 0;
|
||||
foreach ($tmp as $key => $value) {
|
||||
//print_r($value);
|
||||
$year = date('Y', $value['tstamp']);
|
||||
if ($p_year != $year) {
|
||||
$p_year = $year;
|
||||
$arr[] = [
|
||||
'title' => $year,
|
||||
'id' => (int) $i,
|
||||
'hasChildren' => (int) 1,
|
||||
'type' => 'year',
|
||||
'parent' => null,
|
||||
];
|
||||
$parentid = $i;
|
||||
++$i;
|
||||
}
|
||||
$value["tstamp"] += 3600*12;
|
||||
$arr[] = [
|
||||
'title' => strftime("%e. %b. %G", $value["tstamp"]),
|
||||
'hasChildren' => 0,
|
||||
'parent' => $parentid,
|
||||
'type' => 'month',
|
||||
'punkte' => $value['punkte'],
|
||||
'rang' => $value['rang'],
|
||||
'nominiert' => $value['nominiert'],
|
||||
'id' => $i,
|
||||
'uid' => $value['uid'],
|
||||
];
|
||||
++$i;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($arr);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Zuladungsliste;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class _ZuladungslisteController
|
||||
{
|
||||
public function __construct($xaction)
|
||||
{
|
||||
switch ($xaction) {
|
||||
case 'lade_treemenu_position':
|
||||
return TreemenuPosition::laden();
|
||||
break;
|
||||
case 'lade_position_architekt':
|
||||
return PositionArchitekt::laden();
|
||||
break;
|
||||
case 'lade_punktezuweisung':
|
||||
|
||||
break;
|
||||
default:
|
||||
Message::error(__FILE__, __LINE__, 'no xaction switch defined');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Zuteilungen;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class Zuteilung
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function laden()
|
||||
{
|
||||
// load for prit zuteilungen
|
||||
$zuteilung_uid = preg_replace("'\D'", "", $_GET['zuladungid']);
|
||||
if (!is_numeric($zuteilung_uid)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// $arr = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows("a.uid id, a.tstamp, b.wettbewerb, a.anzahl_architekten",
|
||||
// "tx_zuladungsliste_zuteilungen a, tx_zuladungsliste_domain_model_wettbewerbe b",
|
||||
// "a.hidden=0 AND a.uid_wettbewerbe=b.uid AND a.uid=$zuteilung_uid");
|
||||
|
||||
|
||||
$limitSelection=date('Y-m-d', strtotime('-1 year'));
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_zuteilungen');
|
||||
$queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
$queryBuilder
|
||||
->select('tx_zuladungsliste_zuteilungen.uid', 'tx_zuladungsliste_zuteilungen.tstamp', 'b.wettbewerb', 'tx_zuladungsliste_zuteilungen.anzahl_architekten')
|
||||
->from('tx_zuladungsliste_zuteilungen')
|
||||
->join(
|
||||
'tx_zuladungsliste_zuteilungen',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe',
|
||||
'b',
|
||||
$queryBuilder->expr()->eq('b.uid', $queryBuilder->quoteIdentifier('tx_zuladungsliste_zuteilungen.uid_wettbewerbe')),
|
||||
)
|
||||
->where($queryBuilder->expr()->eq('tx_zuladungsliste_zuteilungen.uid', $zuteilung_uid));
|
||||
$statement = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
// Message::note($queryBuilder->getSQL());
|
||||
|
||||
$$print = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<title>Print Zuladungsliste</title></head><body>';
|
||||
|
||||
if (isset($_GET['print'])) {
|
||||
$print .= '<image style="width:300px;" src="/typo3conf/ext/zuladungsliste/Resources/Public/Images/ztkammer-logo-adler.png"><br>';
|
||||
} else {
|
||||
$print .= '<div id="print_header"></div>';
|
||||
}
|
||||
$print .= '<br><br><h3 class="text-subheader center">'.$statement[0]["wettbewerb"].'<br> vom '.date("d. M. y", (int)$statement[0]["tstamp"]).'</h3>';
|
||||
|
||||
$limitSelection=date('Y-m-d', strtotime('-1 year'));
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_zuteilungen');
|
||||
$queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
$queryBuilder
|
||||
->select(
|
||||
'tx_zuladungsliste_zuteilungen_user.uid',
|
||||
'tx_zuladungsliste_zuteilungen_user.tstamp',
|
||||
'tx_zuladungsliste_zuteilungen_user.position',
|
||||
'tx_zuladungsliste_zuteilungen_user.ersatz',
|
||||
'b.company',
|
||||
'b.name'
|
||||
)
|
||||
->from('tx_zuladungsliste_zuteilungen_user')
|
||||
->join(
|
||||
'tx_zuladungsliste_zuteilungen_user',
|
||||
'fe_users',
|
||||
'b',
|
||||
$queryBuilder->expr()->eq('b.uid', $queryBuilder->quoteIdentifier('tx_zuladungsliste_zuteilungen_user.user_id')),
|
||||
)
|
||||
->where($queryBuilder->expr()->eq('tx_zuladungsliste_zuteilungen_user.uid_zuteilungen_user', $zuteilung_uid))
|
||||
->orderBy('ersatz')->addOrderBy('position');
|
||||
|
||||
// Message::note($queryBuilder->getSQL());
|
||||
|
||||
|
||||
|
||||
$statement = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
$nomiert = '<h3 class="center">Nominierungen</h3>';
|
||||
$nomiert .= '<table class="print_zladungen" width="95%" border="0" cellspacing="5" cellpadding="5">';
|
||||
$ersatz = '<h3 class="center">Ersatz Nominierungen</h3>';
|
||||
$ersatz .= '<table class="print_zladungen" width="95%" border="0" cellspacing="5" cellpadding="5">';
|
||||
|
||||
// if (count($statement)/2==$key) {
|
||||
// $print .= '<tr><td> </td></tr>';
|
||||
// }
|
||||
|
||||
foreach ($statement as $key => $value) {
|
||||
$colorclass = $value["ersatz"] ? "ersatz" : "gewaehlt";
|
||||
|
||||
if ($value["ersatz"]) {
|
||||
$ersatz .= '<tr>';
|
||||
$ersatz .= '<td class="position '.$colorclass.'">'.$value["position"].'</td>';
|
||||
$ersatz .= '<td class="company '.$colorclass.'">'.$value["company"].'</td>';
|
||||
$ersatz .= '<td class="name '.$colorclass.'">'.$value["name"].'</td>';
|
||||
$ersatz .= '<td class="'.$colorclass.'">Ersatz</td>';
|
||||
$ersatz .= '</tr>';
|
||||
} else {
|
||||
$nomiert .= '<tr>';
|
||||
$nomiert .= '<td class="position '.$colorclass.'">'.$value["position"].'</td>';
|
||||
$nomiert .= '<td class="company '.$colorclass.'">'.$value["company"].'</td>';
|
||||
$nomiert .= '<td class="name '.$colorclass.'">'.$value["name"].'</td>';
|
||||
$nomiert .= '<td class="'.$colorclass.'">Ausgewählt</td>';
|
||||
$nomiert .= '</tr>';
|
||||
}
|
||||
}
|
||||
$nomiert .= '</table></div>';
|
||||
$ersatz .= '</table></div>';
|
||||
|
||||
$print .= $nomiert;
|
||||
$print .= $ersatz;
|
||||
|
||||
if (isset($_GET['print'])) {
|
||||
$print .= '<script>this.focus(); this.print();</script>';
|
||||
}
|
||||
echo $print;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Zuteilungen;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class ZuteilungNeu
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function zuteilen()
|
||||
{
|
||||
$user = $GLOBALS['TSFE']->fe_user->user;
|
||||
|
||||
/********************************************************
|
||||
* VARS
|
||||
********************************************************/
|
||||
$kammernid = GeneralUtility::_GP("kammernid");
|
||||
if (!is_numeric($kammernid)) {
|
||||
exit;
|
||||
}
|
||||
$wettbewerb_uid = GeneralUtility::_GP("wettbewerb_uid");
|
||||
if (!is_numeric($wettbewerb_uid)) {
|
||||
exit;
|
||||
}
|
||||
$next = GeneralUtility::_GP("next");
|
||||
if (!is_numeric($next)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
* NEXT
|
||||
********************************************************/
|
||||
$arr = Zuteilungen::laden($returnAsArray = true);
|
||||
$next_array = Zuteilungen::filterNaechsten($arr, $next);
|
||||
|
||||
/********************************************************
|
||||
* punkte uid with 0 punkte
|
||||
* Platzhalter für Zuteilung
|
||||
* bei gewinn erden punkte später zugeteilt
|
||||
********************************************************/
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_punkte_kriterien_mm');
|
||||
$queryBuilder
|
||||
->select(
|
||||
'a.uid',
|
||||
'a.bezeichnung',
|
||||
)->from('tx_zuladungsliste_punkte_kriterien_mm')
|
||||
->join(
|
||||
'tx_zuladungsliste_punkte_kriterien_mm',
|
||||
'tx_zuladungsliste_domain_model_punkte',
|
||||
'a',
|
||||
$queryBuilder->expr()->eq('a.uid', $queryBuilder->quoteIdentifier('tx_zuladungsliste_punkte_kriterien_mm.uid_punkte'))
|
||||
)
|
||||
->where($queryBuilder->expr()->eq('tx_zuladungsliste_punkte_kriterien_mm.punkte', 0));
|
||||
// Message::note($queryBuilder->getSQL());
|
||||
$zuweisung_uid_punkte = $queryBuilder->execute()->fetchOne();
|
||||
|
||||
$insert_array = [];
|
||||
$insert_array['tstamp'] = time();
|
||||
$insert_array['crdate'] = time();
|
||||
$insert_array['pid'] = WETTBEWERBE_PID;
|
||||
$insert_array['uid_user'] = $user['uid']; // Ersteller
|
||||
$insert_array['uid_wettbewerbe'] = $wettbewerb_uid;
|
||||
$insert_array['anzahl_architekten'] = $next;
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_zuteilungen');
|
||||
$queryBuilder->insert('tx_zuladungsliste_zuteilungen')->values($insert_array)->execute();
|
||||
$uid_zuteilungen_user = $queryBuilder->getConnection()->lastInsertId();
|
||||
|
||||
foreach ($next_array as $key => $value) {
|
||||
if ($value["ersatz"]==0) {
|
||||
$insert_array = array();
|
||||
$insert_array['crdate'] = time();
|
||||
$insert_array['pid'] = WETTBEWERBE_PID;
|
||||
$insert_array['tstamp_zuordnung'] = time();
|
||||
$insert_array['tstamp_aktivierung'] = time();
|
||||
$insert_array['uid_punkte'] = $zuweisung_uid_punkte;
|
||||
$insert_array['uid_wettbewerbe'] = $wettbewerb_uid;
|
||||
$insert_array['uid_user'] = $value["user_id"]; // Architekten
|
||||
$queryBuilder
|
||||
->insert('tx_zuladungsliste_wettbewerbe_architekten_mm')
|
||||
->values($insert_array)
|
||||
->execute();
|
||||
}
|
||||
$insert_array = array();
|
||||
$insert_array['tstamp'] = time();
|
||||
$insert_array['crdate'] = time();
|
||||
$insert_array['pid'] = WETTBEWERBE_PID;
|
||||
$insert_array['uid_zuteilungen_user'] = $uid_zuteilungen_user;
|
||||
$insert_array['user_id'] = $value["user_id"]; // Architekten
|
||||
$insert_array['position'] = $key+1;
|
||||
$insert_array['ersatz'] = $value["ersatz"];
|
||||
$queryBuilder
|
||||
->insert('tx_zuladungsliste_zuteilungen_user')
|
||||
->values($insert_array)
|
||||
->execute();
|
||||
}
|
||||
sleep(1);
|
||||
echo $uid_zuteilungen_user;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Zuteilungen;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class ZuteilungWettbewerbe
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function laden()
|
||||
{
|
||||
$limitSelection=date('Y-m-d', strtotime('-1 year'));
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_domain_model_wettbewerbe');
|
||||
$queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
$queryBuilder
|
||||
->select('tx_zuladungsliste_domain_model_wettbewerbe.uid', 'tx_zuladungsliste_domain_model_wettbewerbe.wettbewerb', 'tx_zuladungsliste_domain_model_wettbewerbe.sperre_deaktiviert')
|
||||
->from('tx_zuladungsliste_domain_model_wettbewerbe')
|
||||
->join(
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe',
|
||||
'tx_zuladungsliste_domain_model_kriterien',
|
||||
'b',
|
||||
$queryBuilder->expr()->eq('b.uid', $queryBuilder->quoteIdentifier('tx_zuladungsliste_domain_model_wettbewerbe.kriteriumid'))
|
||||
)
|
||||
->where(
|
||||
$queryBuilder->expr()->gt('tx_zuladungsliste_domain_model_wettbewerbe.entscheidungstermin', $queryBuilder->createNamedParameter($limitSelection)),
|
||||
$queryBuilder->expr()->eq('b.sperrung', (int) 1)
|
||||
);
|
||||
$statement = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
// Message::note($queryBuilder->getSQL());
|
||||
|
||||
// select wettbewerb für zuteilung
|
||||
// $limitSelection=date('Y-m-d', strtotime('-1 year'));
|
||||
// // echo $GLOBALS['TYPO3_DB']->SELECTquery("a.uid id, a.wettbewerb name", "tx_zuladungsliste_domain_model_wettbewerbe a, tx_zuladungsliste_domain_model_kriterien b", "a.deleted=0 AND a.hidden=0 AND a.entscheidungstermin>'".$limitSelection."' AND a.kriteriumid=b.uid AND b.sperrung=1","","a.sperre_deaktiviert ASC, a.entscheidungstermin ASC");
|
||||
// $tmp = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
|
||||
// "a.uid id, a.wettbewerb name, a.sperre_deaktiviert",
|
||||
// "tx_zuladungsliste_domain_model_wettbewerbe a, tx_zuladungsliste_domain_model_kriterien b",
|
||||
// "a.deleted=0 AND a.hidden=0 AND a.entscheidungstermin>'".$limitSelection."' AND a.kriteriumid=b.uid AND b.sperrung=1",
|
||||
// "",
|
||||
// "a.uid DESC"
|
||||
// );
|
||||
// $arr=[];
|
||||
// while (list($key, $value) = each($tmp)) {
|
||||
// if ($value["sperre_deaktiviert"]==1) {
|
||||
// $value["label"] = '<div style="width:500px; display:block;overflow:hidden;">' . $value["name"] . '</div> <span class="rot">(Sperre deaktiviert).</span>';
|
||||
// } else {
|
||||
// $value["label"] = '<b>' . $value["name"] . "</b>";
|
||||
// }
|
||||
// $arr[] = $value;
|
||||
// }
|
||||
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($statement);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Zuteilungen;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class Zuteilungen
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function laden($return_array = false)
|
||||
{
|
||||
$liste = new _Berechnung();
|
||||
$liste::berechnen();
|
||||
|
||||
$_p = ['n2','n3','n4','n5','n6','e2','e3','e4','e5','e6'];
|
||||
|
||||
$_arr = [];
|
||||
foreach (_Berechnung::$_data['liste'] as $key => $value) {
|
||||
$door = false;
|
||||
foreach ($_p as $k => $v) {
|
||||
if (isset($value[$v]) and $value[$v] == 1) {
|
||||
$value[$v] = (int) $value[$v];
|
||||
$door = true;
|
||||
}
|
||||
}
|
||||
if ($door) {
|
||||
unset($value['auswertung']);
|
||||
$_arr[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if ($return_array) {
|
||||
return $_arr;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($_arr);
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function filterNaechsten($_arr, $dienaechsten)
|
||||
{
|
||||
$f1 = "n".$dienaechsten;
|
||||
$f2 = "e".$dienaechsten;
|
||||
// echo "\nf1: " . $f1;
|
||||
// echo "\nf2: " . $f2;
|
||||
// echo "\n";
|
||||
$next = [];
|
||||
foreach ($_arr as $key => $value) {
|
||||
if ((isset($value[$f1]) and $value[$f1]==1) || (isset($value[$f2]) and $value[$f2]==1)) {
|
||||
$tmp = [];
|
||||
$tmp['user_id'] = $value['user_id'];
|
||||
$tmp['pos'] = $value['pos'];
|
||||
$tmp['rang'] = $value['rang'];
|
||||
$tmp["ersatz"] = $value[$f2] ? $value[$f2] : 0;
|
||||
$tmp[$f1] = $value[$f1];
|
||||
$tmp[$f2] = $value[$f2];
|
||||
$next[] = $tmp;
|
||||
}
|
||||
}
|
||||
return $next;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Zuteilungen;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class ZuteilungenErteilt
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function laden()
|
||||
{
|
||||
$limitSelection=date('Y-m-d', strtotime('-1 year'));
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_zuladungsliste_zuteilungen');
|
||||
$queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
$queryBuilder
|
||||
->select('tx_zuladungsliste_zuteilungen.uid', 'tx_zuladungsliste_zuteilungen.tstamp', 'b.wettbewerb', 'tx_zuladungsliste_zuteilungen.anzahl_architekten')
|
||||
->from('tx_zuladungsliste_zuteilungen')
|
||||
->join(
|
||||
'tx_zuladungsliste_zuteilungen',
|
||||
'tx_zuladungsliste_domain_model_wettbewerbe',
|
||||
'b',
|
||||
$queryBuilder->expr()->eq('b.uid', $queryBuilder->quoteIdentifier('tx_zuladungsliste_zuteilungen.uid_wettbewerbe'))
|
||||
);
|
||||
$statement = $queryBuilder->execute()->fetchAll();
|
||||
|
||||
// Message::note($queryBuilder->getSQL());
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($statement);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace HermannTelser\Zuladungsliste\Zuteilungen;
|
||||
|
||||
use ForceUTF8\Encoding;
|
||||
use HermannTelser\Zuladungsliste\Berechnung\_Berechnung;
|
||||
use HermannTelser\Zuladungsliste\Utilities\Message;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/***
|
||||
*
|
||||
* This file is part of the "Zuladungsliste Steiermark" Extension for TYPO3 CMS.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 - 2022 Hermann Telser <hermann.telser@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
* ************************************************************* */
|
||||
|
||||
class _ZuteilungenController
|
||||
{
|
||||
public function __construct($xaction)
|
||||
{
|
||||
switch ($xaction) {
|
||||
case 'lade_zuteilungen':
|
||||
Zuteilungen::laden();
|
||||
break;
|
||||
case 'zuteilungen_wettbewerbe':
|
||||
ZuteilungWettbewerbe::laden();
|
||||
break;
|
||||
case 'zuteilungen_erteilt':
|
||||
ZuteilungenErteilt::laden();
|
||||
break;
|
||||
case 'zuteilung_laden':
|
||||
Zuteilung::laden();
|
||||
break;
|
||||
case 'neu_zuteilen':
|
||||
ZuteilungNeu::zuteilen();
|
||||
break;
|
||||
default:
|
||||
Message::error(__FILE__, __LINE__, 'no xaction switch defined');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user