first commit
This commit is contained in:
commit
e81864e683
2984 files changed
+267797
No files matched your search
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user