auto fixes + some impl.

This commit is contained in:
Dennis Eichhorn 2024-01-26 22:54:00 +00:00
parent e6943559d0
commit 85975abe97
25 changed files with 166 additions and 223 deletions

View File

@ -10,37 +10,37 @@ return [
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/components(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/components(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewComponents',
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/imprint(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/imprint(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewImprint',
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/terms(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/terms(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewTerms',
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/privacy(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/privacy(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewDataPrivacy',
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/list(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/list(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewList',
'verb' => RouteVerb::GET,
],
],
'^(\/[a-zA-Z]*\/*|\/)/item(\?.*|$)$' => [
'^(\/[a-zA-Z]*\/*|\/)/item(\?.*$|$)' => [
[
'dest' => '\Web\{APPNAME}\Controller\AppController:viewItem',
'verb' => RouteVerb::GET,

View File

@ -16,7 +16,7 @@ declare(strict_types=1);
<div class="content">
<div class="floater">
<h1>Imprint</h1>
<p>Karaka</p>
<p>Jingga</p>
<h2>Vertreten durch</h2>
<p>Dennis Eichhorn</p>
@ -31,7 +31,7 @@ declare(strict_types=1);
<p>Nicht vorhanden</p>
<h2>Verantwortlich für den Inhalt nach § 55 Abs. 2 RStV</h2>
<p>Karaka</p>
<p>Jingga</p>
<p>Dennis Eichhorn</p>
<h2>Datenschutzbeauftragter</h2>

View File

@ -16,7 +16,7 @@ declare(strict_types=1);
<div class="content">
<div class="floater">
<h1>Privacy Policy</h1>
<p>This privacy policy ("POLICY") will help you understand how [name] ("us", "we", "our") uses and protects the data you provide to us when you visit and use Karaka ("website", "service" and "application").</p>
<p>This privacy policy ("POLICY") will help you understand how [name] ("us", "we", "our") uses and protects the data you provide to us when you visit and use Jingga ("website", "service" and "application").</p>
<h2>Definitions</h2>
<p>For the purposes of these POLICIES:<p>
@ -24,7 +24,7 @@ declare(strict_types=1);
<ul>
<li>AFFILIATED means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority.</li>
<li>COUNTRY refers to Germany</li>
<li>COMPANY (referred to as either "the Company", "We", "Us" or "Our" in this AGREEMENT) refers to Karaka, Kirchstr. 33, 61191 Rosbach.</li>
<li>COMPANY (referred to as either "the Company", "We", "Us" or "Our" in this AGREEMENT) refers to Jingga, Kirchstr. 33, 61191 Rosbach.</li>
<li>DEVICE means any device that can access the SERVICE such as a computer, a cellphone or a digital tablet.</li>
<li>SERVICE refers to the Website</li>
<li>POLICY or AGREEMENT mean these policies that form the entire agreement between You and the COMPANY regarding the use of the SERVICE.</li>
@ -55,7 +55,7 @@ declare(strict_types=1);
</ul>
<h2>Safeguarding and Securing the Data</h2>
<p>Karaka is committed to securing your data and keeping it confidential. Karaka has done all in its power to prevent data theft, unauthorized access, and disclosure by implementing the latest technologies and software, which help us safeguard all the information we collect online.</p>
<p>Jingga is committed to securing your data and keeping it confidential. Jingga has done all in its power to prevent data theft, unauthorized access, and disclosure by implementing the latest technologies and software, which help us safeguard all the information we collect online.</p>
<h2>Our Cookie Policy</h2>
<p>Once you agree to allow our WEBSITE or APPLICATION to use cookies, you also agree to these POLICIES.</p>
@ -76,7 +76,7 @@ declare(strict_types=1);
<li>If you have already agreed to share your information with us, feel free to contact us via email and we will be more than happy to change this for you.</li>
</ul>
<p>Karaka will not lease, sell or distribute your personal information to any third parties, unless we have your permission. We might do so if the law forces us. Your personal information will be used when we need to send you promotional materials if you agree to this privacy policy.</p>
<p>Jingga will not lease, sell or distribute your personal information to any third parties, unless we have your permission. We might do so if the law forces us. Your personal information will be used when we need to send you promotional materials if you agree to this privacy policy.</p>
<h2>Governing Law</h2>
<p>The laws of the COUNTRY, excluding its conflicts of law rules, shall govern this POLICY and Your use of the SERVICE. Your use of the APPLICATION may also be subject to other local, state, national, or international laws.</p>

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
<ul>
<li>AFFILIATED means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority.</li>
<li>COUNTRY refers to Germany</li>
<li>COMPANY (referred to as either "the Company", "We", "Us" or "Our" in this AGREEMENT) refers to Karaka, Kirchstr. 33, 61191 Rosbach.</li>
<li>COMPANY (referred to as either "the Company", "We", "Us" or "Our" in this AGREEMENT) refers to Jingga, Kirchstr. 33, 61191 Rosbach.</li>
<li>DEVICE means any device that can access the Service such as a computer, a cellphone or a digital tablet.</li>
<li>SERVICE refers to the Website</li>
<li>TERMS or AGREEMENT mean these terms that form the entire agreement between You and the COMPANY regarding the use of the SERVICE.</li>
@ -41,7 +41,7 @@ declare(strict_types=1);
<p>Your access to and use of the SERVICE is also conditioned on Your acceptance of and compliance with the Privacy Policy of the COMPANY. Our Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your personal information when You use the Application or the WEBSITE and tells You about Your privacy rights and how the law protects You. Please read Our Privacy Policy carefully before using Our SERVICE.</p>
<h2>Copyright</h2>
<p>Unless otherwise noted, all materials including without limitation, logos, brand names, images, designs, photographs, videos, audio, source code and written and other materials that appear as part of our WEBSITE are copyrights, trademarks, service marks, trade dress and/or other intellectual property whether registered or unregistered ("Intellectual Property") owned, controlled or licensed by Karaka. Our WEBSITE as a whole is protected by copyright and trade dress. Nothing on our WEBSITE should be construed as granting, by implication, estoppel or otherwise, any license or right to use any Intellectual Property displayed or used on our WEBSITE, without the prior written permission of the Intellectual Property owner. Karaka aggressively enforces its intellectual property rights to the fullest extent of the law. The names and logos of Karaka, may not be used in any way, including in advertising or publicity pertaining to distribution of materials on our WEBSITE, without prior, written permission from Karaka. Karaka prohibits use of any logo of Karaka or any of its affiliates as part of a link to or from any WEBSITE unless Karaka approves such link in advance and in writing. Fair use of Karaka Intellectual Property requires proper acknowledgment. Other product and company names mentioned in our Website may be the Intellectual Property of their respective owners.</p>
<p>Unless otherwise noted, all materials including without limitation, logos, brand names, images, designs, photographs, videos, audio, source code and written and other materials that appear as part of our WEBSITE are copyrights, trademarks, service marks, trade dress and/or other intellectual property whether registered or unregistered ("Intellectual Property") owned, controlled or licensed by Jingga. Our WEBSITE as a whole is protected by copyright and trade dress. Nothing on our WEBSITE should be construed as granting, by implication, estoppel or otherwise, any license or right to use any Intellectual Property displayed or used on our WEBSITE, without the prior written permission of the Intellectual Property owner. Jingga aggressively enforces its intellectual property rights to the fullest extent of the law. The names and logos of Jingga, may not be used in any way, including in advertising or publicity pertaining to distribution of materials on our WEBSITE, without prior, written permission from Jingga. Jingga prohibits use of any logo of Jingga or any of its affiliates as part of a link to or from any WEBSITE unless Jingga approves such link in advance and in writing. Fair use of Jingga Intellectual Property requires proper acknowledgment. Other product and company names mentioned in our Website may be the Intellectual Property of their respective owners.</p>
<h2>Links</h2>
<p>Our SERVICE may contain links to third-party web sites or services that are not owned or controlled by the COMPANY.</p>

View File

@ -41,14 +41,6 @@
"foreignTable": "task",
"foreignKey": "task_id"
},
"support_ticket_for": {
"name": "support_ticket_for",
"type": "INT",
"null": true,
"default": null,
"foreignTable": "account",
"foreignKey": "account_id"
},
"support_ticket_app": {
"name": "support_ticket_app",
"type": "INT",
@ -68,11 +60,6 @@
"primary": true,
"autoincrement": true
},
"support_ticket_element_time": {
"name": "support_ticket_element_time",
"type": "INT",
"null": false
},
"support_ticket_element_task_element": {
"name": "support_ticket_element_task_element",
"type": "INT",

View File

@ -47,7 +47,7 @@ return [
// ],
// ],
// ],
// '^.*/task/element.*$' => [
// '^.*/task/element(\?.*$|$)' => [
// [
// 'dest' => '\Modules\Support\Controller\ApiController:apiTaskElementCreate',
// 'verb' => RouteVerb::PUT,

View File

@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/support/list.*$' => [
'^.*/support/list(\?.*$|$)' => [
[
'dest' => '\Modules\Support\Controller\BackendController:viewSupportList',
'verb' => RouteVerb::GET,
@ -29,7 +29,7 @@ return [
],
],
],
'^.*/support/ticket.*$' => [
'^.*/support/ticket(\?.*$|$)' => [
[
'dest' => '\Modules\Support\Controller\BackendController:viewSupportTicket',
'verb' => RouteVerb::GET,
@ -40,7 +40,7 @@ return [
],
],
],
'^.*/support/create.*$' => [
'^.*/support/create(\?.*$|$)' => [
[
'dest' => '\Modules\Support\Controller\BackendController:viewSupportCreate',
'verb' => RouteVerb::GET,
@ -51,7 +51,7 @@ return [
],
],
],
'^.*/support/analysis.*$' => [
'^.*/support/analysis(\?.*$|$)' => [
[
'dest' => '\Modules\Support\Controller\BackendController:viewSupportAnalysis',
'verb' => RouteVerb::GET,
@ -62,7 +62,7 @@ return [
],
],
],
'^.*/support/settings.*$' => [
'^.*/support/settings(\?.*$|$)' => [
[
'dest' => '\Modules\Support\Controller\BackendController:viewSupportSettings',
'verb' => RouteVerb::GET,
@ -73,7 +73,7 @@ return [
],
],
],
'^.*/private/support/dashboard.*$' => [
'^.*/private/support/dashboard(\?.*$|$)' => [
[
'dest' => '\Modules\Support\Controller\BackendController:viewPrivateSupportDashboard',
'verb' => RouteVerb::GET,

View File

@ -14,7 +14,6 @@ declare(strict_types=1);
namespace Modules\Support\Controller;
use Modules\Admin\Models\NullAccount;
use Modules\Support\Models\NullSupportApp;
use Modules\Support\Models\SupportApp;
use Modules\Support\Models\SupportAppMapper;
@ -99,16 +98,12 @@ final class ApiController extends Controller
private function createTicketFromRequest(RequestAbstract $request) : Ticket
{
$request->setData('redirect', 'support/ticket?for={$id}');
$task = $this->app->moduleManager->get('Tasks')->createTaskFromRequest($request);
$task->setType(TaskType::HIDDEN);
$task = $this->app->moduleManager->get('Tasks')->createTaskFromRequest($request);
$task->type = TaskType::HIDDEN;
$ticket = new Ticket($task);
$ticket->app = new NullSupportApp($request->getDataInt('app') ?? 1);
if ($request->hasData('for')) {
$ticket->for = new NullAccount((int) $request->getData('for'));
}
return $ticket;
}
@ -220,9 +215,9 @@ final class ApiController extends Controller
$old = clone $ticket->task;
$ticket->task->setStatus($element->taskElement->getStatus());
$ticket->task->setPriority($element->taskElement->getPriority());
$ticket->task->due = $element->taskElement->due;
$ticket->task->status = $element->taskElement->status;
$ticket->task->priority = $element->taskElement->priority;
$ticket->task->due = $element->taskElement->due;
$this->createModel($request->header->account, $element, TicketElementMapper::class, 'ticketelement', $request->getOrigin());
$this->updateModel($request->header->account, $old, $ticket->task, TaskMapper::class, 'ticket', $request->getOrigin());
@ -244,7 +239,6 @@ final class ApiController extends Controller
$taskElement = $this->app->moduleManager->get('Tasks')->createTaskElementFromRequest($request, $ticket->task);
$ticketElement = new TicketElement($taskElement);
$ticketElement->time = $request->getDataInt('time') ?? 0;
$ticketElement->ticket = $ticket->id;
return $ticketElement;

View File

@ -48,18 +48,6 @@ class SupportApp implements \JsonSerializable
*/
public ?int $unit = null;
/**
* Get id.
*
* @return int Model id
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
}
/**
* {@inheritdoc}
*/

View File

@ -14,7 +14,6 @@ declare(strict_types=1);
namespace Modules\Support\Models;
use Modules\Admin\Models\Account;
use Modules\Tasks\Models\Task;
use Modules\Tasks\Models\TaskType;
@ -60,17 +59,6 @@ class Ticket
*/
public array $ticketElements = [];
/**
* Account this ticket is for
*
* This is not the person who is working on the ticket but the person who needs help.
* This can be different from the person who created it.
*
* @var null|Account
* @since 1.0.0
*/
public ?Account $for = null;
/**
* Constructor.
*
@ -78,23 +66,11 @@ class Ticket
*
* @since 1.0.0
*/
public function __construct(Task $task = null)
public function __construct(?Task $task = null)
{
$this->task = $task ?? new Task();
$this->task->setType(TaskType::HIDDEN);
$this->app = new SupportApp();
}
/**
* Get id.
*
* @return int Model id
*
* @since 1.0.0
*/
public function getId() : int
{
return $this->id;
$this->task = $task ?? new Task();
$this->task->type = TaskType::HIDDEN;
$this->app = new SupportApp();
}
/**
@ -181,11 +157,10 @@ class Ticket
public function toArray() : array
{
return [
'id' => $this->id,
'task' => $this->task,
'app' => $this->app,
'for' => $this->for,
'ticketElements' => $this->ticketElements,
'id' => $this->id,
'task' => $this->task,
'app' => $this->app,
'ticketElements' => $this->ticketElements,
];
}

View File

@ -34,14 +34,6 @@ class TicketElement implements \JsonSerializable
*/
public int $id = 0;
/**
* Ticket element time
*
* @var int
* @since 1.0.0
*/
public int $time = 0;
/**
* Ticket.
*
@ -65,7 +57,7 @@ class TicketElement implements \JsonSerializable
*
* @since 1.0.0
*/
public function __construct(TaskElement $taskElement = null)
public function __construct(?TaskElement $taskElement = null)
{
$this->taskElement = $taskElement ?? new TaskElement();
}
@ -77,7 +69,6 @@ class TicketElement implements \JsonSerializable
{
return [
'id' => $this->id,
'time' => $this->time,
'ticket' => $this->ticket,
'taskElement' => $this->taskElement,
];

View File

@ -39,7 +39,6 @@ final class TicketElementMapper extends DataMapperFactory
public const COLUMNS = [
'support_ticket_element_id' => ['name' => 'support_ticket_element_id', 'type' => 'int', 'internal' => 'id'],
'support_ticket_element_task_element' => ['name' => 'support_ticket_element_task_element', 'type' => 'int', 'internal' => 'taskElement'],
'support_ticket_element_time' => ['name' => 'support_ticket_element_time', 'type' => 'int', 'internal' => 'time'],
'support_ticket_element_ticket' => ['name' => 'support_ticket_element_ticket', 'type' => 'int', 'internal' => 'ticket'],
];
@ -51,8 +50,8 @@ final class TicketElementMapper extends DataMapperFactory
*/
public const OWNS_ONE = [
'taskElement' => [
'mapper' => TaskElementMapper::class,
'external' => 'support_ticket_element_task_element',
'mapper' => TaskElementMapper::class,
'external' => 'support_ticket_element_task_element',
],
];

View File

@ -42,7 +42,6 @@ final class TicketMapper extends DataMapperFactory
public const COLUMNS = [
'support_ticket_id' => ['name' => 'support_ticket_id', 'type' => 'int', 'internal' => 'id'],
'support_ticket_task' => ['name' => 'support_ticket_task', 'type' => 'int', 'internal' => 'task'],
'support_ticket_for' => ['name' => 'support_ticket_for', 'type' => 'int', 'internal' => 'for'],
'support_ticket_app' => ['name' => 'support_ticket_app', 'type' => 'int', 'internal' => 'app'],
];
@ -54,8 +53,8 @@ final class TicketMapper extends DataMapperFactory
*/
public const OWNS_ONE = [
'task' => [
'mapper' => TaskMapper::class,
'external' => 'support_ticket_task',
'mapper' => TaskMapper::class,
'external' => 'support_ticket_task',
],
];
@ -67,10 +66,10 @@ final class TicketMapper extends DataMapperFactory
*/
public const HAS_MANY = [
'ticketElements' => [
'mapper' => TicketElementMapper::class,
'table' => 'support_ticket_element',
'self' => 'support_ticket_element_ticket',
'external' => null,
'mapper' => TicketElementMapper::class,
'table' => 'support_ticket_element',
'self' => 'support_ticket_element_ticket',
'external' => null,
],
];
@ -112,11 +111,11 @@ final class TicketMapper extends DataMapperFactory
$start = SmartDateTime::startOfMonth();
return [
'total' => TicketMapper::count()->with('task')->where('task/createdAt', $start, '>=')->execute(),
'unassigned' => TicketMapper::count()->with('task')->where('for', null)->execute(),
'open' => TicketMapper::count()->with('task')->where('task/status', TaskStatus::OPEN)->execute(),
'closed' => TicketMapper::count()->with('task')->where('task/createdAt', $start, '>=')->where('task/status', TaskStatus::DONE)->where('task/status', TaskStatus::CANCELED, '=', 'OR')->where('task/status', TaskStatus::SUSPENDED, '=', 'OR')->execute(),
'inprogress' => TicketMapper::count()->with('task')->where('task/status', TaskStatus::WORKING)->execute(),
'total' => self::count()->with('task')->where('task/createdAt', $start, '>=')->execute(),
'unassigned' => self::count()->with('task')->where('for', null)->execute(),
'open' => self::count()->with('task')->where('task/status', TaskStatus::OPEN)->execute(),
'closed' => self::count()->with('task')->where('task/createdAt', $start, '>=')->where('task/status', TaskStatus::DONE)->where('task/status', TaskStatus::CANCELED, '=', 'OR')->where('task/status', TaskStatus::SUSPENDED, '=', 'OR')->execute(),
'inprogress' => self::count()->with('task')->where('task/status', TaskStatus::WORKING)->execute(),
];
}
}

View File

@ -64,6 +64,6 @@ return ['Support' => [
'Upload' => 'Hochladen',
'Week' => 'Woche',
'Year' => 'Jahr',
'Total' => 'Gesamt',
'InProgress' => 'In Bearbeitung',
'Total' => 'Gesamt',
'InProgress' => 'In Bearbeitung',
]];

View File

@ -64,6 +64,6 @@ return ['Support' => [
'Upload' => 'Upload',
'Week' => 'Week',
'Year' => 'Year',
'Total' => 'Total',
'InProgress' => 'In Progress',
'Total' => 'Total',
'InProgress' => 'In Progress',
]];

View File

@ -44,14 +44,14 @@ echo $this->data['nav']->render(); ?>
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>">
<span class="tag <?= $this->printHtml('task-status-' . $ticket->task->getStatus()); ?>">
<?= $this->getHtml('S' . $ticket->task->getStatus(), 'Tasks'); ?>
<span class="tag <?= $this->printHtml('task-status-' . $ticket->task->status); ?>">
<?= $this->getHtml('S' . $ticket->task->status, 'Tasks'); ?>
</span></a>
<td><a href="<?= $url; ?>"><?= $this->getHtml('P' . $ticket->task->getPriority(), 'Tasks'); ?></a>
<td><a href="<?= $url; ?>"><?= $this->getHtml('P' . $ticket->task->priority, 'Tasks'); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($ticket->task->title); ?></a>
<td><a class="content" href="<?= UriFactory::build('{/base}/profile/single?for=' . $ticket->task->createdBy->id); ?>"><?= $this->printHtml($ticket->task->createdBy->name1); ?> <?= $this->printHtml($ticket->task->createdBy->name2); ?></a>
<td><a class="content" href="<?= UriFactory::build('{/base}/profile/view?for=' . $ticket->task->createdBy->id); ?>"><?= $this->printHtml($ticket->task->createdBy->name1); ?> <?= $this->printHtml($ticket->task->createdBy->name2); ?></a>
<td><a class="content" href="<?= $url; ?>"><?= $this->printHtml($ticket->task->createdBy->name1); ?> <?= $this->printHtml($ticket->task->createdBy->name2); ?></a>
<td><a class="content" href="<?= UriFactory::build('{/base}/profile/single?for=' . $ticket->for->id); ?>"><?= $this->printHtml($ticket->for->name1); ?> <?= $this->printHtml($ticket->for->name2); ?></a>
<td><a class="content" href="<?= UriFactory::build('{/base}/profile/view?for=' . $ticket->for->id); ?>"><?= $this->printHtml($ticket->for->name1); ?> <?= $this->printHtml($ticket->for->name2); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($ticket->task->createdAt->format('Y-m-d H:i')); ?></a>
<?php endforeach; if ($c == 0) : ?>
<tr><td colspan="7" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>

View File

@ -22,12 +22,12 @@ use phpOMS\Uri\UriFactory;
* @var \Modules\Support\Vies\TicketView $this
* @var \Modules\Support\Models\Ticket $ticket
*/
$ticket = $this->data['ticket'];
$task = $ticket->task;
$taskMedia = $task->getMedia();
$elements = $ticket->invertTicketElements();
$cElements = \count($elements);
$color = 'red'; //$this->getStatus($task->getStatus());
$ticket = $this->data['ticket'];
$task = $ticket->task;
$taskMedia = $task->files;
$elements = $ticket->invertTicketElements();
$cElements = \count($elements);
$color = 'red'; //$this->getStatus($task->status);
echo $this->data['nav']->render(); ?>
@ -67,8 +67,8 @@ echo $this->data['nav']->render(); ?>
<?= $this->printHtml($task->createdBy->name1); ?> - <?= $this->printHtml($task->createdAt->format('Y/m/d H:i')); ?>
</span>
<span class="col-xs end-xs plain-grid">
<span id="task-status-badge" class="nobreak tag task-status-<?= $task->getStatus(); ?>">
<?= $this->getHtml('S' . $task->getStatus(), 'Tasks'); ?>
<span id="task-status-badge" class="nobreak tag task-status-<?= $task->status; ?>">
<?= $this->getHtml('S' . $task->status, 'Tasks'); ?>
</span>
</span>
</div>
@ -88,19 +88,19 @@ echo $this->data['nav']->render(); ?>
<?php if (!empty($taskMedia)) : ?>
<div>
<?php foreach ($taskMedia as $media) : ?>
<span><a class="content" href="<?= UriFactory::build('{/base}/media/single?id=' . $media->id);?>"><?= $media->name; ?></a></span>
<span><a class="content" href="<?= UriFactory::build('{/base}/media/view?id=' . $media->id);?>"><?= $media->name; ?></a></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<div>
<?php if ($task->getPriority() === TaskPriority::NONE) : ?>
<?php if ($task->priority === TaskPriority::NONE) : ?>
<?= $this->getHtml('Due'); ?>: <?= $this->printHtml($task->due->format('Y/m/d H:i')); ?>
<?php else : ?>
<?= $this->getHtml('Priority'); ?>: <?= $this->getHtml('P' . $task->getPriority(), 'Tasks'); ?>
<?= $this->getHtml('Priority'); ?>: <?= $this->getHtml('P' . $task->priority, 'Tasks'); ?>
<?php endif; ?>
<?php $tags = $task->getTags(); foreach ($tags as $tag) : ?>
<?php foreach ($task->tags as $tag) : ?>
<span class="tag" style="background: <?= $this->printHtml($tag->color); ?>"><?= empty($tag->icon) ? '' : ''; ?><?= $this->printHtml($tag->getL11n()); ?></span>
<?php endforeach; ?>
</div>
@ -174,33 +174,33 @@ echo $this->data['nav']->render(); ?>
<?php endif; ?>
<?php $c = 0; $previous = null;
foreach ($elements as $key => $element) : ++$c; ?>
<?php if (($c === 1 && $element->taskElement->getStatus() !== TaskStatus::OPEN)
|| ($previous !== null && $element->taskElement->getStatus() !== $previous->taskElement->getStatus())
<?php if (($c === 1 && $element->taskElement->status !== TaskStatus::OPEN)
|| ($previous !== null && $element->taskElement->status !== $previous->taskElement->status)
) : ?>
<section class="portlet">
<div class="portlet-body">
<?= \sprintf($this->getHtml('status_change', 'Tasks', 'Backend'),
'<a href="' . UriFactory::build('profile/single?{?}&for=' . $element->taskElement->createdBy->id) . '">' . $this->printHtml($element->taskElement->createdBy->name1) . '</a>',
'<a href="' . UriFactory::build('profile/view?{?}&for=' . $element->taskElement->createdBy->id) . '">' . $this->printHtml($element->taskElement->createdBy->name1) . '</a>',
$element->taskElement->createdAt->format('Y-m-d H:i')
); ?>
<span class="tag task-status-<?= $element->taskElement->getStatus(); ?>">
<?= $this->getHtml('S' . $element->taskElement->getStatus(), 'Tasks'); ?>
<span class="tag task-status-<?= $element->taskElement->status; ?>">
<?= $this->getHtml('S' . $element->taskElement->status, 'Tasks'); ?>
</span>
</div>
</section>
<?php endif; ?>
<?php if (($c === 1 && $element->taskElement->getPriority() !== $task->getPriority())
|| ($previous !== null && $element->taskElement->getPriority() !== $previous->taskElement->getPriority())
<?php if (($c === 1 && $element->taskElement->priority !== $task->priority)
|| ($previous !== null && $element->taskElement->priority !== $previous->taskElement->priority)
) : ?>
<section class="portlet">
<div class="portlet-body">
<?= \sprintf($this->getHtml('priority_change', 'Tasks', 'Backend'),
'<a href="' . UriFactory::build('profile/single?{?}&for=' . $element->taskElement->createdBy->id) . '">' . $this->printHtml($element->taskElement->createdBy->name1) . '</a>',
'<a href="' . UriFactory::build('profile/view?{?}&for=' . $element->taskElement->createdBy->id) . '">' . $this->printHtml($element->taskElement->createdBy->name1) . '</a>',
$element->taskElement->createdAt->format('Y-m-d H:i')
); ?>
<span class="tag task-priority-<?= $element->taskElement->getPriority(); ?>">
<?= $this->getHtml('P' . $element->taskElement->getPriority(), 'Tasks'); ?>
<span class="tag task-priority-<?= $element->taskElement->priority; ?>">
<?= $this->getHtml('P' . $element->taskElement->priority, 'Tasks'); ?>
</span>
</div>
</section>
@ -236,7 +236,7 @@ echo $this->data['nav']->render(); ?>
</div>
<?php endif; ?>
<?php $elementMedia = $element->taskElement->getMedia();
<?php $elementMedia = $element->taskElement->files;
if (!empty($elementMedia)
|| ($task->isEditable
&& $this->request->header->account === $element->taskElement->createdBy->id)
@ -245,26 +245,26 @@ echo $this->data['nav']->render(); ?>
<?php if (!empty($elementMedia)) : ?>
<div>
<?php foreach ($elementMedia as $media) : ?>
<span><a class="content" href="<?= UriFactory::build('{/base}/media/single?id=' . $media->id);?>"><?= $media->name; ?></a></span>
<span><a class="content" href="<?= UriFactory::build('{/base}/media/view?id=' . $media->id);?>"><?= $media->name; ?></a></span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($element->taskElement->getStatus() !== TaskStatus::CANCELED
|| $element->taskElement->getStatus() !== TaskStatus::DONE
|| $element->taskElement->getStatus() !== TaskStatus::SUSPENDED
<?php if ($element->taskElement->status !== TaskStatus::CANCELED
|| $element->taskElement->status !== TaskStatus::DONE
|| $element->taskElement->status !== TaskStatus::SUSPENDED
|| $c != $cElements
) : ?>
<div>
<?php
if ($element->taskElement->getPriority() === TaskPriority::NONE
if ($element->taskElement->priority === TaskPriority::NONE
&& ($previous !== null
&& $previous->due->format('Y/m/d H:i') !== $element->taskElement->due->format('Y/m/d H:i')
)
) : ?>
<?= $this->getHtml('Due'); ?>: <?= $this->printHtml($element->taskElement->due->format('Y/m/d H:i')); ?>
<?php elseif ($previous !== null && $previous->taskElement->getPriority() !== $element->taskElement->getPriority()) : ?>
<?= $this->getHtml('Priority'); ?>: <?= $this->getHtml('P' . $element->taskElement->getPriority(), 'Tasks'); ?>
<?php elseif ($previous !== null && $previous->taskElement->priority !== $element->taskElement->priority) : ?>
<?= $this->getHtml('Priority'); ?>: <?= $this->getHtml('P' . $element->taskElement->priority, 'Tasks'); ?>
<?php endif; ?>
</div>
<?php endif; ?>
@ -291,10 +291,10 @@ echo $this->data['nav']->render(); ?>
) : ?>
<section class="portlet wf-100">
<div class="portlet-body">
<a href="<?= UriFactory::build('{/base}/profile/single?{?}&for=' . $element->taskElement->createdBy->id); ?>"><?= $this->printHtml($element->taskElement->createdBy->name1); ?></a> <?= $this->getHtml('forwarded_to'); ?>
<a href="<?= UriFactory::build('{/base}/profile/view?{?}&for=' . $element->taskElement->createdBy->id); ?>"><?= $this->printHtml($element->taskElement->createdBy->name1); ?></a> <?= $this->getHtml('forwarded_to'); ?>
<?php foreach ($tos as $to) : ?>
<?php if ($to instanceof AccountRelation) : ?>
<a href="<?= UriFactory::build('{/base}/profile/single?{?}&for=' . $to->getRelation()->id); ?>"><?= $this->printHtml($to->getRelation()->name1); ?></a>
<a href="<?= UriFactory::build('{/base}/profile/view?{?}&for=' . $to->getRelation()->id); ?>"><?= $this->printHtml($to->getRelation()->name1); ?></a>
<?php elseif ($to instanceof GroupRelation) : ?>
<?= $this->printHtml($to->getRelation()->name); ?>
<?php endif; ?>
@ -334,11 +334,11 @@ echo $this->data['nav']->render(); ?>
<div class="form-group">
<label for="iStatus"><?= $this->getHtml('Status'); ?></label>
<select id="iStatus" name="status">
<option value="<?= TaskStatus::OPEN; ?>"<?= $task->getStatus() === TaskStatus::OPEN ? ' selected' : '';?>><?= $this->getHtml('S1', 'Tasks'); ?>
<option value="<?= TaskStatus::WORKING; ?>"<?= $task->getStatus() === TaskStatus::WORKING ? ' selected' : '';?>><?= $this->getHtml('S2', 'Tasks'); ?>
<option value="<?= TaskStatus::SUSPENDED; ?>"<?= $task->getStatus() === TaskStatus::SUSPENDED ? ' selected' : '';?>><?= $this->getHtml('S3', 'Tasks'); ?>
<option value="<?= TaskStatus::CANCELED; ?>"<?= $task->getStatus() === TaskStatus::CANCELED ? ' selected' : '';?>><?= $this->getHtml('S4', 'Tasks'); ?>
<option value="<?= TaskStatus::DONE; ?>"<?= $task->getStatus() === TaskStatus::DONE ? ' selected' : '';?>><?= $this->getHtml('S5', 'Tasks'); ?>
<option value="<?= TaskStatus::OPEN; ?>"<?= $task->status === TaskStatus::OPEN ? ' selected' : '';?>><?= $this->getHtml('S1', 'Tasks'); ?>
<option value="<?= TaskStatus::WORKING; ?>"<?= $task->status === TaskStatus::WORKING ? ' selected' : '';?>><?= $this->getHtml('S2', 'Tasks'); ?>
<option value="<?= TaskStatus::SUSPENDED; ?>"<?= $task->status === TaskStatus::SUSPENDED ? ' selected' : '';?>><?= $this->getHtml('S3', 'Tasks'); ?>
<option value="<?= TaskStatus::CANCELED; ?>"<?= $task->status === TaskStatus::CANCELED ? ' selected' : '';?>><?= $this->getHtml('S4', 'Tasks'); ?>
<option value="<?= TaskStatus::DONE; ?>"<?= $task->status === TaskStatus::DONE ? ' selected' : '';?>><?= $this->getHtml('S5', 'Tasks'); ?>
</select>
</div>
@ -357,12 +357,12 @@ echo $this->data['nav']->render(); ?>
<div class="form-group">
<label for="iPriority"><?= $this->getHtml('Priority'); ?></label>
<select id="iPriority" name="priority">
<option value="<?= TaskPriority::NONE; ?>"<?= $task->getPriority() === TaskPriority::NONE ? ' selected' : '';?>><?= $this->getHtml('P0', 'Tasks'); ?>
<option value="<?= TaskPriority::VLOW; ?>"<?= $task->getPriority() === TaskPriority::VLOW ? ' selected' : '';?>><?= $this->getHtml('P1', 'Tasks'); ?>
<option value="<?= TaskPriority::LOW; ?>"<?= $task->getPriority() === TaskPriority::LOW ? ' selected' : '';?>><?= $this->getHtml('P2', 'Tasks'); ?>
<option value="<?= TaskPriority::MEDIUM; ?>"<?= $task->getPriority() === TaskPriority::MEDIUM ? ' selected' : '';?>><?= $this->getHtml('P3', 'Tasks'); ?>
<option value="<?= TaskPriority::HIGH; ?>"<?= $task->getPriority() === TaskPriority::HIGH ? ' selected' : '';?>><?= $this->getHtml('P4', 'Tasks'); ?>
<option value="<?= TaskPriority::VHIGH; ?>"<?= $task->getPriority() === TaskPriority::VHIGH ? ' selected' : '';?>><?= $this->getHtml('P5', 'Tasks'); ?>
<option value="<?= TaskPriority::NONE; ?>"<?= $task->priority === TaskPriority::NONE ? ' selected' : '';?>><?= $this->getHtml('P0', 'Tasks'); ?>
<option value="<?= TaskPriority::VLOW; ?>"<?= $task->priority === TaskPriority::VLOW ? ' selected' : '';?>><?= $this->getHtml('P1', 'Tasks'); ?>
<option value="<?= TaskPriority::LOW; ?>"<?= $task->priority === TaskPriority::LOW ? ' selected' : '';?>><?= $this->getHtml('P2', 'Tasks'); ?>
<option value="<?= TaskPriority::MEDIUM; ?>"<?= $task->priority === TaskPriority::MEDIUM ? ' selected' : '';?>><?= $this->getHtml('P3', 'Tasks'); ?>
<option value="<?= TaskPriority::HIGH; ?>"<?= $task->priority === TaskPriority::HIGH ? ' selected' : '';?>><?= $this->getHtml('P4', 'Tasks'); ?>
<option value="<?= TaskPriority::VHIGH; ?>"<?= $task->priority === TaskPriority::VHIGH ? ' selected' : '';?>><?= $this->getHtml('P5', 'Tasks'); ?>
</select>
</div>

View File

@ -47,7 +47,7 @@ class TicketView extends View
*
* @since 1.0.0
*/
public function __construct(L11nManager $l11n = null, RequestAbstract $request = null, ResponseAbstract $response = null)
public function __construct(?L11nManager $l11n = null, ?RequestAbstract $request = null, ?ResponseAbstract $response = null)
{
$this->defaultProfileImage = new NullMedia();
parent::__construct($l11n, $request, $response);

View File

@ -75,8 +75,8 @@ final class Autoloader
*/
public static function defaultAutoloader(string $class) : void
{
$class = \ltrim($class, '\\');
$class = \strtr($class, '_\\', '//');
$class = \ltrim($class, '\\');
$class = \strtr($class, '_\\', '//');
if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) {
$class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class);

View File

@ -1,4 +1,15 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\Support\tests
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
\ini_set('memory_limit', '2048M');
@ -67,10 +78,10 @@ $GLOBALS['is_github'] = $IS_GITHUB;
$tmp = FileLogger::getInstance(__DIR__ . '/../Logs');
$CONFIG = [
'db' => [
'db' => [
'core' => [
'masters' => [
'admin' => [
'admin' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -80,7 +91,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -90,7 +101,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -100,7 +111,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -110,7 +121,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -120,7 +131,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */
@ -132,7 +143,7 @@ $CONFIG = [
],
],
'postgresql' => [
'admin' => [
'admin' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -142,7 +153,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -152,7 +163,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -162,7 +173,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -172,7 +183,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -182,7 +193,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */
@ -194,37 +205,37 @@ $CONFIG = [
],
],
'sqlite' => [
'admin' => [
'admin' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */
@ -232,7 +243,7 @@ $CONFIG = [
],
],
'mssql' => [
'admin' => [
'admin' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -242,7 +253,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'insert' => [
'insert' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -252,7 +263,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'select' => [
'select' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -262,7 +273,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'update' => [
'update' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -272,7 +283,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'delete' => [
'delete' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -282,7 +293,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s',
],
'schema' => [
'schema' => [
'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */
@ -322,16 +333,16 @@ $CONFIG = [
'password' => '123456',
],
],
'log' => [
'log' => [
'file' => [
'path' => __DIR__ . '/Logs',
],
],
'page' => [
'page' => [
'root' => '/',
'https' => false,
],
'app' => [
'app' => [
'path' => __DIR__,
'default' => [
'app' => 'Backend',
@ -350,7 +361,7 @@ $CONFIG = [
],
],
],
'socket' => [
'socket' => [
'master' => [
'host' => '127.0.0.1',
'limit' => 300,
@ -360,7 +371,7 @@ $CONFIG = [
'language' => [
'en',
],
'apis' => [
'apis' => [
],
];

View File

@ -18,7 +18,6 @@ use Modules\Tasks\Models\TaskStatus;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerTicketTrait
{
@ -29,7 +28,7 @@ trait ApiControllerTicketTrait
public function testApiSupportAppCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('name', 'TestSupportApp');
@ -45,7 +44,7 @@ trait ApiControllerTicketTrait
public function testApiSupportAppCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -61,7 +60,7 @@ trait ApiControllerTicketTrait
public function testApiTicketCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('title', 'Test Ticket');
@ -80,7 +79,7 @@ trait ApiControllerTicketTrait
public function testApiTicketGet() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('id', '1');
@ -96,7 +95,7 @@ trait ApiControllerTicketTrait
public function testApiTicketCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -112,7 +111,7 @@ trait ApiControllerTicketTrait
public function testApiTicketElementCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('ticket', '1');
@ -131,7 +130,7 @@ trait ApiControllerTicketTrait
public function testApiTicketElementGet() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('id', '1');
@ -147,7 +146,7 @@ trait ApiControllerTicketTrait
public function testApiTicketElementCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');

View File

@ -54,13 +54,13 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
protected string $appName = 'Api';
};
$this->app->dbPool = $GLOBALS['dbpool'];
$this->app->unitId = 1;
$this->app->accountManager = new AccountManager($GLOBALS['session']);
$this->app->appSettings = new CoreSettings();
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
$this->app->dispatcher = new Dispatcher($this->app);
$this->app->eventManager = new EventManager($this->app->dispatcher);
$this->app->dbPool = $GLOBALS['dbpool'];
$this->app->unitId = 1;
$this->app->accountManager = new AccountManager($GLOBALS['session']);
$this->app->appSettings = new CoreSettings();
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
$this->app->dispatcher = new Dispatcher($this->app);
$this->app->eventManager = new EventManager($this->app->dispatcher);
$this->app->eventManager->importFromFile(__DIR__ . '/../../../../Web/Api/Hooks.php');
$this->app->sessionManager = new HttpSession(36000);
$this->app->l11nManager = new L11nManager();

View File

@ -53,8 +53,8 @@ final class SupportAppTest extends \PHPUnit\Framework\TestCase
self::assertEquals(
[
'id' => 0,
'name' => 'Test Title',
'id' => 0,
'name' => 'Test Title',
],
$serialized
);

View File

@ -56,9 +56,9 @@ final class TicketElementTest extends \PHPUnit\Framework\TestCase
self::assertEquals(
[
'id' => 0,
'time' => 10,
'ticket' => 2,
'id' => 0,
'time' => 10,
'ticket' => 2,
],
$serialized
);

View File

@ -56,14 +56,14 @@ class TicketViewTest extends \PHPUnit\Framework\TestCase
$profile->account = AccountMapper::get()->where('id', 1)->execute();
$profile->image = $media;
$profile->birthday = new \DateTime('now');
$profile->birthday = new \DateTime('now');
$id = ProfileMapper::create()->execute($profile);
self::assertGreaterThan(0, $profile->id);
self::assertEquals($id, $profile->id);
} else {
$profile->image = $media;
$profile->birthday = new \DateTime('now');
$profile->birthday = new \DateTime('now');
ProfileMapper::update()->with('image')->execute($profile);
}