mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-02 22:48:41 +00:00
fix static analysis
This commit is contained in:
parent
f1562c4307
commit
55654b2f44
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Admin
|
||||
* @package Modules\Media
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,9 +15,10 @@ declare(strict_types=1);
|
|||
$data = $this->getData('data') ?? [];
|
||||
|
||||
$out = \fopen('php://output', 'w');
|
||||
if ($out !== false) {
|
||||
foreach ($data as $row) {
|
||||
\fputcsv($out, $row);
|
||||
}
|
||||
|
||||
foreach ($data as $row) {
|
||||
fputcsv($out, $row);
|
||||
\fclose($out);
|
||||
}
|
||||
|
||||
\fclose($out);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Admin
|
||||
* @package Modules\Media
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* Karaka
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Media
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Admin
|
||||
* @package Modules\Media
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -14,11 +14,12 @@ declare(strict_types=1);
|
|||
|
||||
require_once __DIR__ . '/../phpOMS/Autoloader.php';
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use phpOMS\Autoloader;
|
||||
|
||||
Autoloader::addPath(__DIR__ . '/../Resources');
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$media = $this->getData('media');
|
||||
$data = $this->getData('data') ?? [];
|
||||
|
||||
|
|
@ -37,6 +38,9 @@ $file = \tempnam(\sys_get_temp_dir(), 'oms_');
|
|||
$writer = IOFactory::createWriter($excel, 'Xlsx');
|
||||
$writer->save($file);
|
||||
|
||||
echo \file_get_contents($file);
|
||||
$content = \file_get_contents($file);
|
||||
if ($content !== false) {
|
||||
echo $content;
|
||||
}
|
||||
|
||||
\unlink($file);
|
||||
|
|
@ -20,7 +20,7 @@ declare(strict_types=1);
|
|||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @phpstan-import-type TCPDF from ../../../../../Resources/tcpdf.php
|
||||
* @phpstan-import-type TCPDF from ../../../../../Resources/tcpdf/tcpdf.php
|
||||
*/
|
||||
class DefaultPdf extends TCPDF
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Admin
|
||||
* @package Modules\Media
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,10 +15,14 @@ declare(strict_types=1);
|
|||
require_once __DIR__ . '/../phpOMS/Autoloader.php';
|
||||
|
||||
use phpOMS\Autoloader;
|
||||
|
||||
Autoloader::addPath(__DIR__ . '/../Resources');
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$media = $this->getData('media');
|
||||
$data = $this->getData('data') ?? [];
|
||||
|
||||
/** @var array<array> $data */
|
||||
$data = $this->getData('data') ?? [];
|
||||
|
||||
include $media->getSourceByName('template.php')->getAbsolutePath();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Karaka
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Media
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
||||
/**
|
||||
* Default Word class.
|
||||
*
|
||||
* @package Modules\Media
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class DefaultWord extends \PhpOffice\PhpWord\PhpWord
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
|
@ -32,7 +57,7 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
|||
$table->addCell(1300)->addImage(__DIR__ . '/../Web/Backend/img/logo.png', ['width' => 50, 'height' => 50]);
|
||||
|
||||
//second column
|
||||
$cell = $table->addCell(8700, ['valign' => 'bottom']);
|
||||
$cell = $table->addCell(8700, ['valign' => 'bottom']);
|
||||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('Jingga', ['name' => 'helvetica', 'bold' => true, 'size' => 20]);
|
||||
|
||||
|
|
@ -51,7 +76,7 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
|||
// columns
|
||||
$cell = $table->addCell(500);
|
||||
|
||||
$cell = $table->addCell(2000);
|
||||
$cell = $table->addCell(2000);
|
||||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('Jingga e.K.', ['name' => 'helvetica', 'size' => 7]);
|
||||
$textrun = $cell->addTextRun();
|
||||
|
|
@ -59,7 +84,7 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
|||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('61206 Woellstadt', ['name' => 'helvetica', 'size' => 7]);
|
||||
|
||||
$cell = $table->addCell(2700);
|
||||
$cell = $table->addCell(2700);
|
||||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('Geschäftsführer: Dennis Eichhorn', ['name' => 'helvetica', 'size' => 7]);
|
||||
$textrun = $cell->addTextRun();
|
||||
|
|
@ -67,7 +92,7 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
|||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('USt Id: DE ??????????', ['name' => 'helvetica', 'size' => 7]);
|
||||
|
||||
$cell = $table->addCell(2700);
|
||||
$cell = $table->addCell(2700);
|
||||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('Volksbank Mittelhessen', ['name' => 'helvetica', 'size' => 7]);
|
||||
$textrun = $cell->addTextRun();
|
||||
|
|
@ -75,7 +100,7 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
|||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('IBAN: ???????????', ['name' => 'helvetica', 'size' => 7]);
|
||||
|
||||
$cell = $table->addCell(2100);
|
||||
$cell = $table->addCell(2100);
|
||||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('www.jingga.app', ['name' => 'helvetica', 'size' => 7]);
|
||||
$textrun = $cell->addTextRun();
|
||||
|
|
@ -98,14 +123,14 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
|||
]);
|
||||
|
||||
$header = $section->addHeader();
|
||||
$table = $header->addTable();
|
||||
$table = $header->addTable();
|
||||
$table->addRow();
|
||||
|
||||
// first column
|
||||
$table->addCell(1300)->addImage(__DIR__ . '/../Web/Backend/img/logo.png', ['width' => 50, 'height' => 50]);
|
||||
|
||||
//second column
|
||||
$cell = $table->addCell(8700, ['valign' => 'bottom']);
|
||||
$cell = $table->addCell(8700, ['valign' => 'bottom']);
|
||||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('Jingga', ['name' => 'helvetica', 'bold' => true, 'size' => 20]);
|
||||
|
||||
|
|
@ -122,7 +147,7 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
|||
// columns
|
||||
$cell = $table->addCell(500);
|
||||
|
||||
$cell = $table->addCell(2000);
|
||||
$cell = $table->addCell(2000);
|
||||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('Jingga e.K.', ['name' => 'helvetica', 'size' => 7]);
|
||||
$textrun = $cell->addTextRun();
|
||||
|
|
@ -130,7 +155,7 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
|||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('61206 Woellstadt', ['name' => 'helvetica', 'size' => 7]);
|
||||
|
||||
$cell = $table->addCell(2700);
|
||||
$cell = $table->addCell(2700);
|
||||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('Geschäftsführer: Dennis Eichhorn', ['name' => 'helvetica', 'size' => 7]);
|
||||
$textrun = $cell->addTextRun();
|
||||
|
|
@ -138,7 +163,7 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
|||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('USt Id: DE ??????????', ['name' => 'helvetica', 'size' => 7]);
|
||||
|
||||
$cell = $table->addCell(2700);
|
||||
$cell = $table->addCell(2700);
|
||||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('Volksbank Mittelhessen', ['name' => 'helvetica', 'size' => 7]);
|
||||
$textrun = $cell->addTextRun();
|
||||
|
|
@ -146,7 +171,7 @@ class DefaultWord extends \PhpOffice\PhpWord\PhpWord {
|
|||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('IBAN: ???????????', ['name' => 'helvetica', 'size' => 7]);
|
||||
|
||||
$cell = $table->addCell(2100);
|
||||
$cell = $table->addCell(2100);
|
||||
$textrun = $cell->addTextRun();
|
||||
$textrun->addText('www.jingga.app', ['name' => 'helvetica', 'size' => 7]);
|
||||
$textrun = $cell->addTextRun();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Admin
|
||||
* @package Modules\Media
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,19 +15,24 @@ declare(strict_types=1);
|
|||
require_once __DIR__ . '/../phpOMS/Autoloader.php';
|
||||
|
||||
use phpOMS\Autoloader;
|
||||
|
||||
Autoloader::addPath(__DIR__ . '/../Resources');
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$media = $this->getData('media');
|
||||
$data = $this->getData('data') ?? [];
|
||||
|
||||
include $media->getSourceByName('template.php')->getAbsolutePath();
|
||||
|
||||
$word = new DefaultWord();
|
||||
$word = new DefaultWord();
|
||||
$section = $word->createFirstPage();
|
||||
|
||||
$file = \tempnam(\sys_get_temp_dir(), 'oms_');
|
||||
$writer->save($file);
|
||||
|
||||
echo \file_get_contents($file);
|
||||
$content = \file_get_contents($file);
|
||||
if ($content !== false) {
|
||||
echo $content;
|
||||
}
|
||||
|
||||
\unlink($file);
|
||||
\unlink($file);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Admin
|
||||
* @package Modules\Media
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,14 +15,18 @@ declare(strict_types=1);
|
|||
require_once __DIR__ . '/../phpOMS/Autoloader.php';
|
||||
|
||||
use phpOMS\Autoloader;
|
||||
|
||||
Autoloader::addPath(__DIR__ . '/../Resources');
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$media = $this->getData('media');
|
||||
$data = $this->getData('data') ?? [];
|
||||
|
||||
/** @var array<array> $data */
|
||||
$data = $this->getData('data') ?? [];
|
||||
|
||||
include $media->getSourceByName('template.php')->getAbsolutePath();
|
||||
|
||||
$word = new DefaultWord();
|
||||
$word = new DefaultWord();
|
||||
$section = $word->createFirstPage();
|
||||
|
||||
$tbl = '<table border="1" cellpadding="0" cellspacing="0">';
|
||||
|
|
@ -52,4 +56,4 @@ $writer->save($file);
|
|||
|
||||
echo \file_get_contents($file);
|
||||
|
||||
\unlink($file);
|
||||
\unlink($file);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ use phpOMS\Autoloader;
|
|||
|
||||
Autoloader::addPath(__DIR__ . '/../Resources');
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$media = $this->getData('media');
|
||||
$data = $this->getData('data') ?? [];
|
||||
|
||||
|
|
@ -29,6 +30,11 @@ $section = $word->createFirstPage();
|
|||
$file = \tempnam(\sys_get_temp_dir(), 'oms_');
|
||||
$writer->save($file);
|
||||
|
||||
echo \file_get_contents($file);
|
||||
if ($file !== false) {
|
||||
$content = \file_get_contents($file);
|
||||
if ($content !== false) {
|
||||
echo $content;
|
||||
}
|
||||
}
|
||||
|
||||
\unlink($file);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Karaka
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\Admin\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\Admin\Models\SettingsEnum;
|
||||
|
|
|
|||
|
|
@ -1333,12 +1333,15 @@ final class ApiController extends Controller
|
|||
*/
|
||||
public function apiGroupFind(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
/** @var \Modules\Admin\Models\Group[] $groups */
|
||||
$groups = GroupMapper::getAll()
|
||||
->where('name', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
|
||||
->execute();
|
||||
|
||||
$response->header->set('Content-Type', MimeType::M_JSON, true);
|
||||
$response->set(
|
||||
$request->uri->__toString(),
|
||||
\array_values(
|
||||
GroupMapper::getAll()->where('name', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')->execute()
|
||||
)
|
||||
\array_values($groups)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1385,18 +1388,19 @@ final class ApiController extends Controller
|
|||
*/
|
||||
public function apiAccountFind(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
/** @var \Modules\Admin\Models\Account[] $accounts */
|
||||
$accounts = AccountMapper::getAll()
|
||||
->where('login', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
|
||||
->where('email', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name1', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name2', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name3', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->execute();
|
||||
|
||||
$response->header->set('Content-Type', MimeType::M_JSON, true);
|
||||
$response->set(
|
||||
$request->uri->__toString(),
|
||||
\array_values(
|
||||
AccountMapper::getAll()
|
||||
->where('login', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
|
||||
->where('email', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name1', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name2', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name3', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->execute()
|
||||
)
|
||||
\array_values($accounts)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1416,19 +1420,15 @@ final class ApiController extends Controller
|
|||
public function apiAccountGroupFind(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
/** @var Account[] $accounts */
|
||||
$accounts = \array_values(
|
||||
AccountMapper::getAll()
|
||||
->where('login', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
|
||||
->where('email', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name1', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name2', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name3', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->execute()
|
||||
);
|
||||
$accounts = AccountMapper::getAll()
|
||||
->where('login', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
|
||||
->where('email', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name1', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name2', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->where('name3', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE', 'OR')
|
||||
->execute();
|
||||
|
||||
/** @var Group[] $groups */
|
||||
$groups = \array_values(GroupMapper::getAll()->where('name', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')->execute());
|
||||
$data = [];
|
||||
$data = [];
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
/** @var array $temp */
|
||||
|
|
@ -1439,6 +1439,11 @@ final class ApiController extends Controller
|
|||
$data[] = $temp;
|
||||
}
|
||||
|
||||
/** @var Group[] $groups */
|
||||
$groups = GroupMapper::getAll()
|
||||
->where('name', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE')
|
||||
->execute();
|
||||
|
||||
foreach ($groups as $group) {
|
||||
/** @var array $temp */
|
||||
$temp = $group->jsonSerialize();
|
||||
|
|
@ -1731,7 +1736,10 @@ final class ApiController extends Controller
|
|||
);
|
||||
|
||||
if (!empty($defaultGroupSettings)) {
|
||||
$defaultGroupIds = \array_merge($defaultGroupIds, \json_decode($defaultGroupSettings->content, true));
|
||||
$defaultGroupIds = \array_merge(
|
||||
$defaultGroupIds,
|
||||
\json_decode($defaultGroupSettings->content, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1744,7 +1752,10 @@ final class ApiController extends Controller
|
|||
);
|
||||
|
||||
if (!empty($defaultGroupSettings)) {
|
||||
$defaultGroupIds = \array_merge($defaultGroupIds, \json_decode($defaultGroupSettings->content, true));
|
||||
$defaultGroupIds = \array_merge(
|
||||
$defaultGroupIds,
|
||||
\json_decode($defaultGroupSettings->content, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2069,10 +2080,12 @@ final class ApiController extends Controller
|
|||
|
||||
if (!$request->hasData('locale')) {
|
||||
$account->l11n = Localization::fromJson(
|
||||
$this->app->l11nServer === null ? $request->header->l11n->jsonSerialize() : $this->app->l11nServer->jsonSerialize()
|
||||
$this->app->l11nServer === null
|
||||
? $request->header->l11n->jsonSerialize()
|
||||
: $this->app->l11nServer->jsonSerialize()
|
||||
);
|
||||
} else {
|
||||
$locale = \explode('_', $request->getData('locale'));
|
||||
$locale = \explode('_', $request->getdataString('locale') ?? '');
|
||||
|
||||
$account->l11n
|
||||
->loadFromLanguage(
|
||||
|
|
@ -3069,6 +3082,7 @@ final class ApiController extends Controller
|
|||
if ($cliEventHandling) {
|
||||
$count = \count($data);
|
||||
|
||||
/** @var string $cliPath */
|
||||
$cliPath = \realpath(__DIR__ . '/../../../cli.php');
|
||||
if ($cliPath === false) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user