Termine im Portal bearbeiten (0.23.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m53s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m42s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m13s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m10s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m46s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m35s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m54s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m53s
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:
Friederich Loheide 2026-09-27 07:56:48 +00:00
parent 80a0f20447
commit d7d09d6b9a
142 changed files with 917 additions and 315 deletions

View file

@ -3,10 +3,12 @@
namespace App\Support\Permissions;
use App\Models\Audience;
use App\Models\Role;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Support\Facades\Cache;
/**
* Zielgruppen: Ein Objekt ohne Regeln sehen alle. Mit Regeln sieht es, wer
@ -139,4 +141,18 @@ class Audiences
$rules->orWhere(fn (QueryBuilder $q) => $q->where('audiences.rule_type', 'location')->where('audiences.rule_value', $user->location));
}
}
/**
* Auswahl für Zielgruppen-Editoren im Portal (Rollen, Abteilungen, Standorte).
*
* @return array{role: list<array{value: string, label: string}>, department: list<string>, location: list<string>}
*/
public static function options(): array
{
return Cache::remember('pagebuilder.audience-options', 300, fn () => [
'role' => Role::query()->orderBy('name')->get(['id', 'name'])->map(fn ($role) => ['value' => (string) $role->id, 'label' => $role->name])->all(),
'department' => User::query()->active()->whereNotNull('department')->distinct()->orderBy('department')->pluck('department')->all(),
'location' => User::query()->active()->whereNotNull('location')->distinct()->orderBy('location')->pluck('location')->all(),
]);
}
}

View file

@ -9,5 +9,5 @@ namespace App;
*/
final class Version
{
public const VERSION = '0.22.0';
public const VERSION = '0.23.0';
}