Neues Modul Interne Stellenausschreibungen (0.28.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m18s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m1s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m33s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m8s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m42s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m37s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m43s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m38s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m10s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m18s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m1s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m33s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m8s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m42s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m37s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m43s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m38s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m10s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b322b97f32
commit
993d49c99c
146 changed files with 1981 additions and 305 deletions
40
plugins-core/stellen/src/StellenPlugin.php
Normal file
40
plugins-core/stellen/src/StellenPlugin.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Stellen;
|
||||
|
||||
use App\Editorial\Editorial;
|
||||
use App\Models\User;
|
||||
use App\Plugins\Plugin;
|
||||
use App\Search\GlobalSearch;
|
||||
use App\Support\Abilities;
|
||||
use App\Support\Navigation;
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
use Inhaus\Plugins\Stellen\Models\JobPosting;
|
||||
|
||||
class StellenPlugin extends Plugin
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->make(Navigation::class)->add('stellen', 'Stellen', '/stellen', active: 'jobs.*', sort: 72);
|
||||
|
||||
$abilities = $this->app->make(Abilities::class);
|
||||
$abilities->define('jobs.manage', 'Stellen ausschreiben und bearbeiten', 'Stellen', portal: true);
|
||||
$abilities->define('jobs.applications', 'Bewerbungen aller Stellen einsehen und bearbeiten', 'Stellen', portal: true);
|
||||
|
||||
$this->app->make(GlobalSearch::class)->add('stellen', 'Stellen', 'briefcase', fn (...$args) => app(JobSearch::class)(...$args), sort: 55);
|
||||
|
||||
$this->app->make(Editorial::class)->add('stellen', 'Stellen', 'stellen::EditorialJobs', 35,
|
||||
fn (User $user) => $user->can('jobs.manage') || $user->can('jobs.applications'),
|
||||
fn (User $user) => [
|
||||
'postings' => JobPosting::query()->withCount('applications')->orderByRaw('published_at IS NULL DESC')->orderByDesc('published_at')->limit(50)->get()
|
||||
->map(fn (JobPosting $p) => [...Presenter::card($p), 'applications' => $p->applications_count, 'edit_url' => route('jobs.edit', $p), 'applications_url' => route('jobs.applications', $p)])->all(),
|
||||
'canCreate' => $user->can('jobs.manage'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
// Geplante Stellen ankündigen, sobald sie erscheinen
|
||||
Schedule::call(fn () => $this->app->make(Announcer::class)->announceDue())->everyTenMinutes()->name('stellen-announce')->withoutOverlapping(10);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue