58 lines
2.0 KiB
PHP
58 lines
2.0 KiB
PHP
<?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();
|
|
}
|
|
}
|