Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 8m25s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 8m46s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 11m36s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 11m31s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 11m34s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 12m12s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 12m14s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 46s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 11m18s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m15s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
36 lines
1.5 KiB
PHP
36 lines
1.5 KiB
PHP
<?php
|
||
|
||
namespace Inhaus\Plugins\ItService;
|
||
|
||
use App\Dashboard\Widgets;
|
||
use App\Models\User;
|
||
use App\Plugins\Hooks;
|
||
use App\Plugins\Plugin;
|
||
use App\Plugins\PluginAccess;
|
||
use App\Support\Abilities;
|
||
use App\Support\Navigation;
|
||
use Inhaus\Plugins\ItService\OpenNit\Settings;
|
||
|
||
/**
|
||
* IT-Self-Service über OpenNIT (IT-Dokumentation): eigene Geräte, Tickets und Leihgeräte.
|
||
*/
|
||
class ItServicePlugin extends Plugin
|
||
{
|
||
public function register(): void
|
||
{
|
||
$this->app->singleton(Settings::class);
|
||
$this->app->make(Abilities::class)->define('it-service.manage', 'IT-Service (OpenNIT) einrichten', 'IT-Service');
|
||
|
||
$this->app->make(Navigation::class)->add('it-service', 'IT-Service', '/it-service', active: 'it-service.*', sort: 75, icon: 'headset');
|
||
|
||
// Knopf „Meine IT“ im Profilkasten der Startseite
|
||
Hooks::filter('greeting.actions', fn (array $actions, User $user) => app(Settings::class)->configured() && app(PluginAccess::class)->allows('it-service', $user)
|
||
? [...$actions, ['label' => 'Meine IT', 'href' => '/it-service', 'icon' => 'monitor-smartphone']]
|
||
: $actions);
|
||
|
||
// Die Kachel lädt ihre Zahlen selbst nach – die Startseite wartet nicht auf OpenNIT.
|
||
$this->app->make(Widgets::class)->add('it-service.summary', 'it-service::MyIt', 'aside', sort: 25,
|
||
props: fn () => app(Settings::class)->configured() ? [] : null,
|
||
label: 'Meine IT (offene Tickets, Ausleihen)', mobileSort: 45);
|
||
}
|
||
}
|